Skip to content

Commit 6cc5669

Browse files
authored
Merge pull request #301 from toozhsu/main
Add support for Tinker Board 2 and Tinker Edge R
2 parents 9082e33 + 0848d55 commit 6cc5669

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

adafruit_platformdetect/board.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,14 @@ def id(self) -> Optional[str]:
154154
elif chip_id == chips.RK3308:
155155
board_id = self._rock_pi_id()
156156
elif chip_id == chips.RK3399:
157-
board_id = self._rock_pi_id() or self._armbian_id() or self._diet_pi_id()
157+
board_id = (
158+
self._rock_pi_id()
159+
or self._armbian_id()
160+
or self._diet_pi_id()
161+
or self._asus_tinker_board_id()
162+
)
163+
elif chip_id == chips.RK3399PRO:
164+
board_id = self._asus_tinker_board_id()
158165
elif chip_id == chips.RK3399_T:
159166
board_id = self._rock_pi_id() or self._armbian_id()
160167
elif chip_id == chips.ATOM_X5_Z8350:
@@ -614,6 +621,11 @@ def _asus_tinker_board_id(self) -> Optional[str]:
614621
board = None
615622
if board_value and "ASUS Tinker Board" in board_value:
616623
board = boards.ASUS_TINKER_BOARD
624+
if board_value and "ASUS TINKER BOARD 2" in board_value:
625+
board = boards.ASUS_TINKER_BOARD_2
626+
if board_value and "ASUS_TINKER_EDGE_R" in board_value:
627+
board = boards.ASUS_TINKER_EDGE_R
628+
617629
return board
618630

619631
def _pcduino_board_id(self) -> Optional[str]:

adafruit_platformdetect/chip.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ def _linux_id(self) -> Optional[str]:
226226
if self.detector.check_dt_compatible_value("radxa,rock-4c-plus"):
227227
return chips.RK3399_T
228228

229+
if self.detector.check_dt_compatible_value("rockchip,rk3399pro"):
230+
return chips.RK3399PRO
231+
229232
if self.detector.check_dt_compatible_value("rockchip,rk3399"):
230233
return chips.RK3399
231234

adafruit_platformdetect/constants/boards.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
# ASUS Tinker Boards
3737
ASUS_TINKER_BOARD = "ASUS_TINKER_BOARD"
38+
ASUS_TINKER_BOARD_2 = "ASUS_TINKER_BOARD_2"
39+
ASUS_TINKER_EDGE_R = "ASUS_TINKER_EDGE_R"
3840

3941
# Clockwork Pi boards
4042
CLOCKWORK_CPI3 = "CLOCKWORK_CPI3"
@@ -203,7 +205,11 @@
203205
_KHADAS_40_PIN_IDS = (KHADAS_VIM3,)
204206

205207
# Asus Tinkerboard
206-
_ASUS_TINKER_BOARD_IDS = (ASUS_TINKER_BOARD,)
208+
_ASUS_TINKER_BOARD_IDS = (
209+
ASUS_TINKER_BOARD,
210+
ASUS_TINKER_BOARD_2,
211+
ASUS_TINKER_EDGE_R,
212+
)
207213

208214
# STM32MP1
209215
_STM32MP1_IDS = (

adafruit_platformdetect/constants/chips.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
RK3308 = "RK3308"
5656
RK3399 = "RK3399"
5757
RK3399_T = "RK3399_T"
58+
RK3399PRO = "RK3399PRO"
5859
RK3328 = "RK3328"
5960
LPC4330 = "LPC4330"
6061
RK3288 = "RK3288"

0 commit comments

Comments
 (0)