Skip to content

Commit fdbfd06

Browse files
authored
Merge pull request #1 from adafruit/master
Merge
2 parents f1ed775 + 168ff6b commit fdbfd06

File tree

7 files changed

+59
-9
lines changed

7 files changed

+59
-9
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Introduction
66
:alt: Documentation Status
77

88
.. image:: https://img.shields.io/discord/327254708534116352.svg
9-
:target: https://discord.gg/nBQh6qu
9+
:target: https://adafru.it/discord
1010
:alt: Discord
1111

1212
.. image:: https://github.com/adafruit/Adafruit_Python_PlatformDetect/workflows/Build%20CI/badge.svg

adafruit_platformdetect/board.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ def id(self):
121121
board_id = self._pynq_id()
122122
elif chip_id == chips.A64:
123123
board_id = self._pine64_id()
124+
elif chip_id == chips.H6:
125+
board_id = self._pine64_id()
126+
elif chip_id == chips.H5:
127+
board_id = self._armbian_id()
124128
elif chip_id == chips.A33:
125129
board_id = self._clockwork_pi_id()
126130
elif chip_id == chips.RK3308:
@@ -133,6 +137,8 @@ def id(self):
133137
board_id = self._udoo_id()
134138
elif chip_id == chips.STM32MP157:
135139
board_id = self._stm32mp1_id()
140+
elif chip_id == chips.MT8167:
141+
board_id = boards.CORAL_EDGE_TPU_DEV_MINI
136142

137143
self._board_id = board_id
138144
return board_id
@@ -244,6 +250,8 @@ def _armbian_id(self):
244250
board = boards.ORANGE_PI_PC_PLUS
245251
if board_value == "pinebook-a64":
246252
board = boards.PINEBOOK
253+
if board_value == "pineH64":
254+
board = boards.PINEH64
247255
if board_value == "orangepi2":
248256
board = boards.ORANGE_PI_2
249257
if board_value == "bananapim2zero":
@@ -300,10 +308,14 @@ def _pine64_id(self):
300308
board = None
301309
if "pine64" in board_value.lower():
302310
board = boards.PINE64
311+
elif "pine h64" in board_value.lower():
312+
board = boards.PINEH64
303313
elif "pinebook" in board_value.lower():
304314
board = boards.PINEBOOK
305315
elif "pinephone" in board_value.lower():
306316
board = boards.PINEPHONE
317+
elif "sopine" in board_value.lower():
318+
board = boards.SOPINE
307319
return board
308320

309321
# pylint: disable=no-self-use
@@ -391,7 +403,7 @@ def any_orange_pi(self):
391403
@property
392404
def any_coral_board(self):
393405
"""Check whether the current board is any defined Coral."""
394-
return self.CORAL_EDGE_TPU_DEV
406+
return self.id in boards._CORAL_IDS
395407

396408
@property
397409
def any_pynq_board(self):

adafruit_platformdetect/chip.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ def _linux_id(self):
150150
if self.detector.check_dt_compatible_value("st,stm32mp157"):
151151
return chips.STM32MP157
152152

153+
if self.detector.check_dt_compatible_value("sun50i-a64"):
154+
return chips.A64
155+
156+
if self.detector.check_dt_compatible_value("mediatek,mt8167"):
157+
return chips.MT8167
158+
153159
linux_id = None
154160
hardware = self.detector.get_cpuinfo_field("Hardware")
155161

@@ -199,6 +205,10 @@ def _linux_id(self):
199205
return chips.S905X3
200206
if compatible and "sun50i-a64" in compatible:
201207
linux_id = chips.A64
208+
if compatible and "sun50i-h6" in compatible:
209+
linux_id = chips.H6
210+
if compatible and "sun50i-h5" in compatible:
211+
linux_id = chips.H5
202212
if compatible and "odroid-xu4" in compatible:
203213
linux_id = chips.EXYNOS5422
204214

@@ -237,8 +247,6 @@ def _linux_id(self):
237247
linux_id = chips.SAMA5
238248
elif "Pinebook" in hardware:
239249
linux_id = chips.A64
240-
elif "sun50iw1p1" in hardware:
241-
linux_id = chips.A64
242250
elif "ASUS_TINKER_BOARD" in hardware:
243251
linux_id = chips.RK3288
244252
elif "Xilinx Zynq" in hardware:

