Stingray USB PHY driver support
v3 cover Stingray USB PHY driver support
These patches add Stingray USB PHY driver and its corresponding DT nodes with documentation.
This patch set is based on Linux-5.0-rc2.
Changes from v2:
- Addressed Kishon review comments
- Updated patchset to Linux-5.0-rc2
Changes from v1:
- Addressed Kishon review comments
- phy init call return value handle
Srinath Mannam (3):
dt-bindings: phy: Add Stingray USB PHY binding document
phy: sr-usb: Add Stingray USB PHY driver
arm64: dts: Add USB DT nodes for Stingray SoC
.../bindings/phy/brcm,stingray-usb-phy.txt | 62 ++++ .../boot/dts/broadcom/stingray/stingray-usb.dtsi | 95 ++++++ .../arm64/boot/dts/broadcom/stingray/stingray.dtsi | 1 + drivers/phy/broadcom/Kconfig | 11 + drivers/phy/broadcom/Makefile | 1 + drivers/phy/broadcom/phy-bcm-sr-usb.c | 371 +++++++++++++++++++++ 6 files changed, 541 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt create mode 100644 arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi create mode 100644 drivers/phy/broadcom/phy-bcm-sr-usb.c
Signature · 1 line
2.7.4
PATCH v3 1/3 dt-bindings: phy: Add Stingray USB PHY binding document
Add DT binding document for Stingray USB PHY.
--- .../bindings/phy/brcm,stingray-usb-phy.txt | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt new file +62 -0
@@ -0,0 +1,62 @@ +Broadcom Stingray USB PHY + +Required properties: + - compatible : should be one of the listed compatibles + - "brcm,sr-usb-phy" + - "brcm,sr-usb-phy-v2" + - reg: offset and length of the PHY blocks registers + - address-cells: should be 1 + - size-cells: should be 0 + +Sub-nodes: + Each port's PHY should be represented as a sub-node. + +Sub-nodes required properties: + - reg: required for brcm,sr-usb-phy model phy. + reg value 0 is HS phy and 1 is SS phy. + - phy-cells: generic PHY binding; must be 0 + +Refer to phy/phy-bindings.txt for the generic PHY binding properties + +Example: + usbphy0: usb-phy@0 { + compatible = "brcm,sr-usb-phy"; + reg = <0x00000000 0x100>; + #address-cells = <1>; + #size-cells = <0>; + + usb0_phy0: phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + + usb0_phy1: phy@1 { + reg = <1>; + #phy-cells = <0>; + }; + }; + + usbphy1: usb-phy@10000 { + compatible = "brcm,sr-usb-phy"; + reg = <0x00010000 0x100>, + #address-cells = <1>; + #size-cells = <0>; + + usb1_phy0: phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + + usb1_phy1: phy@1 { + reg = <1>; + #phy-cells = <0>; + }; + }; + + usbphy2: usb-phy@20000 { + compatible = "brcm,sr-usb-phy-v2"; + reg = <0x00020000 0x100>, + #address-cells = <1>; + #size-cells = <0>; + #phy-cells = <0>; + };
Signature · 1 line
2.7.4
Rob Herring
maintainerRe: [PATCH v3 1/3] dt-bindings: phy: Add Stingray USB PHY binding document
Quoted 16 lines · Srinath Mannam
Add DT binding document for Stingray USB PHY.
Signed-off-by Srinath Mannam <[email protected]>Reviewed-by Florian Fainelli <[email protected]>Reviewed-by Scott Branden <[email protected]>--- .../bindings/phy/brcm,stingray-usb-phy.txt | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txtDocumentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt new file +0
-0
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt line 6
Quoted 6 lines
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt new file +6
-0@@ -0,0 +1,62 @@ +Broadcom Stingray USB PHY + +Required properties: + - compatible : should be one of the listed compatibles + - "brcm,sr-usb-phy" + - "brcm,sr-usb-phy-v2"
SoC specific compatibles are preferred. Version numbers can be used but should follow some documented scheme and be meaningful. What we don't want is just Linux developers making up numbering.
Quoted 14 lines
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt new file +14
-0+ - reg: offset and length of the PHY blocks registers + - address-cells: should be 1 + - size-cells: should be 0 + +Sub-nodes: + Each port's PHY should be represented as a sub-node. + +Sub-nodes required properties: + - reg: required for brcm,sr-usb-phy model phy. + reg value 0 is HS phy and 1 is SS phy. + - phy-cells: generic PHY binding; must be 0 + +Refer to phy/phy-bindings.txt for the generic PHY binding properties +
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt line 30
Quoted 10 lines
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt new file +10
-0+Example: + usbphy0: usb-phy@0 { + compatible = "brcm,sr-usb-phy"; + reg = <0x00000000 0x100>; + #address-cells = <1>; + #size-cells = <0>; + + usb0_phy0: phy@0 { + reg = <0>; + #phy-cells = <0>;
Unless there's DT resources for each child node, you don't need these. Just make #phy-cells 1 in the parent.
Rob
Re: [PATCH v3 1/3] dt-bindings: phy: Add Stingray USB PHY binding document
Hi Rob,
Thanks for review, please see my comments below inline.
Quoted 12 lines · Rob Herring
Quoted 10 lines · Srinath Mannam
Add DT binding document for Stingray USB PHY.
Signed-off-by Srinath Mannam <[email protected]>Reviewed-by Florian Fainelli <[email protected]>Reviewed-by Scott Branden <[email protected]>--- .../bindings/phy/brcm,stingray-usb-phy.txt | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt
Quoted 17 lines
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt line 6
Quoted 12 lines
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt new file +6
-0@@ -0,0 +1,62 @@ +Broadcom Stingray USB PHY + +Required properties: + - compatible : should be one of the listed compatibles + - "brcm,sr-usb-phy" + - "brcm,sr-usb-phy-v2"SoC specific compatibles are preferred. Version numbers can be used but should follow some documented scheme and be meaningful. What we don't want is just Linux developers making up numbering.
Both versions are different phy controllers and also have separate register offsets.
I will provide more meaningful compatible IDs and their documentation in next patchset.
Quoted 19 lines
Quoted 19 lines
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt new file +19
-0+ - reg: offset and length of the PHY blocks registers + - address-cells: should be 1 + - size-cells: should be 0 + +Sub-nodes: + Each port's PHY should be represented as a sub-node. + +Sub-nodes required properties: + - reg: required for brcm,sr-usb-phy model phy. + reg value 0 is HS phy and 1 is SS phy. + - phy-cells: generic PHY binding; must be 0 + +Refer to phy/phy-bindings.txt for the generic PHY binding properties + +Example: + usbphy0: usb-phy@0 { + compatible = "brcm,sr-usb-phy"; + reg = <0x00000000 0x100>; + #address-cells = <1>;
Quoted 8 lines
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt line 30
Quoted 5 lines
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt new file +5
-0+ #size-cells = <0>; + + usb0_phy0: phy@0 { + reg = <0>; + #phy-cells = <0>;Unless there's DT resources for each child node, you don't need these. Just make #phy-cells 1 in the parent.
With the use of phy-cell, PHY argument is available with xlate function, But controller specific assignments required to be done while probe. So I will take your first option given in previous comment.
Regards,
Srinath.
Quoted 2 lines
Rob
PATCH v3 2/3 phy: sr-usb: Add Stingray USB PHY driver
In reply to Srinath MannamUSB PHY driver supports all versions of stingray SS and HS USB PHYs.
- Version 1 is a combo PHY contains both SS and HS PHYs.
- Version 2 is a single HS PHY.
These PHYs support both Generic xHCI host controller driver and BDC Broadcom device controller driver.
--- drivers/phy/broadcom/Kconfig | 11 + drivers/phy/broadcom/Makefile | 1 + drivers/phy/broadcom/phy-bcm-sr-usb.c | 371 ++++++++++++++++++++++++++++++++++ 3 files changed, 383 insertions(+) create mode 100644 drivers/phy/broadcom/phy-bcm-sr-usb.c
drivers/phy/broadcom/Kconfig +11 -0
@@ -10,6 +10,17 @@ config PHY_CYGNUS_PCIE Enable this to support the Broadcom Cygnus PCIe PHY. If unsure, say N. +config PHY_BCM_SR_USB + tristate "Broadcom Stingray USB PHY driver" + depends on OF && (ARCH_BCM_IPROC || COMPILE_TEST) + select GENERIC_PHY + default ARCH_BCM_IPROC + help + Enable this to support the Broadcom Stingray USB PHY + driver. It supports all versions of Superspeed and + Highspeed PHYs. + If unsure, say N. + config BCM_KONA_USB2_PHY tristate "Broadcom Kona USB2 PHY Driver" depends on HAS_IOMEM
drivers/phy/broadcom/Makefile +1 -0
@@ -11,3 +11,4 @@ obj-$(CONFIG_PHY_BRCM_USB) += phy-brcm-usb-dvr.o phy-brcm-usb-dvr-objs := phy-brcm-usb.o phy-brcm-usb-init.o obj-$(CONFIG_PHY_BCM_SR_PCIE) += phy-bcm-sr-pcie.o +obj-$(CONFIG_PHY_BCM_SR_USB) += phy-bcm-sr-usb.o
drivers/phy/broadcom/phy-bcm-sr-usb.c new file +371 -0
371 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v3 3/3 arm64: dts: Add USB DT nodes for Stingray SoC
In reply to Srinath MannamAdd DT nodes for
- Two xHCI host controllers
- Two BDC Broadcom USB device controller
- Five USB PHY controllers
[xHCI0] [BDC0] [xHCI1] [BDC1]
| | | | --------------- ----------------------- | | | | | [SS-PHY0] [HS-PHY0] [SS-PHY1] [HS-PHY2] [HS-PHY1]
[SS-PHY0/HS-PHY0] and [SS-PHY1/HS-PHY1] are combo PHYs of version1 category has both SS and HS PHYs.. [HS-PHY2] is HS PHY of version2 category.
--- .../boot/dts/broadcom/stingray/stingray-usb.dtsi | 95 ++++++++++++++++++++++ .../arm64/boot/dts/broadcom/stingray/stingray.dtsi | 1 + 2 files changed, 96 insertions(+) create mode 100644 arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi
arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi new file +95 -0
@@ -0,0 +1,95 @@ +// SPDX-License-Identifier: (GPL-2.0 or BSD-3-Clause) +/* + *Copyright(c) 2018 Broadcom + */ + usb { + compatible = "simple-bus"; + dma-ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x68500000 0x00400000>; + + usbphy0: usb-phy@0 { + compatible = "brcm,sr-usb-phy"; + reg = <0x00000000 0x100>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + usb0_phy0: phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + usb0_phy1: phy@1 { + reg = <1>; + #phy-cells = <0>; + }; + + }; + + xhci0: usb@1000 { + compatible = "generic-xhci"; + reg = <0x00001000 0x1000>; + interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>; + phys = <&usb0_phy1>, <&usb0_phy0>; + phy-names = "phy0", "phy1"; + dma-coherent; + status = "disabled"; + }; + + bdc0: usb@2000 { + compatible = "brcm,bdc-v0.16"; + reg = <0x00002000 0x1000>; + interrupts = <GIC_SPI 259 IRQ_TYPE_LEVEL_HIGH>; + phys = <&usb0_phy1>, <&usb0_phy0>; + phy-names = "phy0", "phy1"; + dma-coherent; + status = "disabled"; + }; + + usbphy1: usb-phy@10000 { + compatible = "brcm,sr-usb-phy"; + reg = <0x00010000 0x100>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + usb1_phy0: phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + usb1_phy1: phy@1 { + reg = <1>; + #phy-cells = <0>; + }; + }; + + usbphy2: usb-phy@20000 { + compatible = "brcm,sr-usb-phy-v2"; + reg = <0x00020000 0x100>; + #address-cells = <1>; + #size-cells = <0>; + #phy-cells = <0>; + status = "disabled"; + }; + + xhci1: usb@11000 { + compatible = "generic-xhci"; + reg = <0x00011000 0x1000>; + interrupts = <GIC_SPI 263 IRQ_TYPE_LEVEL_HIGH>; + phys = <&usb1_phy1>, <&usbphy2>, <&usb1_phy0>; + phy-names = "phy0", "phy1", "phy2"; + dma-coherent; + status = "disabled"; + }; + + bdc1: usb@21000 { + compatible = "brcm,bdc-v0.16"; + reg = <0x00021000 0x1000>; + interrupts = <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>; + phys = <&usbphy2>; + phy-names = "phy0"; + dma-coherent; + status = "disabled"; + }; + };
arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi +1 -0
@@ -287,6 +287,7 @@ #include "stingray-fs4.dtsi" #include "stingray-sata.dtsi" #include "stingray-pcie.dtsi" + #include "stingray-usb.dtsi" hsls { compatible = "simple-bus";
Signature · 1 line
2.7.4
Hi Kishon,
Could you please help to review and provide your comments to this patch series when you have time?
Regards,
Srinath.
Quoted 33 lines · Srinath Mannam
These patches add Stingray USB PHY driver and its corresponding DT nodes with documentation.
This patch set is based on Linux-5.0-rc2.
Changes from v2:
- Addressed Kishon review comments
- Updated patchset to Linux-5.0-rc2Changes from v1:
- Addressed Kishon review comments
- phy init call return value handleSrinath Mannam (3):
dt-bindings: phy: Add Stingray USB PHY binding document
phy: sr-usb: Add Stingray USB PHY driver
arm64: dts: Add USB DT nodes for Stingray SoC.../bindings/phy/brcm,stingray-usb-phy.txt | 62 ++++ .../boot/dts/broadcom/stingray/stingray-usb.dtsi | 95 ++++++ .../arm64/boot/dts/broadcom/stingray/stingray.dtsi | 1 + drivers/phy/broadcom/Kconfig | 11 + drivers/phy/broadcom/Makefile | 1 + drivers/phy/broadcom/phy-bcm-sr-usb.c | 371 +++++++++++++++++++++ 6 files changed, 541 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt create mode 100644 arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi create mode 100644 drivers/phy/broadcom/phy-bcm-sr-usb.c--
2.7.4