]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ath79: add env-size for Sitecom WLR-7100 / WLR-8100 u-boot-env 22030/head
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 15 Feb 2026 02:06:53 +0000 (03:06 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Tue, 17 Feb 2026 00:36:52 +0000 (01:36 +0100)
The Linux kernel assumes that the u-boot environment covers the full
partition, but it only covers 0x1000 bytes. Linux checks the CRC and
does this over the full partition. This fails like this:
```
u-boot-env-layout 1f000000.spi:flash@0:partitions:partition@30000:nvmem-layout: Invalid calculated CRC32: 0xfcac8c41 (expected: 0x14e6335a)
u-boot-env-layout 1f000000.spi:flash@0:partitions:partition@30000:nvmem-layout: probe with driver u-boot-env-layout failed with error -22
```

Define the u-boot environment with a length of 0x1000 bytes to calculate
the CRC only over this area.

When replicating the u-boot environment with these parameters it
generates the same CRC:
```
mkenvimage -p 0 -b -s 0x1000 -o output.bin input.txt
```

Fixes: https://github.com/openwrt/openwrt/issues/21696
Fixes: 5e3a602def72 ("ath79: sitecom,wlrx100: use nvmem")
Link: https://github.com/openwrt/openwrt/pull/22030
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts
target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts

index 7903f3d73f1b550af7ee8e0748402e02ca41d4bb..da5eba26de9c000a53a8bd65edd83823defd4608 100644 (file)
 
                                nvmem-layout {
                                        compatible = "u-boot,env";
+                                       env-size = <0x1000>;
 
                                        macaddr_uboot_ethaddr: ethaddr {
                                                #nvmem-cell-cells = <1>;
index 9978a3d7d1405c8d2f41bbecc87a3807150ca55e..e29076d696681a84b481611aa203b3567edf4aae 100644 (file)
@@ -83,6 +83,7 @@
 
                                nvmem-layout {
                                        compatible = "u-boot,env";
+                                       env-size = <0x1000>;
 
                                        macaddr_uboot_ethaddr: ethaddr {
                                                #nvmem-cell-cells = <1>;