From 0822040671e6177020892e0ddbdfafd4bb3690e0 Mon Sep 17 00:00:00 2001
From: Pawel Dembicki <paweldembicki@gmail.com>
Date: Tue, 18 Apr 2023 11:37:04 +0200
Subject: [PATCH] package: layerscape: change loadaddr address

At this moment loadaddr in most layerscape boards are configured to
0x81000000. 5.15 kernel on some boards is bigger than 5.10 and it cause error:

Loading kernel from FIT Image at 81000000 ...

Using 'config-1' configuration
Trying 'kernel-1' kernel subimage
Description: ARM64 OpenWrt Linux-5.15.112
Created: 2023-05-21 17:39:35 UTC
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x810000ec
Data Size: 7513944 Bytes = 7.2 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x80000000
Entry Point: 0x80000000
Hash algo: crc32
Hash value: 6fd69550
Hash algo: sha1
Hash value: ee34c753ffb615e199a428762824ad4a0aaef90a
Verifying Hash Integrity ... crc32+ sha1+ OK
Loading fdt from FIT Image at 81000000 ...

Using 'config-1' configuration
Trying 'fdt-1' fdt subimage
Description: ARM64 OpenWrt fsl_ls1088a-rdb-sdboot device tree blob
Created: 2023-05-21 17:39:35 UTC
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x8172a98c
Data Size: 19794 Bytes = 19.3 KiB
Architecture: AArch64
Hash algo: crc32
Hash value: 59792ba3
Hash algo: sha1
Hash value: 135585a49f86cd85acea559b78b0098ae99d5e12
Verifying Hash Integrity ... crc32+ sha1+ OK
Booting using the fdt blob at 0x8172a98c
Uncompressing Kernel Image
ERROR: new format image overwritten - must RESET the board to recover
resetting ...

This patch changes loadaddr to 0x88000000 (like LS1012A-FRDM board) to
avoid overlapping for bigger images (like initramfs) too.

Tested-by: Alexandra Alth <alexandra@alth.de> [LS1088ARDB]
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
---
 .../uboot-layerscape/files/fsl_ls1012a-frwy-sdboot-uEnv.txt     | 2 +-
 package/boot/uboot-layerscape/files/fsl_ls1012a-rdb-uEnv.txt    | 2 +-
 .../boot/uboot-layerscape/files/fsl_ls1021a-iot-sdboot-uEnv.txt | 2 +-
 .../boot/uboot-layerscape/files/fsl_ls1021a-twr-sdboot-uEnv.txt | 2 +-
 package/boot/uboot-layerscape/files/fsl_ls1021a-twr-uEnv.txt    | 2 +-
 .../boot/uboot-layerscape/files/fsl_ls1043a-rdb-sdboot-uEnv.txt | 2 +-
 package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-uEnv.txt    | 2 +-
 .../uboot-layerscape/files/fsl_ls1046a-frwy-sdboot-uEnv.txt     | 2 +-
 package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-uEnv.txt   | 2 +-
 .../boot/uboot-layerscape/files/fsl_ls1046a-rdb-sdboot-uEnv.txt | 2 +-
 package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-uEnv.txt    | 2 +-
 .../boot/uboot-layerscape/files/fsl_ls1088a-rdb-sdboot-uEnv.txt | 2 +-
 package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-uEnv.txt    | 2 +-
 package/boot/uboot-layerscape/files/fsl_ls2088a-rdb-uEnv.txt    | 2 +-
 .../boot/uboot-layerscape/files/fsl_lx2160a-rdb-sdboot-uEnv.txt | 2 +-
 package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-uEnv.txt    | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/package/boot/uboot-layerscape/files/fsl_ls1012a-frwy-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1012a-frwy-sdboot-uEnv.txt
