|
60 | 60 |
|
61 | 61 | FTDI_FT232H = "FT232H"
|
62 | 62 | DRAGONBOARD_410C = "DRAGONBOARD_410C"
|
| 63 | + |
| 64 | +SIFIVE_UNLEASHED = "SIFIVE_UNLEASHED" |
| 65 | + |
63 | 66 | # pylint: enable=bad-whitespace
|
64 | 67 |
|
65 | 68 | #OrangePI
|
|
119 | 122 | DRAGONBOARD_410C,
|
120 | 123 | )
|
121 | 124 |
|
| 125 | + |
| 126 | +_SIFIVE_IDS = ( |
| 127 | + SIFIVE_UNLEASHED, |
| 128 | +) |
| 129 | + |
122 | 130 | # BeagleBone eeprom board ids from:
|
123 | 131 | # https://github.com/beagleboard/image-builder
|
124 | 132 | # Thanks to zmatt on freenode #beagle for pointers.
|
@@ -305,6 +313,8 @@ def id(self):
|
305 | 313 | board_id = DRAGONBOARD_410C
|
306 | 314 | elif chip_id in (ap_chip.T210, ap_chip.T186, ap_chip.T194):
|
307 | 315 | board_id = self._tegra_id()
|
| 316 | + elif chip_id == ap_chip.HFU540: |
| 317 | + board_id = self._sifive_id() |
308 | 318 | return board_id
|
309 | 319 | # pylint: enable=invalid-name
|
310 | 320 |
|
@@ -387,6 +397,13 @@ def _tegra_id(self):
|
387 | 397 | board = JETSON_NANO
|
388 | 398 | return board
|
389 | 399 |
|
| 400 | + def _sifive_id(self): |
| 401 | + """Try to detect the id for Sifive RISCV64 board.""" |
| 402 | + board_value = self.detector.get_device_model() |
| 403 | + if 'hifive-unleashed-a00' in board_value: |
| 404 | + return SIFIVE_UNLEASHED |
| 405 | + return None |
| 406 | + |
390 | 407 | @property
|
391 | 408 | def any_96boards(self):
|
392 | 409 | """Check whether the current board is any 96boards board."""
|
@@ -432,12 +449,18 @@ def any_jetson_board(self):
|
432 | 449 | """Check whether the current board is any defined Jetson Board."""
|
433 | 450 | return self.id in _JETSON_IDS
|
434 | 451 |
|
| 452 | + @property |
| 453 | + def any_sifive_board(self): |
| 454 | + """Check whether the current board is any defined Jetson Board.""" |
| 455 | + return self.id in _SIFIVE_IDS |
| 456 | + |
435 | 457 | @property
|
436 | 458 | def any_embedded_linux(self):
|
437 | 459 | """Check whether the current board is any embedded Linux device."""
|
438 | 460 | return self.any_raspberry_pi or self.any_beaglebone or \
|
439 | 461 | self.any_orange_pi or self.any_giant_board or self.any_jetson_board or \
|
440 |
| - self.any_coral_board or self.any_odroid_40_pin or self.any_96boards |
| 462 | + self.any_coral_board or self.any_odroid_40_pin or self.any_96boards or \ |
| 463 | + self.any_sifive_board |
441 | 464 |
|
442 | 465 | def __getattr__(self, attr):
|
443 | 466 | """
|
|
0 commit comments