new file mode 100644
@@ -0,0 +1,36 @@
+# SD card image for Radxa Rock 5b
+
+image boot.vfat {
+ vfat {
+ file image.itb {
+ image = "image.itb"
+ }
+ }
+ size = 16M
+}
+
+image sdcard.img {
+ hdimage {
+ partition-table-type = "hybrid"
+ }
+
+ partition uboot {
+ in-partition-table = "false"
+ image = "u-boot-rockchip.bin"
+ offset = 32K
+ size = 12M
+ }
+
+ partition boot {
+ partition-type = "0xC"
+ bootable = "true"
+ image = "boot.vfat"
+ offset = 64M
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext2"
+ offset = 96M
+ }
+}
new file mode 100755
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+GENIMAGE_CFG="$(dirname $0)/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+# genimage needs u-boot-rockchip.bin
+
+cp ${BUILD_DIR}/uboot-2023.07-rc4/u-boot-rockchip.bin ${BINARIES_DIR}/
+
+gzip -fk ${BINARIES_DIR}/Image
+cp board/radxa/rock5b/rock5b.its ${BINARIES_DIR}
+(cd $BINARIES_DIR && mkimage -f rock5b.its image.itb)
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+ --rootpath "${TARGET_DIR}" \
+ --tmppath "${GENIMAGE_TMP}" \
+ --inputpath "${BINARIES_DIR}" \
+ --outputpath "${BINARIES_DIR}" \
+ --config "${GENIMAGE_CFG}"
+
+RET=${?}
+exit ${RET}
new file mode 100644
@@ -0,0 +1,46 @@
+/dts-v1/;
+
+/ {
+ description = "Rock 5B FIT Image";
+ #address-cells = <1>;
+
+ images {
+ kernel {
+ description = "Kernel";
+ data = /incbin/("Image.gz");
+ type = "kernel";
+ arch = "arm64";
+ os = "linux";
+ compression = "gzip";
+ load = <0x0a200000>;
+ entry = <0x0a200000>;
+ hash {
+ algo = "sha256";
+ };
+ };
+ fdt {
+ description = "Device Tree";
+ data = /incbin/("rk3588-rock-5b.dtb");
+ type = "flat_dt";
+ arch = "arm64";
+ compression = "none";
+ load = <0x0e000000>;
+ entry = <0x0e000000>;
+ hash {
+ algo = "sha256";
+ };
+ };
+ };
+
+ configurations {
+ default = "standard";
+ standard {
+ description = "Standard Boot";
+ kernel = "kernel";
+ fdt = "fdt";
+ hash {
+ algo = "sha256";
+ };
+ };
+ };
+};
new file mode 100644
@@ -0,0 +1,3 @@
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="root=/dev/mmcblk0p2 rw rootfstype=ext4 clkin_hz=(25000000) earlycon clk_ignore_unused earlyprintk console=ttyS2,1500000n8 rootwait"
+CONFIG_BOOTCOMMAND="fatload mmc 1:1 ${loadaddr} image.itb && bootm ${loadaddr}"
@@ -1,6 +1,8 @@
BR2_aarch64=y
BR2_cortex_a76_a55=y
BR2_KERNEL_HEADERS_5_10=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/radxa/rock5b/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS=""
BR2_TARGET_GENERIC_HOSTNAME="rock5b"
BR2_TARGET_GENERIC_ISSUE="Rock 5b"
BR2_SYSTEM_DHCP="eth0"
@@ -31,7 +33,10 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y
BR2_TARGET_UBOOT_NEEDS_ROCKCHIP_RKBIN=y
BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="BL31=bl31.bin ROCKCHIP_TPL=ddr.bin"
+BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/radxa/rock5b/uboot.fragment"
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_DTC=y
+BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
This patch adds post image scripts for the Radxa Rock 5B. They generate an sdcard.img file, which can be flashed on an SD card to boot the board. Signed-off-by: Kilian Zinnecker <kilian.zinnecker@mail.de> --- board/radxa/rock5b/genimage.cfg | 36 ++++++++++++++++++++++++ board/radxa/rock5b/post-image.sh | 24 ++++++++++++++++ board/radxa/rock5b/rock5b.its | 46 +++++++++++++++++++++++++++++++ board/radxa/rock5b/uboot.fragment | 3 ++ configs/rock5b_defconfig | 5 ++++ 5 files changed, 114 insertions(+) create mode 100644 board/radxa/rock5b/genimage.cfg create mode 100755 board/radxa/rock5b/post-image.sh create mode 100644 board/radxa/rock5b/rock5b.its create mode 100644 board/radxa/rock5b/uboot.fragment