bmips: refactor Inteno XG6846 device tree

Refactor Inteno XG6846 device tree to be in line with other bmips devices.
Also expose USB LED automatically.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2024-06-25 17:41:19 +02:00
parent f98f95359b
commit 21a5b3b540
2 changed files with 81 additions and 81 deletions

View File

@ -10,6 +10,7 @@ arcadyan,ar7516)
ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
ucidef_set_led_netdev "wlan0" "WiFi" "green:wifi" "phy0-ap0" ucidef_set_led_netdev "wlan0" "WiFi" "green:wifi" "phy0-ap0"
;; ;;
inteno,xg6846 |\
nucom,r5010unv2 |\ nucom,r5010unv2 |\
sercomm,ad1018) sercomm,ad1018)
ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1" ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1"

View File

@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/* /*
* Devicetree for the Inteno XG6846 router, mostly used as a * Devicetree for the Inteno XG6846 router, mostly used as a
@ -16,26 +15,18 @@
* Some devices have a USB type A host receptacle mounted, * Some devices have a USB type A host receptacle mounted,
* some do not. * some do not.
*/ */
#include "bcm6328.dtsi" #include "bcm6328.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
/ { / {
model = "Inteno XG6846"; model = "Inteno XG6846";
compatible = "inteno,xg6846", "brcm,bcm6328"; compatible = "inteno,xg6846", "brcm,bcm6328";
/* OpenWrt-specific aliases */
aliases { aliases {
led-boot = &led_pwr_red; led-boot = &led_power_red;
led-failsafe = &led_pwr_red; led-failsafe = &led_power_red;
led-running = &led_pwr_green; led-running = &led_power_green;
led-upgrade = &led_pwr_red; led-upgrade = &led_power_red;
led-usb = &led_usb_green;
};
chosen {
bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200";
stdout-path = "serial0:115200n8";
}; };
/* /*
@ -60,17 +51,9 @@
#size-cells = <0>; #size-cells = <0>;
}; };
sfp0: sfp0 {
compatible = "sff,sfp";
i2c-bus = <&i2c0>;
los-gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
};
keys { keys {
compatible = "gpio-keys-polled"; compatible = "gpio-keys-polled";
#address-cells = <1>; poll-interval = <100>;
#size-cells = <0>;
poll-interval = <20>;
reset { reset {
label = "reset"; label = "reset";
@ -79,6 +62,12 @@
debounce-interval = <60>; debounce-interval = <60>;
}; };
}; };
sfp0: sfp0 {
compatible = "sff,sfp";
i2c-bus = <&i2c0>;
los-gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
};
}; };
&hsspi { &hsspi {
@ -110,10 +99,20 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
cfe: partition@0 { partition@0 {
label = "cfe"; label = "cfe";
reg = <0x0000000 0x0010000>; reg = <0x0000000 0x0010000>;
read-only; read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_cfe_6a0: macaddr@6a0 {
reg = <0x6a0 0x6>;
};
};
}; };
partition@10000 { partition@10000 {
@ -131,16 +130,6 @@
}; };
}; };
&cfe {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_cfe_6a0: macaddr@6a0 {
reg = <0x6a0 0x6>;
};
};
&ethernet { &ethernet {
status = "okay"; status = "okay";
@ -148,20 +137,33 @@
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address";
}; };
&switch0 { &leds {
dsa,member = <0 0>; status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_leds>,
<&pinctrl_ephy1_spd_led>,
<&pinctrl_ephy3_spd_led>;
ports { led@16 {
switch0port4: port@4 { reg = <16>;
reg = <4>; active-low;
label = "extsw"; function = LED_FUNCTION_USB;
color = <LED_COLOR_ID_GREEN>;
};
phy-mode = "rgmii"; led_power_red: led@18 {
fixed-link { reg = <18>;
speed = <1000>; active-low;
full-duplex; function = LED_FUNCTION_POWER;
}; color = <LED_COLOR_ID_RED>;
}; panic-indicator;
};
led_power_green: led@20 {
reg = <20>;
active-low;
function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_GREEN>;
}; };
}; };
@ -172,8 +174,10 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
reg = <0>; reg = <0>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
dsa,member = <1 0>; dsa,member = <1 0>;
ports { ports {
@ -183,38 +187,45 @@
port@0 { port@0 {
reg = <0>; reg = <0>;
label = "lan1"; label = "lan1";
phy-handle = <&lan1phy>; phy-handle = <&lan1phy>;
}; };
port@1 { port@1 {
reg = <1>; reg = <1>;
label = "lan2"; label = "lan2";
phy-handle = <&lan2phy>; phy-handle = <&lan2phy>;
}; };
port@2 { port@2 {
reg = <2>; reg = <2>;
label = "lan3"; label = "lan3";
phy-handle = <&lan3phy>; phy-handle = <&lan3phy>;
}; };
port@3 { port@3 {
reg = <3>; reg = <3>;
label = "lan4"; label = "lan4";
phy-handle = <&lan4phy>; phy-handle = <&lan4phy>;
}; };
port@4 { port@4 {
reg = <4>; reg = <4>;
label = "ext1"; label = "ext1";
phy-handle = <&ext1phy>; phy-handle = <&ext1phy>;
}; };
port@5 { port@5 {
reg = <5>; reg = <5>;
phy-mode = "rgmii-id";
label = "wan"; label = "wan";
phy-mode = "rgmii-id";
sfp = <&sfp0>; sfp = <&sfp0>;
fixed-link { fixed-link {
speed = <1000>; speed = <1000>;
full-duplex; full-duplex;
@ -223,9 +234,10 @@
port@6 { port@6 {
reg = <6>; reg = <6>;
phy-mode = "rgmii-id"; phy-mode = "rgmii-id";
label = "cpu";
ethernet = <&switch0port4>; ethernet = <&switch0port4>;
fixed-link { fixed-link {
speed = <1000>; speed = <1000>;
full-duplex; full-duplex;
@ -242,21 +254,25 @@
interrupt-parent = <&switch1>; interrupt-parent = <&switch1>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
}; };
lan2phy: ethernet-phy@1 { lan2phy: ethernet-phy@1 {
reg = <1>; reg = <1>;
interrupt-parent = <&switch1>; interrupt-parent = <&switch1>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
}; };
lan3phy: ethernet-phy@2 { lan3phy: ethernet-phy@2 {
reg = <2>; reg = <2>;
interrupt-parent = <&switch1>; interrupt-parent = <&switch1>;
interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
}; };
lan4phy: ethernet-phy@3 { lan4phy: ethernet-phy@3 {
reg = <3>; reg = <3>;
interrupt-parent = <&switch1>; interrupt-parent = <&switch1>;
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
}; };
ext1phy: ethernet-phy@4 { ext1phy: ethernet-phy@4 {
reg = <4>; reg = <4>;
interrupt-parent = <&switch1>; interrupt-parent = <&switch1>;
@ -271,43 +287,26 @@
}; };
&pinctrl { &pinctrl {
pinctrl_xg6846_usb_spd_led: xg6846_usb_spd_led-pins { pinctrl_leds: leds {
function = "led"; function = "led";
pins = "gpio17"; pins = "gpio16", "gpio18", "gpio20";
}; };
}; };
&leds { &switch0 {
status = "okay"; dsa,member = <0 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_xg6846_usb_spd_led>, /* GPIO16 LED USB */
<&pinctrl_ephy1_spd_led>, /* GPIO18 LED PWR red */
<&pinctrl_ephy3_spd_led>; /* GPIO20 LED PWR green */
/* On board variants without USB this LED is not mounted */ ports {
led_usb_green: led@16 { switch0port4: port@4 {
reg = <16>; reg = <4>;
active-low; label = "extsw";
label = "green:usb";
default-state = "off"; phy-mode = "rgmii";
fixed-link {
speed = <1000>;
full-duplex;
};
};
}; };
/*
* LED 18 and 20 drive the same physical LED, the PWR
* LED that can be both red and green.
*/
led_pwr_red: led@18 {
reg = <18>;
active-low;
label = "red:pwr";
default-state = "off";
};
led_pwr_green: led@20 {
reg = <20>;
active-low;
label = "green:pwr";
default-state = "off";
};
}; };