]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
airoha: move common Nokia XG-040G properties to dtsi files
authorMikhail Zhilkin <csharper2005@gmail.com>
Mon, 29 Jun 2026 18:52:26 +0000 (21:52 +0300)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sat, 18 Jul 2026 08:21:08 +0000 (10:21 +0200)
Move shared DTS properties for Nokia XG-040G-MD and XG-040G-MF into
common DTSI files to reduce duplication:
- an758x-nokia_xg-040g-common.dtsi
- an758x-nokia_xg-040g-stock-parts.dtsi
- an758x-nokia_xg-040g-ubi-parts.dtsi

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23809
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/airoha/dts/an7581-nokia_xg-040g-md-common.dtsi
target/linux/airoha/dts/an7581-nokia_xg-040g-md-ubi.dts
target/linux/airoha/dts/an7581-nokia_xg-040g-md.dts
target/linux/airoha/dts/an758x-nokia_xg-040g-common.dtsi [new file with mode: 0644]
target/linux/airoha/dts/an758x-nokia_xg-040g-stock-parts.dtsi [new file with mode: 0644]
target/linux/airoha/dts/an758x-nokia_xg-040g-ubi-parts.dtsi [new file with mode: 0644]

index aecddc73da9df48fa2541bfbb63659eaf5b4fb48..1c1c103b7bd964aa0aef386db5a87ae5faa8d017 100644 (file)
@@ -5,26 +5,9 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include "an7581.dtsi"
+#include "an758x-nokia_xg-040g-common.dtsi"
 
 / {
-       aliases {
-               label-mac-device = &gdm1;
-
-               led-boot = &led_power_green;
-               led-failsafe = &led_power_green;
-               led-running = &led_power_green;
-               led-upgrade = &led_power_green;
-
-               serial0 = &uart1;
-       };
-
-       chosen {
-               bootargs = "console=ttyS0,115200 earlycon";
-               stdout-path = "serial0:115200n8";
-               linux,usable-memory-range =
-                       <0x0 0x80200000 0x0 0x1fe00000>;
-       };
-
        gpio-keys {
                compatible = "gpio-keys";
 
                };
        };
 
-       memory@80000000 {
-               device_type = "memory";
-               reg = <0x0 0x80000000 0x0 0x20000000>;
-       };
-
        reg_3p3v: regulator-3p3v {
                compatible = "regulator-fixed";
                regulator-always-on;
        };
 };
 
-&eth {
-       status = "okay";
-};
-
-&eth_pcs {
-       status = "okay";
-};
-
-&i2c0 {
-       status = "okay";
-};
-
 &mdio {
        /* Airoha EN8811 2.5Gbps phy */
        en8811: ethernet-phy@f {
        };
 };
 
