econet: standardize partitions in DTS files
authorCaleb James DeLisle <[email protected]>
Fri, 7 Nov 2025 16:59:10 +0000 (16:59 +0000)
committerHauke Mehrtens <[email protected]>
Thu, 4 Dec 2025 21:58:00 +0000 (22:58 +0100)
In preparation for the introduction of ethernet, this patch normalizes the
partitions in the devices in DT so that the partition to upgrade will
always be called tclinux, no matter what it is called from the factory.
Also fix a math error in Nokia G240G-E partition table and remove leading
zeros from paritition offsets.

Finally, add NVMEM mac-address entries where they are left by the
factory. In preparation for the introduction of Ethernet and Wifi
support.

Signed-off-by: Caleb James DeLisle <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20685
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/econet/dts/en751221_nokia_g240g-e.dts
target/linux/econet/dts/en751221_smartfiber_xp8421-b.dts
target/linux/econet/dts/en751221_tplink_archer-vr1200v-v2.dts
target/linux/econet/en751221/config-6.12

index 7d82b566ccf8510c55afb25c1f91b17f52ae5ea7..bea569cdbc26d4e18fdc9e65b40b0de6b0746a85 100644 (file)
 
                partition@0 {
                        label = "bootloader";
-                       reg = <0x00000000 0x00040000>;
+                       reg = <0x0 0x40000>;
                        read-only;
                };
 
                partition@40000 {
-                       // Unused
                        label = "romfile";
-                       reg = <0x00040000 0x00040000>;
+                       reg = <0x40000 0x40000>;
                };
 
                partition@80000 {
-                       // trx - OpenWRT kernel is 4MB, factory is 3MB
-                       label = "kernel";
-                       reg = <0x00080000 0x00400000>;
+                       label = "tclinux";
+                       reg = <0x80000 0x2200000>;
+                       econet,enable-remap;
                };
 
-               partition@380000 {
-                       // squashfs
+               partition@480000 {
                        label = "rootfs";
-                       reg = <0x00480000 0x01F00000>;
+                       reg = <0x480000 0x1e00000>;
                        linux,rootfs;
                };
 
                partition@2280000 {
-                       // trx
                        label = "kernel_slave";
-                       reg = <0x02280000 0x00300000>;
+                       reg = <0x2280000 0x300000>;
                };
 
                partition@2580000 {
-                       // squashfs
                        label = "rootfs_slave";
-                       reg = <0x02580000 0x01F00000>;
+                       reg = <0x2580000 0x1f00000>;
                };
 
                partition@4480000 {
-                       // trx
                        label = "kernel_oflt";
-                       reg = <0x04480000 0x00300000>;
+                       reg = <0x4480000 0x300000>;
                };
 
                partition@4780000 {
-                       // squashfs
                        label = "rootfs_oflt";
-                       reg = <0x04780000 0x00C00000>;
+                       reg = <0x4780000 0xc00000>;
                };
 
                partition@5380000 {
-                       // UBI
                        label = "config";
-                       reg = <0x05380000 0x00800000>;
+                       reg = <0x5380000 0x800000>;
                };
 
                partition@5b80000 {
-                       // UBI
                        label = "log";
-                       reg = <0x05b80000 0x00C00000>;
+                       reg = <0x5b80000 0xc00000>;
                };
 
                partition@6780000 {
-                       // UBI / unused
                        label = "extfs";
-                       reg = <0x06780000 0x00600000>;
+                       reg = <0x6780000 0x600000>;
                };
 
                partition@6d80000 {
-                       // binary
                        label = "bosa";
-                       reg = <0x06d80000 0x00040000>;
+                       reg = <0x6d80000 0x40000>;
                };
 
                partition@6dc0000 {
                        label = "flag";
-                       reg = <0x06dc0000 0x00040000>;
+                       reg = <0x6dc0000 0x40000>;
                };
 
                partition@6e00000 {
                        label = "flagback";
-                       reg = <0x06e00000 0x00040000>;
+                       reg = <0x6e00000 0x40000>;
                };
 
                partition@6e40000 {
                        label = "ri";
-                       reg = <0x06e40000 0x00040000>;
+                       reg = <0x6e40000 0x40000>;
+
+                       nvmem-layout {
+                               compatible = "fixed-layout";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               macaddr_ri_3e: macaddr@3e {
+                                       compatible = "mac-base";
+                                       reg = <0x3e 0x6>;
+                                       #nvmem-cell-cells = <1>;
+                               };
+                       };
                };
 
                partition@6e80000 {
                        label = "riback";
-                       reg = <0x06e80000 0x00040000>;
+                       reg = <0x6e80000 0x40000>;
                };
        };
 };
index 45654492a82ceac0092ed25c2f766aa38d32e599..314c98fc5ebf7e33b27072831368197370fa0ce7 100644 (file)
                        label = "bootloader";
                        reg = <0x0 0x40000>;
                        read-only;
