| .. | .. |
|---|
| 9 | 9 | - #size-cells: must be 0 |
|---|
| 10 | 10 | - #address-cells: must be 1 |
|---|
| 11 | 11 | |
|---|
| 12 | +Optional properties: |
|---|
| 13 | + |
|---|
| 14 | +- reset-gpios: GPIO to be used to reset the whole device |
|---|
| 15 | + |
|---|
| 12 | 16 | Subnodes: |
|---|
| 13 | 17 | |
|---|
| 14 | 18 | The integrated switch subnode should be specified according to the binding |
|---|
| 15 | | -described in dsa/dsa.txt. As the QCA8K switches do not have a N:N mapping of |
|---|
| 16 | | -port and PHY id, each subnode describing a port needs to have a valid phandle |
|---|
| 17 | | -referencing the internal PHY connected to it. The CPU port of this switch is |
|---|
| 18 | | -always port 0. |
|---|
| 19 | +described in dsa/dsa.txt. If the QCA8K switch is connect to a SoC's external |
|---|
| 20 | +mdio-bus each subnode describing a port needs to have a valid phandle |
|---|
| 21 | +referencing the internal PHY it is connected to. This is because there's no |
|---|
| 22 | +N:N mapping of port and PHY id. |
|---|
| 23 | + |
|---|
| 24 | +Don't use mixed external and internal mdio-bus configurations, as this is |
|---|
| 25 | +not supported by the hardware. |
|---|
| 26 | + |
|---|
| 27 | +The CPU port of this switch is always port 0. |
|---|
| 19 | 28 | |
|---|
| 20 | 29 | A CPU port node has the following optional node: |
|---|
| 21 | 30 | |
|---|
| .. | .. |
|---|
| 31 | 40 | - 'full-duplex' (boolean, optional), to indicate that full duplex is |
|---|
| 32 | 41 | used. When absent, half duplex is assumed. |
|---|
| 33 | 42 | |
|---|
| 34 | | -Example: |
|---|
| 43 | +Examples: |
|---|
| 35 | 44 | |
|---|
| 45 | +for the external mdio-bus configuration: |
|---|
| 36 | 46 | |
|---|
| 37 | 47 | &mdio0 { |
|---|
| 38 | 48 | phy_port1: phy@0 { |
|---|
| .. | .. |
|---|
| 55 | 65 | reg = <4>; |
|---|
| 56 | 66 | }; |
|---|
| 57 | 67 | |
|---|
| 58 | | - switch0@0 { |
|---|
| 68 | + switch@10 { |
|---|
| 59 | 69 | compatible = "qca,qca8337"; |
|---|
| 60 | 70 | #address-cells = <1>; |
|---|
| 61 | 71 | #size-cells = <0>; |
|---|
| 62 | 72 | |
|---|
| 63 | | - reg = <0>; |
|---|
| 73 | + reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>; |
|---|
| 74 | + reg = <0x10>; |
|---|
| 64 | 75 | |
|---|
| 65 | 76 | ports { |
|---|
| 66 | 77 | #address-cells = <1>; |
|---|
| .. | .. |
|---|
| 108 | 119 | }; |
|---|
| 109 | 120 | }; |
|---|
| 110 | 121 | }; |
|---|
| 122 | + |
|---|
| 123 | +for the internal master mdio-bus configuration: |
|---|
| 124 | + |
|---|
| 125 | + &mdio0 { |
|---|
| 126 | + switch@10 { |
|---|
| 127 | + compatible = "qca,qca8337"; |
|---|
| 128 | + #address-cells = <1>; |
|---|
| 129 | + #size-cells = <0>; |
|---|
| 130 | + |
|---|
| 131 | + reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>; |
|---|
| 132 | + reg = <0x10>; |
|---|
| 133 | + |
|---|
| 134 | + ports { |
|---|
| 135 | + #address-cells = <1>; |
|---|
| 136 | + #size-cells = <0>; |
|---|
| 137 | + |
|---|
| 138 | + port@0 { |
|---|
| 139 | + reg = <0>; |
|---|
| 140 | + label = "cpu"; |
|---|
| 141 | + ethernet = <&gmac1>; |
|---|
| 142 | + phy-mode = "rgmii"; |
|---|
| 143 | + fixed-link { |
|---|
| 144 | + speed = 1000; |
|---|
| 145 | + full-duplex; |
|---|
| 146 | + }; |
|---|
| 147 | + }; |
|---|
| 148 | + |
|---|
| 149 | + port@1 { |
|---|
| 150 | + reg = <1>; |
|---|
| 151 | + label = "lan1"; |
|---|
| 152 | + }; |
|---|
| 153 | + |
|---|
| 154 | + port@2 { |
|---|
| 155 | + reg = <2>; |
|---|
| 156 | + label = "lan2"; |
|---|
| 157 | + }; |
|---|
| 158 | + |
|---|
| 159 | + port@3 { |
|---|
| 160 | + reg = <3>; |
|---|
| 161 | + label = "lan3"; |
|---|
| 162 | + }; |
|---|
| 163 | + |
|---|
| 164 | + port@4 { |
|---|
| 165 | + reg = <4>; |
|---|
| 166 | + label = "lan4"; |
|---|
| 167 | + }; |
|---|
| 168 | + |
|---|
| 169 | + port@5 { |
|---|
| 170 | + reg = <5>; |
|---|
| 171 | + label = "wan"; |
|---|
| 172 | + }; |
|---|
| 173 | + }; |
|---|
| 174 | + }; |
|---|
| 175 | + }; |
|---|