-&npu {
-       status = "okay";
-};
-
-&pon_pcs {
-       status = "okay";
-};
-
-&snfi {
-       status = "okay";
-};
-
-/*
- * SkyHigh ML02G300WHI00
- */
-&spi_nand {
-       /*
-        *  ECC must be aligned with bootloader to prevent read errors.
-        *  Stock fw also uses NAND_ECC_NONE.
-        */
-       nand-ecc-mode = "none";
-       nand-ecc-step-size = <2048>;
-       nand-ecc-strength = <0>;
-
-       partitions: partitions {
-               compatible = "fixed-partitions";
-               #address-cells = <1>;
-               #size-cells = <1>;
-       };
-};
-
-&gdm1 {
-       status = "okay";
-
-       nvmem-cell-names = "mac-address";
-       nvmem-cells = <&macaddr_factory_3e (0)>;
-};
-
 &switch {
        status = "okay";
 
index b61f613e7a0af28d3fca684bf38403fccbda9ec5..91c66229d97b29c2ed6488167059d3f85734ead0 100644 (file)
@@ -1,84 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0-only OR MIT
 
 #include "an7581-nokia_xg-040g-md-common.dtsi"
+#include "an758x-nokia_xg-040g-ubi-parts.dtsi"
 
 / {
        model = "Nokia XG-040G-MD (UBI)";
        compatible = "nokia,xg-040g-md-ubi", "airoha,an7581",
                     "airoha,en7581";
-
-       chosen {
-               rootdisk = <&ubi_fit>;
-       };
-};
-
-&partitions {
-       partition@0_all {
-               label = "all_flash";
-               reg = <0x0 0x10000000>;
-               read-only;
-       };
-
-       partition@0 {
-               label = "bl2";
-               reg = <0x0 0x20000>;
-               read-only;
-       };
-
-       partition@20000 {
-               label = "ubi";
-               reg = <0x20000 0xffe0000>;
-               compatible = "linux,ubi";
-
-               volumes {
-                       ubi-volume-bosa {
-                               volname = "bosa";
-                       };
-
-                       ubi-volume-factory {
-                               volname = "ri";
-
-                               nvmem-layout {
-                                       compatible = "fixed-layout";
-
-                                       #address-cells = <1>;
-                                       #size-cells = <1>;
-
-                                       macaddr_factory_3e: macaddr@3e {
-                                               compatible = "mac-base";
-                                               reg = <0x3e 0x6>;
-                                               #nvmem-cell-cells = <1>;
-                                       };
-                               };
-                       };
-
-                       ubi_fit: ubi-volume-fit {
-                               volname = "fit";
-                       };
-
-                       ubi-volume-fip {
-                               volname = "fip";
-                       };
-
-                       ubi_env: ubi-volume-ubootenv {
-                               volname = "ubootenv";
-                       };
-
-                       ubi_env2: ubi-volume-ubootenv2 {
-                               volname = "ubootenv2";
-                       };
-               };
-       };
-};
-
-&ubi_env {
-       nvmem-layout {
-               compatible = "u-boot,env-redundant-bool-layout";
-       };
-};
-
-&ubi_env2 {
-       nvmem-layout {
-               compatible = "u-boot,env-redundant-bool-layout";
-       };
 };
index 5676c78ab64e3f0ffe57e13f3c7b02b2ab18eaf4..8ccf39a92eaa5573ef7ede21ced15bcc6747778b 100644 (file)
@@ -1,152 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-only OR MIT
 
 #include "an7581-nokia_xg-040g-md-common.dtsi"
+#include "an758x-nokia_xg-040g-stock-parts.dtsi"
 
 / {
        model = "Nokia XG-040G-MD";
        compatible = "nokia,xg-040g-md", "airoha,an7581", "airoha,en7581";
-
-       virtual_flash {
-               compatible = "mtd-concat";
-               devices = <&ubi4 &ubi1 &ubi2 &ubi3 &ubi5 &ubi6>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "ubi";
-                               reg = <0x0 0x0>;
-                       };
-               };
-       };
-};
-
-&partitions {
-       partition@0_all {
-               label = "all_flash";
-               reg = <0x0 0xeba0000>;
-               read-only;
-       };
-
-       partition@0 {
-               label = "bootloader";
-               reg = <0x0 0x80000>;
-               read-only;
-       };
-
-       partition@60000 {
-               label = "u-boot-env";
-               reg = <0x60000 0x20000>;
-       };
-
-       partition@80000 {
-               label = "romfile";
-               reg = <0x80000 0x40000>;
-               read-only;
-       };
-
-       partition@c0000 {
-               label = "nsb_1";
-               reg = <0xc0000 0x2880000>;
-
-               compatible = "fixed-partitions";
-               #address-cells = <1>;
-               #size-cells = <1>;
-
-               partition@0 {
-                       label = "kernel";
-                       reg = <0x0 0x800000>;
-               };
-
-               ubi1: partition@800000 {
-                       label = "rootfs_1";
-                       reg = <0x800000 0x2080000>;
-               };
-       };
-
-       ubi2: partition@2940000 {
-               label = "nsb_2";
-               reg = <0x2940000 0x2880000>;
-       };
-
-       partition@51c0000 {
-               label = "bosa";
-               reg = <0x51c0000 0x40000>;
-               read-only;
-       };
-
-       partition@5200000 {
-               label = "ri";
-               reg = <0x5200000 0x40000>;
-               read-only;
-
-               nvmem-layout {
-                       compatible = "fixed-layout";
-
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       macaddr_factory_3e: macaddr@3e {
-                               compatible = "mac-base";
-                               reg = <0x3e 0x6>;
-                               #nvmem-cell-cells = <1>;
-                       };
-               };
-       };
-
-       partition@5240000 {
-               label = "flag";
-               reg = <0x5240000 0x40000>;
-               read-only;
-       };
-
-       partition@5280000 {
-               label = "flagback";
-               reg = <0x5280000 0x40000>;
-               read-only;
-       };
-
-       ubi3: partition@52c0000 {
-               label = "config";
-               reg = <0x52c0000 0xa00000>;
-       };
-
-       ubi4: partition@5cc0000 {
-               label = "data";
-               reg = <0x5cc0000 0x80e0000>;
-       };
-
-       ubi5: partition@dda0000 {
-               label = "oopsfs";
-               reg = <0xdda0000 0x400000>;
-       };
-
-       partition@e1a0000 {
-               label = "log";
-               reg = <0xe1a0000 0xa00000>;
-
-               compatible = "fixed-partitions";
-               #address-cells = <1>;
-               #size-cells = <1>;
-
-               ubi6: partition@0 {
-                       label = "log_truncated";
-                       reg = <0x0 0x9c0000>;
-               };
-
-               /*
-                * Must be excluded from ubi. Otherwise the data
-                * will be broken after U-Boot 'bootflag swap'
-                * command call. This command writes bootflag at
-                * 0xeb60000 (boot_flag_addr).
-                */
-               partition@9c0000 {
-                       label = "bootflag";
-                       reg = <0x9c0000 0x40000>;
-                       read-only;
-               };
-       };
 };
