diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index 2a889741..e61cd45e 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -113,6 +113,8 @@ def id(self): board_id = self._tegra_id() elif chip_id == chips.HFU540: board_id = self._sifive_id() + elif chip_id == chips.C906: + board_id = self._allwinner_id() elif chip_id == chips.MCP2221: board_id = boards.MICROCHIP_MCP2221 elif chip_id == chips.BINHO: @@ -342,6 +344,13 @@ def _sifive_id(self): return boards.SIFIVE_UNLEASHED return None + def _allwinner_id(self): + """Try to detect the id for Allwiner D1 board.""" + board_value = self.detector.get_device_model() + if "sun20iw1p1" in board_value: + return boards.ALLWINER_D1 + return None + def _pine64_id(self): """Try to detect the id for Pine64 board or device.""" board_value = self.detector.get_device_model() diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index 8bdea95c..0defeb5d 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -162,6 +162,9 @@ def _linux_id(self): if self.detector.check_dt_compatible_value("fu500"): return chips.HFU540 + if self.detector.check_dt_compatible_value("sun20iw1p1"): + return chips.C906 + if self.detector.check_dt_compatible_value("sun8i-a33"): return chips.A33 diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index 25c09649..44867994 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -109,6 +109,8 @@ SIFIVE_UNLEASHED = "SIFIVE_UNLEASHED" +ALLWINER_D1 = "ALLWINER_D1" + MICROCHIP_MCP2221 = "MICROCHIP_MCP2221" # Raspberry Pi Pico with u2if firmware diff --git a/adafruit_platformdetect/constants/chips.py b/adafruit_platformdetect/constants/chips.py index 078bd319..1523ee5e 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -23,6 +23,7 @@ FT232H = "FT232H" FT2232H = "FT2232H" HFU540 = "HFU540" +C906 = "C906" MCP2221 = "MCP2221" BINHO = "BINHO" MIPS24KC = "MIPS24KC"