ARM: dts: BCM5301X:Make usb3 phy use mdio phy driver
PATCH 1/1 ARM: dts: BCM5301X:Make usb3 phy use mdio phy driver
Currently, usb3 phy in bcm5301x.dtsi uses platform driver which requires register range "ccb-mii" <0x18003000 0x1000>. This range overlaps with mdio cmd and param registers (<0x18003000 0x8>). Essentially, the platform driver partly acts like a mdio bus driver, hence to use of this register range.
In some Northstar devices like Linksys EA9500, secondary switch is connected via external mdio. The only way to access and configure the external switch is via mdio bus. When we enable the mdio bus in it's current state, the mdio bus and any child buses fail to register because of the register range overlap.
On Northstar, the usb3 phy is connected at address 0x10 on the internal mdio bus. This change moves the usb3_phy node and makes it a child node of internal mdio bus.
Thanks to Rafa? Mi?ecki's commit af850e14a7ae
("phy: bcm-ns-usb3: add MDIO driver using proper bus layer") the same usb3 platform driver can now act as usb3 phy mdio driver.
Tested on Linksys Panamera (EA9500)
--- arch/arm/boot/dts/bcm47094.dtsi | 7 ++++--- arch/arm/boot/dts/bcm5301x.dtsi | 34 ++++++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 11 deletions(-)
arch/arm/boot/dts/bcm47094.dtsi +4 -3
@@ -7,9 +7,10 @@ #include "bcm4708.dtsi" / { - usb3_phy: usb3-phy { - compatible = "brcm,ns-bx-usb3-phy"; - }; +}; + +&usb3_phy { + compatible = "brcm,ns-bx-usb3-phy"; }; &uart0 {
arch/arm/boot/dts/bcm5301x.dtsi +26 -8
@@ -154,13 +154,6 @@ clock-names = "phy-ref-clk"; }; - usb3_phy: usb3-phy { - compatible = "brcm,ns-ax-usb3-phy"; - reg = <0x18105000 0x1000>, <0x18003000 0x1000>; - reg-names = "dmp", "ccb-mii"; - #phy-cells = <0>; - }; - axi at 18000000 { compatible = "brcm,bus-axi"; reg = <0x18000000 0x1000>;
@@ -359,7 +352,32 @@ reg = <0x18003000 0x8>; #size-cells = <1>; #address-cells = <0>; - status = "disabled"; + }; + + mdio-bus-mux { + compatible = "mdio-mux-mmioreg"; + mdio-parent-bus = <&mdio>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x18003000 0x4>; + mux-mask = <0x200>; + + mdio_int: mdio at 0 { + reg = <0x0>; + #address-cells = <1>; + #size-cells = <0>; + + usb3_phy: usb3-phy at 10 { + compatible = "brcm,ns-ax-usb3-phy"; + reg = <0x10>; + usb3-dmp-syscon = <&usb3_dmp>; + #phy-cells = <0>; + }; + }; + }; + + usb3_dmp: syscon at 18105000 { + reg = <0x18105000 0x1000>; }; i2c0: i2c at 18009000 {
Signature · 1 line
2.11.0
PATCH v2 1/1 ARM: dts: BCM5301X: Make usb3 phy use mdio phy driver
Currently, usb3 phy in bcm5301x.dtsi uses platform driver which requires register range "ccb-mii" <0x18003000 0x1000>. This range overlaps with mdio cmd and param registers (<0x18003000 0x8>). Essentially, the platform driver partly acts like a mdio bus driver, hence to use of this register range.
In some Northstar devices like Linksys EA9500, secondary switch is connected via external mdio. The only way to access and configure the external switch is via mdio bus. When we enable the mdio bus in it's current state, the mdio bus and any child buses fail to register because of the register range overlap.
On Northstar, the usb3 phy is connected at address 0x10 on the internal mdio bus. This change moves the usb3_phy node and makes it a child node of internal mdio bus.
Thanks to Rafa? Mi?ecki's commit af850e14a7ae
("phy: bcm-ns-usb3: add MDIO driver using proper bus layer") the same usb3 platform driver can now act as usb3 phy mdio driver.
Tested on Linksys Panamera (EA9500)
---
v2: Disabled usb3_phy by default, then enabled in dts where
necessary
--- arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts | 4 +++ arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts | 4 +++ arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts | 4 +++ arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts | 4 +++ arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts | 4 +++ arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts | 4 +++ arch/arm/boot/dts/bcm4708-netgear-r6250.dts | 4 +++ arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts | 4 +++ arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts | 4 +++ arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts | 4 +++ arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | 4 +++ arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts | 4 +++ arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts | 4 +++ arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts | 4 +++ arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts | 4 +++ arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | 4 +++ arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts | 4 +++ arch/arm/boot/dts/bcm4709-linksys-ea9200.dts | 4 +++ arch/arm/boot/dts/bcm4709-netgear-r7000.dts | 4 +++ arch/arm/boot/dts/bcm4709-netgear-r8000.dts | 4 +++ arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts | 4 +++ arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts | 4 +++ arch/arm/boot/dts/bcm47094-linksys-panamera.dts | 4 +++ arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts | 4 +++ arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts | 4 +++ arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts | 4 +++ arch/arm/boot/dts/bcm47094-netgear-r8500.dts | 4 +++ arch/arm/boot/dts/bcm47094.dtsi | 7 +++-- arch/arm/boot/dts/bcm5301x.dtsi | 35 +++++++++++++++++----- arch/arm/boot/dts/bcm94708.dts | 4 +++ arch/arm/boot/dts/bcm94709.dts | 4 +++ arch/arm/boot/dts/bcm953012er.dts | 4 +++ arch/arm/boot/dts/bcm953012hr.dts | 4 +++ arch/arm/boot/dts/bcm953012k.dts | 4 +++ 35 files changed, 175 insertions(+), 11 deletions(-) create mode 100755 patchdts.sh
arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts +4 -0
@@ -101,3 +101,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts +4 -0
@@ -91,3 +91,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +4 -0
@@ -147,3 +147,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts +4 -0
@@ -39,3 +39,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts +4 -0
@@ -58,3 +58,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts +4 -0
@@ -59,3 +59,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4708-netgear-r6250.dts +4 -0
@@ -91,3 +91,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +4 -0
@@ -94,3 +94,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts +4 -0
@@ -159,3 +159,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +4 -0
@@ -85,3 +85,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts +4 -0
@@ -129,3 +129,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts +4 -0
@@ -115,3 +115,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts +4 -0
@@ -58,3 +58,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts +4 -0
@@ -106,3 +106,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +4 -0
@@ -100,3 +100,7 @@ &usb2 { vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +4 -0
@@ -73,3 +73,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +4 -0
@@ -128,3 +128,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +4 -0
@@ -40,3 +40,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4709-netgear-r7000.dts +4 -0
@@ -112,3 +112,7 @@ &usb3 { vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4709-netgear-r8000.dts +4 -0
@@ -182,3 +182,7 @@ &usb3 { vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +4 -0
@@ -105,3 +105,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +4 -0
@@ -120,3 +120,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47094-linksys-panamera.dts +4 -0
@@ -34,3 +34,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts +4 -0
@@ -61,3 +61,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts +4 -0
@@ -61,3 +61,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts +4 -0
@@ -101,3 +101,7 @@ &spi_nor { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47094-netgear-r8500.dts +4 -0
@@ -92,3 +92,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm47094.dtsi +4 -3
@@ -7,9 +7,10 @@ #include "bcm4708.dtsi" / { - usb3_phy: usb3-phy { - compatible = "brcm,ns-bx-usb3-phy"; - }; +}; + +&usb3_phy { + compatible = "brcm,ns-bx-usb3-phy"; }; &uart0 {
arch/arm/boot/dts/bcm5301x.dtsi +27 -8
@@ -154,13 +154,6 @@ clock-names = "phy-ref-clk"; }; - usb3_phy: usb3-phy { - compatible = "brcm,ns-ax-usb3-phy"; - reg = <0x18105000 0x1000>, <0x18003000 0x1000>; - reg-names = "dmp", "ccb-mii"; - #phy-cells = <0>; - }; - axi at 18000000 { compatible = "brcm,bus-axi"; reg = <0x18000000 0x1000>;
@@ -359,7 +352,33 @@ reg = <0x18003000 0x8>; #size-cells = <1>; #address-cells = <0>; - status = "disabled"; + }; + + mdio-bus-mux { + compatible = "mdio-mux-mmioreg"; + mdio-parent-bus = <&mdio>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x18003000 0x4>; + mux-mask = <0x200>; + + mdio at 0 { + reg = <0x0>; + #address-cells = <1>; + #size-cells = <0>; + + usb3_phy: usb3-phy at 10 { + compatible = "brcm,ns-ax-usb3-phy"; + reg = <0x10>; + usb3-dmp-syscon = <&usb3_dmp>; + #phy-cells = <0>; + status = "disabled"; + }; + }; + }; + + usb3_dmp: syscon at 18105000 { + reg = <0x18105000 0x1000>; }; i2c0: i2c at 18009000 {
arch/arm/boot/dts/bcm94708.dts +4 -0
@@ -42,3 +42,7 @@ reg = <0x00000000 0x08000000>; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm94709.dts +4 -0
@@ -42,3 +42,7 @@ reg = <0x00000000 0x08000000>; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm953012er.dts +4 -0
@@ -90,3 +90,7 @@ }; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm953012hr.dts +4 -0
@@ -95,3 +95,7 @@ reg = <0x00700000 0x00900000>; }; }; + +&usb3_phy { + status = "okay"; +};
arch/arm/boot/dts/bcm953012k.dts +4 -0
@@ -113,3 +113,7 @@ &uart1 { status = "okay"; }; + +&usb3_phy { + status = "okay"; +};
Signature · 1 line
2.11.0
Re: [PATCH v2] ARM: dts: BCM5301X: Make usb3 phy use mdio phy driver
Quoted 20 lines · Vivek Unune
Currently, usb3 phy in
bcm5301x.dtsiuses platform driver which requires register range "ccb-mii" <0x180030000x1000>. This range overlaps with mdio cmd and param registers (<0x180030000x8>). Essentially, the platform driver partly acts like a mdio bus driver, hence to use of this register range.In some Northstar devices like Linksys EA9500, secondary switch is connected via external mdio. The only way to access and configure the external switch is via mdio bus. When we enable the mdio bus in it's current state, the mdio bus and any child buses fail to register because of the register range overlap.
On Northstar, the usb3 phy is connected at address
0x10on the internal mdio bus. This change moves theusb3_phynode and makes it a child node of internal mdio bus.Thanks to Rafa? Mi?ecki's commit
af850e14a7ae
("phy: bcm-ns-usb3: add MDIO driver using proper bus layer") the same usb3 platform driver can now act as usb3 phy mdio driver.
Quoted 6 lines
Tested on Linksys Panamera (EA9500)
Signed-off-by Vivek Unune <[email protected]>---
v2: Disabledusb3_phyby default, then enabled in dts where
necessary
Rafal, Hauke, this looks good to me, can you review? Thanks
Signature · 1 line
Florian
Re: [PATCH v2] ARM: dts: BCM5301X: Make usb3 phy use mdio phy driver
Quoted 21 lines · Florian Fainelli
Quoted 20 lines · Vivek Unune
Currently, usb3 phy in
bcm5301x.dtsiuses platform driver which requires register range "ccb-mii" <0x180030000x1000>. This range overlaps with mdio cmd and param registers (<0x180030000x8>). Essentially, the platform driver partly acts like a mdio bus driver, hence to use of this register range.In some Northstar devices like Linksys EA9500, secondary switch is connected via external mdio. The only way to access and configure the external switch is via mdio bus. When we enable the mdio bus in it's current state, the mdio bus and any child buses fail to register because of the register range overlap.
On Northstar, the usb3 phy is connected at address
0x10on the internal mdio bus. This change moves theusb3_phynode and makes it a child node of internal mdio bus.Thanks to Rafa? Mi?ecki's commit
af850e14a7ae
("phy: bcm-ns-usb3: add MDIO driver using proper bus layer") the same usb3 platform driver can now act as usb3 phy mdio driver.
Quoted 10 lines
Quoted 6 lines
Tested on Linksys Panamera (EA9500)
Signed-off-by Vivek Unune <[email protected]>---
v2: Disabledusb3_phyby default, then enabled in dts where
necessaryRafal, Hauke, this looks good to me, can you review? Thanks
Signature · 1 line
Florian
Rafa?, Hauke,
I'm sure you are super busy :) Just want to bring this to your attention.
Thanks,
Vivek
Florian Fainelli
AppliedRe: [PATCH v2] ARM: dts: BCM5301X: Make usb3 phy use mdio phy driver
In reply to Vivek UnuneQuoted 16 lines · Vivek Unune
Currently, usb3 phy in
bcm5301x.dtsiuses platform driver which requires register range "ccb-mii" <0x180030000x1000>. This range overlaps with mdio cmd and param registers (<0x180030000x8>). Essentially, the platform driver partly acts like a mdio bus driver, hence to use of this register range.In some Northstar devices like Linksys EA9500, secondary switch is connected via external mdio. The only way to access and configure the external switch is via mdio bus. When we enable the mdio bus in it's current state, the mdio bus and any child buses fail to register because of the register range overlap.
On Northstar, the usb3 phy is connected at address
0x10on the internal mdio bus. This change moves theusb3_phynode and makes it a child node of internal mdio bus.
Quoted 8 lines
Thanks to Rafa? Mi?ecki's commit
af850e14a7ae
("phy: bcm-ns-usb3: add MDIO driver using proper bus layer") the same usb3 platform driver can now act as usb3 phy mdio driver.Tested on Linksys Panamera (EA9500)
Signed-off-by Vivek Unune <[email protected]>---
Applied to devicetree/next, thanks!
--
Florian