Skip to contentSkip to conversation

Stingray USB PHY driver support

PATCH Applied Srinath Mannam 4 participants 9 messages Mar 19, 2019 – Mar 26, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v6 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 v5:
- Removed redundant address and size cells in DT nodes.

Changes from v4:
- Addressed Rob Herring review comments
- Removed child nodes and added #phy-cells 1
- Added xlate function to get phy using phandle argument.

Changes from v3:
- Addressed Rob Herring review comments
- Changed compatible strings.
- updated driver based on new compatible strings.

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         |  32 ++
 .../boot/dts/broadcom/stingray/stingray-usb.dtsi   |  72 ++++
 .../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              | 393 +++++++++++++++++++++
 6 files changed, 510 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
#1 lore raw

PATCH v6 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         | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt
Documentation/devicetree/bindings/phy/brcm,stingray-usb-phy.txt new file +32 -0
new file mode 100644
index 0000000..4ba2989
@@ -0,0 +1,32 @@
+Broadcom Stingray USB PHY
+
+Required properties:
+ - compatible : should be one of the listed compatibles
+	- "brcm,sr-usb-combo-phy" is combo PHY has two PHYs, one SS and one HS.
+	- "brcm,sr-usb-hs-phy" is a single HS PHY.
+ - reg: offset and length of the PHY blocks registers
+ - #phy-cells:
+   - Must be 1 for brcm,sr-usb-combo-phy as it expects one argument to indicate
+     the PHY number of two PHYs. 0 for HS PHY and 1 for SS PHY.
+   - Must be 0 for brcm,sr-usb-hs-phy.
+
+Refer to phy/phy-bindings.txt for the generic PHY binding properties
+
+Example:
+	usbphy0: usb-phy@0 {
+		compatible = "brcm,sr-usb-combo-phy";
+		reg = <0x00000000 0x100>;
+		#phy-cells = <1>;
+	};
+
+	usbphy1: usb-phy@10000 {
+		compatible = "brcm,sr-usb-combo-phy";
+		reg = <0x00010000 0x100>,
+		#phy-cells = <1>;
+	};
+
+	usbphy2: usb-phy@20000 {
+		compatible = "brcm,sr-usb-hs-phy";
+		reg = <0x00020000 0x100>,
+		#phy-cells = <0>;
+	};
Signature · 1 line
2.7.4
#2 lore raw

PATCH v6 2/3 phy: sr-usb: Add Stingray USB PHY driver

In reply to Srinath Mannam

USB PHY driver supports two types of stingray USB PHYs
- Type 1 is a combo PHY contains two PHYs, one SS and one HS.
- Type 2 is a single HS PHY.

These two PHY versons 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 | 393 ++++++++++++++++++++++++++++++++++
 3 files changed, 405 insertions(+)
 create mode 100644 drivers/phy/broadcom/phy-bcm-sr-usb.c
drivers/phy/broadcom/Kconfig +11 -0
index aa917a6..f30f481 100644
@@ -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
index 0f60184..f453c7d 100644
@@ -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 +393 -0

393 lines not on this page · raw message

Signature · 1 line
2.7.4
#3 lore raw

PATCH v6 3/3 arm64: dts: Add USB DT nodes for Stingray SoC

In reply to Srinath Mannam

Add 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 has one SS and one HS PHYs. [HS-PHY2] is a single HS PHY.

xHCI use SS-PHY to detect SS devices and HS-PHY to detect HS/FS/LS devices. BDC use SS-PHY in SS mode and HS-PHY in HS mode.

xHCI0 port1 is SS-PHY0, port2 is HS-PHY0.
xHCI1 port1 is SS-PHY1, port2 is HS-PHY2 and port3 is HS-PHY1.

---
 .../boot/dts/broadcom/stingray/stingray-usb.dtsi   | 72 ++++++++++++++++++++++
 .../arm64/boot/dts/broadcom/stingray/stingray.dtsi |  1 +
 2 files changed, 73 insertions(+)
 create mode 100644 arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi
arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi new file +72 -0
new file mode 100644
index 0000000..55259f9
@@ -0,0 +1,72 @@
+// 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-combo-phy";
+			reg = <0x00000000 0x100>;
+			#phy-cells = <1>;
+			status = "disabled";
+		};
+
+		xhci0: usb@1000 {
+			compatible = "generic-xhci";
+			reg = <0x00001000 0x1000>;
+			interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>;
+			phys = <&usbphy0 1>, <&usbphy0 0>;
+			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 = <&usbphy0 0>, <&usbphy0 1>;
+			phy-names = "phy0", "phy1";
+			dma-coherent;
+			status = "disabled";
+		};
+
+		usbphy1: usb-phy@10000 {
+			compatible = "brcm,sr-usb-combo-phy";
+			reg = <0x00010000 0x100>;
+			#phy-cells = <1>;
+			status = "disabled";
+		};
+
+		usbphy2: usb-phy@20000 {
+			compatible = "brcm,sr-usb-hs-phy";
+			reg = <0x00020000 0x100>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+
+		xhci1: usb@11000 {
+			compatible = "generic-xhci";
+			reg = <0x00011000 0x1000>;
+			interrupts = <GIC_SPI 263 IRQ_TYPE_LEVEL_HIGH>;
+			phys = <&usbphy1 1>, <&usbphy2>, <&usbphy1 0>;
+			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
index cfeaa85..21dbb12 100644
@@ -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
#4 lore raw

Re: [PATCH v6 3/3] arm64: dts: Add USB DT nodes for Stingray SoC

Quoted 14 lines · Srinath Mannam

Add 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 has one SS and one HS PHYs. [HS-PHY2] is a single HS PHY.

Quoted 8 lines

xHCI use SS-PHY to detect SS devices and HS-PHY to detect HS/FS/LS devices. BDC use SS-PHY in SS mode and HS-PHY in HS mode.

xHCI0 port1 is SS-PHY0, port2 is HS-PHY0.
xHCI1 port1 is SS-PHY1, port2 is HS-PHY2 and port3 is HS-PHY1.

---

Applied to devicetree-arm64/next, thanks!
--
Florian

Acked-by on the v6 series
#5 lore raw
In reply to Srinath Mannam

Thanks Srinath and Rob - patch series looks good now.

patch series,

Quoted 42 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 v5:
- Removed redundant address and size cells in DT nodes.

Changes from v4:
- Addressed Rob Herring review comments
- Removed child nodes and added #phy-cells 1
- Added xlate function to get phy using phandle argument.

Changes from v3:
- Addressed Rob Herring review comments
- Changed compatible strings.
- updated driver based on new compatible strings.

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         |  32 ++
  .../boot/dts/broadcom/stingray/stingray-usb.dtsi   |  72 ++++
  .../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              | 393 +++++++++++++++++++++
  6 files changed, 510 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

#6 lore raw
Quoted 6 lines · Scott Branden

Thanks Srinath and Rob - patch series looks good now.

patch series,

Kishon, can you let me know when you apply patches 1 and 2 so I can queue up patch 3 for inclusion the 5.2 ARM SoC pull request? Thanks!

Quoted 46 lines · Srinath Mannam
Quoted 44 lines

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 v5:
   - Removed redundant address and size cells in DT nodes.

Changes from v4:
   - Addressed Rob Herring review comments
      - Removed child nodes and added #phy-cells 1
      - Added xlate function to get phy using phandle argument.

Changes from v3:
   - Addressed Rob Herring review comments
      - Changed compatible strings.
      - updated driver based on new compatible strings.

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         |  32 ++ .../boot/dts/broadcom/stingray/stingray-usb.dtsi   |  72 ++++ .../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              | 393
+++++++++++++++++++++

  6 files changed, 510 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
Florian
#7 lore raw
Quoted 10 lines · Florian Fainelli
Quoted 6 lines · Scott Branden

Thanks Srinath and Rob - patch series looks good now.

patch series,

Kishon, can you let me know when you apply patches 1 and 2 so I can queue up patch 3 for inclusion the 5.2 ARM SoC pull request? Thanks!

merged the dt-binding and sr-usb driver, thanks.

-Kishon

Quoted 49 lines
Quoted 47 lines · Srinath Mannam
Quoted 44 lines

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 v5:
   - Removed redundant address and size cells in DT nodes.

Changes from v4:
   - Addressed Rob Herring review comments
      - Removed child nodes and added #phy-cells 1
      - Added xlate function to get phy using phandle argument.

Changes from v3:
   - Addressed Rob Herring review comments
      - Changed compatible strings.
      - updated driver based on new compatible strings.

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         |  32 ++ .../boot/dts/broadcom/stingray/stingray-usb.dtsi   |  72 ++++ .../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              | 393
+++++++++++++++++++++

  6 files changed, 510 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

#8 lore raw
Quoted 9 lines · Kishon Vijay Abraham I
Quoted 5 lines · Florian Fainelli
Quoted 4 lines · Scott Branden

Thanks Srinath and Rob - patch series looks good now.

patch series,

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Kishon, can you let me know when you apply patches 1 and 2 so I can queue up patch 3 for inclusion the 5.2 ARM SoC pull request? Thanks!

merged the dt-binding and sr-usb driver, thanks.

Thanks a lot Kishon.

Regards,
Srinath.

Quoted 51 lines

-Kishon

Quoted 49 lines
Quoted 47 lines · Srinath Mannam
Quoted 44 lines

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 v5:
- Removed redundant address and size cells in DT nodes.

Changes from v4:
- Addressed Rob Herring review comments
- Removed child nodes and added #phy-cells 1
- Added xlate function to get phy using phandle argument.

Changes from v3:
- Addressed Rob Herring review comments
- Changed compatible strings.
- updated driver based on new compatible strings.

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         |  32 ++
  .../boot/dts/broadcom/stingray/stingray-usb.dtsi   |  72 ++++
  .../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              | 393
+++++++++++++++++++++
  6 files changed, 510 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