Skip to content

Commit cd400bb

Browse files
authored
Merge pull request #260 from mmontol/main
Add supprot for LubanCat Zero,LubanCat1 and LubanCat2
2 parents f6ca7ad + 82bc85b commit cd400bb

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

adafruit_platformdetect/board.py

+22
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ def id(self) -> Optional[str]:
155155
board_id = self._asus_tinker_board_id()
156156
elif chip_id == chips.RK3328:
157157
board_id = self._rock_pi_id()
158+
elif chip_id == chips.RK3566:
159+
board_id = self._rk3566_id()
160+
elif chip_id == chips.RK3568:
161+
board_id = self._rk3568_id()
158162
elif chip_id == chips.RK3588:
159163
board_id = self._rock_pi_id()
160164
elif chip_id == chips.RYZEN_V1605B:
@@ -469,6 +473,24 @@ def _pynq_id(self) -> Optional[str]:
469473
except FileNotFoundError:
470474
return None
471475

476+
def _rk3566_id(self) -> Optional[str]:
477+
"""Check what type of rk3566 board."""
478+
board_value = self.detector.get_device_model()
479+
board = None
480+
if board_value and "LubanCat-Zero" in board_value:
481+
board = boards.LUBANCAT_ZERO
482+
if board_value and "LubanCat1" in board_value:
483+
board = boards.LUBANCAT1
484+
return board
485+
486+
def _rk3568_id(self) -> Optional[str]:
487+
"""Check what type of rk3568 board."""
488+
board_value = self.detector.get_device_model()
489+
board = None
490+
if board_value and "LubanCat2" in board_value:
491+
board = boards.LUBANCAT2
492+
return board
493+
472494
def _rock_pi_id(self) -> Optional[str]:
473495
"""Check what type of Rock Pi board."""
474496
board_value = self.detector.get_device_model()

adafruit_platformdetect/chip.py

+6
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ def _linux_id(self) -> Optional[str]:
218218
if self.detector.check_dt_compatible_value("rockchip,rk3328"):
219219
return chips.RK3328
220220

221+
if self.detector.check_dt_compatible_value("rockchip,rk3566"):
222+
return chips.RK3566
223+
224+
if self.detector.check_dt_compatible_value("rockchip,rk3568"):
225+
return chips.RK3568
226+
221227
if self.detector.check_dt_compatible_value("rockchip,rk3588"):
222228
return chips.RK3588
223229

adafruit_platformdetect/constants/boards.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
# Embedfire LubanCat board
9595
LUBANCAT_IMX6ULL = "LUBANCAT_IMX6ULL"
9696
LUBANCAT_STM32MP157 = "LUBANCAT_STM32MP157"
97+
LUBANCAT_ZERO = "LUBANCAT_ZERO"
98+
LUBANCAT1 = "LUBANCAT1"
99+
LUBANCAT2 = "LUBANCAT2"
97100

98101
# Various Raspberry Pi models
99102
RASPBERRY_PI_B_REV1 = "RASPBERRY_PI_B_REV1"
@@ -220,7 +223,13 @@
220223
_BANANA_PI_IDS = (BANANA_PI_M2_ZERO, BANANA_PI_M2_PLUS, BANANA_PI_M5)
221224

222225
# LubanCat
223-
_LUBANCAT_IDS = (LUBANCAT_IMX6ULL, LUBANCAT_STM32MP157)
226+
_LUBANCAT_IDS = (
227+
LUBANCAT_IMX6ULL,
228+
LUBANCAT_STM32MP157,
229+
LUBANCAT_ZERO,
230+
LUBANCAT1,
231+
LUBANCAT2,
232+
)
224233

225234
# Coral boards
226235
_CORAL_IDS = (CORAL_EDGE_TPU_DEV, CORAL_EDGE_TPU_DEV_MINI)

adafruit_platformdetect/constants/chips.py

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
RK3328 = "RK3328"
5656
LPC4330 = "LPC4330"
5757
RK3288 = "RK3288"
58+
RK3566 = "RK3566"
59+
RK3568 = "RK3568"
5860
RK3588 = "RK3588"
5961
PENTIUM_N3710 = "PENTIUM_N3710" # SOC Braswell core
6062
STM32F405 = "STM32F405"

0 commit comments

Comments
 (0)