Skip to content
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

Added support to SeeedStudio Odyssey X86J4105 SBC #263

Merged
merged 7 commits into from
Nov 28, 2022
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
21 changes: 21 additions & 0 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ def id(self) -> Optional[str]:
board_id = self._rock_pi_id() or self._armbian_id()
elif chip_id == chips.ATOM_X5_Z8350:
board_id = self._rock_pi_id()
elif chip_id == chips.ATOM_J4105:
board_id = self._j4105_id()
elif chip_id == chips.RK3288:
board_id = self._asus_tinker_board_id()
elif chip_id == chips.RK3328:
Expand Down Expand Up @@ -529,6 +531,19 @@ def _udoo_id(self) -> Optional[str]:

return None

def _j4105_id(self) -> Optional[str]:
"""Try to detect the id of J4105 board."""
try:
with open(
"/sys/devices/virtual/dmi/id/board_name", "r", encoding="utf-8"
) as board_name:
board_value = board_name.read().rstrip()
if board_value == "ODYSSEY-X86J4105":
return boards.ODYSSEY_X86J4105
return None
except FileNotFoundError:
return None

def _asus_tinker_board_id(self) -> Optional[str]:
"""Check what type of Tinker Board."""
board_value = self.detector.get_device_model()
Expand Down Expand Up @@ -712,6 +727,11 @@ def any_udoo_board(self) -> bool:
"""Check to see if the current board is an UDOO board"""
return self.id in boards._UDOO_BOARD_IDS

@property
def any_seeed_board(self) -> bool:
"""Check to see if the current board is an SEEED board"""
return self.id in boards._SEEED_BOARD_IDS

@property
def any_asus_tinker_board(self) -> bool:
"""Check to see if the current board is an ASUS Tinker Board"""
Expand Down Expand Up @@ -775,6 +795,7 @@ def lazily_generate_conditions():
yield self.any_rock_pi_board
yield self.any_clockwork_pi_board
yield self.any_udoo_board
yield self.any_seeed_board
yield self.any_asus_tinker_board
yield self.any_stm32mp1
yield self.any_lubancat
Expand Down
2 changes: 2 additions & 0 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ def _linux_id(self) -> Optional[str]:
linux_id = chips.PENTIUM_N3710
elif "X5-Z8350" in model_name:
linux_id = chips.ATOM_X5_Z8350
elif "J4105" in model_name:
linux_id = chips.ATOM_J4105
else:
linux_id = chips.GENERIC_X86
## print("linux_id = ", linux_id)
Expand Down
6 changes: 6 additions & 0 deletions adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@

GREATFET_ONE = "GREATFET_ONE"

# SeeedStudio boards
ODYSSEY_X86J4105 = "ODYSSEY_X86J4105"

# Udoo boards
UDOO_BOLT_V3 = "UDOO_BOLT_V3"
UDOO_BOLT_V8 = "UDOO_BOLT_V8"
Expand Down Expand Up @@ -538,6 +541,9 @@
# UDOO
_UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",), UDOO_X86: ("dummy",)}

# SeeedStudio boards
_SEEED_BOARD_IDS = ODYSSEY_X86J4105

# MaaXBoard boards
_MAAXBOARD_IDS = ("MAAXBOARD", "MAAXBOARD_MINI")

Expand Down
2 changes: 1 addition & 1 deletion adafruit_platformdetect/constants/chips.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@
ATOM_X5_Z8350 = "X5-Z8350"
RP2040_U2IF = "RP2040_U2IF"
D1_RISCV = "D1_RISCV"

ATOM_J4105 = "ATOM_J4105"

BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2835", "BCM2837"}
1 change: 1 addition & 0 deletions bin/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
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 a ODYSSEY X86YJ4105?", detector.board.ODYSSEY_X86J4105)
print("Is this an ASUS Tinker Board?", detector.board.ASUS_TINKER_BOARD)
print("Is this an STM32MP1 Board?", detector.board.any_stm32mp1)
print(
Expand Down