layerscape: support sysupgrade for squashfs rootfs
authorYangbo Lu <yangbo.lu@nxp.com>
Thu, 28 May 2020 04:48:29 +0000 (12:48 +0800)
committerPetr Štetiar <ynezz@true.cz>
Sat, 11 Jul 2020 12:44:22 +0000 (14:44 +0200)
Support sysupgrade for all Layerscape boards with squashfs
rootfs.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt
package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt
package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt
package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt
package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt
package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt
target/linux/layerscape/base-files/lib/upgrade/platform.sh
target/linux/layerscape/image/armv7.mk
target/linux/layerscape/image/armv8_64b.mk

index 5acd5406ce28497262ae6c55a4d565b26533ab4e..f109a98b855e8e7bda37bd8e6a10d30fd6525956 100644 (file)
@@ -3,6 +3,6 @@ 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=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(rootfs)
+bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware)
 bootcmd=echo starting openwrt ...;pfe stop;run qspi_boot
 bootdelay=3
index 387cfeb9ffec51e8a66713538ab4d4e308bdc297..d6c5f56fd94acf883e6e6aa8924177783add006c 100644 (file)
@@ -3,6 +3,6 @@ loadaddr=0x81000000
 fdt_high=0xffffffff
 initrd_high=0xffffffff
 nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
-bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs) cma=64M@0x0-0xb0000000
+bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) cma=64M@0x0-0xb0000000
 bootcmd=echo starting openwrt ...;run nor_boot
 bootdelay=3
index b040cffdbf8e71952ac17bc58e772dbe900ec9bd..1214bf40c28b9d3b5a032f3bcd1a6fdded833690 100644 (file)
@@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff
 initrd_high=0xffffffffffffffff
 hwconfig=fsl_ddr:bank_intlv=auto
 nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
-bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs)
+bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware)
 bootcmd=echo starting openwrt ...;run nor_boot
 bootdelay=3
index 89acac2a82dfb9b238029dc599e12eed39ebfec8..975b1c1e7fa6be20117cda03a1362007285a7135 100644 (file)
@@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff
 initrd_high=0xffffffffffffffff
 hwconfig=fsl_ddr:bank_intlv=auto
 qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
-bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs)
+bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware)
 bootcmd=echo starting openwrt ...;run qspi_boot
 bootdelay=3
index 78556f31654a7337c1469bb7a1a6be41a4edd2dd..7ab55504054c5c3b9e6037eacf498c1183b9ffb4 100644 (file)
@@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff
 hwconfig=fsl_ddr:bank_intlv=auto
 mc_init=sf probe 0:0;sf read 80000000 a00000 300000;sf read 80300000 e00000 100000;fsl_mc start mc 80000000 80300000;sf read 80400000 d00000 100000;fsl_mc apply dpl 80400000
 qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
-bootargs=root=/dev/mtdblock10 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs)
+bootargs=root=/dev/mtdblock10 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware)
 bootcmd=echo starting openwrt ...;run mc_init;run qspi_boot
 bootdelay=3
index 31e937ffcb6659b6c4bd845ff0ee5f8fe89a5e15..fe2febd2cee7f220e1f2423a0aea2971d04d6691 100644 (file)
@@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff
 hwconfig=fsl_ddr:bank_intlv=auto
 mc_init=fsl_mc start mc 580a00000 580e00000;fsl_mc apply dpl 580d00000
 nor_boot=cp.b 580f00000 $fdtaddr 100000;cp.b 581000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
-bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs)
+bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware)
 bootcmd=echo starting openwrt ...;run mc_init;run nor_boot
 bootdelay=3
index 1e1e28987bc93893d7adb0fcd3675465e07c06f1..9b8c07138fa77574a7314b17f3fe517af2d78e74 100644 (file)
@@ -1,5 +1,6 @@
 #
 # Copyright 2015-2019 Traverse Technologies
+# Copyright 2020 NXP
 #
 
 RAMFS_COPY_BIN="/usr/sbin/fw_printenv /usr/sbin/fw_setenv /usr/sbin/ubinfo /bin/echo"
@@ -33,7 +34,13 @@ platform_check_image() {
                nand_do_platform_check "traverse-ls1043" $1
                return $?
                ;;
-       fsl,ls1012a-frdm)
+       fsl,ls1012a-frdm | \
+       fsl,ls1012a-rdb | \
+       fsl,ls1021a-twr | \
+       fsl,ls1043a-rdb | \
+       fsl,ls1046a-rdb | \
+       fsl,ls1088a-rdb | \
+       fsl,ls2088a-rdb)
                return 0
                ;;
        *)
