From 704c62bbc5d30df80002fdd1f6a63bebc0e1842d Mon Sep 17 00:00:00 2001 From: Francois Dugast Date: Mon, 19 Dec 2022 09:57:10 +0100 Subject: [PATCH] configs/visionfive2_defconfig: new defconfig Add a defconfig for the Starfive VisionFive2 board, a board built around the Starfive JH7110 RISC-V 64bit SoC. This board comes with functional lowlevel and U-Boot bootloaders in SPI flash. The defconfig reuses these and only builds a (5.15 based) kernel and rootfs. The factory shipped U-Boot is hard coded to look at MMC partition 3. Signed-off-by: Francois Dugast [Peter: add to DEVELOPERS] Signed-off-by: Peter Korsgaard --- DEVELOPERS | 4 +++ board/visionfive2/genimage.cfg | 21 +++++++++++++ .../overlay/boot/extlinux/extlinux.conf | 4 +++ board/visionfive2/readme.txt | 30 +++++++++++++++++++ configs/visionfive2_defconfig | 18 +++++++++++ 5 files changed, 77 insertions(+) create mode 100644 board/visionfive2/genimage.cfg create mode 100644 board/visionfive2/overlay/boot/extlinux/extlinux.conf create mode 100644 board/visionfive2/readme.txt create mode 100644 configs/visionfive2_defconfig diff --git a/DEVELOPERS b/DEVELOPERS index b0f10148b5..a200edb7f5 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1029,6 +1029,10 @@ F: package/tbb/ N: Francisco Gonzalez F: package/ser2net/ +N: Francois Dugast +F: board/visionfive2/ +F: configs/visionfive2_defconfig + N: Francois Perrad F: board/freescale/ls1028ardb/ F: board/olimex/a20_olinuxino diff --git a/board/visionfive2/genimage.cfg b/board/visionfive2/genimage.cfg new file mode 100644 index 0000000000..c221b49c7b --- /dev/null +++ b/board/visionfive2/genimage.cfg @@ -0,0 +1,21 @@ +# Minimal SD card image for the Starfive VisionFive2 board + +image sdcard.img { + hdimage { + } + + # u-boot is hard coded to look at 3rd partition + partition dummy1 { + size = 512 + } + + partition dummy2 { + size = 512 + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + bootable = "true" + } +} diff --git a/board/visionfive2/overlay/boot/extlinux/extlinux.conf b/board/visionfive2/overlay/boot/extlinux/extlinux.conf new file mode 100644 index 0000000000..6e2c5660d6 --- /dev/null +++ b/board/visionfive2/overlay/boot/extlinux/extlinux.conf @@ -0,0 +1,4 @@ +label linux + kernel /boot/Image + devicetree /boot/jh7110-visionfive-v2.dtb + append console=ttyS0,115200 root=/dev/mmcblk1p3 diff --git a/board/visionfive2/readme.txt b/board/visionfive2/readme.txt new file mode 100644 index 0000000000..2da98f3847 --- /dev/null +++ b/board/visionfive2/readme.txt @@ -0,0 +1,30 @@ +Starfive VisionFive2 +==================== + +The VisionFive2 is a low-cost RISC-V 64-bit based platform, powered by a +Starfive JH7110 processor. + +How to build +============ + +$ make visionfive2_defconfig +$ make + +How to write the SD card +======================== + +Once the build process is finished you will have an image called "sdcard.img" +in the output/images/ directory. + +Copy the bootable "sdcard.img" onto an SD card with "dd": + + $ sudo dd if=output/images/sdcard.img of=/dev/sdX + +Preparing the board +=================== + +Connect a TTL UART cable to pin 6 (GND), 8 (TX) and 10 (RX). + +Insert your SD card. + +Power-up the board using an USB-C cable. diff --git a/configs/visionfive2_defconfig b/configs/visionfive2_defconfig new file mode 100644 index 0000000000..5b07a8efbc --- /dev/null +++ b/configs/visionfive2_defconfig @@ -0,0 +1,18 @@ +BR2_riscv=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15=y +BR2_SYSTEM_DHCP="eth0" +BR2_ROOTFS_OVERLAY="board/visionfive2/overlay" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/visionfive/genimage.cfg" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,linux,7b7b4eddd8d5ae55f6e0ee09b93e16e23ab4f97b)/linux-7b7b4eddd8d5ae55f6e0ee09b93e16e23ab4f97b.tar.gz" +BR2_LINUX_KERNEL_DEFCONFIG="starfive_visionfive2" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="starfive/jh7110-visionfive-v2" +BR2_LINUX_KERNEL_INSTALL_TARGET=y +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +# BR2_TARGET_ROOTFS_TAR is not set +BR2_PACKAGE_HOST_GENIMAGE=y