further mt7988 devicetree work
Subsystems (5)
PATCH 1/14 dt-bindings: net: mediatek,net: update for mt7988
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Update binding for mt7988 which has 3 gmac and 2 reg items.
--- Documentation/devicetree/bindings/net/mediatek,net.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/net/mediatek,net.yaml +7 -2
@@ -28,7 +28,8 @@ properties: - ralink,rt5350-eth reg: - maxItems: 1 + minItems: 1 + maxItems: 2 clocks: minItems: 2
@@ -381,8 +382,12 @@ allOf: - const: xgp2 - const: xgp3 + reg: + minItems: 2 + maxItems: 2 + patternProperties: - "^mac@[0-1]$": + "^mac@[0-2]$": type: object unevaluatedProperties: false allOf:
Signature · 1 line
2.43.0
PATCH 5/14 arm64: dts: mediatek: mt7988: move uart0 and spi1 pins to soc dtsi
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
In order to use uart0 or spi1 there is only 1 possible pin definition so move them to soc dtsi to reuse them in other boards and avoiding conflict if defined twice.
--- .../dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi | 14 -------------- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 14 deletions(-)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi +0 -14
@@ -328,13 +328,6 @@ mux { }; }; - uart0_pins: uart0-pins { - mux { - function = "uart"; - groups = "uart0"; - }; - }; - snfi_pins: snfi-pins { mux { function = "flash";
@@ -356,13 +349,6 @@ mux { }; }; - spi1_pins: spi1-pins { - mux { - function = "spi"; - groups = "spi1"; - }; - }; - spi2_pins: spi2-pins { mux { function = "spi";
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +18 -0
@@ -209,6 +209,20 @@ mux { "pcie_wake_n3_0"; }; }; + + spi1_pins: spi1-pins { + mux { + function = "spi"; + groups = "spi1"; + }; + }; + + uart0_pins: uart0-pins { + mux { + function = "uart"; + groups = "uart0"; + }; + }; }; pwm: pwm@10048000 {
@@ -244,6 +258,8 @@ serial0: serial@11000000 { clocks = <&topckgen CLK_TOP_UART_SEL>, <&infracfg CLK_INFRA_52M_UART0_CK>; clock-names = "baud", "bus"; + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; status = "disabled"; };
@@ -338,6 +354,8 @@ spi1: spi@11008000 { "hclk"; #address-cells = <1>; #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&spi1_pins>; status = "disabled"; };
Signature · 1 line
2.43.0
PATCH 8/14 arm64: dts: mediatek: mt7988: add basic ethernet-nodes
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Add basic ethernet related nodes.
Mac1+2 needs pcs (sgmii+usxgmii) to work correctly which will be linked later when driver is merged.
--- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 124 +++++++++++++++++++++- 1 file changed, 121 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +121 -3
@@ -680,7 +680,28 @@ xphyu3port0: usb-phy@11e13000 { }; }; - clock-controller@11f40000 { + xfi_tphy0: phy@11f20000 { + compatible = "mediatek,mt7988-xfi-tphy"; + reg = <0 0x11f20000 0 0x10000>; + resets = <&watchdog 14>; + clocks = <&xfi_pll CLK_XFIPLL_PLL_EN>, + <&topckgen CLK_TOP_XFI_PHY_0_XTAL_SEL>; + clock-names = "xfipll", "topxtal"; + mediatek,usxgmii-performance-errata; + #phy-cells = <0>; + }; + + xfi_tphy1: phy@11f30000 { + compatible = "mediatek,mt7988-xfi-tphy"; + reg = <0 0x11f30000 0 0x10000>; + resets = <&watchdog 15>; + clocks = <&xfi_pll CLK_XFIPLL_PLL_EN>, + <&topckgen CLK_TOP_XFI_PHY_1_XTAL_SEL>; + clock-names = "xfipll", "topxtal"; + #phy-cells = <0>; + }; + + xfi_pll: clock-controller@11f40000 { compatible = "mediatek,mt7988-xfi-pll"; reg = <0 0x11f40000 0 0x1000>; resets = <&watchdog 16>;
@@ -714,19 +735,116 @@ phy_calibration_p3: calib@97c { }; }; - clock-controller@15000000 { + ethsys: clock-controller@15000000 { compatible = "mediatek,mt7988-ethsys", "syscon"; reg = <0 0x15000000 0 0x1000>; #clock-cells = <1>; #reset-cells = <1>; }; - clock-controller@15031000 { + ethwarp: clock-controller@15031000 { compatible = "mediatek,mt7988-ethwarp"; reg = <0 0x15031000 0 0x1000>; #clock-cells = <1>; #reset-cells = <1>; }; + + eth: ethernet@15100000 { + compatible = "mediatek,mt7988-eth"; + reg = <0 0x15100000 0 0x80000>, + <0 0x15400000 0 0x200000>; + interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>; + clocks = <ðsys CLK_ETHDMA_CRYPT0_EN>, + <ðsys CLK_ETHDMA_FE_EN>, + <ðsys CLK_ETHDMA_GP2_EN>, + <ðsys CLK_ETHDMA_GP1_EN>, + <ðsys CLK_ETHDMA_GP3_EN>, + <ðwarp CLK_ETHWARP_WOCPU2_EN>, + <ðwarp CLK_ETHWARP_WOCPU1_EN>, + <ðwarp CLK_ETHWARP_WOCPU0_EN>, + <ðsys CLK_ETHDMA_ESW_EN>, + <&topckgen CLK_TOP_ETH_GMII_SEL>, + <&topckgen CLK_TOP_ETH_REFCK_50M_SEL>, + <&topckgen CLK_TOP_ETH_SYS_200M_SEL>, + <&topckgen CLK_TOP_ETH_SYS_SEL>, + <&topckgen CLK_TOP_ETH_XGMII_SEL>, + <&topckgen CLK_TOP_ETH_MII_SEL>, + <&topckgen CLK_TOP_NETSYS_SEL>, + <&topckgen CLK_TOP_NETSYS_500M_SEL>, + <&topckgen CLK_TOP_NETSYS_PAO_2X_SEL>, + <&topckgen CLK_TOP_NETSYS_SYNC_250M_SEL>, + <&topckgen CLK_TOP_NETSYS_PPEFB_250M_SEL>, + <&topckgen CLK_TOP_NETSYS_WARP_SEL>, + <ðsys CLK_ETHDMA_XGP1_EN>, + <ðsys CLK_ETHDMA_XGP2_EN>, + <ðsys CLK_ETHDMA_XGP3_EN>; + clock-names = "crypto", "fe", "gp2", "gp1", + "gp3", + "ethwarp_wocpu2", "ethwarp_wocpu1", + "ethwarp_wocpu0", "esw", "top_eth_gmii_sel", + "top_eth_refck_50m_sel", "top_eth_sys_200m_sel", + "top_eth_sys_sel", "top_eth_xgmii_sel", + "top_eth_mii_sel", "top_netsys_sel", + "top_netsys_500m_sel", "top_netsys_pao_2x_sel", + "top_netsys_sync_250m_sel", + "top_netsys_ppefb_250m_sel", + "top_netsys_warp_sel","xgp1", "xgp2", "xgp3"; + assigned-clocks = <&topckgen CLK_TOP_NETSYS_2X_SEL>, + <&topckgen CLK_TOP_NETSYS_GSW_SEL>, + <&topckgen CLK_TOP_USXGMII_SBUS_0_SEL>, + <&topckgen CLK_TOP_USXGMII_SBUS_1_SEL>, + <&topckgen CLK_TOP_SGM_0_SEL>, + <&topckgen CLK_TOP_SGM_1_SEL>; + assigned-clock-parents = <&apmixedsys CLK_APMIXED_NET2PLL>, + <&topckgen CLK_TOP_NET1PLL_D4>, + <&topckgen CLK_TOP_NET1PLL_D8_D4>, + <&topckgen CLK_TOP_NET1PLL_D8_D4>, + <&apmixedsys CLK_APMIXED_SGMPLL>, + <&apmixedsys CLK_APMIXED_SGMPLL>; + mediatek,ethsys = <ðsys>; + mediatek,infracfg = <&topmisc>; + #address-cells = <1>; + #size-cells = <0>; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "internal"; + + fixed-link { + speed = <10000>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + status = "disabled"; + }; + + gmac2: mac@2 { + compatible = "mediatek,eth-mac"; + reg = <2>; + status = "disabled"; + }; + + mdio_bus: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + + /* internal 2.5G PHY */ + int_2p5g_phy: ethernet-phy@f { + reg = <15>; + compatible = "ethernet-phy-ieee802.3-c45"; + phy-mode = "internal"; + }; + }; + }; }; thermal-zones {
Signature · 1 line
2.43.0
PATCH 9/14 arm64: dts: mediatek: mt7988: add switch node
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Add mt7988 builtin mt753x switch nodes.
--- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 166 ++++++++++++++++++++++ 1 file changed, 166 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +166 -0
@@ -5,6 +5,7 @@ #include <dt-bindings/phy/phy.h> #include <dt-bindings/pinctrl/mt65xx.h> #include <dt-bindings/reset/mediatek,mt7988-resets.h> +#include <dt-bindings/leds/common.h> / { compatible = "mediatek,mt7988a";
@@ -742,6 +743,171 @@ ethsys: clock-controller@15000000 { #reset-cells = <1>; }; + switch: switch@15020000 { + compatible = "mediatek,mt7988-switch"; + reg = <0 0x15020000 0 0x8000>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&gic>; + interrupts = <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>; + resets = <ðwarp MT7988_ETHWARP_RST_SWITCH>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + gsw_port0: port@0 { + reg = <0>; + label = "wan"; + phy-mode = "internal"; + phy-handle = <&gsw_phy0>; + }; + + gsw_port1: port@1 { + reg = <1>; + label = "lan1"; + phy-mode = "internal"; + phy-handle = <&gsw_phy1>; + }; + + gsw_port2: port@2 { + reg = <2>; + label = "lan2"; + phy-mode = "internal"; + phy-handle = <&gsw_phy2>; + }; + + gsw_port3: port@3 { + reg = <3>; + label = "lan3"; + phy-mode = "internal"; + phy-handle = <&gsw_phy3>; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "internal"; + + fixed-link { + speed = <10000>; + full-duplex; + pause; + }; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + mediatek,pio = <&pio>; + + gsw_phy0: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + interrupts = <0>; + phy-mode = "internal"; + nvmem-cells = <&phy_calibration_p0>; + nvmem-cell-names = "phy-cal-data"; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + gsw_phy0_led0: led@0 { + reg = <0>; + function = LED_FUNCTION_LAN; + status = "disabled"; + }; + + gsw_phy0_led1: led@1 { + reg = <1>; + function = LED_FUNCTION_LAN; + status = "disabled"; + }; + }; + }; + + gsw_phy1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + interrupts = <1>; + phy-mode = "internal"; + nvmem-cells = <&phy_calibration_p1>; + nvmem-cell-names = "phy-cal-data"; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + gsw_phy1_led0: led@0 { + reg = <0>; + function = LED_FUNCTION_LAN; + status = "disabled"; + }; + + gsw_phy1_led1: led@1 { + reg = <1>; + function = LED_FUNCTION_LAN; + status = "disabled"; + }; + }; + }; + + gsw_phy2: ethernet-phy@2 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <2>; + interrupts = <2>; + phy-mode = "internal"; + nvmem-cells = <&phy_calibration_p2>; + nvmem-cell-names = "phy-cal-data"; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + gsw_phy2_led0: led@0 { + reg = <0>; + function = LED_FUNCTION_LAN; + status = "disabled"; + }; + + gsw_phy2_led1: led@1 { + reg = <1>; + function = LED_FUNCTION_LAN; + status = "disabled"; + }; + }; + }; + + gsw_phy3: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <3>; + interrupts = <3>; + phy-mode = "internal"; + nvmem-cells = <&phy_calibration_p3>; + nvmem-cell-names = "phy-cal-data"; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + gsw_phy3_led0: led@0 { + reg = <0>; + function = LED_FUNCTION_LAN; + status = "disabled"; + }; + + gsw_phy3_led1: led@1 { + reg = <1>; + function = LED_FUNCTION_LAN; + status = "disabled"; + }; + }; + }; + }; + }; + ethwarp: clock-controller@15031000 { compatible = "mediatek,mt7988-ethwarp"; reg = <0 0x15031000 0 0x1000>;
Signature · 1 line
2.43.0
cover further mt7988 devicetree work
From: Frank Wunderlich <[email protected]>
This series continues mt7988 devicetree work
- Add SPI with BPI-R4 nand to reach eMMC
- Add thermal protection (fan+cooling-points)
- Extend cpu frequency scaling with CCI
- Basic network-support (ethernet controller + builtin switch + SFP Cages)
depencies (i hope this list is complete and latest patches/series linked):
"Add Bananapi R4 variants and add xsphy" (reviewed, but not yet applied):
https://patchwork.kernel.org/project/linux-mediatek/list/?series=955733
"net: phy: mediatek: do not require syscon compatible for pio property":
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
for phy led function (RFC not yet reviewed, resent without RFC)
for 2.5g phy function (currently disabled):
- net: ethernet: mtk_eth_soc: add support for MT7988 internal 2.5G PHY (already merged to 6.15-net-next)
- net: phy: mediatek: add driver for built-in 2.5G ethernet PHY on MT7988
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
requested updated patch due to comments
for SFP-Function (macs currently disabled):
PCS clearance which is a 1.5 year discussion currently ongoing
e.g. something like this (one of):
* https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
(changes requested, but no comment on the pcs part)
* https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
(changes requested)
* https://patchwork.kernel.org/project/netdevbpf/patch/ba4e359584a6b3bc4b3470822c42186d5b0856f9.1721910728.git.daniel@makrotopia.org/
full usxgmii driver:
https://patchwork.kernel.org/project/netdevbpf/patch/07845ec900ba41ff992875dce12c622277592c32.1702352117.git.daniel@makrotopia.org/
first PCS-discussion is here:
https://patchwork.kernel.org/project/netdevbpf/patch/8aa905080bdb6760875d62cb3b2b41258837f80e.1702352117.git.daniel@makrotopia.org/
and then dts nodes for sgmiisys+usxgmii
when above depencies are solved the mac1+2 can be enabled and 2.5G phy and SFP slots will work.
Frank Wunderlich (14):
dt-bindings: net: mediatek,net: update for mt7988
dt-bindings: net: dsa: mediatek,mt7530: add dsa-port definition for
mt7988
dt-bindings: net: dsa: mediatek,mt7530: add internal mdio bus
arm64: dts: mediatek: mt7988: add spi controllers
arm64: dts: mediatek: mt7988: move uart0 and spi1 pins to soc dtsi
arm64: dts: mediatek: mt7988: add cci node
arm64: dts: mediatek: mt7988: add phy calibration efuse subnodes
arm64: dts: mediatek: mt7988: add basic ethernet-nodes
arm64: dts: mediatek: mt7988: add switch node
arm64: dts: mediatek: mt7988a-bpi-r4: Add fan and coolingmaps
arm64: dts: mediatek: mt7988a-bpi-r4: configure spi-nodes
arm64: dts: mediatek: mt7988a-bpi-r4: add proc-supply for cci
arm64: dts: mediatek: mt7988a-bpi-r4: add sfp cages and link to gmac
arm64: dts: mediatek: mt7988a-bpi-r4: configure switch phys and leds
.../bindings/net/dsa/mediatek,mt7530.yaml | 17 +- .../devicetree/bindings/net/mediatek,net.yaml | 9 +- .../mediatek/mt7988a-bananapi-bpi-r4-2g5.dts | 11 + .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 18 + .../dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi | 137 +++++- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 402 +++++++++++++++++- 6 files changed, 574 insertions(+), 20 deletions(-)
Signature · 1 line
2.43.0
PATCH 6/14 arm64: dts: mediatek: mt7988: add cci node
From: Frank Wunderlich <[email protected]>
Add cci devicetree node for cpu frequency scaling.
--- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +33 -0
@@ -12,6 +12,35 @@ / { #address-cells = <2>; #size-cells = <2>; + cci: cci { + compatible = "mediatek,mt8183-cci"; + clocks = <&mcusys CLK_MCU_BUS_DIV_SEL>, + <&topckgen CLK_TOP_XTAL>; + clock-names = "cci", "intermediate"; + operating-points-v2 = <&cci_opp>; + }; + + cci_opp: opp-table-cci { + compatible = "operating-points-v2"; + opp-shared; + opp-480000000 { + opp-hz = /bits/ 64 <480000000>; + opp-microvolt = <850000>; + }; + opp-660000000 { + opp-hz = /bits/ 64 <660000000>; + opp-microvolt = <850000>; + }; + opp-900000000 { + opp-hz = /bits/ 64 <900000000>; + opp-microvolt = <850000>; + }; + opp-1080000000 { + opp-hz = /bits/ 64 <1080000000>; + opp-microvolt = <900000>; + }; + }; + cpus { #address-cells = <1>; #size-cells = <0>;
@@ -25,6 +54,7 @@ cpu0: cpu@0 { <&topckgen CLK_TOP_XTAL>; clock-names = "cpu", "intermediate"; operating-points-v2 = <&cluster0_opp>; + mediatek,cci = <&cci>; }; cpu1: cpu@1 {
@@ -36,6 +66,7 @@ cpu1: cpu@1 { <&topckgen CLK_TOP_XTAL>; clock-names = "cpu", "intermediate"; operating-points-v2 = <&cluster0_opp>; + mediatek,cci = <&cci>; }; cpu2: cpu@2 {
@@ -47,6 +78,7 @@ cpu2: cpu@2 { <&topckgen CLK_TOP_XTAL>; clock-names = "cpu", "intermediate"; operating-points-v2 = <&cluster0_opp>; + mediatek,cci = <&cci>; }; cpu3: cpu@3 {
@@ -58,6 +90,7 @@ cpu3: cpu@3 { <&topckgen CLK_TOP_XTAL>; clock-names = "cpu", "intermediate"; operating-points-v2 = <&cluster0_opp>; + mediatek,cci = <&cci>; }; cluster0_opp: opp-table-0 {
Signature · 1 line
2.43.0
PATCH 4/14 arm64: dts: mediatek: mt7988: add spi controllers
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Add SPI controllers for mt7988.
--- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +45 -0
@@ -311,6 +311,51 @@ i2c2: i2c@11005000 { status = "disabled"; }; + spi0: spi@11007000 { + compatible = "mediatek,mt7988-spi-quad", "mediatek,spi-ipm"; + reg = <0 0x11007000 0 0x100>; + interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&topckgen CLK_TOP_MPLL_D2>, + <&topckgen CLK_TOP_SPI_SEL>, + <&infracfg CLK_INFRA_104M_SPI0>, + <&infracfg CLK_INFRA_66M_SPI0_HCK>; + clock-names = "parent-clk", "sel-clk", "spi-clk", + "hclk"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + spi1: spi@11008000 { + compatible = "mediatek,mt7988-spi-single", "mediatek,spi-ipm"; + reg = <0 0x11008000 0 0x100>; + interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&topckgen CLK_TOP_MPLL_D2>, + <&topckgen CLK_TOP_SPIM_MST_SEL>, + <&infracfg CLK_INFRA_104M_SPI1>, + <&infracfg CLK_INFRA_66M_SPI1_HCK>; + clock-names = "parent-clk", "sel-clk", "spi-clk", + "hclk"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + spi2: spi@11009000 { + compatible = "mediatek,mt7988-spi-quad", "mediatek,spi-ipm"; + reg = <0 0x11009000 0 0x100>; + interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&topckgen CLK_TOP_MPLL_D2>, + <&topckgen CLK_TOP_SPI_SEL>, + <&infracfg CLK_INFRA_104M_SPI2_BCK>, + <&infracfg CLK_INFRA_66M_SPI2_HCK>; + clock-names = "parent-clk", "sel-clk", "spi-clk", + "hclk"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + lvts: lvts@1100a000 { compatible = "mediatek,mt7988-lvts-ap"; #thermal-sensor-cells = <1>;
Signature · 1 line
2.43.0
PATCH 3/14 dt-bindings: net: dsa: mediatek,mt7530: add internal mdio bus
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Mt7988 buildin switch has own mdio bus where ge-phys are connected. Add related property for this.
--- Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +3 -0
@@ -156,6 +156,9 @@ properties: maxItems: 1 patternProperties: + "^mdio(-bus)?$": + $ref: /schemas/net/mdio.yaml# + "^(ethernet-)?ports$": type: object additionalProperties: true
Signature · 1 line
2.43.0
PATCH 7/14 arm64: dts: mediatek: mt7988: add phy calibration efuse subnodes
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
MT7988 contains buildin mt753x switch which needs calibration data from efuse.
--- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +16 -0
@@ -696,6 +696,22 @@ efuse@11f50000 { lvts_calibration: calib@918 { reg = <0x918 0x28>; }; + + phy_calibration_p0: calib@940 { + reg = <0x940 0x10>; + }; + + phy_calibration_p1: calib@954 { + reg = <0x954 0x10>; + }; + + phy_calibration_p2: calib@968 { + reg = <0x968 0x10>; + }; + + phy_calibration_p3: calib@97c { + reg = <0x97c 0x10>; + }; }; clock-controller@15000000 {
Signature · 1 line
2.43.0
PATCH 2/14 dt-bindings: net: dsa: mediatek,mt7530: add dsa-port definition for mt7988
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Add own dsa-port binding for SoC with internal switch where only phy-mode 'internal' is valid.
--- .../bindings/net/dsa/mediatek,mt7530.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +13 -1
@@ -186,6 +186,18 @@ required: - reg $defs: + builtin-dsa-port: + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-6]$": + if: + required: [ ethernet ] + then: + properties: + phy-mode: + const: internal + mt7530-dsa-port: patternProperties: "^(ethernet-)?ports$":
@@ -292,7 +304,7 @@ allOf: - mediatek,mt7988-switch - airoha,en7581-switch then: - $ref: "#/$defs/mt7530-dsa-port" + $ref: "#/$defs/builtin-dsa-port" properties: gpio-controller: false mediatek,mcm: false
Signature · 1 line
2.43.0
sorry for splitted series and duplicate part 9
my mail provider responded with "5.7.1 Command rejected" at part 9 and i had to use another one.
regards Frank
Andrew Lunn
maintainerRe: [PATCH v1 02/14] dt-bindings: net: dsa: mediatek,mt7530: add dsa-port definition for mt7988
In reply to Frank WunderlichQuoted 4 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add own dsa-port binding for SoC with internal switch where only phy-mode 'internal' is valid.
So these internal PHYs don't have LEDs?
Andrew
Andrew Lunn
maintainerRe: [PATCH v1 08/14] arm64: dts: mediatek: mt7988: add basic ethernet-nodes
In reply to Frank Wunderlicharch/arm64/boot/dts/mediatek/mt7988a.dtsi phy_calibration_p3: calib@97c { · line 821
Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +10
-0+ gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "internal"; + + fixed-link { + speed = <10000>; + full-duplex; + pause; + };
Does phy-mode internal and fixed-link used together make any sense? Please could you explain this.
Andrew
Andrew Lunn
maintainerRe: [PATCH v1 09/14] arm64: dts: mediatek: mt7988: add switch node
In reply to Frank WunderlichQuoted 32 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add mt7988 builtin mt753x switch nodes.
Signed-off-by Daniel Golle <[email protected]>Signed-off-by Frank Wunderlich <[email protected]>--- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 166 ++++++++++++++++++++++ 1 file changed, 166 insertions(+)arch/arm64/boot/dts/mediatek/mt7988a.dtsi +7
-0@@ -5,6 +5,7 @@ #include <dt-bindings/phy/phy.h> #include <dt-bindings/pinctrl/mt65xx.h> #include <dt-bindings/reset/mediatek,mt7988-resets.h> +#include <dt-bindings/leds/common.h> / { compatible = "mediatek,mt7988a";@@ -742,6 +743,171 @@ ethsys: clock-controller@15000000 { #reset-cells = <1>; }; + switch: switch@15020000 { + compatible = "mediatek,mt7988-switch"; + reg = <0 0x15020000 0 0x8000>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&gic>;
arch/arm64/boot/dts/mediatek/mt7988a.dtsi ethsys: clock-controller@15000000 { · line 761
Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +10
-0+ interrupts = <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>; + resets = <ðwarp MT7988_ETHWARP_RST_SWITCH>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + gsw_port0: port@0 { + reg = <0>; + label = "wan";
I would expect the label to be in the board .dts file, since it is a board property, not a SoC property.
Andrew
Andrew Lunn
maintainerRe: [PATCH v1 02/14] dt-bindings: net: dsa: mediatek,mt7530: add dsa-port definition for mt7988
In reply to Andrew LunnQuoted 7 lines · Andrew Lunn
Quoted 4 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add own dsa-port binding for SoC with internal switch where only phy-mode 'internal' is valid.
So these internal PHYs don't have LEDs?
Ah, i got that wrong, sorry.
What i don't know about here is if you should be defining your own ds-port binding, or taking the existing binding and add a constraint.
Andrew
Aw: Re: [PATCH v1 02/14] dt-bindings: net: dsa: mediatek,mt7530: add dsa-port definition for mt7988
Quoted 11 lines
Gesendet: Sonntag, 11. Mai 2025 um 18:45
Von: "Andrew Lunn" <[email protected]>
Betreff: Re: [PATCH v1 02/14] dt-bindings: net: dsa: mediatek,mt7530: add dsa-port definition for mt7988Quoted 6 lines · Andrew Lunn
Quoted 4 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add own dsa-port binding for SoC with internal switch where only phy-mode 'internal' is valid.
Quoted 6 lines
Quoted 1 line
So these internal PHYs don't have LEDs?
Ah, i got that wrong, sorry.
What i don't know about here is if you should be defining your own ds-port binding, or taking the existing binding and add a constraint.
Hi Andrew
thank you for first review.
this patch is only for allowing the phy-mode 'internal' and corrects the wrong mapping to mt7530-das-port which allows rgmii and sgmii which are invalid on mt7530. i splitted the changes in binding to not squash different changes.
the phys with leds are on the builtin mt7530 internal mdio-bus which i add in patch 3.
regards Frank
Aw: Re: [PATCH v1 09/14] arm64: dts: mediatek: mt7988: add switch node
In reply to Andrew LunnQuoted 43 lines
Gesendet: Sonntag, 11. Mai 2025 um 18:42
Von: "Andrew Lunn" <[email protected]>
Betreff: Re: [PATCH v1 09/14] arm64: dts: mediatek: mt7988: add switch nodeQuoted 37 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add mt7988 builtin mt753x switch nodes.
Signed-off-by Daniel Golle <[email protected]>Signed-off-by Frank Wunderlich <[email protected]>--- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 166 ++++++++++++++++++++++ 1 file changed, 166 insertions(+)arch/arm64/boot/dts/mediatek/mt7988a.dtsi +12
-0@@ -5,6 +5,7 @@ #include <dt-bindings/phy/phy.h> #include <dt-bindings/pinctrl/mt65xx.h> #include <dt-bindings/reset/mediatek,mt7988-resets.h> +#include <dt-bindings/leds/common.h> / { compatible = "mediatek,mt7988a";@@ -742,6 +743,171 @@ ethsys: clock-controller@15000000 { #reset-cells = <1>; }; + switch: switch@15020000 { + compatible = "mediatek,mt7988-switch"; + reg = <0 0x15020000 0 0x8000>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&gic>; + interrupts = <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>; + resets = <ðwarp MT7988_ETHWARP_RST_SWITCH>; + + ports { + #address-cells = <1>;
Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi ethsys: clock-controller@15000000 { · line 761
Quoted 5 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +5
-0+ #size-cells = <0>; + + gsw_port0: port@0 { + reg = <0>; + label = "wan";I would expect the label to be in the board .dts file, since it is a board property, not a SoC property.
i will move that into the board dtsi file in v2 because "normal" bpi-r4 and 2g5 variant are same here.
regards Frank
Andrew Lunn
maintainerRe: Re: [PATCH v1 09/14] arm64: dts: mediatek: mt7988: add switch node
Quoted 1 line
i will move that into the board dtsi file in v2 because "normal" bpi-r4 and 2g5 variant are same here.
Maybe you just need to expand the commit message? What does this .dtsi actually represent? The SoC, or what is common across a number of boards?
Andrew
Re: Re: [PATCH v1 09/14] arm64: dts: mediatek: mt7988: add switch node
Quoted 5 lines · Andrew Lunn
Quoted 1 line
i will move that into the board dtsi file in v2 because "normal" bpi-r4 and 2g5 variant are same here.
Maybe you just need to expand the commit message? What does this .dtsi actually represent? The SoC, or what is common across a number of boards?
mt7988a.dtsi represents the SoC, and thus there shouldn't be any labels assigned to the DSA ports.
In case of the BananaPi R4 there are two different boards, one with 2x SFP+ and one with 1x SFP+ + 1x 2500Base-T (with PoE-in), hence there is a dtsi files for all the parts shared among the two boards. I suppose Frank meant to move the labels to that board dtsi file, and that's correct imho as the labels of the 1G switch ports are the same on BPi-R4 and BPi-R4-PoE.
Re: [PATCH v1 01/14] dt-bindings: net: mediatek,net: update for mt7988
In reply to Frank WunderlichQuoted 14 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Update binding for mt7988 which has 3 gmac and 2 reg items.
Signed-off-by Frank Wunderlich <[email protected]>--- Documentation/devicetree/bindings/net/mediatek,net.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)Documentation/devicetree/bindings/net/mediatek,net.yaml +0
-0
Documentation/devicetree/bindings/net/mediatek,net.yaml properties: · line 32
Quoted 6 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml +2
-1@@ -28,7 +28,8 @@ properties: - ralink,rt5350-eth reg: - maxItems: 1 + minItems: 1 + maxItems: 2
This should become an items list, with an explanation of what each of the reg items represents.
Quoted 20 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml +5
-1clocks: minItems: 2@@ -381,8 +382,12 @@ allOf: - const: xgp2 - const: xgp3 + reg: + minItems: 2 + maxItems: 2 + patternProperties: - "^mac@[0-1]$": + "^mac@[0-2]$": type: object unevaluatedProperties: false allOf:Signature · 1 line
2.43.0
Re: [PATCH v1 08/14] arm64: dts: mediatek: mt7988: add basic ethernet-nodes
In reply to Andrew LunnAm 2025-05-11 18:38, schrieb Andrew Lunn:
Quoted 5 lines
Quoted 5 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +5
-0+ gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "internal"; +
Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi phy_calibration_p3: calib@97c { · line 821
Quoted 5 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +5
-0+ fixed-link { + speed = <10000>; + full-duplex; + pause; + };Does phy-mode internal and fixed-link used together make any sense? Please could you explain this.
Hi,
the fixed link is used to bring up the mac and switch cpu port up with the right settings.
Of course we can hardcode it in driver for mt7988, but driver already supports the generic
definition via devicetree. So imho adding driver code for whats already supported via devicetree
does not make sense for me and devicetree shows the right settings (speed,duplex,flow control) without digging in the driver code.
e.g. we could disable flow-control there (but it causes retransmitts) without changing driver.
Imho this is the cleanest way without adding unnecessary driver code and SoC conditions and devicetree describes hardware ;).
regards Frank
Re: [PATCH v1 01/14] dt-bindings: net: mediatek,net: update for mt7988
In reply to Conor DooleyAm 12. Mai 2025 18:21:45 MESZ schrieb Conor Dooley <[email protected]>:
Quoted 17 lines · Frank Wunderlich
Quoted 16 lines
From: Frank Wunderlich <[email protected]>
Update binding for mt7988 which has 3 gmac and 2 reg items.
Signed-off-by Frank Wunderlich <[email protected]>--- Documentation/devicetree/bindings/net/mediatek,net.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)Documentation/devicetree/bindings/net/mediatek,net.yaml +0
-0@@ -28,7 +28,8 @@ properties: - ralink,rt5350-eth
Quoted 7 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml properties: · line 32
Quoted 4 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml +2
-1reg: - maxItems: 1 + minItems: 1 + maxItems: 2This should become an items list, with an explanation of what each of the reg items represents.
I would change to this
reg:
items:
- description: Register for accessing the MACs.
- description: SoC internal SRAM used for DMA operations.
minItems: 1
Would this be OK this way?
Quoted 7 lines
Quoted 7 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml +0
-0clocks: minItems: 2@@ -381,8 +382,12 @@ allOf: - const: xgp2 - const: xgp3
Quoted 13 lines
Quoted 13 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml +5
-1+ reg: + minItems: 2 + maxItems: 2 + patternProperties: - "^mac@[0-1]$": + "^mac@[0-2]$": type: object unevaluatedProperties: false allOf:Signature · 1 line
2.43.0
Hi Conor
Thank you for review.
regards Frank
Re: [PATCH v1 01/14] dt-bindings: net: mediatek,net: update for mt7988
Quoted 28 lines · Frank Wunderlich
Am 12. Mai 2025 18:21:45 MESZ schrieb Conor Dooley <[email protected]>:
Quoted 17 lines · Frank Wunderlich
Quoted 16 lines
From: Frank Wunderlich <[email protected]>
Update binding for mt7988 which has 3 gmac and 2 reg items.
Signed-off-by Frank Wunderlich <[email protected]>--- Documentation/devicetree/bindings/net/mediatek,net.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)Documentation/devicetree/bindings/net/mediatek,net.yaml +0
-0@@ -28,7 +28,8 @@ properties: - ralink,rt5350-ethQuoted 7 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml properties: · line 32
Quoted 4 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml +2
-1reg: - maxItems: 1 + minItems: 1 + maxItems: 2This should become an items list, with an explanation of what each of the reg items represents.
I would change to this
Quoted 7 lines
reg:
items:
- description: Register for accessing the MACs.
- description: SoC internal SRAM used for DMA operations.
minItems: 1Would this be OK this way?
Ye, that looks good.
Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml allOf: · line 387
Quoted 11 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml +3
-0clocks: minItems: 2@@ -381,8 +382,12 @@ allOf: - const: xgp2 - const: xgp3 + reg: + minItems: 2 + maxItems: 2
You also shouldn't need to set maxItems here, since the list has 2 items total.
Quoted 15 lines
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/net/mediatek,net.yaml +2
-1+ patternProperties: - "^mac@[0-1]$": + "^mac@[0-2]$": type: object unevaluatedProperties: false allOf:Signature · 1 line
2.43.0Hi Conor
Thank you for review.
regards Frank
Re: [PATCH v1 02/14] dt-bindings: net: dsa: mediatek,mt7530: add dsa-port definition for mt7988
In reply to Frank WunderlichQuoted 10 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add own dsa-port binding for SoC with internal switch where only phy-mode 'internal' is valid.
Signed-off-by Frank Wunderlich <[email protected]>--- .../bindings/net/dsa/mediatek,mt7530.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
Rob Herring
maintainerRe: [PATCH v1 03/14] dt-bindings: net: dsa: mediatek,mt7530: add internal mdio bus
In reply to Frank WunderlichQuoted 15 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Mt7988 buildin switch has own mdio bus where ge-phys are connected. Add related property for this.
Signed-off-by Frank Wunderlich <[email protected]>--- Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 3 +++ 1 file changed, 3 insertions(+)Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +0
-0
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml properties: · line 159
Quoted 4 lines
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +1
-0@@ -156,6 +156,9 @@ properties: maxItems: 1 patternProperties: + "^mdio(-bus)?$":
Really need 2 names?
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml properties: · line 160
Quoted 1 line
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +1
-0+ $ref: /schemas/net/mdio.yaml#
unevaluatedProperties: false
Quoted 7 lines
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +1
-0+ "^(ethernet-)?ports$": type: object additionalProperties: trueSignature · 1 line
2.43.0
Aw: Re: [PATCH v1 03/14] dt-bindings: net: dsa: mediatek,mt7530: add internal mdio bus
Hi Rob,
thanks for review
Quoted 22 lines
Gesendet: Mittwoch, 14. Mai 2025 um 23:18
Von: "Rob Herring" <[email protected]>
Betreff: Re: [PATCH v1 03/14] dt-bindings: net: dsa: mediatek,mt7530: add internal mdio busQuoted 17 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Mt7988 buildin switch has own mdio bus where ge-phys are connected. Add related property for this.
Signed-off-by Frank Wunderlich <[email protected]>--- Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 3 +++ 1 file changed, 3 insertions(+)Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +0
-0@@ -156,6 +156,9 @@ properties: maxItems: 1
Quoted 4 lines
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml properties: · line 159
Quoted 2 lines
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +1
-0patternProperties: + "^mdio(-bus)?$":Really need 2 names?
no, i only tried to stay close to definition in mdio.yaml ;) there are some mt7988 boards floating around where i do not know the dts. But i can make only "mdio" to be changed later if needed.
Quoted 3 lines
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml properties: · line 160
Quoted 1 line
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +1
-0+ $ref: /schemas/net/mdio.yaml#unevaluatedProperties: false
ok, then i need to add 'mediatek,pio' subproperty in next round...would be ok in this way?
"^mdio(-bus)?$":
$ref: /schemas/net/mdio.yaml#
unevaluatedProperties: false
properties:
mediatek,pio:
$ref: /schemas/types.yaml#/definitions/phandle description:
Phandle pointing to the mediatek pinctrl node.
regards Frank