Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: Kirkwood: Fix DT based DSA.

During the conversion of boards to use DT to instantiate Distributed
Switch Architecture, nobody volunteered to test. As to be expected,
the conversion was flawed. Testers and access to hardware has now
become available, and this patch hopefully fixes the problems.

dsa,mii-bus must be a phandle to the top level mdio node, not the port
specific subnode of the mdio device.

dsa,ethernet must be a phandle to the port subnode within the ethernet
DT node, not the ethernet node.

Don't pinctrl hog the card detect gpio for mvsdio.

Rename the .dts files to make it clearer which file is for the Z0
stepping and which for the A0 or later stepping.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Cc: seugene@marvell.com
Tested-by: Eugene Sanivsky <seugene@marvell.com>
Fixes: e2eaa339af44: ("ARM: Kirkwood: convert rd88f6281-setup.c to DT.")
Fixes: e7c8f3808be8: ("ARM: kirkwood: Convert mv88f6281gtw_ge switch setup to DT")
Cc: <stable@vger.kernel.org> #v3.15+
Link: https://lkml.kernel.org/r/1409592941-22244-1-git-send-email-andrew@lunn.ch
Signed-off-by: Jason Cooper <jason@lakedaemon.net>

authored by

Andrew Lunn and committed by
Jason Cooper
4f5e01e9 500abb6c

