Skip to content

Addition of onion omega board running OpenWRT #47

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 5 commits into from
Jan 3, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
18 changes: 17 additions & 1 deletion adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@

BINHO_NOVA = "BINHO_NOVA"

ONION_OMEGA = "ONION_OMEGA"
ONION_OMEGA2 = "ONION_OMEGA2"

# pylint: enable=bad-whitespace

#OrangePI
Expand Down Expand Up @@ -288,6 +291,12 @@
),
}

# Onion omega boards
_ONION_OMEGA_BOARD_IDS = (
ONION_OMEGA,
ONION_OMEGA2,
)

class Board:
"""Attempt to detect specific boards."""
def __init__(self, detector):
Expand Down Expand Up @@ -343,6 +352,8 @@ def id(self):
board_id = MICROCHIP_MCP2221
elif chip_id == ap_chip.BINHO:
board_id = BINHO_NOVA
elif chip_id == ap_chip.ONION:
board_id = ONION_OMEGA
return board_id
# pylint: enable=invalid-name

Expand Down Expand Up @@ -489,13 +500,18 @@ def any_sifive_board(self):
"""Check whether the current board is any defined Jetson Board."""
return self.id in _SIFIVE_IDS

@property
def any_onion_omega_board(self):
"""Check whether the current board is any defined OpenWRT board."""
return self.id in _ONION_OMEGA_BOARD_IDS

@property
def any_embedded_linux(self):
"""Check whether the current board is any embedded Linux device."""
return self.any_raspberry_pi or self.any_beaglebone or \
self.any_orange_pi or self.any_giant_board or self.any_jetson_board or \
self.any_coral_board or self.any_odroid_40_pin or self.any_96boards or \
self.any_sifive_board
self.any_sifive_board or self.any_onion_omega_board

@property
def ftdi_ft232h(self):
Expand Down
6 changes: 6 additions & 0 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
HFU540 = "HFU540"
MCP2221 = "MCP2221"
BINHO = "BINHO"
MIPS24KC = "MIPS24KC"

class Chip:
"""Attempt detection of current chip / CPU."""
Expand Down Expand Up @@ -103,6 +104,11 @@ def _linux_id(self): # pylint: disable=too-many-branches
if compatible and 'amlogic, g12b' in compatible:
linux_id = S922X

cpu_model = self.detector.get_cpuinfo_field("cpu model")

if "MIPS 24Kc" in cpu_model:
linux_id = MIPS24KC

elif hardware in ("BCM2708", "BCM2709", "BCM2835"):
linux_id = BCM2XXX
elif "AM33XX" in hardware:
Expand Down
3 changes: 3 additions & 0 deletions bin/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@

if detector.board.any_odroid_40_pin:
print("Odroid detected.")

if detector.board.any_onion_omega_board:
print("Onion Omega detected.")