apm821xx: add u-boot,env compatible
authorChristian Lamparter <chunkeey@gmail.com>
Fri, 9 Jun 2023 18:34:02 +0000 (20:34 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Sat, 2 Mar 2024 13:08:04 +0000 (14:08 +0100)
Note about the MyBook Live.
The MyBook Live didn't have the encompassing fixed-partitions.
This is needed for the u-boot,env compatible to be read as otherwise
the kernel assumes this is a legacy NOR/NAND node and this binding
is unsupported.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
target/linux/apm821xx/config-6.1
target/linux/apm821xx/dts/meraki-mr24.dts
target/linux/apm821xx/dts/meraki-mx60.dts
target/linux/apm821xx/dts/netgear-wndap6x0.dtsi
target/linux/apm821xx/dts/wd-mybooklive.dts

index 2979312101b602c3e82d43eb528e3467d5c52fed..bde05e2f122b75c6a2f8a9fcaf47861dd74e972f 100644 (file)
@@ -153,6 +153,7 @@ CONFIG_NR_CPUS=1
 CONFIG_NR_IRQS=512
 CONFIG_NVMEM=y
 CONFIG_NVMEM_SYSFS=y
+CONFIG_NVMEM_U_BOOT_ENV=y
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
 CONFIG_OF_EARLY_FLATTREE=y
index 14bedc59843c5b35728ce473ef1f84d8f8014a17..a49a4de13fa1b3867b2f9856c535a565572f8031 100644 (file)
                                 * blocks (64KiB) in order to have spares
                                 * around for bad block management
                                 */
-                                       label = "u-boot-env";
-                                       reg = <0x00150000 0x00010000>;
-                                       read-only;
-                               };
+                               label = "u-boot-env";
+                               compatible = "u-boot,env";
+                               reg = <0x00150000 0x00010000>;
+                               read-only;
+                       };
 
                        partition@160000 {
                                /*
index 0e343ed7825e2b0cea4e0a81ba01bb57a2636803..d9568d92635b4db64a29347123850a094f86213e 100644 (file)
@@ -61,6 +61,7 @@
                        partition@100000 {
                                label = "u-boot-env";
                                reg = <0x00100000 0x00100000>;
+                               compatible = "u-boot,env";
                                read-only;
                        };
 
index 144b17950e86a89b07247a475b135e5c43de7a7f..2921bfedb91370be4816d5ec5221be4592258546 100644 (file)
                        };
 
                        partition@100000 {
+                               compatible = "u-boot,env";
                                label = "u-boot-env";
-                               reg = <0x00100000 0x00010000>;
+                               reg = <0x00100000 0x0004000>;
                                read-only;
+
+                               ethaddr {
+                               };
+
+                               bootcmd {
+                               };
+
+                               serno {
+                               };
+
+                               ProductID {
+                               };
+
+                               HardwareVer {
+                               };
                        };
 
+                       /* 0x104000 - 0x10ffff free */
+
                        partition@110000 {
                                label = "firmware";
                                reg = <0x00110000 0x01ac0000>;
index 588f45078cd470ac9da5a7e5e0c7b82ecaa75819..5ed865e286c849538b51e934be42370c0ab1791a 100644 (file)
 &POB0 {
        ebc {
                nor_flash@0,0 {
-                       status = "okay";
-                       compatible = "microchip,sst39vf040", "jedec-flash";
-                       bank-width = <1>;
-                       reg = <0x00000000 0x00000000 0x00080000>;
+                       status = "okay";
+                       compatible = "jedec-flash"; /* "microchip,sst39vf040 */
+                       bank-width = <1>;
+                       reg = <0x00000000 0x00000000 0x00080000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
 
-                       partition@0 {
-                               /* Part of bootrom - Don't use it without a jump */
-                               label = "free";
-                               reg = <0x00000000 0x0001e000>;
-                               read-only;
-                       };
+                       partitions {
+                               compatible = "fixed-partitions";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               partition@0 {
+                                       /* Part of bootrom - Don't use it without a jump */
+                                       label = "free";
+                                       reg = <0x00000000 0x0001e000>;
+                                       read-only;
+                               };
+
+                               partition@1e000 {
+                                       compatible = "fixed-partitions";
+                                       reg = <0x0001e000 0x00002000>;
+                                       label = "u-boot-env";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       partition@0 {
+                                               compatible = "u-boot,env-redundant-bool";
+                                               reg = <0x00000000 0x00001000>;
+                                               label = "u-boot-env-1";
+
+                                               ethaddr {
+                                               };
+                                       };
+
+/*
+ * Causes the following warning: * sysfs: cannot create duplicate filename '/bus/nvmem/devices/u-boot-env0'
+ *
+ *                                     partition@1000 {
+ *                                             compatible = "u-boot,env-redundant-bool";
+ *                                             reg = <0x00001000 0x00001000>;
+ *                                             label = "u-boot-env-2";
+ *
+ *                                     };
+ */
+                               };
 
-                       partition@1e000 {
-                               label = "env";
-                               reg = <0x0001e000 0x00002000>;
-                               read-only;
-                       };
 
-                       partition@20000 {
-                               label = "uboot";
-                               reg = <0x00020000 0x00050000>;
-                               read-only;
+                               partition@20000 {
+                                       label = "uboot";
+                                       reg = <0x00020000 0x00050000>;
+                                       read-only;
+                               };
                        };
                };
        };