commit: 5df6b10f32993cbd4f356d673648f66b786dd349 parent 8ed022bcb792064700c279effe669c41d82fe149 Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me> Date: Tue, 14 Jan 2025 09:54:32 +0100 notes/starfive_visionfive2.xhtml: newDiffstat:
A | notes/starfive_visionfive2.xhtml | 88 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 88 insertions(+), 0 deletions(-)diff --git a/notes/starfive_visionfive2.xhtml b/notes/starfive_visionfive2.xhtml
@@ -0,0 +1,88 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> +<!--#include file="/templates/head.shtml" --> + <title>Notes: StarFive VisionFive2 — lanodan’s cyber-home</title> + </head> + <body> +<!--#include file="/templates/en/nav.shtml" --> + <main> + <h1>Notes: StarFive VisionFive2</h1> + + <h2>bootchip</h2> + <dl> + <dt>OpenSBI</dt> + <dd><a href="https://github.com/riscv-software-src/opensbi">https://github.com/riscv-software-src/opensbi</a></dd> + <dt>U-Boot</dt> + <dd><a href="https://docs.u-boot.org/en/latest/build/source.html">Obtaining the source</a> ; <a href="https://docs.u-boot.org/en/latest/board/starfive/visionfive2.html">VisionFive2 Documentation</a></dd> + </dl> + + <p> + In u-boot: <code>make starfive_visionfive2_defconfig</code> then <code>make</code><br /> + If you want to configure how u-boot gets built, there is <code>make menuconfig</code> + </p> + + <p> + In OpenSBI, create & execute a build script like this one, using u-boot as a payload for OpenSBI: + </p> + +<pre><code><![CDATA[#!/bin/sh +set -ex +uboot_dir="${HOME}/Sources/source.denx.de/u-boot/u-boot/" +uboot_bin="${uboot_dir}/u-boot.bin" +uboot_dtb="${uboot_dir}/arch/riscv/dts/jh7110-starfive-visionfive-2.dtb" +make PLATFORM=generic FW_PAYLOAD_PATH="${uboot_bin}" FW_FDT_PATH="${uboot_dtb}" FW_TEXT_START=0x40000000 +]]></code></pre> + + <p> + Then, back to u-boot: + <ol> + <li><code>wget https://github.com/starfive-tech/Tools/raw/0747c0510e090f69bf7d2884f44903b77b3db5c5/uboot_its/visionfive2-uboot-fit-image.its</code></li> + <li><code>ln -s ~/Sources/github.com/riscv-software-src/opensbi//build/platform/generic/firmware/fw_payload.bin ./</code></li> + <li><code>./tools/mkimage -f visionfive2-uboot-fit-image.its -A riscv -O u-boot -T firmware visionfive2_fw_payload.img</code></li> + </ol> + </p> + + <p> + Finally, you can flash: + <ol> + <li><code>flashcp -v spl/u-boot-spl.bin.normal.out mtd:spl</code></li> + <li><code>flashcp -v visionfive2_fw_payload.img mtd:uboot</code></li> + </ol> + </p> + + <h3>extlinux.conf</h3> + <p> + No need to have it flashed as MBR like on x86, just have it present into a FAT or ext{3,4} filesystem, u-boot will then use it as configuration. + </p> + +<pre><code><![CDATA[menu title StarFive VisionFive +timeout 50 +default lts + +label starfive + menu label Alpine visionfive V2 + kernel /vmlinuz-starfive + initrd /initramfs-starfive + fdtdir /dtbs-starfive/ + append earlycon=sbi rw root=panda/ROOT/alpine-edge rootfstype=zfs console=ttyS0,115200 console=tty0 + +label lts + menu label Alpine LTS + kernel /vmlinuz-lts + initrd /initramfs-lts + fdtdir /dtbs-lts/ + append earlycon=sbi rw root=panda/ROOT/alpine-edge rootfstype=zfs console=ttyS0,115200 console=tty0 + +label edge + menu label Alpine edge + kernel /vmlinuz-edge + initrd /initramfs-edge + fdtdir /dtbs-edge/ + append earlycon=sbi rw root=panda/ROOT/alpine-edge rootfstype=zfs console=ttyS0,115200 console=tty0 +]]></code></pre> + + </main> +<!--#include file="/templates/en/footer.shtml" --> + </body> +</html>