Add Clockwork Pi board

This commit is contained in:
cpi 2020-04-13 10:15:53 -07:00 committed by Johannes Lundberg
parent 34697fef8b
commit ee623a3eaf
5 changed files with 27 additions and 1 deletions

View file

@ -73,6 +73,8 @@ class Board:
board_id = self._pynq_id() board_id = self._pynq_id()
elif chip_id == chips.A64: elif chip_id == chips.A64:
board_id = self._pine64_id() board_id = self._pine64_id()
elif chip_id == chips.A33:
board_id = self._clockwork_pi_id()
return board_id return board_id
# pylint: enable=invalid-name # pylint: enable=invalid-name
@ -252,6 +254,14 @@ class Board:
except FileNotFoundError: except FileNotFoundError:
return None return None
def _clockwork_pi_id(self):
"""Check what type of Clockwork Pi board."""
board_value = self.detector.get_device_model()
board = None
if board_value and "Clockwork CPI3" in board_value:
board = boards.CLOCKWORK_CPI3
return board
@property @property
def any_96boards(self): def any_96boards(self):
"""Check whether the current board is any 96boards board.""" """Check whether the current board is any 96boards board."""
@ -322,6 +332,11 @@ class Board:
"""Check whether the current board is any Pine64 device.""" """Check whether the current board is any Pine64 device."""
return self.id in boards._PINE64_DEV_IDS return self.id in boards._PINE64_DEV_IDS
@property
def any_clockwork_pi_board(self):
"""Check whether the current board is any Clockwork Pi device."""
return self.CLOCKWORK_CPI3
@property @property
def any_embedded_linux(self): def any_embedded_linux(self):
"""Check whether the current board is any embedded Linux device.""" """Check whether the current board is any embedded Linux device."""
@ -331,7 +346,7 @@ class Board:
self.any_giant_board, self.any_jetson_board, self.any_coral_board, self.any_giant_board, self.any_jetson_board, self.any_coral_board,
self.any_odroid_40_pin, self.any_96boards, self.any_sifive_board, self.any_odroid_40_pin, self.any_96boards, self.any_sifive_board,
self.any_onion_omega_board, self.any_pine64_board, self.any_onion_omega_board, self.any_pine64_board,
self.any_pynq_board, self.any_pynq_board, self.any_clockwork_pi_board
] ]
) )

View file

@ -64,6 +64,9 @@ class Chip:
if self.detector.check_dt_compatible_value('fu500'): if self.detector.check_dt_compatible_value('fu500'):
return chips.HFU540 return chips.HFU540
if self.detector.check_dt_compatible_value('sun8i-a33'):
return chips.A33
linux_id = None linux_id = None
hardware = self.detector.get_cpuinfo_field('Hardware') hardware = self.detector.get_cpuinfo_field('Hardware')

View file

@ -24,6 +24,9 @@ PYBOARD = "PYBOARD"
NODEMCU = "NODEMCU" NODEMCU = "NODEMCU"
GIANT_BOARD = "GIANT_BOARD" GIANT_BOARD = "GIANT_BOARD"
# Clockwork Pi boards
CLOCKWORK_CPI3 = "CLOCKWORK_CPI3"
# Orange Pi boards # Orange Pi boards
ORANGE_PI_PC = "ORANGE_PI_PC" ORANGE_PI_PC = "ORANGE_PI_PC"
ORANGE_PI_R1 = "ORANGE_PI_R1" ORANGE_PI_R1 = "ORANGE_PI_R1"

View file

@ -24,5 +24,6 @@ MIPS24KC = "MIPS24KC"
MIPS24KEC = "MIPS24KEC" MIPS24KEC = "MIPS24KEC"
ZYNQ7000 = "ZYNQ7000" ZYNQ7000 = "ZYNQ7000"
A64 = "A64" A64 = "A64"
A33 = "A33"
BCM_RANGE = {'BCM2708', 'BCM2709', 'BCM2711', 'BCM2835', 'BCM2837'} BCM_RANGE = {'BCM2708', 'BCM2709', 'BCM2711', 'BCM2835', 'BCM2837'}

View file

@ -19,6 +19,7 @@ print("Is this a Giant Board?", detector.board.GIANT_BOARD)
print("Is this a Coral Edge TPU?", detector.board.CORAL_EDGE_TPU_DEV) print("Is this a Coral Edge TPU?", detector.board.CORAL_EDGE_TPU_DEV)
print("Is this a SiFive Unleashed? ", detector.board.SIFIVE_UNLEASHED) print("Is this a SiFive Unleashed? ", detector.board.SIFIVE_UNLEASHED)
print("Is this a PYNQ Board?", detector.board.PYNQ_Z1 | detector.board.PYNQ_Z2) print("Is this a PYNQ Board?", detector.board.PYNQ_Z1 | detector.board.PYNQ_Z2)
print("Is this a Clockwork Pi board?", detector.board.any_clockwork_pi_board)
print("Is this an embedded Linux system?", detector.board.any_embedded_linux) print("Is this an embedded Linux system?", detector.board.any_embedded_linux)
print("Is this a generic Linux PC?", detector.board.GENERIC_LINUX_PC) print("Is this a generic Linux PC?", detector.board.GENERIC_LINUX_PC)
print("Is this an OS environment variable special case?", detector.board.FTDI_FT232H | print("Is this an OS environment variable special case?", detector.board.FTDI_FT232H |
@ -44,3 +45,6 @@ if detector.board.any_onion_omega_board:
if detector.board.any_pine64_board: if detector.board.any_pine64_board:
print("Pine64 device detected.") print("Pine64 device detected.")
if detector.board.any_clockwork_pi:
print("Clockwork Pi device detected.")