From 74d1e0a7f8c27517bdc742d0284455b2fb19ca2a Mon Sep 17 00:00:00 2001 From: jjm2473 <1129525450@qq.com> Date: Tue, 11 Apr 2023 14:53:36 +0800 Subject: [PATCH] target/rockchip: r66s r68s combined --- target/linux/rockchip/image/Makefile | 15 ++++++++++++++ .../linux/rockchip/image/rk3568-cb.bootscript | 20 +++++++++++++++++++ target/linux/rockchip/image/rk3568.mk | 9 +++++++++ 3 files changed, 44 insertions(+) create mode 100644 target/linux/rockchip/image/rk3568-cb.bootscript diff --git a/target/linux/rockchip/image/Makefile b/target/linux/rockchip/image/Makefile index d8ee4d8c51..2049180a6f 100644 --- a/target/linux/rockchip/image/Makefile +++ b/target/linux/rockchip/image/Makefile @@ -20,6 +20,21 @@ define Build/boot-common $(CP) $(IMAGE_KERNEL) $@.boot/kernel.img endef +define Build/boot-combined + # This creates a new folder copies the dtbs (as rockchip*.dtb) + # and the kernel image (as kernel.img) + rm -fR $@.boot + mkdir -p $@.boot + + i=0; \ + for dts in $(DEVICE_DTS); do \ + $(CP) $(KDIR)/image-$${dts}.dtb $@.boot/rockchip$$(perl -e 'printf "%b\n",'$$i).dtb; \ + let i+=1; \ + done + $(LN) rockchip0.dtb $@.boot/rockchip.dtb + $(CP) $(IMAGE_KERNEL) $@.boot/kernel.img +endef + define Build/boot-script # Make an U-boot image and copy it to the boot partition mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d $(if $(1),$(1),mmc).bootscript $@.boot/boot.scr diff --git a/target/linux/rockchip/image/rk3568-cb.bootscript b/target/linux/rockchip/image/rk3568-cb.bootscript new file mode 100644 index 0000000000..fec3be4f58 --- /dev/null +++ b/target/linux/rockchip/image/rk3568-cb.bootscript @@ -0,0 +1,20 @@ +# rk3568 combined image + +env delete hwflag + +# using gpio 84 (GPIO2_C4, GMAC0_MDIO) to detect gmac0 +if gpio input 84; then + echo nogmac +else + echo hasgmac + setenv hwflag 1 +fi + +part uuid mmc ${devnum}:2 uuid + +setenv bootargs "earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 root=PARTUUID=${uuid} rw rootwait" + +load mmc ${devnum}:1 ${fdt_addr_r} rockchip${hwflag}.dtb +load mmc ${devnum}:1 ${kernel_addr_r} kernel.img + +booti ${kernel_addr_r} - ${fdt_addr_r} \ No newline at end of file diff --git a/target/linux/rockchip/image/rk3568.mk b/target/linux/rockchip/image/rk3568.mk index 49c75cf386..aca524a1d6 100644 --- a/target/linux/rockchip/image/rk3568.mk +++ b/target/linux/rockchip/image/rk3568.mk @@ -24,6 +24,15 @@ $(call Device/fastrhino_common) endef TARGET_DEVICES += fastrhino_r68s +define Device/fastrhino_r6xs +$(call Device/fastrhino_common) + DEVICE_MODEL := R68s/R66s combined + SUPPORTED_DEVICES += fastrhino,r66s fastrhino,r68s + DEVICE_DTS := rk3568-r66s rk3568-r68s + IMAGE/sysupgrade.img.gz := boot-combined | boot-script rk3568-cb | pine64-img | gzip | append-metadata +endef +TARGET_DEVICES += fastrhino_r6xs + define Device/hinlink_opc-h68k $(call Device/rk3568) DEVICE_VENDOR := HINLINK