Skip to contentSkip to conversation

Add support for LicheePi 4A

PATCH Applied Kanak Shilledar 2 participants 5 messages Mar 9, 2025 – Mar 12, 2025

lore
Share & tools
lore
#0 lore raw

v2 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

 DEVELOPERS                                    |  5 ++
 .../sipeed/licheepi_4a/extlinux/extlinux.conf |  4 ++
 board/sipeed/licheepi_4a/genimage.cfg         |  7 +++
 .../patches/linux-headers/linux-headers.hash  |  2 +
 .../licheepi_4a/patches/linux/linux.hash      |  2 +
 .../licheepi_4a/patches/opensbi/opensbi.hash  |  2 +
 .../licheepi_4a/patches/uboot/uboot.hash      |  2 +
 board/sipeed/licheepi_4a/post-image.sh        | 25 +++++++++
 board/sipeed/licheepi_4a/readme.txt           | 54 +++++++++++++++++++
 configs/sipeed_licheepi_4a_defconfig          | 42 +++++++++++++++
 package/Config.in                             |  1 +
 package/sipeed-lpi4abin/Config.in             |  5 ++
 package/sipeed-lpi4abin/sipeed-lpi4abin.hash  |  2 +
 package/sipeed-lpi4abin/sipeed-lpi4abin.mk    | 26 +++++++++
 14 files changed, 179 insertions(+)
 create mode 100644 board/sipeed/licheepi_4a/extlinux/extlinux.conf
 create mode 100644 board/sipeed/licheepi_4a/genimage.cfg
 create mode 100644 board/sipeed/licheepi_4a/patches/linux-headers/linux-headers.hash
 create mode 100644 board/sipeed/licheepi_4a/patches/linux/linux.hash
 create mode 100644 board/sipeed/licheepi_4a/patches/opensbi/opensbi.hash
 create mode 100644 board/sipeed/licheepi_4a/patches/uboot/uboot.hash
 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
#1 lore raw

PATCH v2 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

---
Changes in v2:
- simplify the BR2_PACKAGE_SIPEED_LPI4ABIN condition.
- change the _VERSION to latest commit hash instead of branch name.
- uncommented _LICENSE and removed _LICENSE_FILES.
- simplify the boot bins filenames.
- simplify the image install commands.
- assigned this package to self in DEVELOPERS.
---

---
 DEVELOPERS                                   |  3 +++
 package/Config.in                            |  1 +
 package/sipeed-lpi4abin/Config.in            |  5 ++++
 package/sipeed-lpi4abin/sipeed-lpi4abin.hash |  2 ++
 package/sipeed-lpi4abin/sipeed-lpi4abin.mk   | 26 ++++++++++++++++++++
 5 files changed, 37 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
DEVELOPERS +3 -0
index 1f04dd2a1e..45eed3630c 100644
@@ -2054,6 +2054,9 @@ F:	package/libodb-mysql/
 F:	package/libqb/
 F:	package/usbguard/
 
+N:	Kanak Shilledar <[email protected]>
+F:	package/sipeed-lpi4abins/
+
 N:	Karoly Kasza <[email protected]>
 F:	package/irqbalance/
 F:	package/openvmtools/