index 592158955e8..18efdc1bc34 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1012a-frwy-sdboot-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1012a-frwy-sdboot-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 fdt_high=0x8fffffff
 initrd_high=0xffffffffffffffff
 sd_boot=ext4load mmc 0:1 $loadaddr fitImage;bootm $loadaddr
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1012a-rdb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1012a-rdb-uEnv.txt
index 8d57d51ece7..0898354e774 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1012a-rdb-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1012a-rdb-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 bootm_size=0x10000000
 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),49m@0xf00000(firmware)
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1021a-iot-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1021a-iot-sdboot-uEnv.txt
index ae0d6a6f96b..f8ec2c10fe8 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1021a-iot-sdboot-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1021a-iot-sdboot-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 fdt_high=0x8fffffff
 initrd_high=0xffffffff
 sd_boot=ext4load mmc 0:1 ${loadaddr} fitImage;bootm ${loadaddr}
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-sdboot-uEnv.txt
index 55620d67257..d7f67e78ec8 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-sdboot-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-sdboot-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 fdt_high=0x8fffffff
 initrd_high=0xffffffff
 sd_boot=ext4load mmc 0:1 $loadaddr fitImage;bootm $loadaddr
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-uEnv.txt
index 6d4647b1fd6..26fb3e9207b 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 bootm_size=0x10000000
 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),49m@0xf00000(firmware) cma=64M@0x0-0xb0000000
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-sdboot-uEnv.txt
index 3c39c2263de..591210eea73 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-sdboot-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-sdboot-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 fdt_high=0x8fffffff
 initrd_high=0xffffffffffffffff
 hwconfig=fsl_ddr:bank_intlv=auto
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-uEnv.txt
index acb61ca00a3..c601cab92f8 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 bootm_size=0x10000000
 hwconfig=fsl_ddr:bank_intlv=auto
 nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-sdboot-uEnv.txt
index 303157cb800..e69332efacb 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-sdboot-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-sdboot-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 bootm_size=0x10000000
 hwconfig=fsl_ddr:bank_intlv=auto
 sd_boot=ext4load mmc 0:1 ${loadaddr} fitImage;bootm ${loadaddr}
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-uEnv.txt
index 5461bba9b66..ad5cc77841d 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1046a-frwy-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 bootm_size=0x10000000
 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
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-sdboot-uEnv.txt
index 3c39c2263de..591210eea73 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-sdboot-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-sdboot-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 fdt_high=0x8fffffff
 initrd_high=0xffffffffffffffff
 hwconfig=fsl_ddr:bank_intlv=auto
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-uEnv.txt
index e52e48802bc..dab8faaf132 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 bootm_size=0x10000000
 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
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-sdboot-uEnv.txt
index f616cb13986..5b235378448 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-sdboot-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-sdboot-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 fdt_high=0xa0000000
 initrd_high=0xffffffffffffffff
 hwconfig=fsl_ddr:bank_intlv=auto
diff --git a/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-uEnv.txt
index 210c18721df..a15717bcb80 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 fdt_high=0xa0000000
 initrd_high=0xffffffffffffffff
 hwconfig=fsl_ddr:bank_intlv=auto
diff --git a/package/boot/uboot-layerscape/files/fsl_ls2088a-rdb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls2088a-rdb-uEnv.txt
index 946029d1f16..646aed44278 100644
--- a/package/boot/uboot-layerscape/files/fsl_ls2088a-rdb-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_ls2088a-rdb-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 fdt_high=0xa0000000
 initrd_high=0xffffffffffffffff
 hwconfig=fsl_ddr:bank_intlv=auto
diff --git a/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-sdboot-uEnv.txt
index d1373199150..2d8043d7b1b 100644
--- a/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-sdboot-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-sdboot-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 bootm_size=0x10000000
 hwconfig=fsl_ddr:bank_intlv=auto
 mc_init=mmc read 80000000 5000 1800;mmc read 80300000 7000 800;fsl_mc start mc 80000000 80300000;mmc read 80400000 6800 800;fsl_mc apply dpl 80400000
diff --git a/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-uEnv.txt
index 41fde35c88c..16f905afc68 100644
--- a/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-uEnv.txt
+++ b/package/boot/uboot-layerscape/files/fsl_lx2160a-rdb-uEnv.txt
@@ -1,5 +1,5 @@
 fdtaddr=0x8f000000
-loadaddr=0x81000000
+loadaddr=0x88000000
 bootm_size=0x10000000
 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