From e7ddeac4e850e8d7be7ab543bb8e02202b6a2ef8 Mon Sep 17 00:00:00 2001 From: tooz Date: Tue, 20 Jun 2023 12:03:32 +0800 Subject: [PATCH] Add support for Tinker Board 2 and Tinker Edge R --- adafruit_platformdetect/board.py | 6 ++++++ adafruit_platformdetect/chip.py | 3 +++ adafruit_platformdetect/constants/boards.py | 8 +++++++- adafruit_platformdetect/constants/chips.py | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index 83ef02b..12574de 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -614,6 +614,12 @@ class Board: board = None if board_value and "ASUS Tinker Board" in board_value: board = boards.ASUS_TINKER_BOARD + if board_value and "ASUS TINKER BOARD 2" in board_value: + board = boards.ASUS_TINKER_BOARD_2 + if board_value and "ASUS_TINKER_EDGE_R" in board_value: + board = boards.ASUS_TINKER_EDGE_R + + print("board: {}".format(board)) return board def _pcduino_board_id(self) -> Optional[str]: diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index fff7cbb..3063caf 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -226,6 +226,9 @@ class Chip: if self.detector.check_dt_compatible_value("radxa,rock-4c-plus"): return chips.RK3399_T + if self.detector.check_dt_compatible_value("rockchip,rk3399pro"): + return chips.RK3399PRO + if self.detector.check_dt_compatible_value("rockchip,rk3399"): return chips.RK3399 diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index caa53b4..3a10ffe 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -35,6 +35,8 @@ GIANT_BOARD = "GIANT_BOARD" # ASUS Tinker Boards ASUS_TINKER_BOARD = "ASUS_TINKER_BOARD" +ASUS_TINKER_BOARD_2 = "ASUS_TINKER_BOARD_2" +ASUS_TINKER_EDGE_R = "ASUS_TINKER_EDGE_R" # Clockwork Pi boards CLOCKWORK_CPI3 = "CLOCKWORK_CPI3" @@ -203,7 +205,11 @@ KHADAS_VIM3 = "KHADAS_VIM3" _KHADAS_40_PIN_IDS = (KHADAS_VIM3,) # Asus Tinkerboard -_ASUS_TINKER_BOARD_IDS = (ASUS_TINKER_BOARD,) +_ASUS_TINKER_BOARD_IDS = ( + ASUS_TINKER_BOARD, + ASUS_TINKER_BOARD_2, + ASUS_TINKER_EDGE_R +) # STM32MP1 _STM32MP1_IDS = ( diff --git a/adafruit_platformdetect/constants/chips.py b/adafruit_platformdetect/constants/chips.py index fbae9d0..e504a52 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -55,6 +55,7 @@ H616 = "H616" RK3308 = "RK3308" RK3399 = "RK3399" RK3399_T = "RK3399_T" +RK3399PRO = "RK3399PRO" RK3328 = "RK3328" LPC4330 = "LPC4330" RK3288 = "RK3288"