Skip to content

Added detection of Starfive JH7110 chip and Starfive VisionFive2 board #364

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 23 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
624a40d
added JH7110 RISC-V chip and STARFIVE VISIONFIVE2 board
DarkMechanikum Jun 26, 2024
d5b4493
debug output added
DarkMechanikum Jun 26, 2024
e8076ca
debug output added
DarkMechanikum Jun 26, 2024
998e553
changed starfive board detection function
DarkMechanikum Jun 26, 2024
f59895f
changed starfive board detection function
DarkMechanikum Jun 26, 2024
5a4de64
changed starfive board detection function
DarkMechanikum Jun 26, 2024
b6162a3
changed starfive board detection function
DarkMechanikum Jun 26, 2024
e663398
changed starfive board detection function
DarkMechanikum Jun 26, 2024
407208c
changed starfive board detection function
DarkMechanikum Jun 26, 2024
2bb3b99
changed starfive board detection function
DarkMechanikum Jun 26, 2024
05220e5
changed starfive board detection function
DarkMechanikum Jun 26, 2024
aa493d0
changed starfive board detection function
DarkMechanikum Jun 26, 2024
d4d2c00
changed starfive board detection function
DarkMechanikum Jun 26, 2024
9b6ad2b
changed starfive board detection function
DarkMechanikum Jun 26, 2024
90295ca
changed starfive board detection function
DarkMechanikum Jun 26, 2024
96b0c05
changed starfive board detection function
DarkMechanikum Jun 26, 2024
d8478ab
changed starfive board detection function
DarkMechanikum Jun 26, 2024
086984c
reformatted the changed files
DarkMechanikum Jun 26, 2024
6de8921
reformatted the changed files
DarkMechanikum Jun 26, 2024
ca3c7b1
formatted
DarkMechanikum Jun 26, 2024
0a85b3b
formatted
DarkMechanikum Jun 26, 2024
7f7fa99
Merge pull request #1 from DarkMechanikum/dev
DarkMechanikum Jun 26, 2024
55436d5
Merge branch 'adafruit:main' into main
DarkMechanikum Jul 5, 2024
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: 8 additions & 1 deletion adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

from adafruit_platformdetect.constants import boards, chips


__version__ = "0.0.0+auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PlatformDetect.git"

Expand Down Expand Up @@ -63,6 +62,8 @@ def id(self) -> Optional[str]:

if chip_id == chips.H3:
board_id = self._armbian_id() or self._allwinner_variants_id()
elif chip_id == chips.JH7110:
board_id = self._starfive_id()
elif chip_id == chips.BCM2XXX:
board_id = self._pi_id()
elif chip_id == chips.OS_AGNOSTIC:
Expand Down Expand Up @@ -226,6 +227,12 @@ def id(self) -> Optional[str]:
return board_id

# pylint: enable=invalid-name
def _starfive_id(self) -> Optional[str]:
model = None
model_value = self.detector.get_device_model()
if "VisionFive" in model_value and "V2" in model_value:
model = boards.VISIONFIVE2
return model

def _pi_id(self) -> Optional[str]:
"""Try to detect id of a Raspberry Pi."""
Expand Down
5 changes: 3 additions & 2 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

"""


import os
import sys

Expand All @@ -30,7 +29,6 @@

from adafruit_platformdetect.constants import chips


__version__ = "0.0.0+auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PlatformDetect.git"

Expand Down Expand Up @@ -224,6 +222,9 @@ def _linux_id(self) -> Optional[str]:
if self.detector.check_dt_compatible_value("jh7100"):
return chips.JH71X0

if self.detector.check_dt_compatible_value("jh7110"):
return chips.JH7110

if self.detector.check_dt_compatible_value("sun8i-a33"):
return chips.A33

Expand Down
4 changes: 3 additions & 1 deletion adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

"""Definition of boards and/or ids"""
# Allow for aligned constant definitions:
VISIONFIVE2 = "VISIONFIVE2"
BEAGLE_PLAY = "BEAGLE_PLAY"
BEAGLEBONE_AI64 = "BEAGLEBONE_AI64"
BEAGLEBONE = "BEAGLEBONE"
Expand Down Expand Up @@ -73,7 +74,6 @@
NANOPI_NEO = "NANOPI_NEO"
NANOPI_NEO_2 = "NANOPI_NEO_2"


# Banana Pi boards
BANANA_PI_M2_ZERO = "BANANA_PI_M2_ZERO"
BANANA_PI_M2_PLUS = "BANANA_PI_M2_PLUS"
Expand Down Expand Up @@ -243,6 +243,8 @@
LUCKFOX_PICO_MINI = "LUCKFOX_PICO_MINI"
LUCKFOX_PICO_PLUS = "LUCKFOX_PICO_PLUS"

# StarFive boards
_STARFIVE_BOARD_IDS = (VISIONFIVE2,)
# Asus Tinkerboard
_ASUS_TINKER_BOARD_IDS = (
ASUS_TINKER_BOARD,
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 @@ -41,6 +41,7 @@
HFU540 = "HFU540"
C906 = "C906"
JH71X0 = "JH71X0"
JH7110 = "JH7110"
MCP2221 = "MCP2221"
BINHO = "BINHO"
MIPS24KC = "MIPS24KC"
Expand Down
Loading