Merge pull request #307 from mmontol/main

Add support for LubanCat-4
This commit is contained in:
Melissa LeBlanc-Williams 2023-08-29 08:34:29 -07:00 committed by GitHub
commit 86f614bd3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View file

@ -42,7 +42,7 @@ class Board:
self.detector = detector self.detector = detector
self._board_id = None self._board_id = None
# pylint: disable=invalid-name, protected-access, too-many-return-statements # pylint: disable=invalid-name, protected-access, too-many-return-statements, too-many-lines
@property @property
def id(self) -> Optional[str]: def id(self) -> Optional[str]:
"""Return a unique id for the detected board, if any.""" """Return a unique id for the detected board, if any."""
@ -177,7 +177,12 @@ class Board:
elif chip_id == chips.RK3568: elif chip_id == chips.RK3568:
board_id = self._rk3568_id() board_id = self._rk3568_id()
elif chip_id == chips.RK3588: elif chip_id == chips.RK3588:
board_id = self._rock_pi_id() or self._orange_pi_id() or self._armbian_id() board_id = (
self._rock_pi_id()
or self._orange_pi_id()
or self._armbian_id()
or self._rk3588_id()
)
elif chip_id == chips.RYZEN_V1605B: elif chip_id == chips.RYZEN_V1605B:
board_id = self._udoo_id() board_id = self._udoo_id()
elif chip_id == chips.PENTIUM_N3710: elif chip_id == chips.PENTIUM_N3710:
@ -559,6 +564,14 @@ class Board:
board = boards.ROCK_PI_3A board = boards.ROCK_PI_3A
return board return board
def _rk3588_id(self) -> Optional[str]:
"""Check what type of rk3588 board."""
board_value = self.detector.get_device_model()
board = None
if board_value and "LubanCat-4" in board_value:
board = boards.LUBANCAT4
return board
def _rock_pi_id(self) -> Optional[str]: def _rock_pi_id(self) -> Optional[str]:
"""Check what type of Rock Pi board.""" """Check what type of Rock Pi board."""
board_value = self.detector.get_device_model() board_value = self.detector.get_device_model()

View file

@ -110,6 +110,7 @@ LUBANCAT_STM32MP157 = "LUBANCAT_STM32MP157"
LUBANCAT_ZERO = "LUBANCAT_ZERO" LUBANCAT_ZERO = "LUBANCAT_ZERO"
LUBANCAT1 = "LUBANCAT1" LUBANCAT1 = "LUBANCAT1"
LUBANCAT2 = "LUBANCAT2" LUBANCAT2 = "LUBANCAT2"
LUBANCAT4 = "LUBANCAT4"
# Various Raspberry Pi models # Various Raspberry Pi models
RASPBERRY_PI_B_REV1 = "RASPBERRY_PI_B_REV1" RASPBERRY_PI_B_REV1 = "RASPBERRY_PI_B_REV1"
@ -273,6 +274,7 @@ _LUBANCAT_IDS = (
LUBANCAT_ZERO, LUBANCAT_ZERO,
LUBANCAT1, LUBANCAT1,
LUBANCAT2, LUBANCAT2,
LUBANCAT4,
) )
# Coral boards # Coral boards