+
+                       nvmem-layout {
+                               compatible = "fixed-layout";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               macaddr_bootloader_ff48: macaddr@ff48 {
+                                       compatible = "mac-base";
+                                       reg = <0xff48 0x6>;
+                                       #nvmem-cell-cells = <1>;
+                               };
+                       };
                };
 
                partition@40000 {
                        label = "romfile";
                        reg = <0x40000 0x40000>;
-                       read-only;
                };
 
                partition@80000 {
                        label = "tclinux";
                        reg = <0x80000 0x1400000>;
-                       read-only;
                        econet,enable-remap;
                };
 
-               /* Nested inside of tclinux */
                partition@480000 {
                        label = "rootfs";
                        reg = <0x480000 0xf80000>;
                        linux,rootfs;
-                       read-only;
                };
 
                partition@1480000 {
                partition@de40000 {
                        label = "reservearea";
                        reg = <0xde40000 0x1c0000>;
+
+                       nvmem-layout {
+                               compatible = "fixed-layout";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               eeprom_reserve_140000: eeprom@140000 {
+                                       /* MT7592 */
+                                       reg = <0x140000 0x200>;
+                               };
+
+                               eeprom_reserve_180040: eeprom@180040 {
+                                       /* MT7612E */
+                                       reg = <0x180040 0x600>;
+                               };
+                       };
                };
        };
 };
index 1866b446fdf7214574845bda4d1d6fb092546e89..56dec97c271f8da6d85a47b1440d530a1dce1823 100644 (file)
 
                partition@0 {
                        label = "bootloader";
-                       reg = <0x0 0x00080000>;
+                       reg = <0x0 0x80000>;
                        read-only;
                };
+
                partition@80000 {
                        label = "misc";
-                       reg = <0x00080000 0x140000>;
+                       reg = <0x80000 0x140000>;
+                       nvmem-layout {
+                               compatible = "fixed-layout";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               eeprom_misc_80000: eeprom@80000 {
+                                       /* MT7592 */
+                                       reg = <0x80000 0x200>;
+                               };
+
+                               eeprom_misc_a0000: eeprom@a0000 {
+                                       /* MT7613BE */
+                                       reg = <0xa0000 0x600>;
+                               };
+
+                               macaddr_misc_8f100: macaddr@8f100 {
+                                       compatible = "mac-base";
+                                       reg = <0x4f100 0x6>;
+                                       #nvmem-cell-cells = <1>;
+                               };
+                       };
                };
-               partition@1c0200 {
-                       label = "kernel";
-                       reg = <0x001c0000 0x400000>;
+
+               partition@1c0000 {
+                       label = "tclinux";
+                       reg = <0x1c0000 0x1e40000>;
+                       econet,enable-remap;
                };
+
                partition@5c0000 {
                        label = "rootfs";
-                       reg = <0x005c0000 0x1a40000>;
+                       reg = <0x5c0000 0x1a40000>;
                        linux,rootfs;
                };
-               partition@1c0000 {
-                       label = "firmware";
-                       reg = <0x001c0000 0x1e40000>;
-               };
+
                partition@2000000 {
                        label = "firmware_factory";
                        reg = <0x2000000 0x1e40000>;
                };
+
+               partition@3e40000 {
+                       label = "unused";
+                       reg = <0x3e40000 0x1a0000>;
+               };
+
                partition@3fe0000 {
                        label = "reserve";
                        reg = <0x3fe0000 0x20000>;
                };
+
                partition@4000000 {
                        label = "openwrt_ubi";
                        /* From the factory this is unallocated space, so it's ours for the taking.
index 653019f9c5f54abc9fa3b19db097e80662d38d8e..86991c39638d2e369181b63aca67508c6ca160f5 100644 (file)
@@ -120,6 +120,9 @@ CONFIG_NET_INGRESS=y
 CONFIG_NET_XGRESS=y
 CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
 CONFIG_NR_CPUS=2
+CONFIG_NVMEM=y
+CONFIG_NVMEM_LAYOUTS=y
+CONFIG_NVMEM_SYSFS=y
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
 CONFIG_OF_EARLY_FLATTREE=y
@@ -141,6 +144,7 @@ CONFIG_RANDSTRUCT_NONE=y
 CONFIG_RATIONAL=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
+CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=y
 CONFIG_SERIAL_MCTRL_GPIO=y
 CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_SGL_ALLOC=y
@@ -152,7 +156,6 @@ CONFIG_SPI=y
 CONFIG_SPI_AIROHA_EN7523=y
 CONFIG_SPI_MASTER=y
 CONFIG_SPI_MEM=y
-CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
 CONFIG_SYSCTL_EXCEPTION_TRACE=y
 CONFIG_SYS_HAS_CPU_MIPS32_R1=y
 CONFIG_SYS_HAS_CPU_MIPS32_R2=y