From patchwork Mon Jul 20 11:02:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1513 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id E41AF3F080 for ; Mon, 20 Jul 2020 13:02:55 +0200 (CEST) Received: by mail-pj1-f69.google.com with SMTP id lk11sf7730740pjb.0 for ; Mon, 20 Jul 2020 04:02:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1595242974; cv=pass; d=google.com; s=arc-20160816; b=W5Z0vw4pO44r/s35lpL82Ya8fuS9fx55kww740J6/bpbY0zcH1jnGQajqUrtV4uzYk Inl7IvLvGwcIUT9DQ3g8ArHq7lCaa5YqlGWkYePPajyRu9dnzFA8cu/CkUctexwfqBo5 wsy8Nsn75zKpW9T+vw8hwMSeF7PCNukrO0dw9r1rGEo8KuflNhJjIxJojO3uuSrX4ZwI Jf32rLjnbt2kUOXGMF33ch8DAfl0n1q8GJI/TI/7iv/QSEE48FcVvn7RVkyPYoQwuphW Spu75A24bzCcj1ycw5Z6zHrdrjJluMLOQd0PIweAtrWgkLwwnbzVstDFt886ad0OKtFX wBdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=2hHzQ3TiRlTCqauxw1joK4gbQWBddIDSCyC3bgNNCGw=; b=KZ6iHp+PkH+Pz1wtB9qeCvnwvDSea2lGFhBO9K8aTpAvnhEEC6Fox4FirZT7tqHz58 lsZRDgVhKBnFbCId8vKPX1FGWww23rrWjcZ5NXe18Lw+c/C2GHRqnDoIEpWtTGu4XWIu BLZmAE3/YIz1y2RZCU5Sz9DB+4MNSQY5GfwuvcRg1gPh/HAufssdAUj9CbzU34/ThRjB a4r1/tSPLrPHcPHweVAzIMFuwFdLbbJFXmqw8+jxEQ3D50cPknVcZaathzJPGmtsbYL9 VSjLAdI/qhg12kmqHAPQETjbptbpDbzAwbaI7Uu1WVOfz4+GAbqmJxHSH2pJR/VFA6rl zW4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=OrN32bn1; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=2hHzQ3TiRlTCqauxw1joK4gbQWBddIDSCyC3bgNNCGw=; b=oVG9+VK6A/qcqmj1qhgsf8lbfL1Bf8/0puefOJ6a5kbvTchY8cE4OaWxtpqiGwXWDt b81VAStDgfaTr3qrr59Li4ayyvWsUtRSSTIUe+2rWTEH641OC3shil7B0bu3vT4z8HTZ qM6rAy35W1JCu85YnKWx0XzISp0aqBRzxvWu8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=2hHzQ3TiRlTCqauxw1joK4gbQWBddIDSCyC3bgNNCGw=; b=R+MIOq9JsEjkykhDOJeaOBjX9rSXiff2Oq2TtApa9f1aIIcTOgl3dQallPoHPvLHrJ J/4Y/vYsw4zBOq/g7iceFBU7bmSEzDPx+RPSDedrbiVF796HC4hixh7L1Hhi7yMCXENG VKctVdVNAzxyqXJV4xfnv2WFOGSWnFPk8AP8S6UjCDlzUKbv53XQChlAnaiK5ES34qT9 rPd+hbb58z2FlMu2nxGMYoo3csMAsMxEeo8btWGdRUCL6jCEtAaubh2CQB4ZmpuvXG5o vpe6IJ1yAk/7spE7YvQJOys+AOCNMnBoA3fXR4nJvhY8Uff/H//A8bjTuwMKjHerted0 mWGQ== X-Gm-Message-State: AOAM530s0uzDwY+yJ/9WSo7fWWecEgplo1QJG/jJAK408M5wEbIxiGBV z9N0IuDm1atJ40Ic+/QubpVu+Tza X-Google-Smtp-Source: ABdhPJyVkdcY93fXqM0GWMgrToIgLv0yYYOkJFa62k8n1xFAQISnufS7u4BU2DADwY1faILlT8vIbg== X-Received: by 2002:aa7:84ce:: with SMTP id x14mr20231681pfn.220.1595242974386; Mon, 20 Jul 2020 04:02:54 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:8a16:: with SMTP id w22ls8082381pjn.1.canary-gmail; Mon, 20 Jul 2020 04:02:54 -0700 (PDT) X-Received: by 2002:a17:90a:65c7:: with SMTP id i7mr22984735pjs.103.1595242973829; Mon, 20 Jul 2020 04:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595242973; cv=none; d=google.com; s=arc-20160816; b=OlaP7JBwJQgddOC3R5dqSXky9RIiq2EWTWi15a88pAiuFa/VVciE/WbJW0nX1tti4W uI0oAohcyqFrSzoe+AwXZMSF/mbcc3O/Xlg9tRZnb+3Iu9ZnBs0lCPeNCWhfr2jv/H2N DsYkTGTCSyMNt4Ua+nhoA/9VBq2M/LAUy/tk/lATq+eq9AXXTfePDSozrfiC86wrAkay 6lxMAFGLu2JjIri522Y4oWGlS+yZvVElC/LvU8QI+UWf5OFN9nGiIDarJ7UM5RE7zAeV xzRQ4mUuuVBWmKVxzR97DXM3wPdicWkVqmY4Aiw2WpSbKJ5siLULdcgtxqNSrpUUHgNb CBlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=nE2C5G9azmjt7+W5WypzQU7MH/oEmdhAcqvQRmdBylE=; b=qGqMKCQXQ3djgmEqJ5jHE93cfeJsV6pEXhqUwnT3nAdLdfMTn/O7YF7ocBj7UtBXn0 kArpK2tt+5hreLvY16czTVeoKSeegxW5eph+DWVduoN2uqAJ0OzBuRqR5OAHQZFg7U+3 /eOV7sImSRFSgx/x4xeVNROGvnbSJGfHAanmivuL5R6zfhL0ZguhROAxkl/CYK36TFUs HRM+EVNJS7+uaUjymHw/YLqKoUPZgUHQfH+H7pM8fFe1yH+6J7Cnty2ockVXj5VIQlgS riV80E0DWTEoOF1YoAF1l2aKvHP+iKFfFMJmwgHvolxpXnAsgCGspF/4DFZ+JkDOmjR2 /uOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=OrN32bn1; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id p8sor19730965pgi.40.2020.07.20.04.02.53 for (Google Transport Security); Mon, 20 Jul 2020 04:02:53 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:757:: with SMTP id 84mr18562219pgh.275.1595242973437; Mon, 20 Jul 2020 04:02:53 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:8c21:db7b:4558:fba3]) by smtp.gmail.com with ESMTPSA id o10sm11445876pjs.27.2020.07.20.04.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 04:02:52 -0700 (PDT) From: Jagan Teki To: Heiko Stuebner , Rob Herring Cc: Suniel Mahesh , Michael Trimarchi , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH 1/3] ARM: dts: rockchip: Add USB for RockPI N8/N10 Date: Mon, 20 Jul 2020 16:32:28 +0530 Message-Id: <20200720110230.367985-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=OrN32bn1; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Radxa dalang carrier board has 2x USB 2.0 and 1x USB 3.0 ports. This patch adds support to enable all these USB ports for N10 and N8 combinations SBCs. Note that the USB 3.0 port on RockPI N8 combination works as USB 2.0 OTG since it is driven from RK3288. Signed-off-by: Jagan Teki Reported-by: kernel test robot --- Note: - depends on https://lkml.org/lkml/2020/7/20/446 arch/arm/boot/dts/rk3288-vmarc-som.dtsi | 42 ++++++++++ .../dts/rockchip-radxa-dalang-carrier.dtsi | 18 +++++ .../dts/rockchip/rk3399pro-vmarc-som.dtsi | 78 +++++++++++++++++++ 3 files changed, 138 insertions(+) diff --git a/arch/arm/boot/dts/rk3288-vmarc-som.dtsi b/arch/arm/boot/dts/rk3288-vmarc-som.dtsi index 0bcb9f067d66..abe3c01d13aa 100644 --- a/arch/arm/boot/dts/rk3288-vmarc-som.dtsi +++ b/arch/arm/boot/dts/rk3288-vmarc-som.dtsi @@ -267,4 +267,46 @@ sdmmc_cmd: sdmmc-cmd { rockchip,pins = <6 RK_PC5 1 &pcfg_pull_up_drv_8ma>; }; }; + + vbus_host { + usb1_en_oc: usb1-en-oc { + rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + vbus_typec { + usb0_en_oc: usb0-en-oc { + rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; +}; + +&usbphy { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usb_host1 { + status = "okay"; +}; + +&usb_otg { + status = "okay"; +}; + +&vbus_host { + enable-active-high; + gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; /* USB1_EN_OC# */ +}; + +&vbus_typec { + enable-active-high; + gpio = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>; /* USB0_EN_OC# */ }; diff --git a/arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi b/arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi index 450e5bb5af0b..d2b6ead148a2 100644 --- a/arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi +++ b/arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi @@ -33,6 +33,24 @@ vcc5v0_sys: vcc5v0-sys-regulator { regulator-max-microvolt = <5000000>; vin-supply = <&vcc12v_dcin>; }; + + vbus_host: vbus-host { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&usb1_en_oc>; + regulator-name = "vbus_host"; /* HOST-5V */ + regulator-always-on; + vin-supply = <&vcc5v0_sys>; + }; + + vbus_typec: vbus-typec { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&usb0_en_oc>; + regulator-name = "vbus_typec"; + regulator-always-on; + vin-supply = <&vcc5v0_sys>; + }; }; &gmac { diff --git a/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi b/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi index 37ed95d5f7e9..111d6cf9a4e6 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi @@ -304,6 +304,18 @@ pmic_int_l: pmic-int-l { rockchip,pins = <1 RK_PC2 0 &pcfg_pull_up>; }; }; + + vbus_host { + usb1_en_oc: usb1-en-oc { + rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + vbus_typec { + usb0_en_oc: usb0-en-oc { + rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; }; &pmu_io_domains { @@ -324,8 +336,74 @@ &sdmmc { max-frequency = <150000000>; }; +&tcphy0 { + status = "okay"; +}; + &tsadc { rockchip,hw-tshut-mode = <1>; rockchip,hw-tshut-polarity = <1>; status = "okay"; }; + +&u2phy0 { + status = "okay"; + + u2phy0_otg: otg-port { + phy-supply = <&vbus_typec>; + status = "okay"; + }; + + u2phy0_host: host-port { + phy-supply = <&vbus_host>; + status = "okay"; + }; +}; + + +&u2phy1 { + status = "okay"; + + u2phy1_host: host-port { + phy-supply = <&vbus_host>; + status = "okay"; + }; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + +&usbdrd3_0 { + status = "okay"; +}; + +&usbdrd_dwc3_0 { + status = "okay"; +}; + +&vbus_host { + enable-active-high; + gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>; /* USB1_EN_OC# */ + pinctrl-names = "default"; + pinctrl-0 = <&usb1_en_oc>; +}; + +&vbus_typec { + enable-active-high; + gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; /* USB0_EN_OC# */ + pinctrl-names = "default"; + pinctrl-0 = <&usb0_en_oc>; +};