package/Config.in +1 -0
index 4a81a62ec4..ce8cb95d7e 100644
@@ -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
new file mode 100644
index 0000000000..1f9791b0bd
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_SIPEED_LPI4ABIN
+	bool "sipeed-lpi4abin"
+	depends on BR2_riscv
+	help
+	  This package provides TH1520 SoC binary blobs for LicheePi 4A.
package/sipeed-lpi4abin/sipeed-lpi4abin.hash new file +2 -0
new file mode 100644
index 0000000000..9d66be164b
@@ -0,0 +1,2 @@
+# Locally computed
+sha256  a1c608a7b0cc641d39666a07d8bb1a73ded35385316989c3e8182d968ed89b3e  sipeed-lpi4abin-44ec4e1cc82141963842ec45db0d1617f9f07e75-git4.tar.gz
package/sipeed-lpi4abin/sipeed-lpi4abin.mk new file +26 -0
new file mode 100644
index 0000000000..315075cede
@@ -0,0 +1,26 @@
+################################################################################
+#
+# sipeed-lpi4abin
+#
+################################################################################
+
+SIPEED_LPI4ABIN_VERSION = 44ec4e1cc82141963842ec45db0d1617f9f07e75
+SIPEED_LPI4ABIN_SITE = https://github.com/revyos/th1520-boot-firmware.git
+SIPEED_LPI4ABIN_SITE_METHOD = git
+SIPEED_LPI4ABIN_LICENSE = PROPRIETARY
+
+SIPEED_LPI4ABIN_INSTALL_IMAGES = YES
+SIPEED_LPI4ABIN_INSTALL_TARGET = NO
+
+SIPEED_LPI4ABIN_FILES = \
+		addons/boot/light_aon_fpga.bin \
+		addons/boot/light_c906_audio.bin \
+		addons/boot/str.bin
+
+define SIPEED_LPI4ABIN_INSTALL_IMAGES_CMDS
+	$(foreach f,$(SIPEED_LPI4ABIN_FILES), \
+		$(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
#2 lore raw

Re: [Buildroot] [PATCH v2 1/2] package/sipeed-lpi4abin: add licheepi4a boot bins

Hi Kanak,

Quoted 6 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

I applied this patch series to next, thanks!

I was able to get access to this board, so I could actually runtime test those patches. While doing so, I did few minor changes and added extra information in the readme.txt.

See:
https://gitlab.com/buildroot.org/buildroot/-/commit/29861832a38976911d931256e8e5a3aad526e761
https://gitlab.com/buildroot.org/buildroot/-/commit/1ab37899ae7c7595d3fc1ab70b67388e67e70c33

Best regards,

Julien.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Re: [Buildroot] [PATCH v2 1/2] package/sipeed-lpi4abin: add licheepi4a boot bins

Hi Julien,
Thank you for accepting the patch series and for testing it on the board. I appreciate the refinements and documentation updates you made. The changes look great!

Thanks and Regards,
Kanak Shilledar

Quoted 17 lines · Julien Olivain

Hi Kanak,

Quoted 6 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

I applied this patch series to next, thanks!

I was able to get access to this board, so I could actually runtime test those patches. While doing so, I did few minor changes and added extra information in the readme.txt.

Quoted 7 lines

See:
https://gitlab.com/buildroot.org/buildroot/-/commit/29861832a38976911d931256e8e5a3aad526e761
https://gitlab.com/buildroot.org/buildroot/-/commit/1ab37899ae7c7595d3fc1ab70b67388e67e70c33

Best regards,

Julien.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

PATCH v2 2/2 configs/sipeed_licheepi_4a: add new board

In reply to Kanak Shilledar

Add 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
---
Changes in v2:
- removed "use-mke2fs=true" for creating ext4 and switched to default
- fixed documentation formatting
- added global patch dir for hash checking
- fixed kernel version in defconfig
- removed _BUSYBOX_SHOW_OTHERS option
- removed HDPARM and IPERF3 package
- added commit hashes to uboot and opensbi
- added self to DEVELOPERS file
---

---
 DEVELOPERS                                    |  2 +
 .../sipeed/licheepi_4a/extlinux/extlinux.conf |  4 ++
 board/sipeed/licheepi_4a/genimage.cfg         |  7 +++
 .../patches/linux-headers/linux-headers.hash  |  2 +
 .../licheepi_4a/patches/linux/linux.hash      |  2 +
 .../licheepi_4a/patches/opensbi/opensbi.hash  |  2 +
 .../licheepi_4a/patches/uboot/uboot.hash      |  2 +
 board/sipeed/licheepi_4a/post-image.sh        | 25 +++++++++
 board/sipeed/licheepi_4a/readme.txt           | 54 +++++++++++++++++++
 configs/sipeed_licheepi_4a_defconfig          | 42 +++++++++++++++
 10 files changed, 142 insertions(+)
 create mode 100644 board/sipeed/licheepi_4a/extlinux/extlinux.conf
 create mode 100644 board/sipeed/licheepi_4a/genimage.cfg
 create mode 100644 board/sipeed/licheepi_4a/patches/linux-headers/linux-headers.hash
 create mode 100644 board/sipeed/licheepi_4a/patches/linux/linux.hash
 create mode 100644 board/sipeed/licheepi_4a/patches/opensbi/opensbi.hash
 create mode 100644 board/sipeed/licheepi_4a/patches/uboot/uboot.hash
 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
DEVELOPERS +2 -0
index 45eed3630c..519193ad8f 100644
@@ -2055,6 +2055,8 @@ F:	package/libqb/
 F:	package/usbguard/
 
 N:	Kanak Shilledar <[email protected]>
+F:	board/sipeed/licheepi_4a/
+F:	configs/sipeed_licheepi_4a_defconfig
 F:	package/sipeed-lpi4abins/
 
 N:	Karoly Kasza <[email protected]>
board/sipeed/licheepi_4a/extlinux/extlinux.conf new file +4 -0
new file mode 100644
index 0000000000..add3954184
@@ -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 +7 -0
new file mode 100644
index 0000000000..54cef1db9b
@@ -0,0 +1,7 @@
+image boot.ext4 {
+	ext4 {
+		label = "boot"
+	}
+
+	size = 64M
+}
board/sipeed/licheepi_4a/patches/linux-headers/linux-headers.hash new file +2 -0
new file mode 100644
index 0000000000..b2db374438
@@ -0,0 +1,2 @@
+# Locally computed
+sha256  beb902a5f69d9e57710112203db38111dad6d30556ea8ce389284c8077fe944d  linux-6.12.18.tar.xz
board/sipeed/licheepi_4a/patches/linux/linux.hash new file +2 -0
new file mode 100644
index 0000000000..b2db374438
@@ -0,0 +1,2 @@
+# Locally computed
+sha256  beb902a5f69d9e57710112203db38111dad6d30556ea8ce389284c8077fe944d  linux-6.12.18.tar.xz
board/sipeed/licheepi_4a/patches/opensbi/opensbi.hash new file +2 -0
new file mode 100644
index 0000000000..5ced5c95cc
@@ -0,0 +1,2 @@
+# Locally computed
+sha256  2510c0e867b4f8c28579def9a21e97fa2e8de95b8c7d66bb8b6642202bcee3b4  opensbi-61d7484c752a5e4c464d5dc18e21d9ac67fbbefa-git4.tar.gz
board/sipeed/licheepi_4a/patches/uboot/uboot.hash new file +2 -0
new file mode 100644
index 0000000000..b63a8d79d4
@@ -0,0 +1,2 @@
+# Locally computed
+sha256  6158b9c6faee41a1e790ad4ba2e1b3e18a122ecdb5749fa77c7495a2d1c56262  uboot-b5ee6e549a7b5ff382a14021a5d6a3c94017bddd-git4.tar.gz
board/sipeed/licheepi_4a/post-image.sh new file +25 -0
new file mode 100755
index 0000000000..93a7572ee3
@@ -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 +42 -0

42 lines not on this page · raw message

Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot