diff --git a/README.rst b/README.rst index 684526d2..f8bbd258 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ Introduction :alt: Documentation Status .. image:: https://img.shields.io/discord/327254708534116352.svg - :target: https://discord.gg/nBQh6qu + :target: https://adafru.it/discord :alt: Discord .. image:: https://github.com/adafruit/Adafruit_Python_PlatformDetect/workflows/Build%20CI/badge.svg diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index ee5923be..1133c6fe 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -121,6 +121,10 @@ def id(self): board_id = self._pynq_id() elif chip_id == chips.A64: board_id = self._pine64_id() + elif chip_id == chips.H6: + board_id = self._pine64_id() + elif chip_id == chips.H5: + board_id = self._armbian_id() elif chip_id == chips.A33: board_id = self._clockwork_pi_id() elif chip_id == chips.RK3308: @@ -133,6 +137,8 @@ def id(self): board_id = self._udoo_id() elif chip_id == chips.STM32MP157: board_id = self._stm32mp1_id() + elif chip_id == chips.MT8167: + board_id = boards.CORAL_EDGE_TPU_DEV_MINI self._board_id = board_id return board_id @@ -244,6 +250,8 @@ def _armbian_id(self): board = boards.ORANGE_PI_PC_PLUS if board_value == "pinebook-a64": board = boards.PINEBOOK + if board_value == "pineH64": + board = boards.PINEH64 if board_value == "orangepi2": board = boards.ORANGE_PI_2 if board_value == "bananapim2zero": @@ -300,10 +308,14 @@ def _pine64_id(self): board = None if "pine64" in board_value.lower(): board = boards.PINE64 + elif "pine h64" in board_value.lower(): + board = boards.PINEH64 elif "pinebook" in board_value.lower(): board = boards.PINEBOOK elif "pinephone" in board_value.lower(): board = boards.PINEPHONE + elif "sopine" in board_value.lower(): + board = boards.SOPINE return board # pylint: disable=no-self-use @@ -391,7 +403,7 @@ def any_orange_pi(self): @property def any_coral_board(self): """Check whether the current board is any defined Coral.""" - return self.CORAL_EDGE_TPU_DEV + return self.id in boards._CORAL_IDS @property def any_pynq_board(self): diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index deb33717..52536c45 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -150,6 +150,12 @@ def _linux_id(self): if self.detector.check_dt_compatible_value("st,stm32mp157"): return chips.STM32MP157 + if self.detector.check_dt_compatible_value("sun50i-a64"): + return chips.A64 + + if self.detector.check_dt_compatible_value("mediatek,mt8167"): + return chips.MT8167 + linux_id = None hardware = self.detector.get_cpuinfo_field("Hardware") @@ -199,6 +205,10 @@ def _linux_id(self): return chips.S905X3 if compatible and "sun50i-a64" in compatible: linux_id = chips.A64 + if compatible and "sun50i-h6" in compatible: + linux_id = chips.H6 + if compatible and "sun50i-h5" in compatible: + linux_id = chips.H5 if compatible and "odroid-xu4" in compatible: linux_id = chips.EXYNOS5422 @@ -237,8 +247,6 @@ def _linux_id(self): linux_id = chips.SAMA5 elif "Pinebook" in hardware: 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: diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index f74b25b0..ef251ae2 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -7,6 +7,7 @@ BEAGLEBONE_POCKETBEAGLE = "BEAGLEBONE_POCKETBEAGLE" BEAGLEBONE_GREEN = "BEAGLEBONE_GREEN" BEAGLEBONE_GREEN_WIRELESS = "BEAGLEBONE_GREEN_WIRELESS" +BEAGLEBONE_GREEN_GATEWAY = "BEAGLEBONE_GREEN_GATEWAY" BEAGLEBONE_BLACK_INDUSTRIAL = "BEAGLEBONE_BLACK_INDUSTRIAL" BEAGLEBONE_ENHANCED = "BEAGLEBONE_ENHANCED" BEAGLEBONE_USOMIQ = "BEAGLEBONE_USOMIQ" @@ -38,6 +39,7 @@ ORANGE_PI_PC_PLUS = "ORANGE_PI_PC_PLUS" ORANGE_PI_PLUS_2E = "ORANGE_PI_PLUS_2E" ORANGE_PI_2 = "ORANGE_PI_2" +ORANGE_PI_ZERO_PLUS_2H5 = "ORANGE_PI_ZERO_PLUS_2H5" # Banana Pi boards BANANA_PI_M2_ZERO = "BANANA_PI_M2_ZERO" @@ -52,6 +54,7 @@ # Google Coral dev board CORAL_EDGE_TPU_DEV = "CORAL_EDGE_TPU_DEV" +CORAL_EDGE_TPU_DEV_MINI = "CORAL_EDGE_TPU_DEV_MINI" # Xilinx PYNQ FPGA dev boards PYNQ_Z1 = "PYNQ_Z1" @@ -77,6 +80,8 @@ RASPBERRY_PI_CM3_PLUS = "RASPBERRY_PI_CM3_PLUS" RASPBERRY_PI_4B = "RASPBERRY_PI_4B" RASPBERRY_PI_AVNET_IIOT_GW = "RASPBERY_PI_AVNET_IIOT_GW" +RASPBERRY_PI_400 = "RASPBERRY_PI_400" +RASPBERRY_PI_CM4 = "RASPBERRY_PI_CM4" ODROID_C1 = "ODROID_C1" ODROID_C1_PLUS = "ODROID_C1_PLUS" @@ -98,8 +103,10 @@ ONION_OMEGA2 = "ONION_OMEGA2" PINE64 = "PINE64" +PINEH64 = "PINEH64" PINEBOOK = "PINEBOOK" PINEPHONE = "PINEPHONE" +SOPINE = "SOPINE" ROCK_PI_S = "ROCK_PI_S" @@ -126,12 +133,17 @@ ORANGE_PI_PC_PLUS, ORANGE_PI_PLUS_2E, ORANGE_PI_2, + ORANGE_PI_ZERO_PLUS_2H5, ) # BananaPI _BANANA_PI_IDS = (BANANA_PI_M2_ZERO,) -_CORAL_IDS = (CORAL_EDGE_TPU_DEV,) +# Coral boards +_CORAL_IDS = ( + CORAL_EDGE_TPU_DEV, + CORAL_EDGE_TPU_DEV_MINI, +) _PYNQ_IDS = (PYNQ_Z1, PYNQ_Z2) @@ -193,9 +205,15 @@ RASPBERRY_PI_3A_PLUS, RASPBERRY_PI_4B, RASPBERRY_PI_AVNET_IIOT_GW, + RASPBERRY_PI_400, ) -_RASPBERRY_PI_CM_IDS = (RASPBERRY_PI_CM1, RASPBERRY_PI_CM3, RASPBERRY_PI_CM3_PLUS) +_RASPBERRY_PI_CM_IDS = ( + RASPBERRY_PI_CM1, + RASPBERRY_PI_CM3, + RASPBERRY_PI_CM3_PLUS, + RASPBERRY_PI_CM4, +) _ODROID_40_PIN_IDS = ( ODROID_C1, @@ -214,6 +232,7 @@ BEAGLEBONE_POCKETBEAGLE, BEAGLEBONE_GREEN, BEAGLEBONE_GREEN_WIRELESS, + BEAGLEBONE_GREEN_GATEWAY, BEAGLEBONE_BLACK_INDUSTRIAL, BEAGLEBONE_ENHANCED, BEAGLEBONE_USOMIQ, @@ -256,6 +275,7 @@ BEAGLEBONE_POCKETBEAGLE: (("A2", "A335PBGL00A2"),), BEAGLEBONE_GREEN: (("1A", "A335BNLT...."), ("UNKNOWN", "A335BNLTBBG1")), BEAGLEBONE_GREEN_WIRELESS: (("W1A", "A335BNLTGW1A"),), + BEAGLEBONE_GREEN_GATEWAY: (("GA1", "A335BNLTGG1A"),), BEAGLEBONE_BLACK_INDUSTRIAL: ( ("A0", "A335BNLTAIA0"), # Arrow ("A0", "A335BNLTEIA0"), # Element14 @@ -373,6 +393,7 @@ "b03112", "c03112", "b03114", + "c03114", "d03114", "1a03111", "2a03111", @@ -387,13 +408,15 @@ "1c03112", "2c03112", ), + RASPBERRY_PI_400: ("c03130",), + RASPBERRY_PI_CM4: ("b03140",), } # Onion omega boards _ONION_OMEGA_BOARD_IDS = (ONION_OMEGA, ONION_OMEGA2) # Pine64 boards and devices -_PINE64_DEV_IDS = (PINE64, PINEBOOK, PINEPHONE) +_PINE64_DEV_IDS = (PINE64, PINEH64, PINEBOOK, PINEPHONE, SOPINE) # 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 0d93bdf3..7b7bfa3b 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -26,12 +26,15 @@ MIPS24KEC = "MIPS24KEC" ZYNQ7000 = "ZYNQ7000" A64 = "A64" +H6 = "H6" A33 = "A33" +H5 = "H5" RK3308 = "RK3308" LPC4330 = "LPC4330" RK3288 = "RK3288" PENTIUM_N3710 = "PENTIUM_N3710" # SOC Braswell core STM32F405 = "STM32F405" STM32MP157 = "STM32MP157" +MT8167 = "MT8167" BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2835", "BCM2837"} diff --git a/bin/detect.py b/bin/detect.py index 192ebd3b..eae7b562 100644 --- a/bin/detect.py +++ b/bin/detect.py @@ -16,7 +16,8 @@ print("Is this a BeagleBone Black?", detector.board.BEAGLEBONE_BLACK) print("Is this a BeagleBone Green?", detector.board.BEAGLEBONE_GREEN) print("Is this a Giant Board?", detector.board.GIANT_BOARD) -print("Is this a Coral Edge TPU?", detector.board.CORAL_EDGE_TPU_DEV) +print("Is this a Coral Dev Board?", detector.board.CORAL_EDGE_TPU_DEV) +print("Is this a Coral Dev Board Mini?", detector.board.CORAL_EDGE_TPU_DEV_MINI) print("Is this a SiFive Unleashed? ", detector.board.SIFIVE_UNLEASHED) print("Is this a PYNQ Board?", detector.board.PYNQ_Z1 | detector.board.PYNQ_Z2) print("Is this a Rock Pi board?", detector.board.any_rock_pi_board) @@ -63,3 +64,6 @@ if detector.board.any_asus_tinker_board: print("ASUS Tinker Board device detected.") + +if detector.board.any_coral_board: + print("Coral device detected.") diff --git a/docs/conf.py b/docs/conf.py index 0027ead7..b9a7c0cc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,7 +36,7 @@ master_doc = "index" # General information about the project. -project = "Adafruit Blinka Library" +project = "Adafruit PlatformDetect Library" copyright = "2017 Adafruit Industries" author = "Brennen Bearnes"