diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index c9194591..f51b3391 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -135,6 +135,8 @@ def id(self): board_id = self._clockwork_pi_id() elif chip_id == chips.RK3308: board_id = self._rock_pi_id() + elif chip_id == chips.RK3399: + board_id = self._rock_pi_id() elif chip_id == chips.ATOM_X5_Z8350: board_id = self._rock_pi_id() elif chip_id == chips.RK3288: @@ -372,6 +374,8 @@ def _rock_pi_id(self): board = None if board_value and "ROCK Pi S" in board_value: board = boards.ROCK_PI_S + if board_value and "ROCK PI 4" in board_value.upper(): + board = boards.ROCK_PI_4 if self.detector.check_board_name_value() == "ROCK Pi X": board = boards.ROCK_PI_X return board @@ -486,8 +490,8 @@ def any_pine64_board(self): @property def any_rock_pi_board(self): - """Check whether the current board is any Clockwork Pi device.""" - return self.ROCK_PI_S + """Check whether the current board is any Rock Pi device.""" + return self.id in boards._ROCK_PI_IDS @property def any_clockwork_pi_board(self): diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index 0838301b..e91a1794 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -144,6 +144,9 @@ def _linux_id(self): if self.detector.check_dt_compatible_value("rockchip,rk3308"): return chips.RK3308 + if self.detector.check_dt_compatible_value("rockchip,rk3399"): + return chips.RK3399 + if self.detector.check_dt_compatible_value("rockchip,rk3288"): return chips.RK3288 diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index 510dc402..383a02ff 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -121,6 +121,7 @@ SOPINE = "SOPINE" ROCK_PI_S = "ROCK_PI_S" +ROCK_PI_4 = "ROCK_PI_4" ROCK_PI_X = "ROCK_PI_X" GREATFET_ONE = "GREATFET_ONE" @@ -454,5 +455,8 @@ # Pine64 boards and devices _PINE64_DEV_IDS = (PINE64, PINEH64, PINEBOOK, PINEPHONE, SOPINE) +# RockPi boards and devices +_ROCK_PI_IDS = (ROCK_PI_S, ROCK_PI_4, ROCK_PI_X) + # UDOO _UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",), UDOO_X86: ("dummy",)} diff --git a/adafruit_platformdetect/constants/chips.py b/adafruit_platformdetect/constants/chips.py index cf8c9fb5..0789fb84 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -33,6 +33,7 @@ H5 = "H5" H616 = "H616" RK3308 = "RK3308" +RK3399 = "RK3399" LPC4330 = "LPC4330" RK3288 = "RK3288" PENTIUM_N3710 = "PENTIUM_N3710" # SOC Braswell core