From 6e27a132058f4f60ba1aa68989e4a4de366a6557 Mon Sep 17 00:00:00 2001 From: Andreas Gnau Date: Tue, 7 Jan 2025 23:04:30 +0100 Subject: [PATCH] ramips: mt7621: Move common DNA EX400 defs to dtsi Move common definitions for DNA Valokuitu Plus EX400 to a dtsi include. This is in preparation of adding the non-branded variant of the device produced by Genexis / Inteno in the next commit. The device with DNA branding differs in the LED labling on the device. Signed-off-by: Andreas Gnau Link: https://github.com/openwrt/openwrt/pull/17551 (cherry picked from commit e8603f3b5a15856fccee2e02a5406ca9c8b2ba1d) Link: https://github.com/openwrt/openwrt/pull/18238 Signed-off-by: Hauke Mehrtens --- .../dts/mt7621_dna_valokuitu-plus-ex400.dts | 125 +---------------- .../mt7621_genexis_pulse-ex400-common.dtsi | 128 ++++++++++++++++++ 2 files changed, 129 insertions(+), 124 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi diff --git a/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts b/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts index cc5b4b71d07..9bbe91beef0 100644 --- a/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts +++ b/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts @@ -1,131 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621.dtsi" - -#include -#include -#include +#include "mt7621_genexis_pulse-ex400-common.dtsi" / { compatible = "dna,valokuitu-plus-ex400", "mediatek,mt7621-soc"; model = "DNA Valokuitu Plus EX400"; - - aliases { - ethernet0 = &gmac0; - label-mac-device = &gmac0; - led-boot = &led_status_red; - led-failsafe = &led_status_red; - led-running = &led_status_green; - led-upgrade = &led_update_green; - }; - - chosen { - bootargs-override = "console=ttyS0,115200 rootfstype=squashfs,jffs2"; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_status_green: led-0 { - color = ; - function = LED_FUNCTION_STATUS; - gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - }; - - led_status_red: led-1 { - color = ; - function = LED_FUNCTION_STATUS; - gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; - }; - - led_update_green: led-2 { - color = ; - function = LED_FUNCTION_PROGRAMMING; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&pcie { - status = "okay"; -}; - -&nand { - status = "okay"; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - reg = <0x00 0x100000>; - label = "uboot"; - read-only; - }; - - partition@100000 { - reg = <0x100000 0xff00000>; - label = "ubi"; - compatible = "linux,ubi"; - - volumes { - ubi-volume-env1 { - volname = "env1"; - - nvmem-layout { - compatible = "u-boot,env-redundant-count"; - - ethaddr: ethaddr { - #nvmem-cell-cells = <1>; - }; - }; - }; - }; - }; - }; -}; - -&gmac1 { - label = "wan"; - phy-handle = <ðphy0>; - nvmem-cells = <ðaddr 1>; - nvmem-cell-names = "mac-address"; - status = "okay"; -}; - -&i2c { - status = "okay"; -}; - -ðphy0 { - /delete-property/ interrupts; -}; - -&state_default { - gpio { - groups = "uart2", "uart3"; - function = "gpio"; - }; -}; - -&switch0 { - ports { - port@1 { - label = "lan"; - nvmem-cells = <ðaddr 0>; - nvmem-cell-names = "mac-address"; - status = "okay"; - }; - }; }; diff --git a/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi new file mode 100644 index 00000000000..dddc381fe8b --- /dev/null +++ b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + aliases { + ethernet0 = &gmac0; + label-mac-device = &gmac0; + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_update_green; + }; + + chosen { + bootargs-override = "console=ttyS0,115200 rootfstype=squashfs,jffs2"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: led-0 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_status_red: led-1 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + }; + + led_update_green: led-2 { + color = ; + function = LED_FUNCTION_PROGRAMMING; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x00 0x100000>; + label = "uboot"; + read-only; + }; + + partition@100000 { + reg = <0x100000 0xff00000>; + label = "ubi"; + compatible = "linux,ubi"; + + volumes { + ubi-volume-env1 { + volname = "env1"; + + nvmem-layout { + compatible = "u-boot,env-redundant-count"; + + ethaddr: ethaddr { + #nvmem-cell-cells = <1>; + }; + }; + }; + }; + }; + }; +}; + +&gmac1 { + label = "wan"; + phy-handle = <ðphy0>; + nvmem-cells = <ðaddr 1>; + nvmem-cell-names = "mac-address"; + status = "okay"; +}; + +&i2c { + status = "okay"; +}; + +ðphy0 { + /delete-property/ interrupts; +}; + +&state_default { + gpio { + groups = "uart2", "uart3"; + function = "gpio"; + }; +}; + +&switch0 { + ports { + port@1 { + label = "lan"; + nvmem-cells = <ðaddr 0>; + nvmem-cell-names = "mac-address"; + status = "okay"; + }; + }; +};