Merge branch 'main' of https://github.com/adafruit/Adafruit_Python_PlatformDetect into debian_orange_pi
This commit is contained in:
commit
184e5a904d
4 changed files with 26 additions and 2 deletions
|
|
@ -65,6 +65,8 @@ class Board:
|
|||
board_id = self._armbian_id() or self._allwinner_variants_id()
|
||||
elif chip_id == chips.BCM2XXX:
|
||||
board_id = self._pi_id()
|
||||
elif chip_id == chips.AM625X:
|
||||
board_id = self._beaglebone_id()
|
||||
elif chip_id == chips.AM33XX:
|
||||
board_id = self._beaglebone_id()
|
||||
elif chip_id == chips.AM65XX:
|
||||
|
|
@ -184,7 +186,7 @@ class Board:
|
|||
elif chip_id == chips.GENERIC_X86:
|
||||
board_id = boards.GENERIC_LINUX_PC
|
||||
elif chip_id == chips.TDA4VM:
|
||||
board_id = self._tisk_id()
|
||||
board_id = self._beaglebone_id() or self._tisk_id()
|
||||
elif chip_id == chips.D1_RISCV:
|
||||
board_id = self._armbian_id()
|
||||
elif chip_id == chips.S905X:
|
||||
|
|
@ -269,6 +271,11 @@ class Board:
|
|||
try:
|
||||
with open("/sys/bus/nvmem/devices/0-00501/nvmem", "rb") as eeprom:
|
||||
eeprom_bytes = eeprom.read(16)
|
||||
except FileNotFoundError:
|
||||
try:
|
||||
# Special Case for AI64
|
||||
with open("/sys/bus/nvmem/devices/2-00500/nvmem", "rb") as eeprom:
|
||||
eeprom_bytes = eeprom.read(16)
|
||||
except FileNotFoundError:
|
||||
return None
|
||||
|
||||
|
|
@ -280,6 +287,14 @@ class Board:
|
|||
if eeprom_bytes == b"\xaaU3\xeeA335BNLT\x1a\x00\x00\x00":
|
||||
return boards.BEAGLEBONE_GREEN
|
||||
|
||||
# BeaglePlay Special Condition
|
||||
# new Beagle EEPROM IDs are 24 Bit, so we need to verify full range
|
||||
if eeprom_bytes == b"\xaaU3\xee\x017\x00\x10.\x00BEAGLE":
|
||||
with open("/sys/bus/nvmem/devices/0-00500/nvmem", "rb") as eeprom:
|
||||
eeprom_bytes = eeprom.read(24)
|
||||
if eeprom_bytes == b"\xaaU3\xee\x017\x00\x10.\x00BEAGLEPLAY-A0-":
|
||||
return boards.BEAGLE_PLAY
|
||||
|
||||
id_string = eeprom_bytes[4:].decode("ascii")
|
||||
for model, bb_ids in boards._BEAGLEBONE_BOARD_IDS.items():
|
||||
for bb_id in bb_ids:
|
||||
|
|
|
|||
|
|
@ -178,6 +178,8 @@ class Chip:
|
|||
# pylint: disable=too-many-branches,too-many-statements
|
||||
# pylint: disable=too-many-return-statements
|
||||
"""Attempt to detect the CPU on a computer running the Linux kernel."""
|
||||
if self.detector.check_dt_compatible_value("ti,am625"):
|
||||
return chips.AM625X
|
||||
if self.detector.check_dt_compatible_value("ti,am654"):
|
||||
return chips.AM65XX
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
"""Definition of boards and/or ids"""
|
||||
# Allow for aligned constant definitions:
|
||||
BEAGLE_PLAY = "BEAGLE_PLAY"
|
||||
BEAGLEBONE_AI64 = "BEAGLEBONE_AI64"
|
||||
BEAGLEBONE = "BEAGLEBONE"
|
||||
BEAGLEBONE_BLACK = "BEAGLEBONE_BLACK"
|
||||
BEAGLEBONE_BLUE = "BEAGLEBONE_BLUE"
|
||||
|
|
@ -352,6 +354,8 @@ _ODROID_40_PIN_IDS = (
|
|||
)
|
||||
|
||||
_BEAGLEBONE_IDS = (
|
||||
BEAGLE_PLAY,
|
||||
BEAGLEBONE_AI64,
|
||||
BEAGLEBONE,
|
||||
BEAGLEBONE_BLACK,
|
||||
BEAGLEBONE_BLUE,
|
||||
|
|
@ -380,6 +384,8 @@ _SIFIVE_IDS = (SIFIVE_UNLEASHED,)
|
|||
# https://github.com/beagleboard/image-builder
|
||||
# Thanks to zmatt on freenode #beagle for pointers.
|
||||
_BEAGLEBONE_BOARD_IDS = {
|
||||
BEAGLE_PLAY: (("A0", "7.BEAGLE")),
|
||||
BEAGLEBONE_AI64: (("B0", "7.BBONEA")),
|
||||
# Original bone/white:
|
||||
BEAGLEBONE: (
|
||||
("A4", "A335BONE00A4"),
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
"""Definition of chips."""
|
||||
A311D = "A311D"
|
||||
AM33XX = "AM33XX"
|
||||
AM625X = "AM625X"
|
||||
AM65XX = "AM65XX"
|
||||
DRA74X = "DRA74X"
|
||||
TDA4VM = "TDA4VM"
|
||||
|
|
|
|||
Loading…
Reference in a new issue