Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
111daa0
Add PineH64 to board detection
dmanla Jul 23, 2020
ee64a3d
Added Allwinner H6; Modified Allwinner A64
dmanla Jul 23, 2020
e586f7e
Add PineH64 and Allwinner H6 constants
dmanla Jul 23, 2020
578742c
Modified a comment for clarification
dmanla Jul 23, 2020
3f33421
Fixed formatting via "black"
dmanla Jul 28, 2020
0c1d3b7
Added support for BeagleBone Green Gateway
jolesieur Oct 28, 2020
bcb2448
Merge pull request #111 from twa127/master
makermelissa Oct 30, 2020
1fa338d
Change Pine64 to use dt-compatible
makermelissa Oct 31, 2020
5423a45
Merge pull request #113 from makermelissa/master
ladyada Oct 31, 2020
74e1d05
Update board.py
twa127 Oct 31, 2020
9ec299e
Update boards.py
twa127 Oct 31, 2020
97ee9a9
Update chips.py
twa127 Oct 31, 2020
72a7a38
Merge remote-tracking branch 'twa127/patch-3' into patch-2
makermelissa Nov 1, 2020
d7457a8
Merge remote-tracking branch 'twa127/patch-4' into patch-2
makermelissa Nov 1, 2020
25d750d
Merge pull request #114 from twa127/patch-2
makermelissa Nov 1, 2020
d2ccda4
Merge pull request #110 from jolesieur/patch-1
makermelissa Nov 1, 2020
ffbbf59
Merge branch 'master' into master
makermelissa Nov 1, 2020
1f6b3f0
Removed long line
makermelissa Nov 1, 2020
9b8c8cd
Merge pull request #90 from dmanla/master
makermelissa Nov 1, 2020
71f4397
Adding Raspberry Pi 400 detection
makermelissa Nov 2, 2020
5fe73c7
Merge pull request #117 from makermelissa/master
ladyada Nov 2, 2020
141ac82
SoPine (Pine64) detection
SecT0uch Nov 17, 2020
94bbfd5
Merge pull request #118 from SecT0uch/master
ladyada Nov 18, 2020
70b9dd7
Add missing Pi 4 Rev code
makermelissa Nov 18, 2020
81c369b
Merge pull request #119 from makermelissa/master
ladyada Nov 18, 2020
aceb21e
Fix documentation title
scottamain Nov 25, 2020
1e83152
Add detection for Coral Dev Board Mini
scottamain Nov 29, 2020
d67b460
Merge pull request #120 from scottamain/patch-1
makermelissa Nov 30, 2020
800fdb0
Fix expired Discord link
mcauser Dec 7, 2020
0461785
Merge pull request #122 from mcauser/patch-1
ladyada Dec 7, 2020
fb283c4
Merge pull request #121 from scottamain/master
makermelissa Dec 7, 2020
3a00e32
Add support for Raspberry Pi CM4
timonsku Dec 10, 2020
933b280
Merge pull request #124 from PTS93/patch-1
ladyada Dec 10, 2020
f30f7c9
fix black
ladyada Dec 10, 2020
168ff6b
Merge pull request #125 from ladyada/master
ladyada Dec 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
12 changes: 10 additions & 2 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
29 changes: 26 additions & 3 deletions adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -98,8 +103,10 @@
ONION_OMEGA2 = "ONION_OMEGA2"

PINE64 = "PINE64"
PINEH64 = "PINEH64"
PINEBOOK = "PINEBOOK"
PINEPHONE = "PINEPHONE"
SOPINE = "SOPINE"

ROCK_PI_S = "ROCK_PI_S"

Expand All @@ -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)

Expand Down Expand Up @@ -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,
Expand All @@ -214,6 +232,7 @@
BEAGLEBONE_POCKETBEAGLE,
BEAGLEBONE_GREEN,
BEAGLEBONE_GREEN_WIRELESS,
BEAGLEBONE_GREEN_GATEWAY,
BEAGLEBONE_BLACK_INDUSTRIAL,
BEAGLEBONE_ENHANCED,
BEAGLEBONE_USOMIQ,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -373,6 +393,7 @@
"b03112",
"c03112",
"b03114",
"c03114",
"d03114",
"1a03111",
"2a03111",
Expand All @@ -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",)}
3 changes: 3 additions & 0 deletions adafruit_platformdetect/constants/chips.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
6 changes: 5 additions & 1 deletion bin/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.")
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down