mirror of
https://github.com/thead-yocto-mirror/meta-riscv
synced 2026-06-21 08:52:24 +02:00
visionfive: Add initial support for Starfive Visionfive board
This is largely based on the beaglev code nbut tweaked to work with current starfive kernel repositories and tweak to the board. The kernel and rootfs boot with working network and graphics. The u-boot binary builds but is as yet untested. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
61
conf/machine/visionfive.conf
Normal file
61
conf/machine/visionfive.conf
Normal file
@@ -0,0 +1,61 @@
|
||||
#@TYPE: Machine
|
||||
#@NAME: visionfive
|
||||
#@SOC: StarFive JH7100
|
||||
#@DESCRIPTION: Machine configuration for the VisionFive board
|
||||
|
||||
require conf/machine/include/riscv/tune-riscv.inc
|
||||
|
||||
MACHINE_FEATURES = "screen keyboard ext2 ext3 serial"
|
||||
|
||||
KERNEL_CLASSES = "kernel-fitimage"
|
||||
KERNEL_IMAGETYPE = "fitImage"
|
||||
UBOOT_ENV ?= "boot"
|
||||
UBOOT_ENV_SUFFIX = "scr.uimg"
|
||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-starfive-dev"
|
||||
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-starfive"
|
||||
|
||||
PREFERRED_VERSION_openocd-native = "riscv"
|
||||
PREFERRED_VERSION_openocd = "riscv"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "opensbi"
|
||||
RISCV_SBI_PLAT = "generic"
|
||||
|
||||
## This sets u-boot as the default OpenSBI payload
|
||||
RISCV_SBI_PAYLOAD ?= "u-boot.bin"
|
||||
|
||||
RISCV_SBI_FDT ?= "jh7100-visionfive.dtb"
|
||||
|
||||
SERIAL_CONSOLES = "115200;ttyS0"
|
||||
|
||||
MACHINE_EXTRA_RRECOMMENDS += " kernel-modules linux-firmware-beaglev-bcm43430"
|
||||
|
||||
IMAGE_FSTYPES += "wic.gz wic.bmap ext4"
|
||||
KERNEL_DEVICETREE ?= "starfive/jh7100-starfive-visionfive-v1.dtb"
|
||||
|
||||
## Do not update fstab file when using wic images
|
||||
WIC_CREATE_EXTRA_ARGS ?= "--no-fstab-update"
|
||||
|
||||
EXTRA_IMAGEDEPENDS += "u-boot-starfive"
|
||||
UBOOT_MACHINE = "starfive_jh7100_visionfive_smode_defconfig"
|
||||
|
||||
UBOOT_ENTRYPOINT = "0x80200000"
|
||||
UBOOT_DTB_LOADADDRESS = "0x82200000"
|
||||
UBOOT_DTB = "1"
|
||||
UBOOT_DTB_BINARY = "jh7100-visionfive.dtb"
|
||||
|
||||
## wic default support
|
||||
WKS_FILE_DEPENDS ?= " \
|
||||
opensbi \
|
||||
e2fsprogs-native \
|
||||
bmap-tools-native \
|
||||
"
|
||||
|
||||
IMAGE_BOOT_FILES ?= " \
|
||||
fw_payload.bin \
|
||||
${KERNEL_IMAGETYPE} \
|
||||
${RISCV_SBI_FDT} \
|
||||
boot.scr.uimg \
|
||||
uEnv.txt \
|
||||
"
|
||||
|
||||
WKS_FILE ?= "beaglev.wks"
|
||||
19
recipes-bsp/u-boot/u-boot-starfive/fix-riscv-isa.patch
Normal file
19
recipes-bsp/u-boot/u-boot-starfive/fix-riscv-isa.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
u-boot for visionfive won't build with recent versions of the toolchain
|
||||
and ISA without using this specific architecture flag.
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
||||
|
||||
Index: riscv/Makefile
|
||||
===================================================================
|
||||
--- riscv.orig/arch/riscv/Makefile
|
||||
+++ riscv/arch/riscv/Makefile
|
||||
@@ -15,7 +15,7 @@ ifeq ($(CONFIG_RISCV_ISA_A),y)
|
||||
ARCH_A = a
|
||||
endif
|
||||
ifeq ($(CONFIG_RISCV_ISA_C),y)
|
||||
- ARCH_C = c
|
||||
+ ARCH_C = c_zicsr_zifencei
|
||||
endif
|
||||
ifeq ($(CONFIG_CMODEL_MEDLOW),y)
|
||||
CMODEL = medlow
|
||||
11
recipes-bsp/u-boot/u-boot-starfive/uEnv-visionfive.txt
Normal file
11
recipes-bsp/u-boot/u-boot-starfive/uEnv-visionfive.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
fdt_high=0xffffffffffffffff
|
||||
initrd_high=0xffffffffffffffff
|
||||
scriptaddr=0x88100000
|
||||
script_offset_f=0x1fff000
|
||||
script_size_f=0x1000
|
||||
kernel_addr_r=0x84000000
|
||||
kernel_comp_addr_r=0x90000000
|
||||
kernel_cx_addr_r=0x88000000
|
||||
ramdisk_addr_r=0x88300000
|
||||
load mmc 0:1 0xa0000000 fitImage
|
||||
bootm 0xa0000000
|
||||
@@ -3,13 +3,25 @@ require recipes-bsp/u-boot/u-boot.inc
|
||||
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
|
||||
|
||||
SRC_URI = "git://github.com/starfive-tech/u-boot.git;protocol=https;branch=Fedora_VIC_7100_2021.04 \
|
||||
BRANCH:visionfive = "JH7100_VisionFive_OH_dev"
|
||||
BRANCH:beaglev-starlight-jh7100 = "Fedora_VIC_7100_2021.04"
|
||||
|
||||
SRC_URI = "git://github.com/starfive-tech/u-boot.git;protocol=https;branch=${BRANCH} \
|
||||
file://tftp-mmc-boot.txt \
|
||||
file://977abc529f98c1c90a80ad280fe9e58ddd43c87a.patch \
|
||||
file://2feaab2bd04ed736c637518b3b553615f0c97890.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:beaglev-starlight-jh7100 = " \
|
||||
file://977abc529f98c1c90a80ad280fe9e58ddd43c87a.patch \
|
||||
file://2feaab2bd04ed736c637518b3b553615f0c97890.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:visionfive = " \
|
||||
file://fix-riscv-isa.patch \
|
||||
file://uEnv-visionfive.txt \
|
||||
"
|
||||
|
||||
SRCREV = "7b70e1d44ba9702a519ca936cabf19070309123a"
|
||||
SRCREV:visionfive = "ccecef294d355e9d05edf0bb6058002a0fe08908"
|
||||
|
||||
DEPENDS:append = " u-boot-tools-native"
|
||||
|
||||
@@ -22,6 +34,10 @@ do_configure:prepend() {
|
||||
-d ${WORKDIR}/tftp-mmc-boot.txt ${WORKDIR}/${UBOOT_ENV_BINARY}
|
||||
}
|
||||
|
||||
COMPATIBLE_MACHINE = "(beaglev-starlight-jh7100)"
|
||||
do_deploy:append:visionfive() {
|
||||
install -m 644 ${WORKDIR}/uEnv-visionfive.txt ${DEPLOYDIR}/uEnv.txt
|
||||
}
|
||||
|
||||
COMPATIBLE_MACHINE = "(beaglev-starlight-jh7100|visionfive)"
|
||||
|
||||
TOOLCHAIN = "gcc"
|
||||
|
||||
@@ -6,17 +6,20 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
KERNEL_VERSION_SANITY_SKIP = "1"
|
||||
|
||||
SRCREV = "${AUTOREV}"
|
||||
SRCREV:visionfive = "f754a58449f0de76312bf84249139f5d8b232c66"
|
||||
BRANCH:visionfive = "esmil_starlight"
|
||||
BRANCH:beaglev-starlight-jh7100 = "beaglev_fedora_devel"
|
||||
FORK ?= "starfive-tech"
|
||||
BRANCH ?= "esmil_starlight"
|
||||
SRC_URI = "git://github.com/${FORK}/linux.git;protocol=https;branch=${BRANCH} \
|
||||
file://0001-riscv-Use-mno-relax-when-using-lld-linker.patch \
|
||||
file://extra.cfg \
|
||||
file://modules.cfg \
|
||||
"
|
||||
|
||||
LINUX_VERSION ?= "5.14.0"
|
||||
LINUX_VERSION_EXTENSION:append = "-starlight"
|
||||
LINUX_VERSION ?= "5.19.0-rc4"
|
||||
LINUX_VERSION_EXTENSION:append:beaglev-starlight-jh7100 = "-starlight"
|
||||
|
||||
KBUILD_DEFCONFIG:beaglev-starlight-jh7100 = "beaglev_defconfig"
|
||||
KBUILD_DEFCONFIG:visionfive = "visionfive_defconfig"
|
||||
|
||||
COMPATIBLE_MACHINE = "(beaglev-starlight-jh7100)"
|
||||
COMPATIBLE_MACHINE = "(beaglev-starlight-jh7100|visionfive)"
|
||||
|
||||
@@ -15,3 +15,5 @@ CONFIG_SOC_STARFIVE_VIC7100=y
|
||||
# restart
|
||||
CONFIG_MFD_TPS65086=y
|
||||
CONFIG_POWER_RESET_TPS65086=y
|
||||
|
||||
CONFIG_HW_RANDOM_STARFIVE_VIC=y
|
||||
|
||||
Reference in New Issue
Block a user