mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 18:19:02 +00:00
3ea6125c50
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>
224 lines
3.6 KiB
Plaintext
224 lines
3.6 KiB
Plaintext
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
|
|
#include "mt7621.dtsi"
|
|
|
|
#include <dt-bindings/gpio/gpio.h>
|
|
#include <dt-bindings/input/input.h>
|
|
|
|
/ {
|
|
compatible = "tenbay,t-mb5eu-v01", "mediatek,mt7621-soc";
|
|
model = "Tenbay T-MB5EU-V01";
|
|
|
|
aliases {
|
|
led-boot = &led_green;
|
|
led-failsafe = &led_red;
|
|
led-running = &led_blue;
|
|
led-upgrade = &led_red;
|
|
label-mac-device = &gmac1;
|
|
};
|
|
|
|
chosen {
|
|
bootargs = "console=ttyS0,115200";
|
|
bootargs-override = "console=ttyS0,115200";
|
|
};
|
|
|
|
leds {
|
|
compatible = "gpio-leds";
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&led_pins>;
|
|
|
|
led_blue: blue {
|
|
label = "blue";
|
|
gpios = <&aw9523 0 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led_red: red {
|
|
label = "red";
|
|
gpios = <&aw9523 1 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led_green: green {
|
|
label = "green";
|
|
gpios = <&aw9523 11 GPIO_ACTIVE_LOW>;
|
|
};
|
|
};
|
|
|
|
keys {
|
|
compatible = "gpio-keys-polled";
|
|
poll-interval = <50>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&button_pins>;
|
|
|
|
reset {
|
|
label = "reset";
|
|
gpios = <&aw9523 9 GPIO_ACTIVE_LOW>;
|
|
linux,code = <KEY_RESTART>;
|
|
};
|
|
|
|
wps {
|
|
label = "wps";
|
|
gpios = <&aw9523 8 GPIO_ACTIVE_LOW>;
|
|
linux,code = <KEY_WPS_BUTTON>;
|
|
};
|
|
};
|
|
|
|
i2c-gpio {
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
|
|
compatible = "i2c-gpio";
|
|
gpios = <&gpio 7 GPIO_ACTIVE_HIGH &gpio 8 GPIO_ACTIVE_HIGH>;
|
|
i2c-gpio,delay-us = <10>;
|
|
|
|
aw9523: gpio-expander@5b {
|
|
compatible = "awinic,aw9523-pinctrl";
|
|
reg = <0x5b>;
|
|
gpio-controller;
|
|
#gpio-cells = <2>;
|
|
gpio-ranges = <&aw9523 0 0 16>;
|
|
|
|
reset-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
|
|
|
|
button_pins: button-pins {
|
|
pins = "gpio8", "gpio9";
|
|
function = "gpio";
|
|
bias-pull-up;
|
|
drive-open-drain;
|
|
input-enable;
|
|
};
|
|
|
|
led_pins: led-pins {
|
|
pins = "gpio0", "gpio1", "gpio11";
|
|
function = "gpio";
|
|
input-disable;
|
|
output-low;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
&pcie {
|
|
status = "okay";
|
|
};
|
|
|
|
&pcie1 {
|
|
wifi@0,0 {
|
|
compatible = "mediatek,mt76";
|
|
reg = <0x0 0 0 0 0>;
|
|
nvmem-cells = <&eeprom_factory_0>;
|
|
nvmem-cell-names = "eeprom";
|
|
mediatek,disable-radar-background;
|
|
};
|
|
};
|
|
|
|
&gmac0 {
|
|
nvmem-cells = <&macaddr_factory_4 0>;
|
|
nvmem-cell-names = "mac-address";
|
|
};
|
|
|
|
&gmac1 {
|
|
status = "okay";
|
|
label = "wan";
|
|
phy-handle = <ðphy0>;
|
|
|
|
nvmem-cells = <&macaddr_factory_4 (-2)>;
|
|
nvmem-cell-names = "mac-address";
|
|
};
|
|
|
|
ðphy0 {
|
|
/delete-property/ interrupts;
|
|
};
|
|
|
|
&switch0 {
|
|
ports {
|
|
port@1 {
|
|
status = "okay";
|
|
label = "lan1";
|
|
};
|
|
|
|
port@2 {
|
|
status = "okay";
|
|
label = "lan2";
|
|
};
|
|
|
|
port@3 {
|
|
status = "okay";
|
|
label = "lan3";
|
|
};
|
|
|
|
port@4 {
|
|
status = "okay";
|
|
label = "lan4";
|
|
};
|
|
};
|
|
};
|
|
|
|
&state_default {
|
|
gpio {
|
|
groups = "uart3";
|
|
function = "gpio";
|
|
};
|
|
};
|
|
|
|
&spi0 {
|
|
status = "okay";
|
|
|
|
flash@0 {
|
|
compatible = "jedec,spi-nor";
|
|
reg = <0>;
|
|
spi-max-frequency = <50000000>;
|
|
|
|
partitions {
|
|
compatible = "fixed-partitions";
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
|
|
partition@0 {
|
|
label = "u-boot";
|
|
reg = <0x0 0x30000>;
|
|
read-only;
|
|
};
|
|
|
|
partition@30000 {
|
|
label = "u-boot-env";
|
|
reg = <0x30000 0x10000>;
|
|
read-only;
|
|
};
|
|
|
|
partition@40000 {
|
|
label = "product";
|
|
reg = <0x40000 0x10000>;
|
|
read-only;
|
|
};
|
|
|
|
partition@50000 {
|
|
label = "factory";
|
|
reg = <0x50000 0x40000>;
|
|
read-only;
|
|
|
|
nvmem-layout {
|
|
compatible = "fixed-layout";
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
|
|
eeprom_factory_0: eeprom@0 {
|
|
reg = <0x0 0xe00>;
|
|
};
|
|
|
|
macaddr_factory_4: macaddr@4 {
|
|
compatible = "mac-base";
|
|
reg = <0x4 0x6>;
|
|
#nvmem-cell-cells = <1>;
|
|
};
|
|
};
|
|
};
|
|
|
|
partition@90000 {
|
|
compatible = "denx,fit";
|
|
label = "firmware";
|
|
reg = <0x90000 0xf70000>;
|
|
};
|
|
};
|
|
};
|
|
};
|