Add support for LicheePi 4A
cover Add support for LicheePi 4A
These set of patches add support for LicheePi 4A board. LicheePi 4A is a RISCV SBC based on TH1520 SoC from Sipeed.
These patches include the necessary changes to enable booting and basic functionality on this board.
The first patch adds the propreitary binaries required by TH1520 for booting, these include binaries for audio as well as WiFi.
The second patch adds the board configuration files.
Wiki: https://wiki.sipeed.com/hardware/en/lichee/th1520/lpi4a/1_intro.html
Kanak Shilledar (2):
package/sipeed-lpi4abin: add licheepi4a boot bins configs/sipeed_licheepi_4a: add new board
.../sipeed/licheepi_4a/extlinux/extlinux.conf | 4 ++ board/sipeed/licheepi_4a/genimage.cfg | 9 ++++ board/sipeed/licheepi_4a/post-image.sh | 25 +++++++++ board/sipeed/licheepi_4a/readme.txt | 54 +++++++++++++++++++ configs/sipeed_licheepi_4a_defconfig | 40 ++++++++++++++ package/Config.in | 1 + package/sipeed-lpi4abin/Config.in | 5 ++ package/sipeed-lpi4abin/sipeed-lpi4abin.hash | 2 + package/sipeed-lpi4abin/sipeed-lpi4abin.mk | 30 +++++++++++ 9 files changed, 170 insertions(+) create mode 100644 board/sipeed/licheepi_4a/extlinux/extlinux.conf create mode 100644 board/sipeed/licheepi_4a/genimage.cfg create mode 100755 board/sipeed/licheepi_4a/post-image.sh create mode 100644 board/sipeed/licheepi_4a/readme.txt create mode 100644 configs/sipeed_licheepi_4a_defconfig create mode 100644 package/sipeed-lpi4abin/Config.in create mode 100644 package/sipeed-lpi4abin/sipeed-lpi4abin.hash create mode 100644 package/sipeed-lpi4abin/sipeed-lpi4abin.mk
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 1/2 package/sipeed-lpi4abin: add licheepi4a boot bins
Sipeed LicheePi 4A requires some proprietary binaries for booting, these are provided in the th1520-boot-firmware repo [1]. These binaries are also required for the onboard sound and wifi.
[1] https://github.com/revyos/th1520-boot-firmware
--- package/Config.in | 1 + package/sipeed-lpi4abin/Config.in | 5 ++++ package/sipeed-lpi4abin/sipeed-lpi4abin.hash | 2 ++ package/sipeed-lpi4abin/sipeed-lpi4abin.mk | 30 ++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 package/sipeed-lpi4abin/Config.in create mode 100644 package/sipeed-lpi4abin/sipeed-lpi4abin.hash create mode 100644 package/sipeed-lpi4abin/sipeed-lpi4abin.mk
package/Config.in +1 -0
@@ -616,6 +616,7 @@ endmenu source "package/setserial/Config.in" source "package/sg3_utils/Config.in" source "package/sigrok-cli/Config.in" + source "package/sipeed-lpi4abin/Config.in" source "package/sispmctl/Config.in" source "package/smartmontools/Config.in" source "package/smstools3/Config.in"
package/sipeed-lpi4abin/Config.in new file +5 -0
@@ -0,0 +1,5 @@ +config BR2_PACKAGE_SIPEED_LPI4ABIN + bool "sipeed-lpi4abin" + depends on BR2_riscv=y + help + This package provides TH1520 SoC binary blobs for LicheePi 4A.
package/sipeed-lpi4abin/sipeed-lpi4abin.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally computed +sha256 e5b29e1267009617dcf7cf3d0d59d7de62b06b96bb1981de3206b9a53123481f sipeed-lpi4abin-master-git4.tar.gz
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +30 -0
@@ -0,0 +1,30 @@ +################################################################################ +# +# sipeed-lpi4abin +# +################################################################################ + +SIPEED_LPI4ABIN_VERSION = master +SIPEED_LPI4ABIN_SITE = https://github.com/revyos/th1520-boot-firmware.git +SIPEED_LPI4ABIN_SITE_METHOD = git +# SIPEED_LPI4ABIN_LICENSE = PROPRIETARY +# SIPEED_LPI4ABIN_LICENSE_FILES = LICENSE + +SIPEED_LPI4ABIN_INSTALL_IMAGES = YES +SIPEED_LPI4ABIN_INSTALL_TARGET = NO + +SIPEED_LPI4ABIN_AON_FPGA_FILENAME = addons/boot/light_aon_fpga.bin +SIPEED_LPI4ABIN_C906_AUDIO_FILENAME = addons/boot/light_c906_audio.bin +SIPEED_LPI4ABIN_STR_FILENAME = addons/boot/str.bin + +define SIPEED_LPI4ABIN_INSTALL_IMAGES_CMDS + $(foreach f, \ + $(SIPEED_LPI4ABIN_AON_FPGA_FILENAME) \ + $(SIPEED_LPI4ABIN_C906_AUDIO_FILENAME) \ + $(SIPEED_LPI4ABIN_STR_FILENAME) \ + , \ + $(INSTALL) -D -m 0644 -t $(BINARIES_DIR)/bootbins $(@D)/$(f) + ) +endef + +$(eval $(generic-package))
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/2] package/sipeed-lpi4abin: add licheepi4a boot bins
Hi Kanak,
Thanks for the patch!
I have few comments, see below.
Quoted 36 lines · Kanak Shilledar
Sipeed LicheePi 4A requires some proprietary binaries for booting, these are provided in the th1520-boot-firmware repo [1]. These binaries are also required for the onboard sound and wifi.
[1] https://github.com/revyos/th1520-boot-firmware
Signed-off-by Kanak Shilledar <[email protected]>--- package/Config.in | 1 + package/sipeed-lpi4abin/Config.in | 5 ++++ package/sipeed-lpi4abin/sipeed-lpi4abin.hash | 2 ++ package/sipeed-lpi4abin/sipeed-lpi4abin.mk | 30 ++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 package/sipeed-lpi4abin/Config.in create mode 100644 package/sipeed-lpi4abin/sipeed-lpi4abin.hash create mode 100644 package/sipeed-lpi4abin/sipeed-lpi4abin.mkpackage/Config.in +1
-0@@ -616,6 +616,7 @@ endmenu source "package/setserial/Config.in" source "package/sg3_utils/Config.in" source "package/sigrok-cli/Config.in" + source "package/sipeed-lpi4abin/Config.in" source "package/sispmctl/Config.in" source "package/smartmontools/Config.in" source "package/smstools3/Config.in"package/sipeed-lpi4abin/Config.in new file +0
-0
package/sipeed-lpi4abin/Config.in line 3
Quoted 3 lines
package/sipeed-lpi4abin/Config.in new file +3
-0@@ -0,0 +1,5 @@ +config BR2_PACKAGE_SIPEED_LPI4ABIN + bool "sipeed-lpi4abin" + depends on BR2_riscv=y
Here, the condition should be simplified to:
depends on BR2_riscv
Quoted 17 lines
package/sipeed-lpi4abin/Config.in new file +2
-0+ help + This package provides TH1520 SoC binary blobs for LicheePi 4A.package/sipeed-lpi4abin/sipeed-lpi4abin.hash new file +2
-0@@ -0,0 +1,2 @@ +# Locally computed +sha256
e5b29e1267009617dcf7cf3d0d59d7de62b06b96bb1981de3206b9a53123481fsipeed-lpi4abin-master-git4.tar.gzpackage/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +0
-0
package/sipeed-lpi4abin/sipeed-lpi4abin.mk line 7
Quoted 7 lines
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +7
-0@@ -0,0 +1,30 @@ +################################################################################ +# +# sipeed-lpi4abin +# +################################################################################ + +SIPEED_LPI4ABIN_VERSION = master
Branch names should not be used in _VERSION. The downloaded data will be cached in the download directory and will not be updated if the remote changes.
If you want to use the "latest" version as of today, for example:
https://github.com/revyos/th1520-boot-firmware/commit/44ec4e1cc82141963842ec45db0d1617f9f07e75
You can then set:SIPEED_LPI4ABIN_VERSION = 44ec4e1cc82141963842ec45db0d1617f9f07e75
You'll also need to update the hash file accordingly.
package/sipeed-lpi4abin/sipeed-lpi4abin.mk line 10
Quoted 4 lines
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +1
-0+SIPEED_LPI4ABIN_SITE =https://github.com/revyos/th1520-boot-firmware.git
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +2
-0+SIPEED_LPI4ABIN_SITE_METHOD = git +# SIPEED_LPI4ABIN_LICENSE = PROPRIETARY
The _LICENSE should not be commented here. Could you uncomment it?
Quoted 1 line
+#
SIPEED_LPI4ABIN_LICENSE_FILES= LICENSE
There is no real license file in the upstream repository.
Technically, there is the "copyright" file:
https://github.com/revyos/th1520-boot-firmware/blob/master/debian/copyright
but its content does not really give information on the actual license terms.
So this comment line should be removed.
package/sipeed-lpi4abin/sipeed-lpi4abin.mk line 18
Quoted 6 lines
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +6
-0+SIPEED_LPI4ABIN_INSTALL_IMAGES = YES +SIPEED_LPI4ABIN_INSTALL_TARGET = NO + +SIPEED_LPI4ABIN_AON_FPGA_FILENAME = addons/boot/light_aon_fpga.bin +SIPEED_LPI4ABIN_C906_AUDIO_FILENAME = addons/boot/light_c906_audio.bin +SIPEED_LPI4ABIN_STR_FILENAME = addons/boot/str.bin
Since those variables are not reused anywhere else, this could be simplified as:
SIPEED_LPI4ABIN_FILES = \ addons/boot/light_aon_fpga.bin \ addons/boot/light_c906_audio.bin \ addons/boot/str.bin
package/sipeed-lpi4abin/sipeed-lpi4abin.mk line 27
Quoted 8 lines
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +8
-0+define SIPEED_LPI4ABIN_INSTALL_IMAGES_CMDS + $(foreach f, \ + $(SIPEED_LPI4ABIN_AON_FPGA_FILENAME) \ + $(SIPEED_LPI4ABIN_C906_AUDIO_FILENAME) \ + $(SIPEED_LPI4ABIN_STR_FILENAME) \ + , \ + $(INSTALL) -D -m 0644 -t $(BINARIES_DIR)/bootbins $(@D)/$(f) + )
Then, this could be simplified to:
$(foreach f,$(SIPEED_LPI4ABIN_FILES), \ $(INSTALL) -D -m 0644 -t $(BINARIES_DIR)/bootbins $(@D)/$(f) )
Quoted 5 lines
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +3
-1+endef + +$(eval $(generic-package)) --2.43.0
Could you send an updated patch with those changes please?
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 1/2] package/sipeed-lpi4abin: add licheepi4a boot bins
Hi Julien,
Thanks for reviewing my patch. I have followed your comments and made the necessary changes.
Additionally I added myself into the DEVELOPERS file for this package as well (if that's alright).
Sending the v2 patch shortly
Thanks and Regards,
Kanak Shilledar
Quoted 141 lines · Julien Olivain
Hi Kanak,
Thanks for the patch!
I have few comments, see below.
Quoted 37 lines · Kanak Shilledar
Sipeed LicheePi 4A requires some proprietary binaries for booting, these are provided in the th1520-boot-firmware repo [1]. These binaries are also required for the onboard sound and wifi.
[1] https://github.com/revyos/th1520-boot-firmware
Signed-off-by Kanak Shilledar <[email protected]>--- package/Config.in | 1 + package/sipeed-lpi4abin/Config.in | 5 ++++ package/sipeed-lpi4abin/sipeed-lpi4abin.hash | 2 ++ package/sipeed-lpi4abin/sipeed-lpi4abin.mk | 30 ++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 package/sipeed-lpi4abin/Config.in create mode 100644 package/sipeed-lpi4abin/sipeed-lpi4abin.hash create mode 100644 package/sipeed-lpi4abin/sipeed-lpi4abin.mkpackage/Config.in +1
-0@@ -616,6 +616,7 @@ endmenu source "package/setserial/Config.in" source "package/sg3_utils/Config.in" source "package/sigrok-cli/Config.in" + source "package/sipeed-lpi4abin/Config.in" source "package/sispmctl/Config.in" source "package/smartmontools/Config.in" source "package/smstools3/Config.in"package/sipeed-lpi4abin/Config.in new file +0
-0package/sipeed-lpi4abin/Config.in line 3
Quoted 3 lines
package/sipeed-lpi4abin/Config.in new file +3
-0@@ -0,0 +1,5 @@ +config BR2_PACKAGE_SIPEED_LPI4ABIN + bool "sipeed-lpi4abin" + depends on BR2_riscv=yHere, the condition should be simplified to:
depends on
BR2_riscvQuoted 20 lines
package/sipeed-lpi4abin/Config.in new file +2
-0+ help + This package provides TH1520 SoC binary blobs for LicheePi 4A.package/sipeed-lpi4abin/sipeed-lpi4abin.hash new file +2
-0@@ -0,0 +1,2 @@ +# Locally computed +sha256
e5b29e1267009617dcf7cf3d0d59d7de62b06b96bb1981de3206b9a53123481fsipeed-lpi4abin-master-git4.tar.gzpackage/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +0
-0package/sipeed-lpi4abin/sipeed-lpi4abin.mk line 7
Quoted 7 lines
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +7
-0@@ -0,0 +1,30 @@ +################################################################################ +# +# sipeed-lpi4abin +# +################################################################################ + +SIPEED_LPI4ABIN_VERSION = masterBranch names should not be used in
_VERSION. The downloaded data will be cached in the download directory and will not be updated if the remote changes.If you want to use the "latest" version as of today, for example:
https://github.com/revyos/th1520-boot-firmware/commit/44ec4e1cc82141963842ec45db0d1617f9f07e75You can then set:
SIPEED_LPI4ABIN_VERSION=44ec4e1cc82141963842ec45db0d1617f9f07e75You'll also need to update the hash file accordingly.
package/sipeed-lpi4abin/sipeed-lpi4abin.mk line 10
Quoted 4 lines
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +1
-0+SIPEED_LPI4ABIN_SITE =https://github.com/revyos/th1520-boot-firmware.git
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +2
-0+SIPEED_LPI4ABIN_SITE_METHOD = git +# SIPEED_LPI4ABIN_LICENSE = PROPRIETARYThe
_LICENSEshould not be commented here. Could you uncomment it?Quoted 1 line
+#
SIPEED_LPI4ABIN_LICENSE_FILES= LICENSEThere is no real license file in the upstream repository.
Technically, there is the "copyright" file:
https://github.com/revyos/th1520-boot-firmware/blob/master/debian/copyright
but its content does not really give information on the actual license terms.So this comment line should be removed.
package/sipeed-lpi4abin/sipeed-lpi4abin.mk line 18
Quoted 6 lines
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +6
-0+SIPEED_LPI4ABIN_INSTALL_IMAGES = YES +SIPEED_LPI4ABIN_INSTALL_TARGET = NO + +SIPEED_LPI4ABIN_AON_FPGA_FILENAME = addons/boot/light_aon_fpga.bin +SIPEED_LPI4ABIN_C906_AUDIO_FILENAME = addons/boot/light_c906_audio.bin +SIPEED_LPI4ABIN_STR_FILENAME = addons/boot/str.binSince those variables are not reused anywhere else, this could be simplified as:
SIPEED_LPI4ABIN_FILES = \ addons/boot/light_aon_fpga.bin \ addons/boot/light_c906_audio.bin \ addons/boot/str.binpackage/sipeed-lpi4abin/sipeed-lpi4abin.mk line 27
Quoted 8 lines
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +8
-0+define SIPEED_LPI4ABIN_INSTALL_IMAGES_CMDS + $(foreach f, \ + $(SIPEED_LPI4ABIN_AON_FPGA_FILENAME) \ + $(SIPEED_LPI4ABIN_C906_AUDIO_FILENAME) \ + $(SIPEED_LPI4ABIN_STR_FILENAME) \ + , \ + $(INSTALL) -D -m 0644 -t $(BINARIES_DIR)/bootbins $(@D)/$(f) + )Then, this could be simplified to:
$(foreach f,$(SIPEED_LPI4ABIN_FILES), \ $(INSTALL) -D -m 0644 -t $(BINARIES_DIR)/bootbins $(@D)/$(f) )
Quoted 7 lines
Quoted 5 lines
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +3
-1+endef + +$(eval $(generic-package)) --2.43.0
Could you send an updated patch with those changes please?
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/2 configs/sipeed_licheepi_4a: add new board
In reply to Kanak ShilledarAdd support for the LicheePi 4A with mainline component:
- Linux Kernel 6.12
The following components are provided by vendor:
- U-Boot 2020.01
- OpenSBI v0.9
Board homepage and more usable wiki:
- https://wiki.sipeed.com/hardware/en/lichee/th1520/lpi4a/1_intro.html
th1520-boot-firmware is selected from the package sipeed-lpi4abins. This is inspired from lone0's fork of buildroot for th1520.[1]
[1] https://github.com/lone0/buildroot-th1520
--- .../sipeed/licheepi_4a/extlinux/extlinux.conf | 4 ++ board/sipeed/licheepi_4a/genimage.cfg | 9 ++++ board/sipeed/licheepi_4a/post-image.sh | 25 +++++++++ board/sipeed/licheepi_4a/readme.txt | 54 +++++++++++++++++++ configs/sipeed_licheepi_4a_defconfig | 40 ++++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 board/sipeed/licheepi_4a/extlinux/extlinux.conf create mode 100644 board/sipeed/licheepi_4a/genimage.cfg create mode 100755 board/sipeed/licheepi_4a/post-image.sh create mode 100644 board/sipeed/licheepi_4a/readme.txt create mode 100644 configs/sipeed_licheepi_4a_defconfig
board/sipeed/licheepi_4a/extlinux/extlinux.conf new file +4 -0
@@ -0,0 +1,4 @@ +label linux + kernel /Image + devicetree /th1520-lichee-pi-4a.dtb + append console=ttyS0,115200 root=/dev/mmcblk0p4 rootfstype=ext4 rootwait rw earlycon clk_ignore_unused init=/sbin/init
board/sipeed/licheepi_4a/genimage.cfg new file +9 -0
@@ -0,0 +1,9 @@ +image boot.ext4 { + ext4 { + use-mke2fs = true + label = "boot" + } + + size = 64M +} +
board/sipeed/licheepi_4a/post-image.sh new file +25 -0
@@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +BOARD_DIR="$(dirname $0)" +BOARD_NAME="$(basename ${BOARD_DIR})" +GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg" +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" + +trap 'rm -rf "${ROOTPATH_TMP}"' EXIT +ROOTPATH_TMP="$(mktemp -d)" +rm -rf "${GENIMAGE_TMP}" + +cp ${BINARIES_DIR}/Image ${BINARIES_DIR}/*.dtb ${BINARIES_DIR}/fw_dynamic.bin ${ROOTPATH_TMP} +cp -a ${BINARIES_DIR}/bootbins/* ${ROOTPATH_TMP} +cp -a ${BOARD_DIR}/extlinux ${ROOTPATH_TMP} + +genimage \ + --rootpath "${ROOTPATH_TMP}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG}" + +exit $?
board/sipeed/licheepi_4a/readme.txt new file +54 -0
54 lines not on this page · raw message
configs/sipeed_licheepi_4a_defconfig new file +40 -0
@@ -0,0 +1,40 @@ +BR2_riscv=y +BR2_RISCV_ISA_RVC=y +BR2_RISCV_ISA_RVV=y +BR2_TARGET_GENERIC_HOSTNAME="licheepi4a" +BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the LicheePi 4A" +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0" +BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/sipeed/licheepi_4a/post-image.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="thead/th1520-lichee-pi-4a" +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y +BR2_PACKAGE_LINUX_FIRMWARE=y +BR2_PACKAGE_LINUX_FIRMWARE_RTL_RTW88=y +BR2_PACKAGE_HDPARM=y +BR2_PACKAGE_IPERF3=y +BR2_PACKAGE_IW=y +BR2_PACKAGE_SIPEED_LPI4ABIN=y +BR2_PACKAGE_WIRELESS_REGDB=y +BR2_PACKAGE_WIRELESS_TOOLS=y +BR2_PACKAGE_WPA_SUPPLICANT=y +BR2_PACKAGE_WPA_SUPPLICANT_CLI=y +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_OPENSBI=y +BR2_TARGET_OPENSBI_CUSTOM_GIT=y +BR2_TARGET_OPENSBI_CUSTOM_REPO_URL="https://github.com/revyos/thead-opensbi.git" +BR2_TARGET_OPENSBI_CUSTOM_REPO_VERSION="lpi4a" +BR2_TARGET_OPENSBI_PLAT="generic" +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BOARDNAME="light_lpi4a" +BR2_TARGET_UBOOT_CUSTOM_GIT=y +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/revyos/thead-u-boot.git" +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="th1520" +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="u-boot-with-spl.bin" +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/2] configs/sipeed_licheepi_4a: add new board
Hi Kanak,
Thanks for the patch!
I have few questions/comments, see below.
Quoted 45 lines · Kanak Shilledar
Add support for the LicheePi 4A with mainline component:
- Linux Kernel 6.12The following components are provided by vendor:
- U-Boot 2020.01
- OpenSBI v0.9Board homepage and more usable wiki:
- https://wiki.sipeed.com/hardware/en/lichee/th1520/lpi4a/1_intro.htmlth1520-boot-firmware is selected from the package sipeed-lpi4abins. This is inspired from lone0's fork of buildroot for th1520.[1]
[1] https://github.com/lone0/buildroot-th1520
Signed-off-by Kanak Shilledar <[email protected]>--- .../sipeed/licheepi_4a/extlinux/extlinux.conf | 4 ++ board/sipeed/licheepi_4a/genimage.cfg | 9 ++++ board/sipeed/licheepi_4a/post-image.sh | 25 +++++++++ board/sipeed/licheepi_4a/readme.txt | 54 +++++++++++++++++++ configs/sipeed_licheepi_4a_defconfig | 40 ++++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 board/sipeed/licheepi_4a/extlinux/extlinux.conf create mode 100644 board/sipeed/licheepi_4a/genimage.cfg create mode 100755 board/sipeed/licheepi_4a/post-image.sh create mode 100644 board/sipeed/licheepi_4a/readme.txt create mode 100644 configs/sipeed_licheepi_4a_defconfigboard/sipeed/licheepi_4a/extlinux/extlinux.conf new file +4
-0@@ -0,0 +1,4 @@ +label linux + kernel /Image + devicetree /th1520-lichee-pi-4a.dtb + append console=ttyS0,115200 root=/dev/mmcblk0p4 rootfstype=ext4rootwait rw earlycon
clk_ignore_unusedinit=/sbin/initboard/sipeed/licheepi_4a/genimage.cfg new file +0
-0
board/sipeed/licheepi_4a/genimage.cfg line 3
Quoted 3 lines
board/sipeed/licheepi_4a/genimage.cfg new file +3
-0@@ -0,0 +1,9 @@ +image boot.ext4 { + ext4 { + use-mke2fs = true
Why "use-mke2fs = true" is needed here? I think it is the first configuration in Buildroot using it.
Could you add a comment why it is needed? (or it if works with the default value, then it could be removed).
Quoted 50 lines
board/sipeed/licheepi_4a/genimage.cfg new file +6
-0+ label = "boot" + } + + size = 64M +} +board/sipeed/licheepi_4a/post-image.sh new file +14
-0@@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +BOARD_DIR="$(dirname $0)" +BOARD_NAME="$(basename ${BOARD_DIR})" +GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg" +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" + +trap 'rm -rf "${ROOTPATH_TMP}"' EXIT +ROOTPATH_TMP="$(mktemp -d)" +rm -rf "${GENIMAGE_TMP}" + +cp ${BINARIES_DIR}/Image ${BINARIES_DIR}/*.dtb${BINARIES_DIR}/fw_dynamic.bin ${ROOTPATH_TMP}
board/sipeed/licheepi_4a/post-image.sh new file +11
-0+cp -a ${BINARIES_DIR}/bootbins/* ${ROOTPATH_TMP} +cp -a ${BOARD_DIR}/extlinux ${ROOTPATH_TMP} + +genimage \ + --rootpath "${ROOTPATH_TMP}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG}" + +exit $?board/sipeed/licheepi_4a/readme.txt new file +6
-0@@ -0,0 +1,54 @@ +Intro +===== + +This directory contains a buildroot configuration for building a +LicheePi 4A. +
board/sipeed/licheepi_4a/readme.txt line 16
Quoted 10 lines
board/sipeed/licheepi_4a/readme.txt new file +10
-0+How to build it +=============== + +Configure Buildroot +------------------- + + $ make sipeed_licheepi_4a_defconfig + +Build the boot and rootfs +----------------
Could you underline the full section title here, please?
Build the boot and rootfs
-------------------------
Quoted 27 lines
board/sipeed/licheepi_4a/readme.txt new file +27
-0+ +Note: you will need to have access to the network, since Buildroot +will download the packages' sources. + +You may now build your rootfs with: + + $ make + +(This may take a while, consider getting yourself a coffee ;-) ) + +Result of the build +------------------- + +After building, you should obtain this tree: + + output/images/ + +-- boot.ext4 + +-- rootfs.ext2 + +-- rootfs.ext4 -> rootfs.ext2 + +-- rootfs.tar + +-- u-boot.bin + +-- u-boot-with-spl.bin + +-- fw_dynamic.bin + `-- Image + +How to flash the board +========================
board/sipeed/licheepi_4a/readme.txt line 53
Quoted 10 lines
board/sipeed/licheepi_4a/readme.txt new file +10
-0+ +Once the build process is finished you will have to flash the +correspoding images to the respective partitions in the eMMC. +LicheePi 4A uses fastboot to flash the images. + +# fastboot flash ram u-boot-with-spl.bin +# fastboot reboot +# fastboot flash uboot u-boot-with-spl.bin +# fastboot flash boot boot.ext4 +# fastboot flash root rootfs.ext2
Out of curiosity, is it possible to boot the Buildroot image from the SD card? If yes, it could be interesting to also have the method here (and boot config switches).
configs/sipeed_licheepi_4a_defconfig line 3
Quoted 9 lines
configs/sipeed_licheepi_4a_defconfig new file +3
-0@@ -0,0 +1,40 @@ +BR2_riscv=y +BR2_RISCV_ISA_RVC=y +BR2_RISCV_ISA_RVV=y
We need to pin a Kernel version (see below), so the kernel headers needs to be set to the same version, with the config:
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
Also, new defconfigs should add custom hash files for board specific packages. So you should have configs like:
BR2_GLOBAL_PATCH_DIR="board/sipeed/licheepi_4a/patches" BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
This patch should also introduce the corresponding hash files.
configs/sipeed_licheepi_4a_defconfig line 9
Quoted 6 lines
configs/sipeed_licheepi_4a_defconfig new file +6
-0+BR2_TARGET_GENERIC_HOSTNAME="licheepi4a" +BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the LicheePi 4A" +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0" +BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/sipeed/licheepi_4a/post-image.sh" +BR2_LINUX_KERNEL=y
The defconfig should pin a fixed Kernel version. For example:
BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.18"
See other defconfigs in Buildroot.
configs/sipeed_licheepi_4a_defconfig line 13
Quoted 4 lines
configs/sipeed_licheepi_4a_defconfig new file +4
-0+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="thead/th1520-lichee-pi-4a" +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
The Buildroot defconfigs should be kept minimal: only the package needed to build, boot and provide core functionality should be kept. I believe BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y is added here for BR2_PACKAGE_HDPARM=y. They could be removed.
configs/sipeed_licheepi_4a_defconfig line 17
Quoted 4 lines
configs/sipeed_licheepi_4a_defconfig new file +4
-0+BR2_PACKAGE_LINUX_FIRMWARE=y +BR2_PACKAGE_LINUX_FIRMWARE_RTL_RTW88=y +BR2_PACKAGE_HDPARM=y +BR2_PACKAGE_IPERF3=y
BR2_PACKAGE_HDPARM=y and BR2_PACKAGE_IPERF3=y could be removed.
configs/sipeed_licheepi_4a_defconfig line 30
Quoted 13 lines
configs/sipeed_licheepi_4a_defconfig new file +13
-0+BR2_PACKAGE_IW=y +BR2_PACKAGE_SIPEED_LPI4ABIN=y +BR2_PACKAGE_WIRELESS_REGDB=y +BR2_PACKAGE_WIRELESS_TOOLS=y +BR2_PACKAGE_WPA_SUPPLICANT=y +BR2_PACKAGE_WPA_SUPPLICANT_CLI=y +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_OPENSBI=y +BR2_TARGET_OPENSBI_CUSTOM_GIT=y +BR2_TARGET_OPENSBI_CUSTOM_REPO_URL="https://github.com/revyos/thead-opensbi.git" +BR2_TARGET_OPENSBI_CUSTOM_REPO_VERSION="lpi4a"
Git branch names should not be used in repo version. Please change it to a tag name or commit id.
configs/sipeed_licheepi_4a_defconfig line 36
Quoted 6 lines
configs/sipeed_licheepi_4a_defconfig new file +6
-0+BR2_TARGET_OPENSBI_PLAT="generic" +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BOARDNAME="light_lpi4a" +BR2_TARGET_UBOOT_CUSTOM_GIT=y +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/revyos/thead-u-boot.git" +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="th1520"
Git branch names should not be used in repo version. Please change it to a tag name or commit id.
configs/sipeed_licheepi_4a_defconfig line 40
Quoted 4 lines
configs/sipeed_licheepi_4a_defconfig new file +4
-0+BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="u-boot-with-spl.bin" +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y
Also, could you add yourself as the maintainer of this defconfig in the file "DEVELOPERS"?
Best regards,
Julien.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH 2/2] configs/sipeed_licheepi_4a: add new board
Hey Julien,
Thanks for reviewing my patch. I have followed your comments and made the necessary changes.
Sending the v2 patch shortly.
Quoted 62 lines · Julien Olivain
Hi Kanak,
Thanks for the patch!
I have few questions/comments, see below.
Quoted 47 lines · Kanak Shilledar
Add support for the LicheePi 4A with mainline component:
- Linux Kernel 6.12The following components are provided by vendor:
- U-Boot 2020.01
- OpenSBI v0.9Board homepage and more usable wiki:
- https://wiki.sipeed.com/hardware/en/lichee/th1520/lpi4a/1_intro.htmlth1520-boot-firmware is selected from the package sipeed-lpi4abins. This is inspired from lone0's fork of buildroot for th1520.[1]
[1] https://github.com/lone0/buildroot-th1520
Signed-off-by Kanak Shilledar <[email protected]>--- .../sipeed/licheepi_4a/extlinux/extlinux.conf | 4 ++ board/sipeed/licheepi_4a/genimage.cfg | 9 ++++ board/sipeed/licheepi_4a/post-image.sh | 25 +++++++++ board/sipeed/licheepi_4a/readme.txt | 54 +++++++++++++++++++ configs/sipeed_licheepi_4a_defconfig | 40 ++++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 board/sipeed/licheepi_4a/extlinux/extlinux.conf create mode 100644 board/sipeed/licheepi_4a/genimage.cfg create mode 100755 board/sipeed/licheepi_4a/post-image.sh create mode 100644 board/sipeed/licheepi_4a/readme.txt create mode 100644 configs/sipeed_licheepi_4a_defconfigboard/sipeed/licheepi_4a/extlinux/extlinux.conf new file +4
-0@@ -0,0 +1,4 @@ +label linux + kernel /Image + devicetree /th1520-lichee-pi-4a.dtb + append console=ttyS0,115200 root=/dev/mmcblk0p4 rootfstype=ext4rootwait rw earlycon
clk_ignore_unusedinit=/sbin/initboard/sipeed/licheepi_4a/genimage.cfg new file +0
-0board/sipeed/licheepi_4a/genimage.cfg line 3
Quoted 3 lines
board/sipeed/licheepi_4a/genimage.cfg new file +3
-0@@ -0,0 +1,9 @@ +image boot.ext4 { + ext4 { + use-mke2fs = trueWhy "use-mke2fs = true" is needed here? I think it is the first configuration in Buildroot using it.
Quoted 2 lines
Could you add a comment why it is needed? (or it if works with the default value, then it could be removed).
"use-mke2fs=true" was indeed not required and the default value worked just fine.
Quoted 8 lines
Quoted 8 lines
board/sipeed/licheepi_4a/genimage.cfg new file +8
-0+How to flash the board +======================== + +Once the build process is finished you will have to flash the +correspoding images to the respective partitions in the eMMC. +LicheePi 4A uses fastboot to flash the images. + +# fastboot flash ram u-boot-with-spl.bin
Quoted 9 lines
board/sipeed/licheepi_4a/genimage.cfg
Quoted 4 lines
board/sipeed/licheepi_4a/genimage.cfg new file +4
-0+# fastboot reboot +# fastboot flash uboot u-boot-with-spl.bin +# fastboot flash boot boot.ext4 +# fastboot flash root rootfs.ext2Out of curiosity, is it possible to boot the Buildroot image from the SD card? If yes, it could be interesting to also have the method here (and boot config switches).
The board is currently unable to boot from SD card as per my testing the boot rom currently doesn't support loading images from the SD card. Also the Sipeed Wiki doesn't have much instructions on booting via the SD card apart from mention about the DIP switch. If Ifigure out how to get it to boot via the SD card,
I will update the readme in a future commit.
Quoted 9 lines
board/sipeed/licheepi_4a/genimage.cfg
Quoted 5 lines
board/sipeed/licheepi_4a/genimage.cfg new file +4
-0+BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="u-boot-with-spl.bin" +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=yAlso, could you add yourself as the maintainer of this defconfig in the file "DEVELOPERS"?
Quoted 3 lines
Best regards,
Julien.
Thanks and Regards,
Kanak Shilledar
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot