Files
eternalwrt-mt798x/target/linux/airoha/dts/an7581-nokia_xg-040g-md-common.dtsi
T
Mikhail ZhilkinandJonas Jelonek 05c4cb954e 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 <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23809
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-18 10:21:08 +02:00

279 lines
4.6 KiB
Devicetree

// SPDX-License-Identifier: GPL-2.0-only OR MIT
/dts-v1/;
#include <dt-bindings/leds/common.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "an7581.dtsi"
#include "an758x-nokia_xg-040g-common.dtsi"
/ {
gpio-keys {
compatible = "gpio-keys";
button-0 {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&en7581_pinctrl 0 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
};
leds {
compatible = "gpio-leds";
led_power_green: led-0 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_POWER;
gpios = <&en7581_pinctrl 17 GPIO_ACTIVE_LOW>;
panic-indicator;
};
led-1 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN;
gpios = <&en7581_pinctrl 18 GPIO_ACTIVE_LOW>;
};
led-2 {
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_WAN;
gpios = <&en7581_pinctrl 19 GPIO_ACTIVE_LOW>;
};
led-3 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN_ONLINE;
gpios = <&en7581_pinctrl 20 GPIO_ACTIVE_LOW>;
};
led-4 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_USB;
function-enumerator = <2>;
gpios = <&en7581_pinctrl 34 GPIO_ACTIVE_LOW>;
linux,default-trigger = "usbport";
trigger-sources = <&usb_port2>;
};
led-5 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_USB;
function-enumerator = <1>;
gpios = <&en7581_pinctrl 35 GPIO_ACTIVE_LOW>;
linux,default-trigger = "usbport";
trigger-sources = <&usb_port1>;
};
};
reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-always-on;
regulator-boot-on;
regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <3300000>;
regulator-name = "fixed-3.3V";
};
reg_usb_5v: regulator-usb-5v {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&en7581_pinctrl 24 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
regulator-max-microvolt = <5000000>;
regulator-min-microvolt = <5000000>;
regulator-name = "usb-5v";
};
/*
* Controls both USB ports at once
*/
usb-power {
compatible = "regulator-output";
vout-supply = <&reg_usb_5v>;
};
};
&en7581_pinctrl {
gpio-ranges = <&en7581_pinctrl 0 13 47>;
mdio_pins: mdio-pins {
mux {
function = "mdio";
groups = "mdio";
};
conf {
pins = "gpio2";
output-high;
};
};
gswp2_led0_pins: gswp2-led0-pins {
mux {
function = "phy2_led0";
pins = "gpio44";
};
};
gswp3_led0_pins: gswp3-led0-pins {
mux {
function = "phy3_led0";
pins = "gpio45";
};
};
gswp4_led0_pins: gswp4-led0-pins {
mux {
function = "phy4_led0";
pins = "gpio46";
};
};
};
&mdio {
/* Airoha EN8811 2.5Gbps phy */
en8811: ethernet-phy@f {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <0xf>;
reset-gpios = <&en7581_pinctrl 31 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <20000>;
leds {
#address-cells = <1>;
#size-cells = <0>;
led-0 {
reg = <0>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
default-state = "keep";
};
};
};
};
&switch {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&mdio_pins>;
};
&gsw_port2 {
status = "okay";
label = "lan2";
};
&gsw_phy2 {
status = "okay";
interrupts = <2>;
pinctrl-names = "gbe-led";
pinctrl-0 = <&gswp2_led0_pins>;
};
&gsw_phy2_led0 {
status = "okay";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
active-low;
};
&gsw_port3 {
status = "okay";
label = "lan3";
};
&gsw_phy3 {
status = "okay";
interrupts = <3>;
pinctrl-names = "gbe-led";
pinctrl-0 = <&gswp3_led0_pins>;
};
&gsw_phy3_led0 {
status = "okay";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <3>;
active-low;
};
&gsw_port4 {
status = "okay";
label = "lan4";
};
&gsw_phy4 {
status = "okay";
interrupts = <4>;
pinctrl-names = "gbe-led";
pinctrl-0 = <&gswp4_led0_pins>;
};
&gsw_phy4_led0 {
status = "okay";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <4>;
active-low;
};
&gdm4 {
status = "okay";
openwrt,netdev-name = "lan1";
phy-handle = <&en8811>;
phy-mode = "2500base-x";
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_factory_3e (0)>;
};
&usb0 {
status = "okay";
vusb33-supply = <&reg_3p3v>;
#address-cells = <1>;
#size-cells = <0>;
usb_port1: port@1 {
reg = <1>;
#trigger-source-cells = <0>;
};
};
&usb1 {
status = "okay";
mediatek,u3p-dis-msk = <0x1>;
phys = <&usb1_phy PHY_TYPE_USB2>;
vusb33-supply = <&reg_3p3v>;
#address-cells = <1>;
#size-cells = <0>;
usb_port2: port@1 {
reg = <1>;
#trigger-source-cells = <0>;
};
};