Skip to content

Commit 0de2f8b

Browse files
authored
Merge pull request #95 from zzts/master
Pentium N3710 (Braswell SOC) on UDOO x86
2 parents c207b2f + da46b46 commit 0de2f8b

File tree

5 files changed

+47
-24
lines changed

5 files changed

+47
-24
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: 6 additions & 0 deletions
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,6 +326,10 @@ 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
329+
330+
if self.detector.check_board_name_value() == "UDOO x86":
331+
return boards.UDOO_X86
332+
327333
return None
328334

329335
def _asus_tinker_board_id(self):

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: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,11 @@
9898
ROCK_PI_S = "ROCK_PI_S"
9999

100100
GREATFET_ONE = "GREATFET_ONE"
101+
102+
# Udoo boards
101103
UDOO_BOLT_V3 = "UDOO_BOLT_V3"
102104
UDOO_BOLT_V8 = "UDOO_BOLT_V8"
105+
UDOO_X86 = "UDOO_X86"
103106

104107
# pylint: enable=bad-whitespace
105108

@@ -120,13 +123,10 @@
120123

121124
_CORAL_IDS = (CORAL_EDGE_TPU_DEV,)
122125

123-
_PYNQ_IDS = (
124-
PYNQ_Z1,
125-
PYNQ_Z2,
126-
)
126+
_PYNQ_IDS = (PYNQ_Z1, PYNQ_Z2)
127127

128128
_JETSON_IDS = {
129-
JETSON_TX1: ("nvidia,p2371-2180", "nvidia,jetson-cv",),
129+
JETSON_TX1: ("nvidia,p2371-2180", "nvidia,jetson-cv"),
130130
JETSON_TX2: (
131131
"nvidia,p2771-0000",
132132
"nvidia,p2771-0888",
@@ -135,8 +135,8 @@
135135
"nvidia,quill",
136136
"nvidia,storm",
137137
),
138-
JETSON_XAVIER: ("nvidia,p2972-0000", "nvidia,p2972-0006", "nvidia,jetson-xavier",),
139-
JETSON_NANO: ("nvidia,p3450-0000", "nvidia,p3450-0002", "nvidia,jetson-nano",),
138+
JETSON_XAVIER: ("nvidia,p2972-0000", "nvidia,p2972-0006", "nvidia,jetson-xavier"),
139+
JETSON_NANO: ("nvidia,p3450-0000", "nvidia,p3450-0002", "nvidia,jetson-nano"),
140140
JETSON_NX: (
141141
"nvidia,p3509-0000+p3668-0000",
142142
"nvidia,p3509-0000+p3668-0001",
@@ -217,7 +217,7 @@
217217
BEAGLEBONE_BLUE: (("A2", "A335BNLTBLA2"),),
218218
BEAGLEBONE_BLACK_WIRELESS: (("A5", "A335BNLTBWA5"),),
219219
BEAGLEBONE_POCKETBEAGLE: (("A2", "A335PBGL00A2"),),
220-
BEAGLEBONE_GREEN: (("1A", "A335BNLT...."), ("UNKNOWN", "A335BNLTBBG1"),),
220+
BEAGLEBONE_GREEN: (("1A", "A335BNLT...."), ("UNKNOWN", "A335BNLTBBG1")),
221221
BEAGLEBONE_GREEN_WIRELESS: (("W1A", "A335BNLTGW1A"),),
222222
BEAGLEBONE_BLACK_INDUSTRIAL: (
223223
("A0", "A335BNLTAIA0"), # Arrow
@@ -261,10 +261,10 @@
261261
"100000e",
262262
"100000f",
263263
),
264-
RASPBERRY_PI_B_PLUS: ("0010", "0013", "900032", "1000010", "1000013", "1900032",),
265-
RASPBERRY_PI_A: ("0007", "0008", "0009", "1000007", "1000008", "1000009",),
266-
RASPBERRY_PI_A_PLUS: ("0012", "0015", "900021", "1000012", "1000015", "1900021",),
267-
RASPBERRY_PI_CM1: ("0011", "0014", "10000011", "10000014",),
264+
RASPBERRY_PI_B_PLUS: ("0010", "0013", "900032", "1000010", "1000013", "1900032"),
265+
RASPBERRY_PI_A: ("0007", "0008", "0009", "1000007", "1000008", "1000009"),
266+
RASPBERRY_PI_A_PLUS: ("0012", "0015", "900021", "1000012", "1000015", "1900021"),
267+
RASPBERRY_PI_CM1: ("0011", "0014", "10000011", "10000014"),
268268
RASPBERRY_PI_ZERO: (
269269
"900092",
270270
"920092",
@@ -279,7 +279,7 @@
279279
"2900093",
280280
"2920093", # warranty bit 25
281281
),
282-
RASPBERRY_PI_ZERO_W: ("9000c1", "19000c1", "29000c1",), # warranty bits
282+
RASPBERRY_PI_ZERO_W: ("9000c1", "19000c1", "29000c1"), # warranty bits
283283
RASPBERRY_PI_2B: (
284284
"a01040",
285285
"a01041",
@@ -316,7 +316,7 @@
316316
"2a32082",
317317
"2a52082", # warranty bit 25
318318
),
319-
RASPBERRY_PI_3B_PLUS: ("a020d3", "1a020d3", "2a020d3",), # warranty bits
319+
RASPBERRY_PI_3B_PLUS: ("a020d3", "1a020d3", "2a020d3"), # warranty bits
320320
RASPBERRY_PI_AVNET_IIOT_GW: ("60a220b0",),
321321
RASPBERRY_PI_CM3: (
322322
"a020a0",
@@ -326,8 +326,8 @@
326326
"1a220a0",
327327
"2a220a0",
328328
),
329-
RASPBERRY_PI_3A_PLUS: ("9020e0", "19020e0", "29020e0",), # warranty bits
330-
RASPBERRY_PI_CM3_PLUS: ("a02100", "1a02100", "2a02100",), # warranty bits
329+
RASPBERRY_PI_3A_PLUS: ("9020e0", "19020e0", "29020e0"), # warranty bits
330+
RASPBERRY_PI_CM3_PLUS: ("a02100", "1a02100", "2a02100"), # warranty bits
331331
RASPBERRY_PI_4B: (
332332
"a03111",
333333
"b03111",
@@ -352,13 +352,10 @@
352352
}
353353

354354
# Onion omega boards
355-
_ONION_OMEGA_BOARD_IDS = (
356-
ONION_OMEGA,
357-
ONION_OMEGA2,
358-
)
355+
_ONION_OMEGA_BOARD_IDS = (ONION_OMEGA, ONION_OMEGA2)
359356

360357
# Pine64 boards and devices
361358
_PINE64_DEV_IDS = (PINE64, PINEBOOK, PINEPHONE)
362359

363360
# UDOO
364-
_UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",)}
361+
_UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",), UDOO_X86: ("dummy",)}

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)