adafruit_platformdetect/constants/boards.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
BEAGLEBONE_POCKETBEAGLE = "BEAGLEBONE_POCKETBEAGLE"
88
BEAGLEBONE_GREEN = "BEAGLEBONE_GREEN"
99
BEAGLEBONE_GREEN_WIRELESS = "BEAGLEBONE_GREEN_WIRELESS"
10+
BEAGLEBONE_GREEN_GATEWAY = "BEAGLEBONE_GREEN_GATEWAY"
1011
BEAGLEBONE_BLACK_INDUSTRIAL = "BEAGLEBONE_BLACK_INDUSTRIAL"
1112
BEAGLEBONE_ENHANCED = "BEAGLEBONE_ENHANCED"
1213
BEAGLEBONE_USOMIQ = "BEAGLEBONE_USOMIQ"
@@ -38,6 +39,7 @@
3839
ORANGE_PI_PC_PLUS = "ORANGE_PI_PC_PLUS"
3940
ORANGE_PI_PLUS_2E = "ORANGE_PI_PLUS_2E"
4041
ORANGE_PI_2 = "ORANGE_PI_2"
42+
ORANGE_PI_ZERO_PLUS_2H5 = "ORANGE_PI_ZERO_PLUS_2H5"
4143

4244
# Banana Pi boards
4345
BANANA_PI_M2_ZERO = "BANANA_PI_M2_ZERO"
@@ -52,6 +54,7 @@
5254

5355
# Google Coral dev board
5456
CORAL_EDGE_TPU_DEV = "CORAL_EDGE_TPU_DEV"
57+
CORAL_EDGE_TPU_DEV_MINI = "CORAL_EDGE_TPU_DEV_MINI"
5558

5659
# Xilinx PYNQ FPGA dev boards
5760
PYNQ_Z1 = "PYNQ_Z1"
@@ -77,6 +80,8 @@
7780
RASPBERRY_PI_CM3_PLUS = "RASPBERRY_PI_CM3_PLUS"
7881
RASPBERRY_PI_4B = "RASPBERRY_PI_4B"
7982
RASPBERRY_PI_AVNET_IIOT_GW = "RASPBERY_PI_AVNET_IIOT_GW"
83+
RASPBERRY_PI_400 = "RASPBERRY_PI_400"
84+
RASPBERRY_PI_CM4 = "RASPBERRY_PI_CM4"
8085

8186
ODROID_C1 = "ODROID_C1"
8287
ODROID_C1_PLUS = "ODROID_C1_PLUS"
@@ -98,8 +103,10 @@
98103
ONION_OMEGA2 = "ONION_OMEGA2"
99104

100105
PINE64 = "PINE64"
106+
PINEH64 = "PINEH64"
101107
PINEBOOK = "PINEBOOK"
102108
PINEPHONE = "PINEPHONE"
109+
SOPINE = "SOPINE"
103110

104111
ROCK_PI_S = "ROCK_PI_S"
105112

@@ -126,12 +133,17 @@
126133
ORANGE_PI_PC_PLUS,
127134
ORANGE_PI_PLUS_2E,
128135
ORANGE_PI_2,
136+
ORANGE_PI_ZERO_PLUS_2H5,
129137
)
130138

131139
# BananaPI
132140
_BANANA_PI_IDS = (BANANA_PI_M2_ZERO,)
133141

134-
_CORAL_IDS = (CORAL_EDGE_TPU_DEV,)
142+
# Coral boards
143+
_CORAL_IDS = (
144+
CORAL_EDGE_TPU_DEV,
145+
CORAL_EDGE_TPU_DEV_MINI,
146+
)
135147

136148
_PYNQ_IDS = (PYNQ_Z1, PYNQ_Z2)
137149

@@ -193,9 +205,15 @@
193205
RASPBERRY_PI_3A_PLUS,
194206
RASPBERRY_PI_4B,
195207
RASPBERRY_PI_AVNET_IIOT_GW,
208+
RASPBERRY_PI_400,
196209
)
197210

198-
_RASPBERRY_PI_CM_IDS = (RASPBERRY_PI_CM1, RASPBERRY_PI_CM3, RASPBERRY_PI_CM3_PLUS)
211+
_RASPBERRY_PI_CM_IDS = (
212+
RASPBERRY_PI_CM1,
213+
RASPBERRY_PI_CM3,
214+
RASPBERRY_PI_CM3_PLUS,
215+
RASPBERRY_PI_CM4,
216+
)
199217

