phy: bcm63xx-usbh: Add BCM63xx USBH driver
Subsystems (2)
v3 cover phy: bcm63xx-usbh: Add BCM63xx USBH driver
Add BCM63xx USBH PHY driver for BMIPS.
v3: introduce changes suggested by Florian:
- Add support for device mode.
v2: introduce changes suggested by Florian:
- phy-cells changed to 1.
- Drop OF dependency (use device_get_match_data).
- Drop __initconst from variant tables.
- Use devm_clk_get_optional.
Álvaro Fernández Rojas (2):
dt-bindings: phy: add bcm63xx-usbh bindings
phy: bcm63xx-usbh: Add BCM63xx USBH driver
.../bindings/phy/brcm,bcm63xx-usbh-phy.yaml | 72 +++ drivers/phy/broadcom/Kconfig | 9 + drivers/phy/broadcom/Makefile | 1 + drivers/phy/broadcom/phy-bcm63xx-usbh.c | 456 ++++++++++++++++++ 4 files changed, 538 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/brcm,bcm63xx-usbh-phy.yaml create mode 100644 drivers/phy/broadcom/phy-bcm63xx-usbh.c
Signature · 1 line
2.27.0
PATCH v3 1/2 dt-bindings: phy: add bcm63xx-usbh bindings
Document BCM63xx USBH PHY bindings.
---
v3: no changes
v2: phy-cells changed to 1.
.../bindings/phy/brcm,bcm63xx-usbh-phy.yaml | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/brcm,bcm63xx-usbh-phy.yaml
Documentation/devicetree/bindings/phy/brcm,bcm63xx-usbh-phy.yaml new file +72 -0
@@ -0,0 +1,72 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/phy/brcm,bcm63xx-usbh-phy.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: BCM63xx USBH PHY + +maintainers: + - Álvaro Fernández Rojas <[email protected]> + +properties: + compatible: + enum: + - brcm,bcm6318-usbh-phy + - brcm,bcm6328-usbh-phy + - brcm,bcm6358-usbh-phy + - brcm,bcm6362-usbh-phy + - brcm,bcm6368-usbh-phy + - brcm,bcm63268-usbh-phy + + reg: + maxItems: 1 + + clocks: + maxItems: 2 + + clock-names: + items: + - const: usbh + - const: usb_ref + + resets: + maxItems: 1 + + "#phy-cells": + const: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - resets + - "#phy-cells" + +if: + properties: + compatible: + enum: + - brcm,bcm6318-usbh-phy + - brcm,bcm6328-usbh-phy + - brcm,bcm6362-usbh-phy + - brcm,bcm63268-usbh-phy + +then: + properties: + power-domains: + maxItems: 1 + required: + - power-domains + +examples: + - | + usbh: usb-phy@10001700 { + compatible = "brcm,bcm6368-usbh-phy"; + reg = <0x10001700 0x38>; + clocks = <&periph_clk BCM6368_CLK_USBH>; + clock-names = "usbh"; + resets = <&periph_rst BCM6368_RST_USBH>; + #phy-cells = <1>; + };
Signature · 1 line
2.27.0
Re: [PATCH v3 1/2] dt-bindings: phy: add bcm63xx-usbh bindings
Quoted 3 lines · Álvaro Fernández Rojas
Document BCM63xx USBH PHY bindings.
Signed-off-by Álvaro Fernández Rojas <[email protected]>
Since the USB PHY supports both roles (host and device) on a large number of SoCs, I would just remove "H" from the subject/binding/name accordingly. With that:
Signature · 1 line
Florian
Re: [PATCH v3 1/2] dt-bindings: phy: add bcm63xx-usbh bindings
Quoted 5 lines · Florian Fainelli
Quoted 2 lines · Álvaro Fernández Rojas
Document BCM63xx USBH PHY bindings.
Quoted 7 lines
Quoted 1 line
Signed-off-by Álvaro Fernández Rojas <[email protected]>Since the USB PHY supports both roles (host and device) on a large number of SoCs, I would just remove "H" from the subject/binding/name accordingly. With that:
Well, the register is indeed named USBH, so the name can stay as-is, this is fine, thanks!
Signature · 1 line
Florian
PATCH v3 2/2 phy: bcm63xx-usbh: Add BCM63xx USBH driver
In reply to Álvaro Fernández RojasAdd BCM63xx USBH PHY driver for BMIPS.
---
v3: introduce changes suggested by Florian:
- Add support for device mode.
v2: introduce changes suggested by Florian:
- Drop OF dependency (use device_get_match_data).
- Drop __initconst from variant tables.
- Use devm_clk_get_optional.
drivers/phy/broadcom/Kconfig | 9 + drivers/phy/broadcom/Makefile | 1 + drivers/phy/broadcom/phy-bcm63xx-usbh.c | 456 ++++++++++++++++++++++++ 3 files changed, 466 insertions(+) create mode 100644 drivers/phy/broadcom/phy-bcm63xx-usbh.c
drivers/phy/broadcom/Kconfig +9 -0
@@ -2,6 +2,15 @@ # # Phy drivers for Broadcom platforms # +config PHY_BCM63XX_USBH + tristate "BCM63xx USBH PHY driver" + depends on BMIPS_GENERIC || COMPILE_TEST + select GENERIC_PHY + default BMIPS_GENERIC + help + Enable this to support the BCM63xx USBH PHY driver. + If unsure, say N. + config PHY_CYGNUS_PCIE tristate "Broadcom Cygnus PCIe PHY driver" depends on OF && (ARCH_BCM_CYGNUS || COMPILE_TEST)
drivers/phy/broadcom/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_PHY_BCM63XX_USBH) += phy-bcm63xx-usbh.o obj-$(CONFIG_PHY_CYGNUS_PCIE) += phy-bcm-cygnus-pcie.o obj-$(CONFIG_BCM_KONA_USB2_PHY) += phy-bcm-kona-usb2.o obj-$(CONFIG_PHY_BCM_NS_USB2) += phy-bcm-ns-usb2.o
drivers/phy/broadcom/phy-bcm63xx-usbh.c new file +456 -0
456 lines not on this page · raw message
Signature · 1 line
2.27.0
Hi Álvaro,
Quoted 17 lines · Álvaro Fernández Rojas
Add BCM63xx USBH PHY driver for BMIPS.
Signed-off-by Álvaro Fernández Rojas <[email protected]>---
v3: introduce changes suggested by Florian:
- Add support for device mode.
v2: introduce changes suggested by Florian:
- Drop OF dependency (usedevice_get_match_data).
- Drop__initconstfrom variant tables.
- Usedevm_clk_get_optional.drivers/phy/broadcom/Kconfig | 9 + drivers/phy/broadcom/Makefile | 1 + drivers/phy/broadcom/phy-bcm63xx-usbh.c | 456 ++++++++++++++++++++++++ 3 files changed, 466 insertions(+) create mode 100644 drivers/phy/broadcom/phy-bcm63xx-usbh.c
[...]
Quoted 6 lines
drivers/phy/broadcom/phy-bcm63xx-usbh.c new file +0
-0@@ -0,0 +1,456 @@
[...]
drivers/phy/broadcom/phy-bcm63xx-usbh.c line 397
Quoted 1 line
drivers/phy/broadcom/phy-bcm63xx-usbh.c new file +1
-0+ usbh->reset =devm_reset_control_get (dev,NULL );
Please use devm_reset_control_get_exclusive() instead when requesting exclusive reset controls.
drivers/phy/broadcom/phy-bcm63xx-usbh.c line 402
Quoted 5 lines
drivers/phy/broadcom/phy-bcm63xx-usbh.c new file +5
-0+if (IS_ERR (usbh->reset)) { +if (PTR_ERR (usbh->reset) != -EPROBE_DEFER ) +dev_err (dev,"failed to get reset\n" ); +return PTR_ERR (usbh->reset); + }
regards
Philipp
Quoted 3 lines · Álvaro Fernández Rojas
Add BCM63xx USBH PHY driver for BMIPS.
Signed-off-by Álvaro Fernández Rojas <[email protected]>
As discussed in the v2 series, you also need to control the UTMI_CONTROL1 register for operating the port in device/host/otg mode. --
Florian