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:
Richard Purdie
2022-07-03 23:26:01 +01:00
committed by Khem Raj
parent 75faf63282
commit 82d47bed4c
6 changed files with 98 additions and 3 deletions

View 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"

View 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

View 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

View File

@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://Licenses/README;md5=5a7450c57ffe5ae63fd732446b988025"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
BRANCH:visionfive = "JH7100_VisionFive_OH_dev"
BRANCH:beaglev-starlight-jh7100 = "Fedora_JH7100_2021.04"
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 \

View File

@@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
KERNEL_VERSION_SANITY_SKIP = "1"
SRCREV = "${AUTOREV}"
BRANCH = "visionfive"
SRCREV:visionfive = "f754a58449f0de76312bf84249139f5d8b232c66"
BRANCH:visionfive = "esmil_starlight"
BRANCH:beaglev-starlight-jh7100 = "beaglev_fedora_devel"
FORK ?= "starfive-tech"
SRC_URI = "git://github.com/${FORK}/linux.git;protocol=https;branch=${BRANCH} \
file://extra.cfg \
@@ -16,7 +18,7 @@ SRC_URI = "git://github.com/${FORK}/linux.git;protocol=https;branch=${BRANCH} \
LINUX_VERSION ?= "6.0.0"
LINUX_VERSION_EXTENSION:append:beaglev-starlight-jh7100 = "-starlight"
KBUILD_DEFCONFIG:beaglev-starlight-jh7100 = "starfive_jh7100_fedora_defconfig"
KBUILD_DEFCONFIG:beaglev-starlight-jh7100 = "beaglev_defconfig"
KBUILD_DEFCONFIG:visionfive = "visionfive_defconfig"
COMPATIBLE_MACHINE = "(beaglev-starlight-jh7100|visionfive)"

View File

@@ -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