From patchwork Tue Jul 21 15:24:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1549 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8C55D3F03F for ; Tue, 21 Jul 2020 17:25:15 +0200 (CEST) Received: by mail-io1-f71.google.com with SMTP id n3sf13573772iob.8 for ; Tue, 21 Jul 2020 08:25:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1595345114; cv=pass; d=google.com; s=arc-20160816; b=Hw9lFmMsNV2LRMN/jXftLClnz4nvxAN1/qOzNdXLRfEivvEuaob6oCR+Ku7Zr5KXKM +OCxtPtUx7YCuVhWL4hfxQPfVutZNp0ebApXJaq7XvsEYbbNkePHlpFeMS4kyIZQ7tpk C8yFgR7w5uHe2sizMxqPMPiqH499DQO7qC61osulfPkYxMgAUShOLFa4+mR+80/aZm3t bFXdbvR8zeqMFvaNqmN6utvm74gIEOKd2y7EeZwcE8e5bvM+Jd5ZmGIhJm9mtkE0csp0 cG5rBTCL+kBKFBSwKQ6H5Z07TDciIhrviHuJJqqxZL+8wRyeoUNu/GpkDflKduMa0SLk TM/A== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ZokoD7PNPouCUninHB82GUnQsA2AgK2wQ6YMu6unF3Y=; b=J0acUNBp3fWIvzkQ+BsEFIHi2kCFffjT5WtxdhCs/hvZu/DDeNUUz9km/5wTIlJGLX vAQ68ialMu1JZZY4iHf2g90k93fXgoXpo9ora2GK3k0MnwJCG66B20xCQnSsJjoBjpjB XtkltUxpaZF4AwLIhQn83UIz4xlhQuuBgowGbHV3p9VCdHau5iUlF10HohqZ/OUWEMDE /KqdS9T1ZJjva8AMJR8tjmzABEGVfuZdrS+OL/L2foVlC7UfTT5//K2XI3lqYAiLiazT DzZI+3psDZTGmt4H0tYTg0hLlUSoZtCAMw3jv0C0Or8q/yONiLGItmBmoSL9Pjw+rCqo vYmg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=i2CmEJaf; 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:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=ZokoD7PNPouCUninHB82GUnQsA2AgK2wQ6YMu6unF3Y=; b=cXjT1qrw8JR4T4uMYO20rYtEHoZJdriczfnDoJwfl4FEzr7RkpPMxokcs/jsBPKRZv ZWLYgWa8xIl8VUI4q8cinaeyE3rtSMzDGCzEz8u4kIlCxw5QOfZIf86EuHSLgtIAp6r9 PGbAJdnwsSaQAyEH91piR3EQlHMzSIeZT4Bx4= 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:in-reply-to :references: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=ZokoD7PNPouCUninHB82GUnQsA2AgK2wQ6YMu6unF3Y=; b=MSM/YLeq2WGIG7MwCbOkN0I4Lb+y/AFo0T3VEcqdP5IjFQFSKZa1Ed82HSEIAgoQaA dZ6Gguqy6Of094SCs3IsqmfK6WVJ/r+rkAEjsDXYL3Wo3TdXd8KN7c92QgZBCocusDbo 5WzoRIc5fLmK9onAfQJWpPN4ni1XNWCTAm4IQQEu7jXjpwOToa3J6bh2KK11woLvgg4U ZblUVlH7Ga7iTB54+LbcZoN8evwWf3Ad5E14SGFoPRWpCotbp4xqYen2DYNi/nZsYwK8 krLfjqXfMapm6zOH5+XrRN966xArJVTaAMl+QYHa9nAIo3lHs+/q4dlDc6UJRY6tXKLP OfJA== X-Gm-Message-State: AOAM533OVYRAGQbrO6oo69KooBJDpqrGdhbu3HfxjTNah0gGYwkv3Zba 2VVEX8qTXIpaK9BKKiWHZwStAmLJ X-Google-Smtp-Source: ABdhPJxk/cFHwEfBPDlX0Tr3IMfWmHOqnPj1tKFUKvCDM2hhPT3f5HsBYhOsI/CSb8eED81xnPB3CA== X-Received: by 2002:a02:682:: with SMTP id 124mr64934jav.110.1595345113624; Tue, 21 Jul 2020 08:25:13 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6602:1549:: with SMTP id h9ls3701634iow.4.gmail; Tue, 21 Jul 2020 08:25:13 -0700 (PDT) X-Received: by 2002:a5e:8b04:: with SMTP id g4mr5438073iok.203.1595345113141; Tue, 21 Jul 2020 08:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595345113; cv=none; d=google.com; s=arc-20160816; b=UsDupP2pjlqcFwJLjOZXdwIPX8G8NqJOtqU80YHmvkqOx8qlIvK97raITuBlbC4rRu XOhJ45RCwpwp3YHXgz+KhWfwdWcYqCk9k1tP5DNMx7Rw5uzvS7XDZ9f9wVfaTSdG9UyZ mhW00lqpvB0bhLOXXN9M8AYlhSQWn31Ro4fdyLhF2uix/4nJH9+aqswI7tZC+GuihwUn PR821acQHMUUaNGqsBFv/W/bSSzv/N5/hSR7/SU3D33qBDqlVIyRIQ/Zpn5k8PwfubyY 4y5XuBnCt5u91KDu7iDjSnFUyxldy4+rvhyUKegbYQOgsQKPiIzCUcovNZwsT0pCN+Im E4vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=WUEZCvXM6b4XdeRuAzykStbjmf+stosFsibv2H/fuuY=; b=kEFyzpFV9PVF+uHZdMlLM0diy7eI/m4rtXZTgYtUxVPLifv7TRaC27beTGxzaT3OEU GUIrpPppNET9LKhHv5HT5OOJk0NVx7o10EJSxNa2gSrdd4PfL4kFcW6gXraqmZ4RXntn 2SA+uMedEBuAK/C8e9ONFZQFpD8zIGLoOxry64xlYoaNbH0nN28+jTHn61wn8lAdauV3 mFE/QMHDllbzxCEhrF1yoNFmkRvD0vm/G6O073Jw0M8OcpwqLcLwRzyNtasybLiRItAr 7k+sZJA5T3rAPoEwMZ/0itoziwMtNCCNyAUBRC+otIpL8D075Nnv7+lNERfN5tL43dre 18XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=i2CmEJaf; 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 c9sor16880077ilq.1.2020.07.21.08.25.13 for (Google Transport Security); Tue, 21 Jul 2020 08:25:13 -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:a17:90a:ee95:: with SMTP id i21mr5543937pjz.77.1595345112809; Tue, 21 Jul 2020 08:25:12 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:3df7:ef76:b2b5:fa14]) by smtp.gmail.com with ESMTPSA id h131sm2876838pfe.138.2020.07.21.08.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 08:25:12 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Cc: Suniel Mahesh , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki Subject: [PATCH v2 04/12] ARM: dts: rockchip: Add USB for RockPI N8/N10 Date: Tue, 21 Jul 2020 20:54:38 +0530 Message-Id: <20200721152443.37602-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200721152443.37602-1-jagan@amarulasolutions.com> References: <20200721152443.37602-1-jagan@amarulasolutions.com> 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=i2CmEJaf; 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 Reviewed-by: Kever Yang --- Changes for v2: - none arch/arm/dts/rk3288-vmarc-som.dtsi | 42 ++++++++++ arch/arm/dts/rk3399pro-vmarc-som.dtsi | 78 +++++++++++++++++++ .../dts/rockchip-radxa-dalang-carrier.dtsi | 18 +++++ 3 files changed, 138 insertions(+) diff --git a/arch/arm/dts/rk3288-vmarc-som.dtsi b/arch/arm/dts/rk3288-vmarc-som.dtsi index 7a9fd40e5b..72a503e50d 100644 --- a/arch/arm/dts/rk3288-vmarc-som.dtsi +++ b/arch/arm/dts/rk3288-vmarc-som.dtsi @@ -258,4 +258,46 @@ 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/dts/rk3399pro-vmarc-som.dtsi b/arch/arm/dts/rk3399pro-vmarc-som.dtsi index 37ed95d5f7..111d6cf9a4 100644 --- a/arch/arm/dts/rk3399pro-vmarc-som.dtsi +++ b/arch/arm/dts/rk3399pro-vmarc-som.dtsi @@ -304,6 +304,18 @@ 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 @@ 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>; +}; diff --git a/arch/arm/dts/rockchip-radxa-dalang-carrier.dtsi b/arch/arm/dts/rockchip-radxa-dalang-carrier.dtsi index 450e5bb5af..d2b6ead148 100644 --- a/arch/arm/dts/rockchip-radxa-dalang-carrier.dtsi +++ b/arch/arm/dts/rockchip-radxa-dalang-carrier.dtsi @@ -33,6 +33,24 @@ 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 {