1 Mediatek MT7530 Ethernet switch
2 ================================
6 - compatible: may be compatible = "mediatek,mt7530"
7 or compatible = "mediatek,mt7621"
8 - #address-cells: Must be 1.
9 - #size-cells: Must be 0.
10 - mediatek,mcm: Boolean; if defined, indicates that either MT7530 is the part
11 on multi-chip module belong to MT7623A has or the remotely standalone
12 chip as the function MT7623N reference board provided for.
14 If compatible mediatek,mt7530 is set then the following properties are required
16 - core-supply: Phandle to the regulator node necessary for the core power.
17 - io-supply: Phandle to the regulator node necessary for the I/O power.
18 See Documentation/devicetree/bindings/regulator/mt6323-regulator.txt
19 for details for the regulator setup on these boards.
21 If the property mediatek,mcm isn't defined, following property is required
23 - reset-gpios: Should be a gpio specifier for a reset line.
25 Else, following properties are required
27 - resets : Phandle pointing to the system reset controller with
28 line index for the ethsys.
29 - reset-names : Should be set to "mcm".
31 Required properties for the child nodes within ports container:
33 - reg: Port address described must be 6 for CPU port and from 0 to 5 for
35 - phy-mode: String, must be either "trgmii" or "rgmii" for port labeled
38 Port 5 of the switch is muxed between:
39 1. GMAC5: GMAC5 can interface with another external MAC or PHY.
40 2. PHY of port 0 or port 4: PHY interfaces with an external MAC like 2nd GMAC
41 of the SOC. Used in many setups where port 0/4 becomes the WAN port.
42 Note: On a MT7621 SOC with integrated switch: 2nd GMAC can only connected to
43 GMAC5 when the gpios for RGMII2 (GPIO 22-33) are not used and not
44 connected to external component!
46 Port 5 modes/configurations:
47 1. Port 5 is disabled and isolated: An external phy can interface to the 2nd
49 In the case of a build-in MT7530 switch, port 5 shares the RGMII bus with 2nd
50 GMAC and an optional external phy. Mind the GPIO/pinctl settings of the SOC!
51 2. Port 5 is muxed to PHY of port 0/4: Port 0/4 interfaces with 2nd GMAC.
52 It is a simple MAC to PHY interface, port 5 needs to be setup for xMII mode
54 3. Port 5 is muxed to GMAC5 and can interface to an external phy.
55 Port 5 becomes an extra switch port.
56 Only works on platform where external phy TX<->RX lines are swapped.
57 Like in the Ubiquiti ER-X-SFP.
58 4. Port 5 is muxed to GMAC5 and interfaces with the 2nd GAMC as 2nd CPU port.
59 Currently a 2nd CPU port is not supported by DSA code.
61 Depending on how the external PHY is wired:
62 1. normal: The PHY can only connect to 2nd GMAC but not to the switch
63 2. swapped: RGMII TX, RX are swapped; external phy interface with the switch as
64 a ethernet port. But can't interface to the 2nd GMAC.
66 Based on the DT the port 5 mode is configured.
68 Driver tries to lookup the phy-handle of the 2nd GMAC of the master device.
69 When phy-handle matches PHY of port 0 or 4 then port 5 set-up as mode 2.
70 phy-mode must be set, see also example 2 below!
71 * mt7621: phy-mode = "rgmii-txid";
72 * mt7623: phy-mode = "rgmii";
74 See Documentation/devicetree/bindings/net/dsa/dsa.txt for a list of additional
75 required, optional properties and how the integrated switch subnodes must
82 compatible = "mediatek,mt7530";
87 core-supply = <&mt6323_vpa_reg>;
88 io-supply = <&mt6323_vemc3v3_reg>;
89 reset-gpios = <&pio 33 0>;
134 Example 2: MT7621: Port 4 is WAN port: 2nd GMAC -> Port 5 -> PHY port 4.
138 compatible = "mediatek,eth-mac";
150 compatible = "mediatek,eth-mac";
152 phy-mode = "rgmii-txid";
153 phy-handle = <&phy4>;
157 #address-cells = <1>;
161 phy4: ethernet-phy@4 {
166 compatible = "mediatek,mt7621";
167 #address-cells = <1>;
170 pinctrl-names = "default";
173 resets = <&rstctrl 2>;
177 #address-cells = <1>;
200 /* Commented out. Port 4 is handled by 2nd GMAC.
224 Example 3: MT7621: Port 5 is connected to external PHY: Port 5 -> external PHY.
228 compatible = "mediatek,eth-mac";
240 #address-cells = <1>;
244 ephy5: ethernet-phy@7 {
249 compatible = "mediatek,mt7621";
250 #address-cells = <1>;
253 pinctrl-names = "default";
256 resets = <&rstctrl 2>;
260 #address-cells = <1>;
292 phy-handle = <&ephy5>;