Skip to content

Commit 7126b96

Browse files
authored
Merge pull request #263 from ecarozzo/main
Added support to SeeedStudio Odyssey X86J4105 SBC
2 parents b6f715e + fa92078 commit 7126b96

File tree

5 files changed

+31
-1
lines changed

5 files changed

+31
-1
lines changed

adafruit_platformdetect/board.py

+21
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ def id(self) -> Optional[str]:
153153
board_id = self._rock_pi_id() or self._armbian_id()
154154
elif chip_id == chips.ATOM_X5_Z8350:
155155
board_id = self._rock_pi_id()
156+
elif chip_id == chips.ATOM_J4105:
157+
board_id = self._j4105_id()
156158
elif chip_id == chips.RK3288:
157159
board_id = self._asus_tinker_board_id()
158160
elif chip_id == chips.RK3328:
@@ -529,6 +531,19 @@ def _udoo_id(self) -> Optional[str]:
529531

530532
return None
531533

534+
def _j4105_id(self) -> Optional[str]:
535+
"""Try to detect the id of J4105 board."""
536+
try:
537+
with open(
538+
"/sys/devices/virtual/dmi/id/board_name", "r", encoding="utf-8"
539+
) as board_name:
540+
board_value = board_name.read().rstrip()
541+
if board_value == "ODYSSEY-X86J4105":
542+
return boards.ODYSSEY_X86J4105
543+
return None
544+
except FileNotFoundError:
545+
return None
546+
532547
def _asus_tinker_board_id(self) -> Optional[str]:
533548
"""Check what type of Tinker Board."""
534549
board_value = self.detector.get_device_model()
@@ -712,6 +727,11 @@ def any_udoo_board(self) -> bool:
712727
"""Check to see if the current board is an UDOO board"""
713728
return self.id in boards._UDOO_BOARD_IDS
714729

730+
@property
731+
def any_seeed_board(self) -> bool:
732+
"""Check to see if the current board is an SEEED board"""
733+
return self.id in boards._SEEED_BOARD_IDS
734+
715735
@property
716736
def any_asus_tinker_board(self) -> bool:
717737
"""Check to see if the current board is an ASUS Tinker Board"""
@@ -775,6 +795,7 @@ def lazily_generate_conditions():
775795
yield self.any_rock_pi_board
776796
yield self.any_clockwork_pi_board
777797
yield self.any_udoo_board
798+
yield self.any_seeed_board
778799
yield self.any_asus_tinker_board
779800
yield self.any_stm32mp1
780801
yield self.any_lubancat

adafruit_platformdetect/chip.py

+2
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ def _linux_id(self) -> Optional[str]:
290290
linux_id = chips.PENTIUM_N3710
291291
elif "X5-Z8350" in model_name:
292292
linux_id = chips.ATOM_X5_Z8350
293+
elif "J4105" in model_name:
294+
linux_id = chips.ATOM_J4105
293295
else:
294296
linux_id = chips.GENERIC_X86
295297
## print("linux_id = ", linux_id)

adafruit_platformdetect/constants/boards.py

+6
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@
172172

173173
GREATFET_ONE = "GREATFET_ONE"
174174

175+
# SeeedStudio boards
176+
ODYSSEY_X86J4105 = "ODYSSEY_X86J4105"
177+
175178
# Udoo boards
176179
UDOO_BOLT_V3 = "UDOO_BOLT_V3"
177180
UDOO_BOLT_V8 = "UDOO_BOLT_V8"
@@ -538,6 +541,9 @@
538541
# UDOO
539542
_UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",), UDOO_X86: ("dummy",)}
540543

544+
# SeeedStudio boards
545+
_SEEED_BOARD_IDS = ODYSSEY_X86J4105
546+
541547
# MaaXBoard boards
542548
_MAAXBOARD_IDS = ("MAAXBOARD", "MAAXBOARD_MINI")
543549

adafruit_platformdetect/constants/chips.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@
6868
ATOM_X5_Z8350 = "X5-Z8350"
6969
RP2040_U2IF = "RP2040_U2IF"
7070
D1_RISCV = "D1_RISCV"
71-
71+
ATOM_J4105 = "ATOM_J4105"
7272

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

bin/detect.py

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
print("Is this an embedded Linux system?", detector.board.any_embedded_linux)
5454
print("Is this a generic Linux PC?", detector.board.GENERIC_LINUX_PC)
5555
print("Is this a UDOO Bolt?", detector.board.UDOO_BOLT)
56+
print("Is this a ODYSSEY X86YJ4105?", detector.board.ODYSSEY_X86J4105)
5657
print("Is this an ASUS Tinker Board?", detector.board.ASUS_TINKER_BOARD)
5758
print("Is this an STM32MP1 Board?", detector.board.any_stm32mp1)
5859
print(

0 commit comments

Comments
 (0)