Skip to content

Commit 5d80f7e

Browse files
committed
Merge branch 'udoo'
2 parents 2908910 + c711421 commit 5d80f7e

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

adafruit_platformdetect/__init__.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def get_device_compatible(self):
121121

122122
def check_board_asset_tag_value(self):
123123
"""
124-
Search /proc/device-tree/model for the device model and return its value, if found,
124+
Search /sys/devices/virtual/dmi/id for the device model and return its value, if found,
125125
otherwise None.
126126
"""
127127
tag = None
@@ -133,3 +133,18 @@ def check_board_asset_tag_value(self):
133133
pass
134134

135135
return tag
136+
137+
def check_board_name_value(self):
138+
"""
139+
Search /sys/devices/virtual/dmi/id for the device model and return its value, if found,
140+
otherwise None. Debian/ubuntu based
141+
"""
142+
board_name = None
143+
144+
try:
145+
with open("/sys/devices/virtual/dmi/id/board_name", "r") as board_name_file:
146+
board_name = board_name_file.read().strip()
147+
except FileNotFoundError:
148+
pass
149+
150+
return board_name

adafruit_platformdetect/board.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ def id(self):
123123
board_id = self._asus_tinker_board_id()
124124
elif chip_id == chips.RYZEN_V1605B:
125125
board_id = self._udoo_id()
126+
elif chip_id == chips.PENTIUM_N3710:
127+
board_id = self._udoo_id()
126128

127129
return board_id
128130

@@ -324,7 +326,11 @@ def _udoo_id(self):
324326
for board_id, board_tags in boards._UDOO_BOARD_IDS.items():
325327
if any(v == board_asset_tag for v in board_tags):
326328
return board_id
327-
return None
329+
330+
if self.detector.check_board_name_value() == 'UDOO x86':
331+
return boards.UDOO_X86
332+
else:
333+
return None
328334

329335
def _asus_tinker_board_id(self):
330336
"""Check what type of Tinker Board."""

adafruit_platformdetect/chip.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,14 @@ def _linux_id(self):
144144
linux_id = chips.RYZEN_V1202B
145145
if "RYZEN EMBEDDED V1605B" in model_name:
146146
linux_id = chips.RYZEN_V1605B
147+
elif vendor_id == "GenuineIntel":
148+
model_name = self.detector.get_cpuinfo_field("model name").upper()
149+
## print('model_name =', model_name)
150+
if "N3710" in model_name:
151+
linux_id = chips.PENTIUM_N3710
147152
else:
148153
linux_id = chips.GENERIC_X86
149-
elif vendor_id == "GenuineIntel":
150-
linux_id = chips.GENERIC_X86
154+
## print("linux_id = ", linux_id)
151155

152156
compatible = self.detector.get_device_compatible()
153157
if compatible and "tegra" in compatible:

adafruit_platformdetect/constants/boards.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,11 @@
9999
ROCK_PI_S = "ROCK_PI_S"
100100

101101
GREATFET_ONE = "GREATFET_ONE"
102+
103+
#Udoo boards
102104
UDOO_BOLT_V3 = "UDOO_BOLT_V3"
103105
UDOO_BOLT_V8 = "UDOO_BOLT_V8"
106+
UDOO_X86 = "UDOO_X86"
104107

105108
# pylint: enable=bad-whitespace
106109

@@ -364,4 +367,6 @@
364367
_ASUS_TINKER_BOARD_DEV_IDS = ASUS_TINKER_BOARD
365368

366369
# UDOO
367-
_UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",)}
370+
_UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",),
371+
UDOO_X86: ("dummy",)
372+
}

adafruit_platformdetect/constants/chips.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@
3131
RK3308 = "RK3308"
3232
LPC4330 = "LPC4330"
3333
RK3288 = "RK3288"
34+
PENTIUM_N3710="PENTIUM_N3710" # SOC Braswell core
3435

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

0 commit comments

Comments
 (0)