@@ -55,7 +62,13 @@ platform_do_upgrade() {
        traverse,ls1043s)
                platform_do_upgrade_traverse_nandubi "$1"
                ;;
-       fsl,ls1012a-frdm)
+       fsl,ls1012a-frdm | \
+       fsl,ls1012a-rdb | \
+       fsl,ls1021a-twr | \
+       fsl,ls1043a-rdb | \
+       fsl,ls1046a-rdb | \
+       fsl,ls1088a-rdb | \
+       fsl,ls2088a-rdb)
                PART_NAME=firmware
                default_do_upgrade "$1"
                ;;
index e1a9efb8b6d370e99161e4b9c6a146a6395ffb89..27246740d570a7d4ec6be7679d96ac896582f9f4 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2018 NXP
+# Copyright 2018-2020 NXP
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,11 +8,13 @@
 define Device/Default
   PROFILES := Default
   FILESYSTEMS := squashfs
-  IMAGES := firmware.bin
+  IMAGES := firmware.bin sysupgrade.bin
   KERNEL := kernel-bin | uImage none
   KERNEL_NAME := zImage
   KERNEL_LOADADDR := 0x80008000
   KERNEL_ENTRY_POINT := 0x80008000
+  IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \
+    append-rootfs | pad-rootfs | check-size 50331649 | append-metadata
 endef
 
 define Device/ls1021atwr
@@ -29,6 +31,7 @@ define Device/ls1021atwr
     ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
     append-kernel | pad-to 32M | \
     append-rootfs | pad-rootfs | check-size 67108865
+  SUPPORTED_DEVICES := fsl,ls1021a-twr
 endef
 TARGET_DEVICES += ls1021atwr
 
index 3ad831b0b1d81e034ff714549d8796dfadd268d9..b7208b4c8f51ab7c0f339e6109c15c51187e430f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2018 NXP
+# Copyright 2018-2020 NXP
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -7,11 +7,13 @@
 
 define Device/Default
   PROFILES := Default
-  IMAGES := firmware.bin
+  IMAGES := firmware.bin sysupgrade.bin
   FILESYSTEMS := squashfs
   KERNEL := kernel-bin | gzip | uImage gzip
   KERNEL_LOADADDR := 0x80080000
   KERNEL_ENTRY_POINT := 0x80080000
+  IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \
+    append-rootfs | pad-rootfs | check-size 50331649 | append-metadata
 endef
 
 define Device/ls1012afrdm
@@ -23,7 +25,6 @@ define Device/ls1012afrdm
     kmod-ppfe
   DEVICE_DTS := freescale/fsl-ls1012a-frdm
   BLOCKSIZE := 256KiB
-  IMAGES += sysupgrade.bin
   IMAGE/firmware.bin := \
     ls-clean | \
     ls-append $(1)-bl2.pbl | pad-to 1M | \
@@ -58,6 +59,7 @@ define Device/ls1012ardb
     ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
     append-kernel | pad-to 32M | \
     append-rootfs | pad-rootfs | check-size 67108865
+  SUPPORTED_DEVICES := fsl,ls1012a-rdb
 endef
 TARGET_DEVICES += ls1012ardb
 
@@ -105,6 +107,7 @@ define Device/ls1043ardb
     ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
     append-kernel | pad-to 32M | \
     append-rootfs | pad-rootfs | check-size 67108865
+  SUPPORTED_DEVICES := fsl,ls1043a-rdb
 endef
 TARGET_DEVICES += ls1043ardb
 
@@ -150,6 +153,7 @@ define Device/ls1046ardb
     ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
     append-kernel | pad-to 32M | \
     append-rootfs | pad-rootfs | check-size 67108865
+  SUPPORTED_DEVICES := fsl,ls1046a-rdb
 endef
 TARGET_DEVICES += ls1046ardb
 
@@ -198,6 +202,7 @@ define Device/ls1088ardb
     ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
     append-kernel | pad-to 32M | \
     append-rootfs | pad-rootfs | check-size 67108865
+  SUPPORTED_DEVICES := fsl,ls1088a-rdb
 endef
 TARGET_DEVICES += ls1088ardb
 
@@ -248,6 +253,7 @@ define Device/ls2088ardb
     ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
     append-kernel | pad-to 32M | \
     append-rootfs | pad-rootfs | check-size 67108865
+  SUPPORTED_DEVICES := fsl,ls2088a-rdb
 endef
 TARGET_DEVICES += ls2088ardb