This commit is contained in:
Melissa LeBlanc-Williams 2023-05-10 09:12:49 -07:00
commit 184e5a904d
4 changed files with 26 additions and 2 deletions

View file

@ -65,6 +65,8 @@ class Board:
board_id = self._armbian_id() or self._allwinner_variants_id() board_id = self._armbian_id() or self._allwinner_variants_id()
elif chip_id == chips.BCM2XXX: elif chip_id == chips.BCM2XXX:
board_id = self._pi_id() board_id = self._pi_id()
elif chip_id == chips.AM625X:
board_id = self._beaglebone_id()
elif chip_id == chips.AM33XX: elif chip_id == chips.AM33XX:
board_id = self._beaglebone_id() board_id = self._beaglebone_id()
elif chip_id == chips.AM65XX: elif chip_id == chips.AM65XX:
@ -184,7 +186,7 @@ class Board:
elif chip_id == chips.GENERIC_X86: elif chip_id == chips.GENERIC_X86:
board_id = boards.GENERIC_LINUX_PC board_id = boards.GENERIC_LINUX_PC
elif chip_id == chips.TDA4VM: 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: elif chip_id == chips.D1_RISCV:
board_id = self._armbian_id() board_id = self._armbian_id()
elif chip_id == chips.S905X: elif chip_id == chips.S905X:
@ -270,7 +272,12 @@ class Board:
with open("/sys/bus/nvmem/devices/0-00501/nvmem", "rb") as eeprom: with open("/sys/bus/nvmem/devices/0-00501/nvmem", "rb") as eeprom:
eeprom_bytes = eeprom.read(16) eeprom_bytes = eeprom.read(16)
except FileNotFoundError: except FileNotFoundError:
return None 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
if eeprom_bytes[:4] != b"\xaaU3\xee": if eeprom_bytes[:4] != b"\xaaU3\xee":
return None return None
@ -280,6 +287,14 @@ class Board:
if eeprom_bytes == b"\xaaU3\xeeA335BNLT\x1a\x00\x00\x00": if eeprom_bytes == b"\xaaU3\xeeA335BNLT\x1a\x00\x00\x00":
return boards.BEAGLEBONE_GREEN 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") id_string = eeprom_bytes[4:].decode("ascii")
for model, bb_ids in boards._BEAGLEBONE_BOARD_IDS.items(): for model, bb_ids in boards._BEAGLEBONE_BOARD_IDS.items():
for bb_id in bb_ids: for bb_id in bb_ids:

View file

@ -178,6 +178,8 @@ class Chip:
# pylint: disable=too-many-branches,too-many-statements # pylint: disable=too-many-branches,too-many-statements
# pylint: disable=too-many-return-statements # pylint: disable=too-many-return-statements
"""Attempt to detect the CPU on a computer running the Linux kernel.""" """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"): if self.detector.check_dt_compatible_value("ti,am654"):
return chips.AM65XX return chips.AM65XX

View file

@ -4,6 +4,8 @@
"""Definition of boards and/or ids""" """Definition of boards and/or ids"""
# Allow for aligned constant definitions: # Allow for aligned constant definitions:
BEAGLE_PLAY = "BEAGLE_PLAY"
BEAGLEBONE_AI64 = "BEAGLEBONE_AI64"
BEAGLEBONE = "BEAGLEBONE" BEAGLEBONE = "BEAGLEBONE"
BEAGLEBONE_BLACK = "BEAGLEBONE_BLACK" BEAGLEBONE_BLACK = "BEAGLEBONE_BLACK"
BEAGLEBONE_BLUE = "BEAGLEBONE_BLUE" BEAGLEBONE_BLUE = "BEAGLEBONE_BLUE"
@ -352,6 +354,8 @@ _ODROID_40_PIN_IDS = (
) )
_BEAGLEBONE_IDS = ( _BEAGLEBONE_IDS = (
BEAGLE_PLAY,
BEAGLEBONE_AI64,
BEAGLEBONE, BEAGLEBONE,
BEAGLEBONE_BLACK, BEAGLEBONE_BLACK,
BEAGLEBONE_BLUE, BEAGLEBONE_BLUE,
@ -380,6 +384,8 @@ _SIFIVE_IDS = (SIFIVE_UNLEASHED,)
# https://github.com/beagleboard/image-builder # https://github.com/beagleboard/image-builder
# Thanks to zmatt on freenode #beagle for pointers. # Thanks to zmatt on freenode #beagle for pointers.
_BEAGLEBONE_BOARD_IDS = { _BEAGLEBONE_BOARD_IDS = {
BEAGLE_PLAY: (("A0", "7.BEAGLE")),
BEAGLEBONE_AI64: (("B0", "7.BBONEA")),
# Original bone/white: # Original bone/white:
BEAGLEBONE: ( BEAGLEBONE: (
("A4", "A335BONE00A4"), ("A4", "A335BONE00A4"),

View file

@ -5,6 +5,7 @@
"""Definition of chips.""" """Definition of chips."""
A311D = "A311D" A311D = "A311D"
AM33XX = "AM33XX" AM33XX = "AM33XX"
AM625X = "AM625X"
AM65XX = "AM65XX" AM65XX = "AM65XX"
DRA74X = "DRA74X" DRA74X = "DRA74X"
TDA4VM = "TDA4VM" TDA4VM = "TDA4VM"