diff --git a/target/linux/airoha/dts/an758x-nokia_xg-040g-common.dtsi b/target/linux/airoha/dts/an758x-nokia_xg-040g-common.dtsi
new file mode 100644 (file)
index 0000000..dff7cd4
--- /dev/null
@@ -0,0 +1,73 @@
+// SPDX-License-Identifier: GPL-2.0-only OR MIT
+
+/ {
+       aliases {
+               label-mac-device = &gdm1;
+
+               led-boot = &led_power_green;
+               led-failsafe = &led_power_green;
+               led-running = &led_power_green;
+               led-upgrade = &led_power_green;
+
+               serial0 = &uart1;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200 earlycon";
+               stdout-path = "serial0:115200n8";
+               linux,usable-memory-range =
+                       <0x0 0x80200000 0x0 0x1fe00000>;
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x0 0x80000000 0x0 0x20000000>;
+       };
+};
+
+&eth {
+       status = "okay";
+};
+
+&eth_pcs {
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+};
+
+&npu {
+       status = "okay";
+};
+
+&pon_pcs {
+       status = "okay";
+};
+
+&snfi {
+       status = "okay";
+};
+
+&spi_nand {
+       /*
+        *  ECC must be aligned with bootloader to prevent read errors.
+        *  Stock fw also uses NAND_ECC_NONE.
+        */
+       nand-ecc-mode = "none";
+       nand-ecc-step-size = <2048>;
+       nand-ecc-strength = <0>;
+
+       partitions: partitions {
+               compatible = "fixed-partitions";
+               #address-cells = <1>;
+               #size-cells = <1>;
+       };
+};
+
+&gdm1 {
+       status = "okay";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_factory_3e (0)>;
+};
diff --git a/target/linux/airoha/dts/an758x-nokia_xg-040g-stock-parts.dtsi b/target/linux/airoha/dts/an758x-nokia_xg-040g-stock-parts.dtsi
new file mode 100644 (file)
index 0000000..7c86aec
--- /dev/null
@@ -0,0 +1,147 @@
+// SPDX-License-Identifier: GPL-2.0-only OR MIT
+
+/ {
+       virtual_flash {
+               compatible = "mtd-concat";
+               devices = <&ubi4 &ubi1 &ubi2 &ubi3 &ubi5 &ubi6>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "ubi";
+                               reg = <0x0 0x0>;
+                       };
+               };
+       };
+};
+
+&partitions {
+       partition@0_all {
+               label = "all_flash";
+               reg = <0x0 0xeba0000>;
+               read-only;
+       };
+
+       partition@0 {
+               label = "bootloader";
+               reg = <0x0 0x80000>;
+               read-only;
+       };
+
+       partition@60000 {
+               label = "u-boot-env";
+               reg = <0x60000 0x20000>;
+       };
+
+       partition@80000 {
+               label = "romfile";
+               reg = <0x80000 0x40000>;
+               read-only;
+       };
+
+       partition@c0000 {
+               label = "nsb_1";
+               reg = <0xc0000 0x2880000>;
+
+               compatible = "fixed-partitions";
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               partition@0 {
+                       label = "kernel";
+                       reg = <0x0 0x800000>;
+               };
+
+               ubi1: partition@800000 {
+                       label = "rootfs_1";
+                       reg = <0x800000 0x2080000>;
+               };
+       };
+
+       ubi2: partition@2940000 {
+               label = "nsb_2";
+               reg = <0x2940000 0x2880000>;
+       };
+
+       partition@51c0000 {
+               label = "bosa";
+               reg = <0x51c0000 0x40000>;
+               read-only;
+       };
+
+       partition@5200000 {
+               label = "ri";
+               reg = <0x5200000 0x40000>;
+               read-only;
+
+               nvmem-layout {
+                       compatible = "fixed-layout";
+
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       macaddr_factory_3e: macaddr@3e {
+                               compatible = "mac-base";
+                               reg = <0x3e 0x6>;
+                               #nvmem-cell-cells = <1>;
+                       };
+               };
+       };
+
+       partition@5240000 {
+               label = "flag";
+               reg = <0x5240000 0x40000>;
+               read-only;
+       };
+
+       partition@5280000 {
+               label = "flagback";
+               reg = <0x5280000 0x40000>;
+               read-only;
+       };
+
+       ubi3: partition@52c0000 {
+               label = "config";
+               reg = <0x52c0000 0xa00000>;
+       };
+
+       ubi4: partition@5cc0000 {
+               label = "data";
+               reg = <0x5cc0000 0x80e0000>;
+       };
+
+       ubi5: partition@dda0000 {
+               label = "oopsfs";
+               reg = <0xdda0000 0x400000>;
+       };
+
+       partition@e1a0000 {
+               label = "log";
+               reg = <0xe1a0000 0xa00000>;
+
+               compatible = "fixed-partitions";
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               ubi6: partition@0 {
+                       label = "log_truncated";
+                       reg = <0x0 0x9c0000>;
+               };
+
+               /*
+                * Must be excluded from ubi. Otherwise the data
+                * will be broken after U-Boot 'bootflag swap'
+                * command call. This command writes bootflag at
+                * 0xeb60000 (boot_flag_addr).
+                */
+               partition@9c0000 {
+                       label = "bootflag";
+                       reg = <0x9c0000 0x40000>;
+                       read-only;
+               };
+       };
+};
diff --git a/target/linux/airoha/dts/an758x-nokia_xg-040g-ubi-parts.dtsi b/target/linux/airoha/dts/an758x-nokia_xg-040g-ubi-parts.dtsi
new file mode 100644 (file)
index 0000000..7a72632
--- /dev/null
@@ -0,0 +1,78 @@
+// SPDX-License-Identifier: GPL-2.0-only OR MIT
+
+/ {
+       chosen {
+               rootdisk = <&ubi_fit>;
+       };
+};
+
+&partitions {
+       partition@0_all {
+               label = "all_flash";
+               reg = <0x0 0x10000000>;
+               read-only;
+       };
+
+       partition@0 {
+               label = "bl2";
+               reg = <0x0 0x20000>;
+               read-only;
+       };
+
+       partition@20000 {
+               label = "ubi";
+               reg = <0x20000 0xffe0000>;
+               compatible = "linux,ubi";
+
+               volumes {
+                       ubi-volume-bosa {
+                               volname = "bosa";
+                       };
+
+                       ubi-volume-factory {
+                               volname = "ri";
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       macaddr_factory_3e: macaddr@3e {
+                                               compatible = "mac-base";
+                                               reg = <0x3e 0x6>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
+                       };
+
+                       ubi_fit: ubi-volume-fit {
+                               volname = "fit";
+                       };
+
+                       ubi-volume-fip {
+                               volname = "fip";
+                       };
+
+                       ubi_env: ubi-volume-ubootenv {
+                               volname = "ubootenv";
+                       };
+
+                       ubi_env2: ubi-volume-ubootenv2 {
+                               volname = "ubootenv2";
+                       };
+               };
+       };
+};
+
+&ubi_env {
+       nvmem-layout {
+               compatible = "u-boot,env-redundant-bool-layout";
+       };
+};
+
+&ubi_env2 {
+       nvmem-layout {
+               compatible = "u-boot,env-redundant-bool-layout";
+       };
+};