From patchwork Thu Sep 2 11:28:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 505870 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-24.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8128C432BE for ; Thu, 2 Sep 2021 11:28:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C75A610E6 for ; Thu, 2 Sep 2021 11:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245744AbhIBL3n (ORCPT ); Thu, 2 Sep 2021 07:29:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:37248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245647AbhIBL3n (ORCPT ); Thu, 2 Sep 2021 07:29:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3559A61057; Thu, 2 Sep 2021 11:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630582125; bh=iwKTETCoMU3En+5uE5SOOsreZ29nNC4aV2mE/kPiRkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hKi9JgcJgYx5kYLIU1nZchHhXm17mxjRSk0r/F3ouFiKZNd2HlQNVyrX6Xy3QwmAw z+2TyblYym2CwtkW6lOVoVOgezqhZ/jEZM5I9OvsF0m15mZlbO40JiCIpCrrBTcEDX Rb/MZ2NL7T49O4Bbz/ljTvNmOOUar4J/PCdnW4UBE1GNmmor6VO7/zxphqPzKMAp9t 5l93q/6VwI23FEpf/p8QxmpZMOGWTQHHnbEw62Up6jTPiD1Dm1/3QWCpE44Knr+Dg1 KBpNKCXsC2wrAzcvo0XKiv/FHs9YQqMVUmSCIuJlsKYW3DlOCGD8CxRaZLfCxi0wmz CTARycQPw6cmA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mLktf-0004ZO-5u; Thu, 02 Sep 2021 13:28:43 +0200 From: Mauro Carvalho Chehab To: Rob Herring Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Yu Chen , "John Stultz" , Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mauro Carvalho Chehab Subject: [PATCH v3 1/4] dt-bindings: misc: add schema for USB hub on Kirin devices Date: Thu, 2 Sep 2021 13:28:34 +0200 Message-Id: <9b49f98da440865212f040dad841ac689e7f73e7.1630581434.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Yu Chen This patch adds binding documentation to support USB HUB and USB data role switch of HiSilicon HiKey960 and HiKey970 boards. [mchehab: updated OF schema and added HiKey970 example] Signed-off-by: Yu Chen Signed-off-by: John Stultz Signed-off-by: Mauro Carvalho Chehab --- .../bindings/misc/hisilicon,hikey-usb.yaml | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/hisilicon,hikey-usb.yaml diff --git a/Documentation/devicetree/bindings/misc/hisilicon,hikey-usb.yaml b/Documentation/devicetree/bindings/misc/hisilicon,hikey-usb.yaml new file mode 100644 index 000000000000..12754a98786f --- /dev/null +++ b/Documentation/devicetree/bindings/misc/hisilicon,hikey-usb.yaml @@ -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 + +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-array + 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-gpios + - otg-switch-gpios + - hub-vdd-supply + - usb-role-switch + - port + +additionalProperties: false + +examples: + - | + #include + + usb-hub960 { + compatible = "hisilicon,hikey960-usbhub"; + typec-vbus-gpios = <&gpio25 2 GPIO_ACTIVE_HIGH>; + otg-switch-gpios = <&gpio25 6 GPIO_ACTIVE_HIGH>; + hub-vdd-supply = <&usb_hub_vdd>; + usb-role-switch; + port { + #address-cells = <1>; + #size-cells = <0>; + hikey960_usb_ep0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dwc3_role_switch_960>; + }; + hikey960_usb_ep1: endpoint@1 { + reg = <1>; + remote-endpoint = <&rt1711h_ep_960>; + }; + }; + }; + + usb-hub970 { + compatible = "hisilicon,hikey970-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>; + hikey970_usb_ep0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dwc3_role_switch_970>; + }; + hikey970_usb_ep1: endpoint@1 { + reg = <1>; + remote-endpoint = <&rt1711h_ep_970>; + }; + }; + }; From patchwork Thu Sep 2 11:28:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 505869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18033C4320A for ; Thu, 2 Sep 2021 11:28:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC85A610E8 for ; Thu, 2 Sep 2021 11:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343577AbhIBL3o (ORCPT ); Thu, 2 Sep 2021 07:29:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:37254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245695AbhIBL3n (ORCPT ); Thu, 2 Sep 2021 07:29:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 382E3610CD; Thu, 2 Sep 2021 11:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630582125; bh=t5jqLXWSCvkoEWBIixIhEk25N1p5VRoDG3iLJpBa4KQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VbMBY59GdRtIBJzGqkWGa0MULEUj8bu5kgXOZogUNioWucm9C5mVX0c7wAAVERUzt Q6P6nGOy3oHhAnONxBpHVXt0uq4ZANPY7oFIK35grJiTelkBDNVXMKSl0DnIwfnGZY pKdtFtKN6cZhQCztV7GPgAzLkYZYNCQFVBUY5z1X62+s7f5A3Zl9fU0a84Bd1N9R9H mhyXjJpkZJ6pR83m/kEPOHdpbXqpWeXUsYIrJAqbYNUkdB5wMLD18IDSos+uSbeWwt N3vG9SCpZoSMj2oKTT84HKPccwtYCx6e8p3U+Y2ayHVP2lmMQxDXB19M0Khlk7JAAO LcHWG9BJ73O0w== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mLktf-0004ZW-A1; Thu, 02 Sep 2021 13:28:43 +0200 From: Mauro Carvalho Chehab To: Rob Herring Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , "John Stultz" , Rob Herring , Wei Xu , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/4] arm64: dts: hisilicon: Add usb mux hub for hikey970 Date: Thu, 2 Sep 2021 13:28:36 +0200 Message-Id: <1df0b8f59fb75d6c1f3b5248f74f66b93a072a02.1630581434.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add 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. Signed-off-by: Mauro Carvalho Chehab --- .../boot/dts/hisilicon/hi3670-hikey970.dts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts b/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts index 60594db07041..0cec08083c4f 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts +++ b/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts @@ -53,6 +53,29 @@ wlan_en: wlan-en-1-8v { startup-delay-us = <70000>; enable-active-high; }; + + usb-hub { + compatible = "hisilicon,hikey970-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>; + }; + }; + }; }; /* From patchwork Thu Sep 2 11:28:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 505735 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp1127157jai; Thu, 2 Sep 2021 04:28:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvrW8LCm1+glG3grFRjlgXSLZw9KCqjUGFMQcPhThpx7wU+5ALpJyT4tpCvGRf3tLLys59 X-Received: by 2002:a17:906:13da:: with SMTP id g26mr3364806ejc.356.1630582129549; Thu, 02 Sep 2021 04:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630582129; cv=none; d=google.com; s=arc-20160816; b=s4WsTzECozsI4S0+vgRDjeAFkY713hQO1SeS+meeNXnigp8EzRXrTAA88FAg696OqS bN+hKIneDpMjm9xj5GkCUhcp856a1cpfY1dwVv/Yd7DHTqnL4t7MsqD/HQhfRNplf7kL syxjdYjH5NeuuXHSo6X9d4h5nk/mwl2ELtOjL5EXLdssFeqkHl+uzh5sOBHN524n3hC4 EULnHGarG+xOg8hNiXO85LJkqSZ82CbPiBr56YMdUIpCLXHkRO+djA1UhpzeAAKcF+pD 7kvYumh8xumNOW03aQs1cOKK60nfktiKzfKmILOnGoyQrx9NQUIaQcWNMmM2EZUK6Gl4 DRRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=raQ2nJywyjWViYfFW9OK6tm6B0Q5WANefW8P0Z9lfQM=; b=wdRX0iV1ZzMGIuE43d2dXXkRJNjZiExFbUSD0rSaqNMrJJbyNGC8O846qiwGWPbbMs 8QVC4wxn6vt1w/OM0tgbcLxcnI/6oUCUH1z8LFkxsGHnP6a2Q1ZJlOxy6GbAgXjYu8IU QVCDT4qgz/NhxDXz0tHk6YUz5tL0HHMbaTI1SYcLuq5ndWYounl8Km13lRO33pZRJSRc v5DarYw+S+ww97fsviZcGcpg9lTO85S4osEKJZmEL8tX2b4xM+TPYUnJ9OeUTS07H2OJ 0B0Cp5+A/41Cv/639qdVR0ewFs8BHo1ivddDwZLU/DyVaFnWeuRVgQd80didDpou7xVR yDSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e0jJCHZG; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si1778467edq.14.2021.09.02.04.28.49; Thu, 02 Sep 2021 04:28:49 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e0jJCHZG; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234206AbhIBL3p (ORCPT + 6 others); Thu, 2 Sep 2021 07:29:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:37252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245693AbhIBL3n (ORCPT ); Thu, 2 Sep 2021 07:29:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 31828610C9; Thu, 2 Sep 2021 11:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630582125; bh=JZA7W0CCB3PFjX9plJtLmN9hVAcF+Ajoc3SN0ou+EPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e0jJCHZGRqfkLFgxFLAXOsLLvyS0s7QDJlZ4yx1LpWz3jO7jSAl+tqKBvrejsGs9B lmiUtw2jBWC/WQqlohOHSql7NIzTQbwx8tJ5Y/q14wHB7IgpDnCtUzzukOnEKBi7hL S+fMeLw3DhVAVYez51XWGmzhdzSCrjs/pvjJqe8dTqNFL50zRt/TZkPcuYMjGRBSur 9no5h5j1tJX0D6wfFOzw8HxAkfjBaO1r3X/WhlqvN+ilgcjDg8MHFHfQgQ/CgaEbfz /yHpiKmbzNC44MFmw7oGEAmk0vPH60FDw3wgPVN4PfxrBF9880rYqfwMV3DolpiG+0 CSJie12QpFbcg== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mLktf-0004Za-Bx; Thu, 02 Sep 2021 13:28:43 +0200 From: Mauro Carvalho Chehab To: Rob Herring Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, John Stultz , Rob Herring , Wei Xu , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mauro Carvalho Chehab Subject: [PATCH v3 4/4] arm64: dts: hisilicon: Add usb mux hub for hikey960 Date: Thu, 2 Sep 2021 13:28:37 +0200 Message-Id: <4b5ea17f9dd2b3a2652396a99a69a977b744eaf4.1630581434.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: John Stultz 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. [mchehab: modified it to adapt to the merged DT schema] Signed-off-by: John Stultz Signed-off-by: Mauro Carvalho Chehab --- .../boot/dts/hisilicon/hi3660-hikey960.dts | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) -- 2.31.1 diff --git a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts index f68580dc87d8..0f253bb705db 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts +++ b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts @@ -197,6 +197,37 @@ optee { method = "smc"; }; }; + + usb_hub_vdd: usb_hub_vdd { + compatible = "regulator-fixed"; + regulator-name = "hub-vdd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio5 6 0>; + enable-active-high; + }; + + usb-hub { + compatible = "hisilicon,hikey960-usbhub"; + typec-vbus-gpios = <&gpio25 2 GPIO_ACTIVE_HIGH>; + otg-switch-gpios = <&gpio25 6 GPIO_ACTIVE_HIGH>; + hub-vdd-supply = <&usb_hub_vdd>; + 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 {