openwrt/target/linux/ramips/dts/mt7621_tplink_er605-v2.dts
Arınç ÜNAL 3ea6125c50 ramips: mt7621-dts: describe switch PHYs and adjust PHY muxing
Currently, the MT7530 DSA subdriver configures the MT7530 switch to provide
direct access to switch PHYs, meaning, the switch PHYs listen on the MDIO
bus the switch listens on. The PHY muxing feature makes use of this.

This is problematic as the PHY may be attached before the switch is
initialised, in which case, the PHY will fail to be attached.

Since commit 91374ba537bd ("net: dsa: mt7530: support OF-based registration
of switch MDIO bus") on mainline Linux, we can describe the switch PHYs on
the MDIO bus of the switch on the device tree.

When the PHY is described this way, the switch will be initialised first,
then the switch MDIO bus will be registered. Only after these steps, the
PHY will be attached.

Describe the switch PHYs on mt7621.dtsi and remove defining the switch PHY
on the SoC's mdio bus node. When the PHY muxing is in use, the interrupts
for the muxed PHY won't work, therefore delete the "interrupts" property on
the devices where the PHY muxing feature is in use.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
2024-05-01 13:50:54 +01:00

178 lines
3.0 KiB
Plaintext

// SPDX-License-Identifier: GPL-2.0-or-later
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
model = "TP-Link ER605 v2";
compatible = "tplink,er605-v2", "mediatek,mt7621-soc";
chosen {
bootargs = "console=ttyS0,115200 noinitrd";
// Override bootargs because u-boot passes wrong root parameter.
// Instead allow kernel determine root automatically by looking for rootfs volume
bootargs-override = "console=ttyS0,115200 noinitrd ubi.mtd=3,2048";
};
aliases {
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
label-mac-device = &gmac0;
};
leds {
compatible = "gpio-leds";
led_usb: usb {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
};
led_power: power {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
default-state = "on";
};
led_system: system {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
default-state = "keep";
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset button";
gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_RESTART>;
};
};
reg_usb_vbus: regulator-usb {
compatible = "regulator-fixed";
regulator-name = "usb_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio 10 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
};
};
&gmac0 {
label = "dsa";
};
&gmac1 {
status = "okay";
label = "eth0";
phy-handle = <&ethphy0>;
};
&switch0 {
ports {
port@0 {
status = "disabled";
};
port@1 {
status = "okay";
label = "eth1";
};
port@2 {
status = "okay";
label = "eth2";
};
port@3 {
status = "okay";
label = "eth3";
};
port@4 {
status = "okay";
label = "eth4";
};
};
};
&nand {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x80000>;
read-only;
};
partition@80000 {
label = "u-boot-env";
reg = <0x80000 0x80000>;
read-only;
};
partition@100000 {
label = "factory";
reg = <0x100000 0x40000>;
read-only;
};
partition@140000 {
label = "firmware";
reg = <0x140000 0x7cc0000>;
};
partition@7e00000 {
label = "panic-ops";
reg = <0x7e00000 0x200000>;
};
};
};
&ethphy0 {
/delete-property/ interrupts;
};
&state_default {
gpio {
groups = "uart2", "uart3", "pcie", "jtag";
function = "gpio";
};
};
&spi0 {
status = "disabled";
};
&xhci {
vusb33-supply = <&reg_3p3v>;
vbus-supply = <&reg_usb_vbus>;
};