openwrt/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.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

223 lines
4.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>
/ {
compatible = "snr,snr-cpe-me1", "mediatek,mt7621-soc";
model = "SNR-CPE-ME1";
aliases {
label-mac-device = &gmac1;
led-boot = &led_usb;
led-failsafe = &led_vpn;
led-running = &led_green;
led-upgrade = &led_sys;
};
leds {
compatible = "gpio-leds";
led_usb: led-0 { // USB Activity
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_USB;
gpios = <&gpio 13 GPIO_ACTIVE_LOW>; // [JTAG] JTDO
};
led_vpn: led-1 { // VPN Activity
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_INDICATOR;
gpios = <&gpio 16 GPIO_ACTIVE_LOW>; // [JTAG] JTCLK
};
led_sys: led-2 { // System config
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 3 GPIO_ACTIVE_LOW>; // [I2C] I2C_SD
panic-indicator;
};
led_green: led-3 { // ? LED
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_HEARTBEAT;
gpios = <&gpio 15 GPIO_ACTIVE_LOW>; // [JTAG] JTMS
};
};
keys {
compatible = "gpio-keys";
reset {
label = "Reset Button";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>; // [JTAG] JTDI
linux,code = <KEY_RESTART>;
};
};
reg_usb_vbus: regulator {
compatible = "regulator-fixed";
regulator-name = "usb_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio 17 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 {
nvmem-cells = <&macaddr_factory_e000>;
nvmem-cell-names = "mac-address";
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
nvmem-cells = <&macaddr_factory_e006>;
nvmem-cell-names = "mac-address";
};
&ethphy4 {
/delete-property/ interrupts;
};
&pcie {
status = "okay";
};
&pcie0 { // MT7603EN
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
ieee80211-freq-limit = <2400000 2500000>;
};
};
&pcie1 { // MT7610EN
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_factory_8000>;
nvmem-cell-names = "eeprom";
ieee80211-freq-limit = <5000000 6000000>;
};
};
&spi0 {
status = "okay";
flash@0 { // GD25Q128CSIG
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <44000000>; // 44 MHz
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "Bootloader";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "Config";
reg = <0x30000 0x10000>;
read-only;
};
partition@40000 {
label = "Factory";
reg = <0x40000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory_0: eeprom@0 {
reg = <0x0 0x400>;
};
eeprom_factory_8000: eeprom@8000 {
reg = <0x8000 0x200>;
};
macaddr_factory_e000: macaddr@e000 {
reg = <0xe000 0x6>;
};
macaddr_factory_e006: macaddr@e006 {
reg = <0xe006 0x6>;
};
};
};
partition@50000 {
compatible = "openwrt,uimage", "denx,uimage";
label = "firmware";
reg = <0x50000 0xfb0000>;
};
partition@30001 {
label = "uboot-env";
reg = <0x30000 0x1000>;
};
};
};
};
&state_default {
gpio {
groups = "i2c", "jtag";
function = "gpio";
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan4";
};
port@1 {
status = "okay";
label = "lan3";
};
port@2 {
status = "okay";
label = "lan2";
};
port@3 {
status = "okay";
label = "lan1";
};
};
};
&xhci {
vbus-supply = <&reg_usb_vbus>;
vusb33-supply = <&reg_3p3v>;
};