Skip to content

Updated Code for Udoo bolt ID #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 12 additions & 3 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class Board:

def __init__(self, detector):
self.detector = detector
self.board_asset_tag = self.detector.check_board_asset_tag_value().strip()

# pylint: disable=invalid-name, protected-access
@property
Expand Down Expand Up @@ -92,6 +91,8 @@ def id(self):
board_id = boards.ODROID_C4
elif chip_id == chips.S922X:
board_id = boards.ODROID_N2
elif chip_id == chips.EXYNOS5422:
board_id = boards.ODROID_XU4
elif chip_id == chips.FT232H:
board_id = boards.FTDI_FT232H
elif chip_id == chips.APQ8016:
Expand All @@ -118,8 +119,8 @@ def id(self):
board_id = self._clockwork_pi_id()
elif chip_id == chips.RK3308:
board_id = self._rock_pi_id()
elif self.board_asset_tag == boards._UDOO_BOLT_BOARD_ASSET_TAG:
board_id = boards.UDOO_BOLT
elif chip_id == chips.RYZEN_V1605B:
board_id = self._udoo_id()

return board_id

Expand Down Expand Up @@ -315,6 +316,14 @@ def _clockwork_pi_id(self):
board = boards.CLOCKWORK_CPI3
return board

def _udoo_id(self):
"""Try to detect the id of udoo board."""
board_asset_tag = self.detector.check_board_asset_tag_value()
for board_id, board_tags in boards._UDOO_BOARD_IDS.items():
if any(v == board_asset_tag for v in board_tags):
return board_id
return None

@property
def any_96boards(self):
"""Check whether the current board is any 96boards board."""
Expand Down
4 changes: 4 additions & 0 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def _linux_id(self):
return chips.S905X3
if compatible and "sun50i-a64" in compatible:
linux_id = chips.A64
if compatible and "odroid-xu4" in compatible:
linux_id = chips.EXYNOS5422

cpu_model = self.detector.get_cpuinfo_field("cpu model")

Expand Down Expand Up @@ -200,6 +202,8 @@ def _linux_id(self):
linux_id = chips.S922X
elif "ODROID-C4" in hardware:
linux_id = chips.S905X3
elif "ODROID-XU4" in hardware:
linux_id = chips.EXYNOS5422
elif "SAMA5" in hardware:
linux_id = chips.SAMA5
elif "Pinebook" in hardware:
Expand Down
19 changes: 11 additions & 8 deletions adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
ODROID_C2 = "ODROID_C2"
ODROID_C4 = "ODROID_C4"
ODROID_N2 = "ODROID_N2"
ODROID_XU4 = "ODROID_XU4"

FTDI_FT232H = "FTDI_FT232H"
DRAGONBOARD_410C = "DRAGONBOARD_410C"
Expand All @@ -94,6 +95,7 @@
ROCK_PI_S = "ROCK_PI_S"

GREATFET_ONE = "GREATFET_ONE"
UDOO_BOLT = "UDOO_BOLT"

# pylint: enable=bad-whitespace

Expand Down Expand Up @@ -151,7 +153,14 @@

_RASPBERRY_PI_CM_IDS = (RASPBERRY_PI_CM1, RASPBERRY_PI_CM3, RASPBERRY_PI_CM3_PLUS)

_ODROID_40_PIN_IDS = (ODROID_C1, ODROID_C1_PLUS, ODROID_C2, ODROID_C4, ODROID_N2)
_ODROID_40_PIN_IDS = (
ODROID_C1,
ODROID_C1_PLUS,
ODROID_C2,
ODROID_C4,
ODROID_N2,
ODROID_XU4,
)

_BEAGLEBONE_IDS = (
BEAGLEBONE,
Expand Down Expand Up @@ -335,11 +344,5 @@
# Pine64 boards and devices
_PINE64_DEV_IDS = (PINE64, PINEBOOK, PINEPHONE)

UDOO_BOLT = "UDOO_BOLT"
_UDOO_BOLT_BOARD_ASSET_TAG = "SC40-2000-0000-C0|C"

# UDOO
_UDOO_BOARD_IDS = (
UDOO_BOLT,
_UDOO_BOLT_BOARD_ASSET_TAG,
)
_UDOO_BOARD_IDS = {UDOO_BOLT: ("SC40-2000-0000-C0|C",)}
1 change: 1 addition & 0 deletions adafruit_platformdetect/constants/chips.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
IMX8MX = "IMX8MX"
BCM2XXX = "BCM2XXX"
ESP8266 = "ESP8266"
EXYNOS5422 = "EXYNOS5422"
RYZEN_V1605B = "RYZEN_V1605B"
SAMD21 = "SAMD21"
STM32 = "STM32"
Expand Down