-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards: starfive: add visionfive2 board
these list of patches add support the Starfive Visionfive2 SBC based on the JH7110 SoC. Board identifier is `visionfive2`. Signed-off-by: Kanak Shilledar <kanakshilledar111@protonmail.com> Signed-off-by: Pratik Farkase <pratik.farkase@wsisweden.com>
- Loading branch information
1 parent
c35bfd6
commit b17d7fc
Showing
10 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _boards-starfive: | ||
|
||
StarFive | ||
######## | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:glob: | ||
|
||
**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) 2021 Katsuhiro Suzuki | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if BOARD_VISIONFIVE2_JH7110 | ||
|
||
config SYS_CLOCK_TICKS_PER_SEC | ||
default 1000 | ||
|
||
config SYS_CLOCK_HW_CYCLES_PER_SEC | ||
default 1000000 | ||
|
||
endif # BOARD_VISIONFIVE2_JH7110 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2024 Kanak Shilledar <kanakshilledar111@protonmail.com> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config BOARD_VISIONFIVE2_JH7110 | ||
select SOC_JH7110 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# SPDX-License-Identifier: Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) 2024 Kanak Shilledar <kanakshilledar111@protonmail.com> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
board: | ||
name: visionfive2 | ||
vendor: starfive | ||
socs: | ||
- name: jh7110 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.. _visionfive2: | ||
|
||
Starfive VisionFive2 JH7110 | ||
########################### | ||
|
||
Overview | ||
******** | ||
|
||
Starfive VisionFive 2 is the world’s first high-performance RISC-V single board computer (SBC) with an integrated GPU. Compared with its last generation, VisionFive 2 has been fully upgraded with significant improvements in the processor work frequency, multimedia processing capabilities, scalability, etc. Its superior performance and reasonable price make VisionFive 2 the best affordable RISC-V development board ever. | ||
|
||
.. figure:: img/Visionfive2.webp | ||
:align: center | ||
:alt: | ||
|
||
Programming and debugging | ||
************************* | ||
|
||
Building | ||
======== | ||
|
||
Applications for the ``visionfive2_jh7110`` board configuration can be built | ||
as usual (see :ref:`build_an_application`) using the corresponding board name: | ||
|
||
.. zephyr-app-commands:: | ||
:board: visionfive2 | ||
:goals: build | ||
|
||
To build zephyr.bin for this board use this command: | ||
|
||
.. code-block:: console | ||
west build -p always -b visionfive2 samples/hello_world/ | ||
spl_tool is a jh7110 signature tool used to generate spl header information and generate zephyr.bin.normal.out. | ||
`here <https://github.com/starfive-tech/Tools/tree/master/spl_tool/>`_ | ||
|
||
.. code-block:: console | ||
./spl_tool -c -f build/zephyr/zephyr.bin | ||
This will create a new file build/zephyr/zephyr.bin.normal.out that can be flashed. | ||
|
||
Flashing | ||
======== | ||
|
||
.. note:: | ||
The following steps use minicom for serial communication, feel free to use | ||
any other serial terminal that supports xmodem based file transfers. | ||
|
||
git clone the vf2-loader tool from https://github.com/orangecms/vf2-loader.git and xmodem tool from https://github.com/orangecms/xmodem.rs.git side by side. | ||
|
||
#. VisionFive2 uses uart for flashing. Refer to `VisionFive2 Recovery Quick Start Guide here <https://doc-en.rvspace.org/VisionFive2/Quick_Start_Guide/VisionFive2_SDK_QSG/recovering_bootloader%20-%20vf2.html>`_ | ||
to connect your serial-to-usb converter. Now power on the board and using | ||
minicom access board's serial and press the reset switch on the board until you see CCCCCC... prompt | ||
|
||
Copy the zephyr.bin.normal.out from build/zephyr/zephyr.bin.normal.out to previously git cloned vf2-loader/ directory and cd into it. | ||
Flash the zephyr.bin.normal.out using this command: | ||
|
||
.. code-block:: console | ||
cargo run -- zephyr.bin.normal.out && minicom -D /dev/ttyUSB0 | ||
.. code-block:: console | ||
cargo run -- zephyr.bin.normal.out && minicom -D /dev/ttyUSB0 | ||
Finished dev [unoptimized + debuginfo] target(s) in 0.03s | ||
Running `target/debug/vf2-loader zephyr.bin.normal.out` | ||
Welcome to minicom 2.7.1 | ||
OPTIONS: I18n | ||
Compiled on Dec 23 2019, 02:06:26. | ||
Port /dev/ttyUSB0, 14:59:24 | ||
Press CTRL-A Z for help on special keys | ||
6*** Booting Zephyr OS build v3.6.0-rc3 *** | ||
Hello World! visionfive2_jh7110 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2024 Kanak Shilledar <kanakshilledar111@protonmail.com> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
|
||
#include "starfive/jh7110-visionfive-v2.dtsi" | ||
|
||
/ { | ||
model = "StarFive VisionFive V2"; | ||
compatible = "starfive,visionfive-v2"; | ||
|
||
chosen { | ||
zephyr,console = &uart0; | ||
zephyr,shell-uart = &uart0; | ||
zephyr,sram = &ram0; | ||
}; | ||
}; | ||
|
||
&uart0 { | ||
status = "okay"; | ||
current-speed = <115200>; | ||
}; | ||
|
||
&uart1 { | ||
status = "okay"; | ||
current-speed = <115200>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
identifier: visionfive2 | ||
name: Visionfive JH7110 (NON-SMP) | ||
type: mcu | ||
arch: riscv64 | ||
toolchain: | ||
- zephyr | ||
- cross-compile | ||
supported: | ||
- uart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Zephyr Kernel Configuration | ||
CONFIG_PRINTK=y | ||
CONFIG_XIP=n | ||
|
||
# Serial Drivers | ||
CONFIG_SERIAL=y | ||
CONFIG_CONSOLE=y | ||
CONFIG_UART_CONSOLE=y |