From 286628bcc2d1931807c4648ef4359873bb3ee559 Mon Sep 17 00:00:00 2001 From: Angelo Compagnucci Date: Fri, 16 Dec 2022 09:04:32 +0100 Subject: [PATCH] configs/lichee_rv: new defconfig Lichee RV - Nezha CM is a compute module with modular design, equipped with Allwinner D1 chip (based on T-Head XuanTie C906 core), 512MB DDR3 RAM. Board support is based on the nezha defconfig already available in buildroot. https://wiki.sipeed.com/hardware/en/lichee/RV/RV.html https://linux-sunxi.org/Sipeed_Lichee_RV Signed-off-by: Angelo Compagnucci Reviewed-by: Indrek Kruusa Tested-by: Indrek Kruusa Signed-off-by: Peter Korsgaard --- DEVELOPERS | 2 ++ board/sipeed/lichee_rv/genimage.cfg | 19 +++++++++++ .../overlay/boot/extlinux/extlinux.conf | 4 +++ board/sipeed/lichee_rv/readme.txt | 26 +++++++++++++++ configs/sipeed_lichee_rv_defconfig | 33 +++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 board/sipeed/lichee_rv/genimage.cfg create mode 100644 board/sipeed/lichee_rv/overlay/boot/extlinux/extlinux.conf create mode 100644 board/sipeed/lichee_rv/readme.txt create mode 100644 configs/sipeed_lichee_rv_defconfig diff --git a/DEVELOPERS b/DEVELOPERS index b52a065dbc..2f27ddb110 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -157,6 +157,8 @@ N: Andrey Yurovsky F: package/rauc/ N: Angelo Compagnucci +F: board/sipeed/lichee_rv/ +F: configs/sipeed_lichee_rv* F: package/apparmor/ F: package/corkscrew/ F: package/cups/ diff --git a/board/sipeed/lichee_rv/genimage.cfg b/board/sipeed/lichee_rv/genimage.cfg new file mode 100644 index 0000000000..d5df41203d --- /dev/null +++ b/board/sipeed/lichee_rv/genimage.cfg @@ -0,0 +1,19 @@ +# Minimal SD card image for the sipeed Lichee RV + +image sdcard.img { + hdimage { + } + + partition u-boot { + in-partition-table = false + image = "u-boot-sunxi-with-spl.bin" + offset = 8K + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + bootable = "true" + offset = 1M + } +} diff --git a/board/sipeed/lichee_rv/overlay/boot/extlinux/extlinux.conf b/board/sipeed/lichee_rv/overlay/boot/extlinux/extlinux.conf new file mode 100644 index 0000000000..91b2298628 --- /dev/null +++ b/board/sipeed/lichee_rv/overlay/boot/extlinux/extlinux.conf @@ -0,0 +1,4 @@ +label linux + kernel /boot/Image + # use devicetree from u-boot + append console=ttyS0,115200 root=/dev/mmcblk0p1 ro rootwait diff --git a/board/sipeed/lichee_rv/readme.txt b/board/sipeed/lichee_rv/readme.txt new file mode 100644 index 0000000000..24e8141851 --- /dev/null +++ b/board/sipeed/lichee_rv/readme.txt @@ -0,0 +1,26 @@ +Lichee RV +=============== + +Lichee RV - Nezha CM is a compute module with modular design, equipped +with Allwinner D1 chip (based on T-Head XuanTie C906 core), 512MB DDR3 RAM. +It can boot from TF card or SD-NAND, uses two sets of M.2 b key 67 pin +connectors to route all IO, making it convient for wide use and easy to replace. + +How to build +============ + +$ make sipeed_lichee_rv_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 + +Connect a TTL UART to the debug connector, insert the microSD card and +plug in a USB-C cable to the PWR connector to boot the system. diff --git a/configs/sipeed_lichee_rv_defconfig b/configs/sipeed_lichee_rv_defconfig new file mode 100644 index 0000000000..f9782f870b --- /dev/null +++ b/configs/sipeed_lichee_rv_defconfig @@ -0,0 +1,33 @@ +BR2_riscv=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_0=y +BR2_ROOTFS_OVERLAY="board/sipeed/lichee_rv/overlay" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/sipeed/lichee_rv/genimage.cfg" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,ca67838d84af4c9f85d06311c9e98e1adf46308f)/linux-ca67838d84af4c9f85d06311c9e98e1adf46308f.tar.gz" +BR2_LINUX_KERNEL_DEFCONFIG="nezha" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1-lichee-rv" +BR2_LINUX_KERNEL_INSTALL_TARGET=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_OPENSBI=y +BR2_TARGET_OPENSBI_CUSTOM_VERSION=y +BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.1" +BR2_TARGET_OPENSBI_PLAT="generic" +# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_TARBALL=y +BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,528ae9bc6c55edd3ffe642734b4132a8246ea777)/uboot-528ae9bc6c55edd3ffe642734b4132a8246ea777.tar.gz" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="lichee_rv_dock" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y +BR2_TARGET_UBOOT_NEEDS_OPENSBI=y +# BR2_TARGET_UBOOT_FORMAT_BIN is not set +BR2_TARGET_UBOOT_FORMAT_CUSTOM=y +BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin" +BR2_PACKAGE_HOST_GENIMAGE=y