From: Mikhail Zhilkin Date: Mon, 29 Jun 2026 18:52:26 +0000 (+0300) Subject: airoha: move common Nokia XG-040G properties to dtsi files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05c4cb954e481316fea45462c0da174eaef733d2;p=thirdparty%2Fopenwrt.git airoha: move common Nokia XG-040G properties to dtsi files 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 Link: https://github.com/openwrt/openwrt/pull/23809 Signed-off-by: Jonas Jelonek --- diff --git a/target/linux/airoha/dts/an7581-nokia_xg-040g-md-common.dtsi b/target/linux/airoha/dts/an7581-nokia_xg-040g-md-common.dtsi index aecddc73da9..1c1c103b7bd 100644 --- a/target/linux/airoha/dts/an7581-nokia_xg-040g-md-common.dtsi +++ b/target/linux/airoha/dts/an7581-nokia_xg-040g-md-common.dtsi @@ -5,26 +5,9 @@ #include #include #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"; @@ -83,11 +66,6 @@ }; }; - memory@80000000 { - device_type = "memory"; - reg = <0x0 0x80000000 0x0 0x20000000>; - }; - reg_3p3v: regulator-3p3v { compatible = "regulator-fixed"; regulator-always-on; @@ -153,18 +131,6 @@ }; }; -ð { - status = "okay"; -}; - -ð_pcs { - status = "okay"; -}; - -&i2c0 { - status = "okay"; -}; - &mdio { /* Airoha EN8811 2.5Gbps phy */ en8811: ethernet-phy@f { @@ -190,44 +156,6 @@ }; }; -&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"; diff --git a/target/linux/airoha/dts/an7581-nokia_xg-040g-md-ubi.dts b/target/linux/airoha/dts/an7581-nokia_xg-040g-md-ubi.dts index b61f613e7a0..91c66229d97 100644 --- a/target/linux/airoha/dts/an7581-nokia_xg-040g-md-ubi.dts +++ b/target/linux/airoha/dts/an7581-nokia_xg-040g-md-ubi.dts @@ -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"; - }; }; diff --git a/target/linux/airoha/dts/an7581-nokia_xg-040g-md.dts b/target/linux/airoha/dts/an7581-nokia_xg-040g-md.dts index 5676c78ab64..8ccf39a92ea 100644 --- a/target/linux/airoha/dts/an7581-nokia_xg-040g-md.dts +++ b/target/linux/airoha/dts/an7581-nokia_xg-040g-md.dts @@ -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 index 00000000000..dff7cd4ba86 --- /dev/null +++ b/target/linux/airoha/dts/an758x-nokia_xg-040g-common.dtsi @@ -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>; + }; +}; + +ð { + status = "okay"; +}; + +ð_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 index 00000000000..7c86aec8645 --- /dev/null +++ b/target/linux/airoha/dts/an758x-nokia_xg-040g-stock-parts.dtsi @@ -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 index 00000000000..7a726322a5a --- /dev/null +++ b/target/linux/airoha/dts/an758x-nokia_xg-040g-ubi-parts.dtsi @@ -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"; + }; +};