Browse Source

Add support for LubanCat i.MX6ULL and STM32MP157

pull/130/head
flyleaf91 4 years ago
parent
commit
e277535f63
5 changed files with 38 additions and 1 deletions
  1. +17
    -0
      adafruit_platformdetect/board.py
  2. +3
    -0
      adafruit_platformdetect/chip.py
  3. +14
    -1
      adafruit_platformdetect/constants/boards.py
  4. +1
    -0
      adafruit_platformdetect/constants/chips.py
  5. +3
    -0
      bin/detect.py

+ 17
- 0
adafruit_platformdetect/board.py View File

@ -83,6 +83,8 @@ class Board:
board_id = self._sama5_id()
elif chip_id == chips.IMX8MX:
board_id = self._imx8mx_id()
elif chip_id == chips.IMX6ULL:
board_id = self._imx6ull_id()
elif chip_id == chips.ESP8266:
board_id = boards.FEATHER_HUZZAH
elif chip_id == chips.SAMD21:
@ -277,6 +279,8 @@ class Board:
board_value = self.detector.get_device_model()
if "STM32MP157C-DK2" in board_value:
return boards.STM32MP157C_DK2
if "LubanCat" in board_value:
return boards.LUBANCAT_STM32MP157
return None
def _imx8mx_id(self):
@ -286,6 +290,13 @@ class Board:
return boards.CORAL_EDGE_TPU_DEV
return None
def _imx6ull_id(self):
"""Check what type iMX6ULL board."""
board_value = self.detector.get_device_model()
if "LubanCat" in board_value or "Embedfire" in board_value:
return boards.LUBANCAT_IMX6ULL
return None
def _tegra_id(self):
"""Try to detect the id of aarch64 board."""
compatible = self.detector.get_device_compatible()
@ -402,6 +413,11 @@ class Board:
"""Check whether the current board is any defined Orange Pi."""
return self.id in boards._ORANGE_PI_IDS
@property
def any_lubancat(self):
"""Check whether the current board is any defined lubancat."""
return self.id in boards._LUBANCAT_IDS
@property
def any_coral_board(self):
"""Check whether the current board is any defined Coral."""
@ -489,6 +505,7 @@ class Board:
self.any_udoo_board,
self.any_asus_tinker_board,
self.any_stm32mp1,
self.any_lubancat,
]
)


+ 3
- 0
adafruit_platformdetect/chip.py View File

@ -159,6 +159,9 @@ class Chip:
if self.detector.check_dt_compatible_value("mediatek,mt8167"):
return chips.MT8167
if self.detector.check_dt_compatible_value("imx6ull"):
return chips.IMX6ULL
linux_id = None
hardware = self.detector.get_cpuinfo_field("Hardware")


+ 14
- 1
adafruit_platformdetect/constants/boards.py View File

@ -63,6 +63,10 @@ PYNQ_Z2 = "PYNQ_Z2"
# STM32 MPU boards
STM32MP157C_DK2 = "STM32MP157C_DK2"
# Embedfire LubanCat board
LUBANCAT_IMX6ULL = "LUBANCAT_IMX6ULL"
LUBANCAT_STM32MP157 = "LUBANCAT_STM32MP157"
# Various Raspberry Pi models
RASPBERRY_PI_B_REV1 = "RASPBERRY_PI_B_REV1"
RASPBERRY_PI_B_REV2 = "RASPBERRY_PI_B_REV2"
@ -121,7 +125,10 @@ UDOO_X86 = "UDOO_X86"
_ASUS_TINKER_BOARD_IDS = (ASUS_TINKER_BOARD,)
# STM32MP1
_STM32MP1_IDS = (STM32MP157C_DK2,)
_STM32MP1_IDS = (
STM32MP157C_DK2,
LUBANCAT_STM32MP157,
)
# OrangePI
_ORANGE_PI_IDS = (
@ -139,6 +146,12 @@ _ORANGE_PI_IDS = (
# BananaPI
_BANANA_PI_IDS = (BANANA_PI_M2_ZERO,)
# LubanCat
_LUBANCAT_IDS = (
LUBANCAT_IMX6ULL,
LUBANCAT_STM32MP157,
)
# Coral boards
_CORAL_IDS = (
CORAL_EDGE_TPU_DEV,


+ 1
- 0
adafruit_platformdetect/constants/chips.py View File

@ -1,5 +1,6 @@
"""Definition of chips."""
AM33XX = "AM33XX"
IMX6ULL = "IMX6ULL"
IMX8MX = "IMX8MX"
BCM2XXX = "BCM2XXX"
ESP8266 = "ESP8266"


+ 3
- 0
bin/detect.py View File

@ -67,3 +67,6 @@ if detector.board.any_asus_tinker_board:
if detector.board.any_coral_board:
print("Coral device detected.")
if detector.board.any_lubancat:
print("LubanCat detected.")

|||||||
x
 
000:0
Loading…
Cancel
Save