From 98cdaa4bbae0182ba3dd06bca7c1b8c10c58472f Mon Sep 17 00:00:00 2001 From: BlitzCityDIY Date: Fri, 29 May 2020 13:00:37 -0400 Subject: [PATCH] Adding Tinker Board detection Adding detection for the ASUS Tinker Board SBC. SoC: Rockchip 3288 (RK3288) --- adafruit_platformdetect/board.py | 2 ++ adafruit_platformdetect/chip.py | 5 +++++ adafruit_platformdetect/constants/boards.py | 7 +++++++ adafruit_platformdetect/constants/chips.py | 1 + bin/detect.py | 1 + docs/conf.py | 0 requirements.txt | 0 setup.py | 0 8 files changed, 16 insertions(+) mode change 100755 => 100644 bin/detect.py mode change 100755 => 100644 docs/conf.py mode change 100755 => 100644 requirements.txt mode change 100755 => 100644 setup.py diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index b528e3e..6cde2ca 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -119,6 +119,8 @@ class Board: board_id = self._clockwork_pi_id() elif chip_id == chips.RK3308: board_id = self._rock_pi_id() + elif chip_id == chips.RK3288: + board_id = boards.ASUS_TINKER_BOARD elif chip_id == chips.RYZEN_V1605B: board_id = self._udoo_id() diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index dc416c3..0aaa968 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -129,6 +129,9 @@ class Chip: if self.detector.check_dt_compatible_value("rockchip,rk3308"): return chips.RK3308 + + if self.detector.check_dt_compatible_value("rockchip,rk3288"): + return chips.RK3288 linux_id = None hardware = self.detector.get_cpuinfo_field("Hardware") @@ -212,6 +215,8 @@ class Chip: linux_id = chips.A64 elif "sun50iw1p1" in hardware: linux_id = chips.A64 + elif "ASUS_TINKER_BOARD" in hardware: + linux_id = chips.RK3288 elif "Xilinx Zynq" in hardware: compatible = self.detector.get_device_compatible() if compatible and "xlnx,zynq-7000" in compatible: diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index 98eb832..b13b852 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -98,6 +98,8 @@ GREATFET_ONE = "GREATFET_ONE" UDOO_BOLT_V3 = "UDOO_BOLT_V3" UDOO_BOLT_V8 = "UDOO_BOLT_V8" +ASUS_TINKER_BOARD = "ASUS_TINKER_BOARD" + # pylint: enable=bad-whitespace # OrangePI @@ -345,5 +347,10 @@ _ONION_OMEGA_BOARD_IDS = ( # Pine64 boards and devices _PINE64_DEV_IDS = (PINE64, PINEBOOK, PINEPHONE) +# ASUS Tinker Board +_ASUS_TINKER_BOARD_DEV_IDS = ( +ASUS_TINKER_BOARD +) + # UDOO _UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",)} diff --git a/adafruit_platformdetect/constants/chips.py b/adafruit_platformdetect/constants/chips.py index 0fe1ced..27b46f4 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -30,5 +30,6 @@ A64 = "A64" A33 = "A33" RK3308 = "RK3308" LPC4330 = "LPC4330" +RK3288 = "RK3288" BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2835", "BCM2837"} diff --git a/bin/detect.py b/bin/detect.py old mode 100755 new mode 100644 index ff609f9..1b0ea91 --- a/bin/detect.py +++ b/bin/detect.py @@ -24,6 +24,7 @@ print("Is this a Clockwork Pi board?", detector.board.any_clockwork_pi_board) print("Is this an embedded Linux system?", detector.board.any_embedded_linux) print("Is this a generic Linux PC?", detector.board.GENERIC_LINUX_PC) print("Is this a UDOO Bolt?", detector.board.UDOO_BOLT) +print("Is this an ASUS Tinker Board?", detector.board.ASUS_TINKER_BOARD) print( "Is this an OS environment variable special case?", detector.board.FTDI_FT232H diff --git a/docs/conf.py b/docs/conf.py old mode 100755 new mode 100644 diff --git a/requirements.txt b/requirements.txt old mode 100755 new mode 100644 diff --git a/setup.py b/setup.py old mode 100755 new mode 100644