layerscape: ls1012afrdm: introduce dynamic partitioning
authorTomasz Maciej Nowak <tomek_n@o2.pl>
Tue, 25 Feb 2020 19:07:39 +0000 (20:07 +0100)
committerPetr Štetiar <ynezz@true.cz>
Thu, 12 Mar 2020 11:59:44 +0000 (12:59 +0100)
Combine fixed sizes of "kernel" and "rootfs" partitions into one
partition managed by OpenWrt splitter, it will allow better management
of chip capacity and less maintenance burden when compiled kernel image
will outgrow allocated size for kernel partition. This also changes kernel
image format, since splitter only manages kernel and rootfs partitions,
the dtb needs to be updated with the kernel, so for convenience, kernel is
packed to FIT image.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
package/boot/uboot-layerscape/files/ls1012afrdm-uEnv.txt
target/linux/layerscape/armv8_64b/config-4.14
target/linux/layerscape/image/armv8_64b.mk

index 0f213d85e8f8795b364de3bd8839269f7e129fe7..415155810e44105b2bf22218ef09a0640dbff12f 100644 (file)
@@ -2,7 +2,7 @@ fdtaddr=0x8f000000
 loadaddr=0x81000000
 fdt_high=0xffffffffffffffff
 initrd_high=0xffffffffffffffff
-qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
-bootargs=rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.quadspi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(rootfs)
+qspi_boot=sf probe 0:0;sf read $loadaddr 1000000 2800000;bootm $loadaddr
+bootargs=rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.quadspi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),-(firmware)
 bootcmd=echo starting OpenWrt ...;pfe stop;run qspi_boot
 bootdelay=3
index 54e6d4cd9d29eab7fe7f580632ae53f8dbd8acfc..c1bd7183669ceb079dc8c017e7d480c287cd460c 100644 (file)
@@ -630,6 +630,8 @@ CONFIG_MTD_NAND_FSL_IFC=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIT_FW=y
 CONFIG_MTD_SST25L=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_BEB_LIMIT=20
index 70af95aa28debbc2faf77fc8582c793ee530683b..3a7b28c4168bc57bff9f640352b0187848ed606c 100644 (file)
@@ -32,8 +32,9 @@ define Device/ls1012afrdm
     ls-append $(1)-uboot-env.bin | pad-to 10M | \
     ls-append pfe.itb | pad-to 15M | \
     ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
-    append-kernel | pad-to 32M | \
+    append-kernel | pad-to $$(BLOCKSIZE) | \
     append-rootfs | pad-rootfs | check-size 67108865
+  KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
   KERNEL_INITRAMFS := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
 endef
 TARGET_DEVICES += ls1012afrdm