dt-bindings: phy: brcm,brcmstb-usb-phy: convert to the json-schema
Subsystems (4)
PATCH 1/3 dt-bindings: phy: brcm,brcmstb-usb-phy: convert to the json-schema
From: Rafał Miłecki <[email protected]>
Changes that require mentioning:
1. interrupt-names
Name "wakeup" was changed to the "wake". It matches example and what Linux driver looks for in the first place
2. brcm,ipp and brcm,ioc
Both were described as booleans with 0 / 1 values. In examples they were integers and Linux driver checks for int as well.
I made both uint32 but that probably should be refactored later.
3. Added minimal description
--- .../bindings/phy/brcm,brcmstb-usb-phy.txt | 86 -------- .../bindings/phy/brcm,brcmstb-usb-phy.yaml | 195 ++++++++++++++++++ 2 files changed, 195 insertions(+), 86 deletions(-) delete mode 100644 Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.txt create mode 100644 Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml
Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.txt deleted +0 -86
@@ -1,86 +0,0 @@ -Broadcom STB USB PHY - -Required properties: -- compatible: should be one of - "brcm,brcmstb-usb-phy" - "brcm,bcm7216-usb-phy" - "brcm,bcm7211-usb-phy" - -- reg and reg-names properties requirements are specific to the - compatible string. - "brcm,brcmstb-usb-phy": - - reg: 1 or 2 offset and length pairs. One for the base CTRL registers - and an optional pair for systems with USB 3.x support - - reg-names: not specified - "brcm,bcm7216-usb-phy": - - reg: 3 offset and length pairs for CTRL, XHCI_EC and XHCI_GBL - registers - - reg-names: "ctrl", "xhci_ec", "xhci_gbl" - "brcm,bcm7211-usb-phy": - - reg: 5 offset and length pairs for CTRL, XHCI_EC, XHCI_GBL, - USB_PHY and USB_MDIO registers and an optional pair - for the BDC registers - - reg-names: "ctrl", "xhci_ec", "xhci_gbl", "usb_phy", "usb_mdio", "bdc_ec" - -- #phy-cells: Shall be 1 as it expects one argument for setting - the type of the PHY. Possible values are: - - PHY_TYPE_USB2 for USB1.1/2.0 PHY - - PHY_TYPE_USB3 for USB3.x PHY - -Optional Properties: -- clocks : clock phandles. -- clock-names: String, clock name. -- interrupts: wakeup interrupt -- interrupt-names: "wakeup" -- brcm,ipp: Boolean, Invert Port Power. - Possible values are: 0 (Don't invert), 1 (Invert) -- brcm,ioc: Boolean, Invert Over Current detection. - Possible values are: 0 (Don't invert), 1 (Invert) -- dr_mode: String, PHY Device mode. - Possible values are: "host", "peripheral ", "drd" or "typec-pd" - If this property is not defined, the phy will default to "host" mode. -- brcm,syscon-piarbctl: phandle to syscon for handling config registers -NOTE: one or both of the following two properties must be set -- brcm,has-xhci: Boolean indicating the phy has an XHCI phy. -- brcm,has-eohci: Boolean indicating the phy has an EHCI/OHCI phy. - - -Example: - -usbphy_0: usb-phy@f0470200 { - reg = <0xf0470200 0xb8>, - <0xf0471940 0x6c0>; - compatible = "brcm,brcmstb-usb-phy"; - #phy-cells = <1>; - dr_mode = "host" - brcm,ioc = <1>; - brcm,ipp = <1>; - brcm,has-xhci; - brcm,has-eohci; - clocks = <&usb20>, <&usb30>; - clock-names = "sw_usb", "sw_usb3"; -}; - -usb-phy@29f0200 { - reg = <0x29f0200 0x200>, - <0x29c0880 0x30>, - <0x29cc100 0x534>, - <0x2808000 0x24>, - <0x2980080 0x8>; - reg-names = "ctrl", - "xhci_ec", - "xhci_gbl", - "usb_phy", - "usb_mdio"; - brcm,ioc = <0x0>; - brcm,ipp = <0x0>; - compatible = "brcm,bcm7211-usb-phy"; - interrupts = <0x30>; - interrupt-parent = <&vpu_intr1_nosec_intc>; - interrupt-names = "wake"; - #phy-cells = <0x1>; - brcm,has-xhci; - syscon-piarbctl = <&syscon_piarbctl>; - clocks = <&scmi_clk 256>; - clock-names = "sw_usb"; -};
Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml new file +195 -0
195 lines not on this page · raw message
Signature · 1 line
2.26.2
PATCH 2/3 dt-bindings: phy: brcm,brcmstb-usb-phy: add BCM4908 binding
From: Rafał Miłecki <[email protected]>
BCM4908 uses the same PHY and may require just slightly different programming.
--- .../devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml +4 -1
@@ -14,6 +14,7 @@ maintainers: properties: compatible: enum: + - brcm,bcm4908-usb-phy - brcm,bcm7211-usb-phy - brcm,bcm7216-usb-phy - brcm,brcmstb-usb-phy
@@ -90,7 +91,9 @@ allOf: properties: compatible: contains: - const: brcm,brcmstb-usb-phy + enum: + - const: brcm,bcm4908-usb-phy + - const: brcm,brcmstb-usb-phy then: properties: reg:
Signature · 1 line
2.26.2
Re: [PATCH 2/3] dt-bindings: phy: brcm,brcmstb-usb-phy: add BCM4908 binding
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
BCM4908 uses the same PHY and may require just slightly different programming.
Signed-off-by Rafał Miłecki <[email protected]>
Signature · 1 line
Florian
PATCH 3/3 phy: phy-brcm-usb: support BCM4908 binding
In reply to Rafał MiłeckiFrom: Rafał Miłecki <[email protected]>
BCM4908 seems to have slightly different registers but work when programmed just like the STB one.
--- drivers/phy/broadcom/phy-brcm-usb.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/phy/broadcom/phy-brcm-usb.c +4 -0
@@ -285,6 +285,10 @@ static const struct match_chip_info chip_info_7445 = { };static const struct of_device_id brcm_usb_dt_ids[] = { + { + .compatible ="brcm,bcm4908-usb-phy" , + .data = &chip_info_7445, + }, { .compatible ="brcm,bcm7216-usb-phy" , .data = &chip_info_7216,
Signature · 1 line
2.26.2
Re: [PATCH 3/3] phy: phy-brcm-usb: support BCM4908 binding
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
BCM4908 seems to have slightly different registers but work when programmed just like the STB one.
Signed-off-by Rafał Miłecki <[email protected]>
Signature · 1 line
Florian
Quoted 120 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Changes that require mentioning:
1. interrupt-names
Name "wakeup" was changed to the "wake". It matches example and what Linux driver looks for in the first place
2. brcm,ipp and brcm,ioc
Both were described as booleans with 0 / 1 values. In examples they were integers and Linux driver checks for int as well.
I made both uint32 but that probably should be refactored later.
3. Added minimal descriptionSigned-off-by Rafał Miłecki <[email protected]>--- .../bindings/phy/brcm,brcmstb-usb-phy.txt | 86 -------- .../bindings/phy/brcm,brcmstb-usb-phy.yaml | 195 ++++++++++++++++++ 2 files changed, 195 insertions(+), 86 deletions(-) delete mode 100644 Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.txt create mode 100644 Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yamlDocumentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.txt deleted +0
-86@@ -1,86 +0,0 @@ -Broadcom STB USB PHY - -Required properties: -- compatible: should be one of - "brcm,brcmstb-usb-phy" - "brcm,bcm7216-usb-phy" - "brcm,bcm7211-usb-phy" - -- reg and reg-names properties requirements are specific to the - compatible string. - "brcm,brcmstb-usb-phy": - - reg: 1 or 2 offset and length pairs. One for the base CTRL registers - and an optional pair for systems with USB 3.x support - - reg-names: not specified - "brcm,bcm7216-usb-phy": - - reg: 3 offset and length pairs for CTRL, XHCI_EC and XHCI_GBL - registers - - reg-names: "ctrl", "xhci_ec", "xhci_gbl" - "brcm,bcm7211-usb-phy": - - reg: 5 offset and length pairs for CTRL, XHCI_EC, XHCI_GBL, - USB_PHY and USB_MDIO registers and an optional pair - for the BDC registers - - reg-names: "ctrl", "xhci_ec", "xhci_gbl", "usb_phy", "usb_mdio", "bdc_ec" - -- #phy-cells: Shall be 1 as it expects one argument for setting - the type of the PHY. Possible values are: - - PHY_TYPE_USB2 for USB1.1/2.0 PHY - - PHY_TYPE_USB3 for USB3.x PHY - -Optional Properties: -- clocks : clock phandles. -- clock-names: String, clock name. -- interrupts: wakeup interrupt -- interrupt-names: "wakeup" -- brcm,ipp: Boolean, Invert Port Power. - Possible values are: 0 (Don't invert), 1 (Invert) -- brcm,ioc: Boolean, Invert Over Current detection. - Possible values are: 0 (Don't invert), 1 (Invert) -- dr_mode: String, PHY Device mode. - Possible values are: "host", "peripheral ", "drd" or "typec-pd" - If this property is not defined, the phy will default to "host" mode. -- brcm,syscon-piarbctl: phandle to syscon for handling config registers -NOTE: one or both of the following two properties must be set -- brcm,has-xhci: Boolean indicating the phy has an XHCI phy. -- brcm,has-eohci: Boolean indicating the phy has an EHCI/OHCI phy. - - -Example: - -usbphy_0: usb-phy@f0470200 { - reg = <0xf0470200 0xb8>, - <0xf0471940 0x6c0>; - compatible = "brcm,brcmstb-usb-phy"; - #phy-cells = <1>; - dr_mode = "host" - brcm,ioc = <1>; - brcm,ipp = <1>; - brcm,has-xhci; - brcm,has-eohci; - clocks = <&usb20>, <&usb30>; - clock-names = "sw_usb", "sw_usb3"; -}; - -usb-phy@29f0200 { - reg = <0x29f0200 0x200>, - <0x29c0880 0x30>, - <0x29cc100 0x534>, - <0x2808000 0x24>, - <0x2980080 0x8>; - reg-names = "ctrl", - "xhci_ec", - "xhci_gbl", - "usb_phy", - "usb_mdio"; - brcm,ioc = <0x0>; - brcm,ipp = <0x0>; - compatible = "brcm,bcm7211-usb-phy"; - interrupts = <0x30>; - interrupt-parent = <&vpu_intr1_nosec_intc>; - interrupt-names = "wake"; - #phy-cells = <0x1>; - brcm,has-xhci; - syscon-piarbctl = <&syscon_piarbctl>; - clocks = <&scmi_clk 256>; - clock-names = "sw_usb"; -};Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml new file +2
-0@@ -0,0 +1,195 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2
Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml line 12
Quoted 10 lines
Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml new file +10
-0+--- +$id: http://devicetree.org/schemas/phy/brcm,brcmstb-usb-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Broadcom STB USB PHY + +description: Broadcom's PHY that handles EHCI/OHCI and/or XHCI + +maintainers: + - Rafał Miłecki <[email protected]>
You would probably want to have Al Cooper be listed as a maintainer as well of this binding.
Have not tried to validate the binding, but LGTM!
Signature · 1 line
Florian