From 52ccff6d54f798b6eef13b49b5cad40fb1f319d9 Mon Sep 17 00:00:00 2001 From: Robert Grizzell Date: Fri, 5 Dec 2025 21:40:06 -0600 Subject: [PATCH 1/3] Add device profile for Luckfox Pico Mini --- target/linux/rockchip/image/Makefile | 2 +- target/linux/rockchip/image/cortexa7.mk | 18 +++++++++++++++++- target/linux/rockchip/image/uboot.env.sd.txt | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 target/linux/rockchip/image/uboot.env.sd.txt diff --git a/target/linux/rockchip/image/Makefile b/target/linux/rockchip/image/Makefile index 88bc374d47726c..7abed48eb3535b 100644 --- a/target/linux/rockchip/image/Makefile +++ b/target/linux/rockchip/image/Makefile @@ -98,7 +98,7 @@ define Build/rockchip32-legacy-bin $(CP) $(IMAGE_KERNEL) $@.boot/kernel # generate boot.img with boot.its - mkimage -E -p 0x800 -f $@.boot/boot.its $@.boot/boot.img + PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -E -p 0x800 -f $@.boot/boot.its $@.boot/boot.img # generate basic image dd if=/dev/zero of="$@" bs=512 count=67136 conv=notrunc diff --git a/target/linux/rockchip/image/cortexa7.mk b/target/linux/rockchip/image/cortexa7.mk index 659508492bfbbc..69d12d73dd7506 100644 --- a/target/linux/rockchip/image/cortexa7.mk +++ b/target/linux/rockchip/image/cortexa7.mk @@ -47,9 +47,12 @@ endef define Device/Default-sdcard $(Device/Default-arm32) FILESYSTEMS := squashfs - IMAGES := boot.img rootfs.img + IMAGES := boot.img rootfs.img env.img idblock.img uboot.img IMAGE/rootfs.img := append-rootfs | pad-extra 128k IMAGE/boot.img := resource-img | boot-arm-bin + IMAGE/env.img := env-rv1106-sd-img | rockchip-env-img + IMAGE/idblock.img := rockchip-idblock-img + IMAGE/uboot.img := rockchip-uboot-img endef define Device/Default-spiflash @@ -129,6 +132,19 @@ define Device/luckfox_pico-max endef TARGET_DEVICES += luckfox_pico-max +define Device/luckfox_pico-mini + $(Device/Default-sdcard) + DEVICE_TITLE := Luckfox Pico Mini + SUPPORTED_DEVICES := luckfox,rv1103-luckfox-pico-mini + SOC := rv1103 + DEVICE_DTS := rv1103g-luckfox-pico-mini + UBOOT_DEVICE_NAME := rv1106-sd + DEFAULT_PACKAGES += kmod-rknpu-rockchip + IMAGES += sysupgrade.img.gz + IMAGE/sysupgrade.img.gz := env-rv1106-sd-img | rockchip32-legacy-bin | append-rootfs | pad-extra 128k | gzip | append-metadata +endef +TARGET_DEVICES += luckfox_pico-mini + define Device/luckfox_pico-86panel-w $(Device/Default-emmc) DEVICE_TITLE := Luckfox Pico 86panel-w diff --git a/target/linux/rockchip/image/uboot.env.sd.txt b/target/linux/rockchip/image/uboot.env.sd.txt new file mode 100644 index 00000000000000..7fcd2f23826ccc --- /dev/null +++ b/target/linux/rockchip/image/uboot.env.sd.txt @@ -0,0 +1,3 @@ +blkdevparts=mmcblk1:32K(env),512K@32K(idblock),256K(uboot),32M(boot),2G(rootfs),1G(oem),2G(userdata),-(media) +sys_bootargs= root=/dev/mmcblk1p5 rootfstype=squashfs,ext4,f2fs rw rootwait rk_dma_heap_cma=24M +sd_parts=mmcblk0:16K@512(env),512K@32K(idblock),4M(uboot) From 0e4ab839229a9ce1bdf6c27f4c3b7f24d41337e2 Mon Sep 17 00:00:00 2001 From: Robert Grizzell Date: Wed, 10 Dec 2025 18:40:23 -0600 Subject: [PATCH 2/3] Bump Rockchip load binaries to include rv11xx devices --- package/boot/rkbin/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/boot/rkbin/Makefile b/package/boot/rkbin/Makefile index d895c06547b0b7..ded46e533c2c77 100644 --- a/package/boot/rkbin/Makefile +++ b/package/boot/rkbin/Makefile @@ -9,9 +9,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/rockchip-linux/rkbin.git -PKG_SOURCE_DATE:=2024-02-22 -PKG_SOURCE_VERSION:=a2a0b89b6c8c612dca5ed9ed8a68db8a07f68bc0 -PKG_MIRROR_HASH:=39f15e5f8fac02026065b6747b355b93f4e06202783ae448c43607763211597c +PKG_SOURCE_DATE:=2025-06-13 +PKG_SOURCE_VERSION:=74213af1e952c4683d2e35952507133b61394862 +PKG_MIRROR_HASH:=6031a672c66272b3003a2795336f4905058972527e01b881c77b316f5df0132c PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Tianling Shen From e99ee60c3e7f8c82475cf0d2f0ae1073dfa7d67b Mon Sep 17 00:00:00 2001 From: Robert Grizzell Date: Thu, 26 Mar 2026 17:58:49 -0500 Subject: [PATCH 3/3] boot: add uboot-luckfox package and rkbin RV1106 support Add uboot-luckfox package that builds vendor U-Boot 2017.09 for the RV1106 SoC, producing rv1106-sd-uboot.img (FIT image) for SD card boot. Mainline U-Boot has no RV1106 support, so this uses the Luckfox vendor fork with the luckfox_rv1106_uboot defconfig. Add RV1106 variant to rkbin with a custom install handler that generates rv1106-sd-idblock.img via boot_merger and stages DDR/SPL binaries. Co-Authored-By: Claude Opus 4.6 --- package/boot/rkbin/Makefile | 22 ++++++++++++- package/boot/uboot-luckfox/Makefile | 51 +++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 package/boot/uboot-luckfox/Makefile diff --git a/package/boot/rkbin/Makefile b/package/boot/rkbin/Makefile index ded46e533c2c77..040d8816e9d82f 100644 --- a/package/boot/rkbin/Makefile +++ b/package/boot/rkbin/Makefile @@ -63,13 +63,20 @@ define Trusted-Firmware-A/rk3588 TPL:=rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.16.bin endef +define Trusted-Firmware-A/rv1106 + BUILD_SUBTARGET:=cortexa7 + ATF:=rv11/rv1106_spl_v1.02.bin + TPL:=rv11/rv1106_ddr_924MHz_v1.15.bin +endef + TFA_TARGETS:= \ rk3308 \ rk3308-rock-pi-s \ rk3566 \ rk3568 \ rk3568-e25 \ - rk3588 + rk3588 \ + rv1106 ifeq ($(BUILD_VARIANT),rk3308-rock-pi-s) TPL_FILE:=rk3308_ddr_589MHz_uart0_m0_v2.07.bin @@ -113,4 +120,17 @@ define Package/trusted-firmware-a/install $(CP) $(PKG_BUILD_DIR)/bin/$(TPL) $(STAGING_DIR_IMAGE)/ endef +define Package/trusted-firmware-a-rv1106/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + # Stage raw binaries + $(CP) $(PKG_BUILD_DIR)/bin/rv11/rv1106_spl_v1.02.bin $(STAGING_DIR_IMAGE)/ + $(CP) $(PKG_BUILD_DIR)/bin/rv11/rv1106_ddr_924MHz_v1.15.bin $(STAGING_DIR_IMAGE)/ + # Generate idblock.img using boot_merger with vendor INI + chmod +x $(PKG_BUILD_DIR)/tools/boot_merger + cd $(PKG_BUILD_DIR) && ./tools/boot_merger RKBOOT/RV1106MINIALL.ini + $(CP) $(PKG_BUILD_DIR)/rv1106_idblock_v*.img $(STAGING_DIR_IMAGE)/rv1106-sd-idblock.img + # Stage loaderimage for the future uboot-luckfox package + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/loaderimage $(STAGING_DIR_IMAGE)/loaderimage +endef + $(eval $(call BuildPackage/Trusted-Firmware-A)) diff --git a/package/boot/uboot-luckfox/Makefile b/package/boot/uboot-luckfox/Makefile new file mode 100644 index 00000000000000..2b0412c1df1fc5 --- /dev/null +++ b/package/boot/uboot-luckfox/Makefile @@ -0,0 +1,51 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_VERSION:=2017.09 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/rgrizzell/uboot-luckfox.git +PKG_SOURCE_DATE:=2026-03-26 +PKG_SOURCE_VERSION:=08d5d37be95d0138f4796c7681f11d88b196c1cd +PKG_MIRROR_HASH:=skip + +include $(INCLUDE_DIR)/u-boot.mk +include $(INCLUDE_DIR)/package.mk + +define U-Boot/Default + BUILD_TARGET:=rockchip + UENV:=default + HIDDEN:=1 +endef + +define U-Boot/rv1106-sd + BUILD_SUBTARGET:=cortexa7 + NAME:=Luckfox Pico RV1106 SD + UBOOT_CONFIG:=luckfox_rv1106_uboot + DEPENDS:=+PACKAGE_u-boot-$(1):trusted-firmware-a-rv1106 + BUILD_DEVICES:=luckfox_pico-mini +endef + +UBOOT_TARGETS := rv1106-sd + +# Vendor U-Boot 2017.09 uses _defconfig (no _config compat rule) +define Build/Configure + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) \ + $(UBOOT_CONFIG)_defconfig +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/u-boot.img $(STAGING_DIR_IMAGE)/rv1106-sd-uboot.img +endef + +define Package/u-boot/install/default +endef + +$(eval $(call BuildPackage/U-Boot))