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]>
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>;
};
};
};
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>;
+ };
+ };
};
};
};
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.
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
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
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