+68 -68
+2 -2
arch/arm/boot/dts/Makefile
··· 144 144 kirkwood-openrd-client.dtb \ 145 145 kirkwood-openrd-ultimate.dtb \ 146 146 kirkwood-rd88f6192.dtb \ 147 - kirkwood-rd88f6281-a0.dtb \ 148 - kirkwood-rd88f6281-a1.dtb \ 147 + kirkwood-rd88f6281-z0.dtb \ 148 + kirkwood-rd88f6281-a.dtb \ 149 149 kirkwood-rs212.dtb \ 150 150 kirkwood-rs409.dtb \ 151 151 kirkwood-rs411.dtb \
+6 -10
arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
··· 123 123 124 124 dsa@0 { 125 125 compatible = "marvell,dsa"; 126 - #address-cells = <2>; 126 + #address-cells = <1>; 127 127 #size-cells = <0>; 128 128 129 - dsa,ethernet = <&eth0>; 130 - dsa,mii-bus = <&ethphy0>; 129 + dsa,ethernet = <&eth0port>; 130 + dsa,mii-bus = <&mdio>; 131 131 132 132 switch@0 { 133 133 #address-cells = <1>; ··· 169 169 170 170 &mdio { 171 171 status = "okay"; 172 - 173 - ethphy0: ethernet-phy@ff { 174 - reg = <0xff>; /* No phy attached */ 175 - speed = <1000>; 176 - duplex = <1>; 177 - }; 178 172 }; 179 173 180 174 &eth0 { 181 175 status = "okay"; 176 + 182 177 ethernet0-port@0 { 183 - phy-handle = <&ethphy0>; 178 + speed = <1000>; 179 + duplex = <1>; 184 180 }; 185 181 };
+43
arch/arm/boot/dts/kirkwood-rd88f6281-a.dts
··· 1 + /* 2 + * Marvell RD88F6181 A Board descrition 3 + * 4 + * Andrew Lunn <andrew@lunn.ch> 5 + * 6 + * This file is licensed under the terms of the GNU General Public 7 + * License version 2. This program is licensed "as is" without any 8 + * warranty of any kind, whether express or implied. 9 + * 10 + * This file contains the definitions for the board with the A0 or 11 + * higher stepping of the SoC. The ethernet switch does not have a 12 + * "wan" port. 13 + */ 14 + 15 + /dts-v1/; 16 + #include "kirkwood-rd88f6281.dtsi" 17 + 18 + / { 19 + model = "Marvell RD88f6281 Reference design, with A0 or higher SoC"; 20 + compatible = "marvell,rd88f6281-a", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood"; 21 + 22 + dsa@0 { 23 + switch@0 { 24 + reg = <10 0>; /* MDIO address 10, switch 0 in tree */ 25 + }; 26 + }; 27 + }; 28 + 29 + &mdio { 30 + status = "okay"; 31 + 32 + ethphy1: ethernet-phy@11 { 33 + reg = <11>; 34 + }; 35 + }; 36 + 37 + &eth1 { 38 + status = "okay"; 39 + 40 + ethernet1-port@0 { 41 + phy-handle = <&ethphy1>; 42 + }; 43 + };
-26
arch/arm/boot/dts/kirkwood-rd88f6281-a0.dts
··· 1 - /* 2 - * Marvell RD88F6181 A0 Board descrition 3 - * 4 - * Andrew Lunn <andrew@lunn.ch> 5 - * 6 - * This file is licensed under the terms of the GNU General Public 7 - * License version 2. This program is licensed "as is" without any 8 - * warranty of any kind, whether express or implied. 9 - * 10 - * This file contains the definitions for the board with the A0 variant of 11 - * the SoC. The ethernet switch does not have a "wan" port. 12 - */ 13 - 14 - /dts-v1/; 15 - #include "kirkwood-rd88f6281.dtsi" 16 - 17 - / { 18 - model = "Marvell RD88f6281 Reference design, with A0 SoC"; 19 - compatible = "marvell,rd88f6281-a0", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood"; 20 - 21 - dsa@0 { 22 - switch@0 { 23 - reg = <10 0>; /* MDIO address 10, switch 0 in tree */ 24 - }; 25 - }; 26 - };
+10 -6
arch/arm/boot/dts/kirkwood-rd88f6281-a1.dts arch/arm/boot/dts/kirkwood-rd88f6281-z0.dts
··· 1 1 /* 2 - * Marvell RD88F6181 A1 Board descrition 2 + * Marvell RD88F6181 Z0 stepping descrition 3 3 * 4 4 * Andrew Lunn <andrew@lunn.ch> 5 5 * ··· 7 7 * License version 2. This program is licensed "as is" without any 8 8 * warranty of any kind, whether express or implied. 9 9 * 10 - * This file contains the definitions for the board with the A1 variant of 11 - * the SoC. The ethernet switch has a "wan" port. 12 - */ 10 + * This file contains the definitions for the board using the Z0 11 + * stepping of the SoC. The ethernet switch has a "wan" port. 12 + */ 13 13 14 14 /dts-v1/; 15 15 16 16 #include "kirkwood-rd88f6281.dtsi" 17 17 18 18 / { 19 - model = "Marvell RD88f6281 Reference design, with A1 SoC"; 20 - compatible = "marvell,rd88f6281-a1", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood"; 19 + model = "Marvell RD88f6281 Reference design, with Z0 SoC"; 20 + compatible = "marvell,rd88f6281-z0", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood"; 21 21 22 22 dsa@0 { 23 23 switch@0 { ··· 28 28 }; 29 29 }; 30 30 }; 31 + }; 32 + 33 + &eth1 { 34 + status = "disabled"; 31 35 };
+5 -22
arch/arm/boot/dts/kirkwood-rd88f6281.dtsi
··· 37 37 38 38 ocp@f1000000 { 39 39 pinctrl: pin-controller@10000 { 40 - pinctrl-0 = <&pmx_sdio_cd>; 41 40 pinctrl-names = "default"; 42 41 43 42 pmx_sdio_cd: pmx-sdio-cd { ··· 68 69 #address-cells = <2>; 69 70 #size-cells = <0>; 70 71 71 - dsa,ethernet = <&eth0>; 72 - dsa,mii-bus = <&ethphy1>; 72 + dsa,ethernet = <&eth0port>; 73 + dsa,mii-bus = <&mdio>; 73 74 74 75 switch@0 { 75 76 #address-cells = <1>; ··· 118 119 }; 119 120 120 121 partition@300000 { 121 - label = "data"; 122 + label = "rootfs"; 122 123 reg = <0x0300000 0x500000>; 123 124 }; 124 125 }; 125 126 126 127 &mdio { 127 128 status = "okay"; 128 - 129 - ethphy0: ethernet-phy@0 { 130 - reg = <0>; 131 - }; 132 - 133 - ethphy1: ethernet-phy@ff { 134 - reg = <0xff>; /* No PHY attached */ 135 - speed = <1000>; 136 - duple = <1>; 137 - }; 138 129 }; 139 130 140 131 &eth0 { 141 132 status = "okay"; 142 133 ethernet0-port@0 { 143 - phy-handle = <&ethphy0>; 144 - }; 145 - }; 146 - 147 - &eth1 { 148 - status = "okay"; 149 - ethernet1-port@0 { 150 - phy-handle = <&ethphy1>; 134 + speed = <1000>; 135 + duplex = <1>; 151 136 }; 152 137 };
+2 -2
arch/arm/boot/dts/kirkwood.dtsi
··· 309 309 marvell,tx-checksum-limit = <1600>; 310 310 status = "disabled"; 311 311 312 - ethernet0-port@0 { 312 + eth0port: ethernet0-port@0 { 313 313 compatible = "marvell,kirkwood-eth-port"; 314 314 reg = <0>; 315 315 interrupts = <11>; ··· 342 342 pinctrl-names = "default"; 343 343 status = "disabled"; 344 344 345 - ethernet1-port@0 { 345 + eth1port: ethernet1-port@0 { 346 346 compatible = "marvell,kirkwood-eth-port"; 347 347 reg = <0>; 348 348 interrupts = <15>;