Skip to content

Adding support for Allwinner D1 with Xuantie-C906 #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@

SIFIVE_UNLEASHED = "SIFIVE_UNLEASHED"

ALLWINER_D1 = "ALLWINER_D1"

MICROCHIP_MCP2221 = "MICROCHIP_MCP2221"

# Raspberry Pi Pico with u2if firmware
Expand Down
1 change: 1 addition & 0 deletions adafruit_platformdetect/constants/chips.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
FT232H = "FT232H"
FT2232H = "FT2232H"
HFU540 = "HFU540"
C906 = "C906"
MCP2221 = "MCP2221"
BINHO = "BINHO"
MIPS24KC = "MIPS24KC"
Expand Down