200218
_ODROID_40_PIN_IDS = (
201219
ODROID_C1,
@@ -214,6 +232,7 @@
214232
BEAGLEBONE_POCKETBEAGLE,
215233
BEAGLEBONE_GREEN,
216234
BEAGLEBONE_GREEN_WIRELESS,
235+
BEAGLEBONE_GREEN_GATEWAY,
217236
BEAGLEBONE_BLACK_INDUSTRIAL,
218237
BEAGLEBONE_ENHANCED,
219238
BEAGLEBONE_USOMIQ,
@@ -256,6 +275,7 @@
256275
BEAGLEBONE_POCKETBEAGLE: (("A2", "A335PBGL00A2"),),
257276
BEAGLEBONE_GREEN: (("1A", "A335BNLT...."), ("UNKNOWN", "A335BNLTBBG1")),
258277
BEAGLEBONE_GREEN_WIRELESS: (("W1A", "A335BNLTGW1A"),),
278+
BEAGLEBONE_GREEN_GATEWAY: (("GA1", "A335BNLTGG1A"),),
259279
BEAGLEBONE_BLACK_INDUSTRIAL: (
260280
("A0", "A335BNLTAIA0"), # Arrow
261281
("A0", "A335BNLTEIA0"), # Element14
@@ -373,6 +393,7 @@
373393
"b03112",
374394
"c03112",
375395
"b03114",
396+
"c03114",
376397
"d03114",
377398
"1a03111",
378399
"2a03111",
@@ -387,13 +408,15 @@
387408
"1c03112",
388409
"2c03112",
389410
),
411+
RASPBERRY_PI_400: ("c03130",),
412+
RASPBERRY_PI_CM4: ("b03140",),
390413
}
391414

392415
# Onion omega boards
393416
_ONION_OMEGA_BOARD_IDS = (ONION_OMEGA, ONION_OMEGA2)
394417

395418
# Pine64 boards and devices
396-
_PINE64_DEV_IDS = (PINE64, PINEBOOK, PINEPHONE)
419+
_PINE64_DEV_IDS = (PINE64, PINEH64, PINEBOOK, PINEPHONE, SOPINE)
397420

398421
# UDOO
399422
_UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",), UDOO_X86: ("dummy",)}

adafruit_platformdetect/constants/chips.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@
2626
MIPS24KEC = "MIPS24KEC"
2727
ZYNQ7000 = "ZYNQ7000"
2828
A64 = "A64"
29+
H6 = "H6"
2930
A33 = "A33"
31+
H5 = "H5"
3032
RK3308 = "RK3308"
3133
LPC4330 = "LPC4330"
3234
RK3288 = "RK3288"
3335
PENTIUM_N3710 = "PENTIUM_N3710" # SOC Braswell core
3436
STM32F405 = "STM32F405"
3537
STM32MP157 = "STM32MP157"
38+
MT8167 = "MT8167"
3639

3740
BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2835", "BCM2837"}

bin/detect.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
print("Is this a BeagleBone Black?", detector.board.BEAGLEBONE_BLACK)
1717
print("Is this a BeagleBone Green?", detector.board.BEAGLEBONE_GREEN)
1818
print("Is this a Giant Board?", detector.board.GIANT_BOARD)
19-
print("Is this a Coral Edge TPU?", detector.board.CORAL_EDGE_TPU_DEV)
19+
print("Is this a Coral Dev Board?", detector.board.CORAL_EDGE_TPU_DEV)
20+
print("Is this a Coral Dev Board Mini?", detector.board.CORAL_EDGE_TPU_DEV_MINI)
2021
print("Is this a SiFive Unleashed? ", detector.board.SIFIVE_UNLEASHED)
2122
print("Is this a PYNQ Board?", detector.board.PYNQ_Z1 | detector.board.PYNQ_Z2)
2223
print("Is this a Rock Pi board?", detector.board.any_rock_pi_board)
@@ -63,3 +64,6 @@
6364

6465
if detector.board.any_asus_tinker_board:
6566
print("ASUS Tinker Board device detected.")
67+
68+
if detector.board.any_coral_board:
69+
print("Coral device detected.")

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
master_doc = "index"
3737

3838
# General information about the project.
39-
project = "Adafruit Blinka Library"
39+
project = "Adafruit PlatformDetect Library"
4040
copyright = "2017 Adafruit Industries"
4141
author = "Brennen Bearnes"
4242

0 commit comments

Comments
 (0)