Make USB ports to work on HiKey960/970
Subsystems (2)
v2 cover Make USB ports to work on HiKey960/970
Hi Rob,
It follows a second version for the patch adding a DT schema needed to power on and to use the integrated USB HUB found on HiKey 960 and Hikey 970 boards.
The entire series, which contains the remaining patches to support PCI and USB on HiKey970, and USB on HiKey960 is at:
https://github.com/mchehab/linux/commits/linux-next
John,
The primary reason why I added the HiKey960/970 bindings on this series is because the Hikey960 one came from your tree:
https://git.linaro.org/people/john.stultz/android-dev.git/commit/?h=dev/hikey960-mainline-WIP&id=fac6d20f0fee01eaaca36a8c52a44c741c6cbe78
Yet, you forgot to add your SoB there. Could you please reply to such patch with your SoB ?
Thanks!
Mauro
---
v2:
- changed the compatible strings to better reflect the names;
- dropped the GPIO pin for Hikey960 power supply. It should use, instead, a regulator;
- changed the names of the two gpio properties to better reflect that they're gpio;
- use "-" instead of "_" at the DT property names;
- Added DTS patches.
John Stultz (1):
arm64: dts: hisilicon: Add usb mux hub for hikey960
Mauro Carvalho Chehab (1):
arm64: dts: hisilicon: Add usb mux hub for hikey970
Yu Chen (1):
dt-bindings: misc: add schema for USB hub on Kirin devices
.../bindings/misc/hisilicon,hikey-usb.yaml | 108 ++++++++++++++++++ .../boot/dts/hisilicon/hi3660-hikey960.dts | 35 +++++- .../boot/dts/hisilicon/hi3670-hikey970.dts | 24 ++++ 3 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/misc/hisilicon,hikey-usb.yaml
Signature · 1 line
2.31.1
PATCH v2 1/3 dt-bindings: misc: add schema for USB hub on Kirin devices
From: Yu Chen <[email protected]>
This patch adds binding documentation to support USB HUB and USB data role switch of HiSilicon HiKey960 and HiKey970 boards.
--- .../bindings/misc/hisilicon,hikey-usb.yaml | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/hisilicon,hikey-usb.yaml
Documentation/devicetree/bindings/misc/hisilicon,hikey-usb.yaml new file +108 -0
@@ -0,0 +1,108 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019 Linaro Ltd. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/hisilicon,hikey-usb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiKey960/970 onboard USB GPIO Hub + +maintainers: + - John Stultz <[email protected]> + +description: | + Supports the onboard USB GPIO hub found on HiKey960/970. + The HUB, which acts as a role-switch intermediary to detect the state of + the USB-C port, to switch the hub into dual-role USB-C or host mode, + which enables the onboard USB-A host ports. + + Schematics about the hub can be found here: + https://github.com/96boards/documentation/raw/master/consumer/hikey/hikey960/hardware-docs/HiKey960_Schematics.pdf + https://www.96boards.org/documentation/consumer/hikey/hikey970/hardware-docs/files/hikey970-schematics.pdf + +properties: + compatible: + enum: + - hisilicon,hikey960-usbhub + - hisilicon,hikey970-usbhub + + typec-vbus-gpios: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: phandle to the typec-vbus gpio + + otg-switch-gpios: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: phandle to the otg-switch gpio + + hub-reset-en-gpios: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to the hub reset gpio + + usb-role-switch: + $ref: /schemas/types.yaml#/definitions/flag + description: Support role switch. + + hub-vdd-supply: + description: regulator for hub power + + port: + description: | + describe hadware connections between USB endpoints. + Two ports are supported: the first being the endpoint that will + be notified by this driver, and the second being the endpoint + that notifies this driver of a role switch. + +required: + - compatible + - typec-vbus-gpio + - otg-switch-gpio + - hub-vdd-supply + - usb-role-switch + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + hisi_hikey_usb: hisi_hikey_usb { + compatible = "hisilicon,hikey960-usbhub"; + typec-vbus-gpio = <&gpio25 2 GPIO_ACTIVE_HIGH>; + otg-switch-gpio = <&gpio25 6 GPIO_ACTIVE_HIGH>; + hub-vdd-supply = <&usb_hub>; + usb-role-switch; + port { + #address-cells = <1>; + #size-cells = <0>; + hikey_usb_ep0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dwc3_role_switch>; + }; + hikey_usb_ep1: endpoint@1 { + reg = <1>; + remote-endpoint = <&rt1711h_ep>; + }; + }; + }; + + hisi-hikey-usb: hisi-hikey-usb { + compatible = "hisilicon,hikey970-usbhub"; + typec-vbus-gpios = <&gpio25 2 GPIO_ACTIVE_HIGH>; + otg-switch-gpios = <&gpio25 6 GPIO_ACTIVE_HIGH>; + hub-reset-en-gpios = <&gpio0 3 0>; + hub-vdd-supply = <&ldo17>; + usb-role-switch; + port { + #address-cells = <1>; + #size-cells = <0>; + hikey_usb_ep0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dwc3_role_switch>; + }; + hikey_usb_ep1: endpoint@1 { + reg = <1>; + remote-endpoint = <&rt1711h_ep>; + }; + }; + };
Signature · 1 line
2.31.1
Rob Herring
maintainerRe: [PATCH v2 1/3] dt-bindings: misc: add schema for USB hub on Kirin devices
Quoted 5 lines · Mauro Carvalho Chehab
From: Yu Chen <[email protected]>
This patch adds binding documentation to support USB HUB and USB data role switch of HiSilicon HiKey960 and HiKey970 boards.
Quoted 9 lines
[mchehab: updated OF schema and added HiKey970 example]Signed-off-by Yu Chen <[email protected]>Signed-off-by John Stultz <[email protected]>Signed-off-by Mauro Carvalho Chehab <[email protected]>--- .../bindings/misc/hisilicon,hikey-usb.yaml | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/hisilicon,hikey-usb.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/misc/hisilicon,hikey-usb.example.dts:41.23-24 syntax error FATAL ERROR: Unable to parse input tree
make[1]: *** [scripts/Makefile.lib:380: Documentation/devicetree/bindings/misc/hisilicon,hikey-usb.example.dt.yaml] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1419: dt_binding_check] Error 2
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1523123
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit.
PATCH v2 2/3 arm64: dts: hisilicon: Add usb mux hub for hikey970
In reply to Mauro Carvalho ChehabAdd dt bindings for Kirin 970 USB HUB. Such board comes with an integrated USB HUB provided via a TI TUSB8041 4-port USB 3.0 hub.
--- .../boot/dts/hisilicon/hi3670-hikey970.dts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts +24 -0
@@ -53,6 +53,30 @@ wlan_en: wlan-en-1-8v { startup-delay-us = <70000>; enable-active-high; }; + + hikey_usbhub: hikey_usbhub { + compatible = "hisilicon,kirin970_hikey_usbhub"; + + typec-vbus-gpios = <&gpio26 1 0>; + otg-switch-gpios = <&gpio4 2 0>; + hub-reset-en-gpios = <&gpio0 3 0>; + hub-vdd-supply = <&ldo17>; + usb-role-switch; + + port { + #address-cells = <1>; + #size-cells = <0>; + + hikey_usb_ep0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dwc3_role_switch>; + }; + hikey_usb_ep1: endpoint@1 { + reg = <1>; + remote-endpoint = <&rt1711h_ep>; + }; + }; + }; }; /*
Signature · 1 line
2.31.1
PATCH v2 3/3 arm64: dts: hisilicon: Add usb mux hub for hikey960
In reply to Mauro Carvalho ChehabFrom: John Stultz <[email protected]>
Add dt bindings for Kirin 960 USB HUB. Such board comes with an integrated USB HUB provided via a Microchip USB5734 4-port high-speed hub controller.
--- .../boot/dts/hisilicon/hi3660-hikey960.dts | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts +33 -2
@@ -191,12 +191,43 @@ wlan_en: wlan-en-1-8v { enable-active-high; }; + usb_hub: hub-vdd { + compatible = "regulator-fixed"; + regulator-name = "hub-vdd"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + gpio = <&gpio5 6 GPIO_ACTIVE_HIGH>; + }; + firmware { optee { compatible = "linaro,optee-tz"; method = "smc"; }; }; + + hisi_hikey_usb: hisi_hikey_usb { + compatible = "hisilicon,hikey960-usbhub"; + typec-vbus-gpios = <&gpio25 2 GPIO_ACTIVE_HIGH>; + otg-switch-gpios = <&gpio25 6 GPIO_ACTIVE_HIGH>; + hub-vdd33-en-gpios = <&gpio5 6 GPIO_ACTIVE_HIGH>; + hub-vdd-supply = <&usb_hub>; + usb-role-switch; + + port { + #address-cells = <1>; + #size-cells = <0>; + + hikey_usb_ep0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dwc3_role_switch>; + }; + hikey_usb_ep1: endpoint@1 { + reg = <1>; + remote-endpoint = <&rt1711h_ep>; + }; + }; + }; }; /*
@@ -564,7 +595,7 @@ port { rt1711h_ep: endpoint@0 { reg = <0>; - remote-endpoint = <&dwc3_role_switch>; + remote-endpoint = <&hikey_usb_ep1>; }; }; };
@@ -686,7 +717,7 @@ port { #size-cells = <0>; dwc3_role_switch: endpoint@0 { reg = <0>; - remote-endpoint = <&rt1711h_ep>; + remote-endpoint = <&hikey_usb_ep0>; }; dwc3_ss: endpoint@1 {
Signature · 1 line
2.31.1
Re: [PATCH v2 3/3] arm64: dts: hisilicon: Add usb mux hub for hikey960
Quoted 3 lines · Mauro Carvalho Chehab
From: John Stultz <[email protected]>
My apologies for not writing a proper patch description & s-o-b on the commit you pulled this from!
I had split it out from an earlier patch that was sent upstream and didn't get to cleaning it up.
Quoted 5 lines
Add dt bindings for Kirin 960 USB HUB. Such board comes with an integrated USB HUB provided via a Microchip USB5734 4-port high-speed hub controller.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
Feel free to add:
to the patch.
Thanks for continuing to push this upstream!
-john