diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index 5df172f..48b7631 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -156,6 +156,8 @@ class Board: or self._allwinner_variants_id() or self._repka_variants_id() ) + elif chip_id == chips.H618: + board_id = self._armbian_id() or self._allwinner_variants_id() elif chip_id == chips.H616: board_id = self._armbian_id() or self._allwinner_variants_id() elif chip_id == chips.A33: @@ -431,6 +433,10 @@ class Board: board = boards.BANANA_PI_M2_PLUS elif board_value == "bananapim2berry": board = boards.BANANA_PI_M2_BERRY + elif board_value == "bananapim4berry": + board = boards.BANANA_PI_M4_BERRY + elif board_value == "bananapim4zero": + board = boards.BANANA_PI_M4_ZERO elif board_value == "bananapim5": board = boards.BANANA_PI_M5 elif board_value == "orangepizeroplus2-h5": @@ -758,6 +764,14 @@ class Board: if "banana pi m2 berry" in board_value: board = boards.BANANA_PI_M2_BERRY + if any(x in board_value for x in ("banana pi", "bananapi")); + if "m2 berry" in board_value: + board = boards.BANANA_PI_M2_BERRY + elif "m4berry" in board_value or "m4 berry" in board_value: + board = boards.BANANA_PI_M4_BERRY + elif "m4zero" in board_value or "m4 zero" in board_value: + board = boards.BANANA_PI_M4_ZERO + if "nanopi" in board_value: if "neo" in board_value and "SUN8I" in chip_id: board = boards.NANOPI_NEO_AIR diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index 8728dd8..1c29bd7 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -285,6 +285,9 @@ class Chip: if self.detector.check_dt_compatible_value("sun50i-h5"): return chips.H5 + if self.detector.check_dt_compatible_value("sun50i-h618"): + return chips.H618 + if self.detector.check_dt_compatible_value("sun50i-h616"): return chips.H616 diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index 47c0efb..86a1ff6 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -78,6 +78,8 @@ NANOPI_NEO_2 = "NANOPI_NEO_2" BANANA_PI_M2_ZERO = "BANANA_PI_M2_ZERO" BANANA_PI_M2_PLUS = "BANANA_PI_M2_PLUS" BANANA_PI_M2_BERRY = "BANANA_PI_M2_BERRY" +BANANA_PI_M4_BERRY = "BANANA_PI_M4_BERRY" +BANANA_PI_M4_ZERO = "BANANA_PI_M4_ZERO" BANANA_PI_M5 = "BANANA_PI_M5" # LeMaker boards @@ -305,6 +307,8 @@ _BANANA_PI_IDS = ( BANANA_PI_M2_ZERO, BANANA_PI_M2_PLUS, BANANA_PI_M2_BERRY, + BANANA_PI_M4_BERRY, + BANANA_PI_M4_ZERO, BANANA_PI_M5, ) diff --git a/adafruit_platformdetect/constants/chips.py b/adafruit_platformdetect/constants/chips.py index 3210724..c785acf 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -55,6 +55,7 @@ A33 = "A33" H5 = "H5" H3 = "H3" H616 = "H616" +H618 = "H618" RK3308 = "RK3308" RK3399 = "RK3399" RK3399_T = "RK3399_T" diff --git a/bin/detect.py b/bin/detect.py index d33a1f1..e234659 100755 --- a/bin/detect.py +++ b/bin/detect.py @@ -75,6 +75,9 @@ print( "Is this an OS environment variable special case?", detector.board.os_environ_board ) +if detector.board.any_bananapi: + print("Bananapi board detected.") + if detector.board.any_jetson_board: print("Jetson platform detected.")