Skip to content

Commit 9ea2588

Browse files
authored
Merge pull request #235 from Ste-Trat/main
chip detection for STMP157 Single board computer from olimex
2 parents 745892e + c1a9eda commit 9ea2588

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

adafruit_platformdetect/board.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ def id(self) -> Optional[str]:
151151
board_id = self._udoo_id()
152152
elif chip_id == chips.STM32MP157:
153153
board_id = self._stm32mp1_id()
154+
elif chip_id == chips.STM32MP157DAA1:
155+
board_id = self._stm32mp1_id()
154156
elif chip_id == chips.MT8167:
155157
board_id = boards.CORAL_EDGE_TPU_DEV_MINI
156158
elif chip_id == chips.RP2040_U2IF:
@@ -349,6 +351,8 @@ def _stm32mp1_id(self) -> Optional[str]:
349351
return boards.OSD32MP1_BRK
350352
if "OSD32MP1-RED" in board_value:
351353
return boards.OSD32MP1_RED
354+
if "STM32MP1XX OLinuXino" in board_value:
355+
return boards.STMP157_OLINUXINO_LIME2
352356
return None
353357

354358
def _imx8mx_id(self) -> Optional[str]:

adafruit_platformdetect/chip.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ def _linux_id(self) -> Optional[str]:
211211
if self.detector.check_dt_compatible_value("st,stm32mp157"):
212212
return chips.STM32MP157
213213

214+
if self.detector.check_dt_compatible_value("st,stm32mp153"):
215+
return chips.STM32MP157DAA1
216+
214217
if self.detector.check_dt_compatible_value("sun50i-a64"):
215218
return chips.A64
216219

@@ -294,7 +297,6 @@ def _linux_id(self) -> Optional[str]:
294297
linux_id = chips.H5
295298
if compatible and "odroid-xu4" in compatible:
296299
linux_id = chips.EXYNOS5422
297-
298300
cpu_model = self.detector.get_cpuinfo_field("cpu model")
299301

300302
if cpu_model is not None:

adafruit_platformdetect/constants/boards.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
STM32MP157C_DK2 = "STM32MP157C_DK2"
8585
OSD32MP1_BRK = "OSD32MP1_BRK"
8686
OSD32MP1_RED = "OSD32MP1_RED"
87+
STMP157_OLINUXINO_LIME2 = "STMP157_OLINUXINO_LIME2"
8788

8889
# Embedfire LubanCat board
8990
LUBANCAT_IMX6ULL = "LUBANCAT_IMX6ULL"
@@ -174,7 +175,13 @@
174175
_ASUS_TINKER_BOARD_IDS = (ASUS_TINKER_BOARD,)
175176

176177
# STM32MP1
177-
_STM32MP1_IDS = (STM32MP157C_DK2, LUBANCAT_STM32MP157, OSD32MP1_BRK, OSD32MP1_RED)
178+
_STM32MP1_IDS = (
179+
STM32MP157C_DK2,
180+
LUBANCAT_STM32MP157,
181+
OSD32MP1_BRK,
182+
OSD32MP1_RED,
183+
STMP157_OLINUXINO_LIME2,
184+
)
178185

179186
# OrangePI
180187
_ORANGE_PI_IDS = (

adafruit_platformdetect/constants/chips.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
STM32F405 = "STM32F405"
5353
RP2040 = "RP2040"
5454
STM32MP157 = "STM32MP157"
55+
STM32MP157DAA1 = "STM32MP157DAA1"
5556
MT8167 = "MT8167"
5657
ATOM_X5_Z8350 = "X5-Z8350"
5758
RP2040_U2IF = "RP2040_U2IF"

0 commit comments

Comments
 (0)