All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jagan@amarulasolutions.com>
To: Kever Yang <kever.yang@rock-chips.com>,
	Philipp Tomsich <philipp.tomsich@theobroma-systems.com>,
	Simon Glass <sjg@chromium.org>
Cc: Suniel Mahesh <sunil@amarulasolutions.com>,
	U-Boot-Denx <u-boot@lists.denx.de>,
	linux-rockchip@lists.infradead.org,
	linux-amarula <linux-amarula@amarulasolutions.com>,
	Jagan Teki <jagan@amarulasolutions.com>
Subject: [PATCH 04/16] ARM: dts: rockchip: Add USB for RockPI N8/N10
Date: Tue, 21 Jul 2020 00:21:08 +0530	[thread overview]
Message-ID: <20200720185120.671064-5-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20200720185120.671064-1-jagan@amarulasolutions.com>

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 <jagan@amarulasolutions.com>
---
 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 {
-- 
2.25.1

WARNING: multiple messages have this Message-ID (diff)
From: Jagan Teki <jagan@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [PATCH 04/16] ARM: dts: rockchip: Add USB for RockPI N8/N10
Date: Tue, 21 Jul 2020 00:21:08 +0530	[thread overview]
Message-ID: <20200720185120.671064-5-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20200720185120.671064-1-jagan@amarulasolutions.com>

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 <jagan@amarulasolutions.com>
---
 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 {
-- 
2.25.1

  parent reply	other threads:[~2020-07-20 18:51 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 18:51 [PATCH 00/16] board: Add new features for ROCKPi N8/N10 Jagan Teki
2020-07-20 18:51 ` Jagan Teki
2020-07-20 18:51 ` [PATCH 01/16] ARM: dts: rockchip: Sync ROCKPi N8/N10 dts(i) from Linux Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-21  3:14   ` Kever Yang
2020-07-21  3:14     ` Kever Yang
2020-07-20 18:51 ` [PATCH 02/16] arm: dts: rockchip: Sync rk3288 dtsi from linux Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-21  3:14   ` Kever Yang
2020-07-21  3:14     ` Kever Yang
2020-07-20 18:51 ` [PATCH 03/16] ARM: dts: rockchip: Add usb host0 ohci node for rk3288 Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-21  3:17   ` Kever Yang
2020-07-21  3:17     ` Kever Yang
2020-07-21  6:26     ` Jagan Teki
2020-07-21  6:26       ` Jagan Teki
2020-07-20 18:51 ` Jagan Teki [this message]
2020-07-20 18:51   ` [PATCH 04/16] ARM: dts: rockchip: Add USB for RockPI N8/N10 Jagan Teki
2020-07-20 18:51 ` [PATCH 05/16] arm: dts: rockchip: Add HDMI out " Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-20 18:51 ` [PATCH 06/16] arm64: dts: rockchip: Add PCIe for RockPI N10 Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-20 18:51 ` [PATCH 07/16] configs: Enable USB host on Rock-PI-N10 Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-21  3:20   ` Kever Yang
2020-07-21  3:20     ` Kever Yang
2020-07-20 18:51 ` [PATCH 08/16] configs: Enable HDMI output Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-20 18:51 ` [PATCH 09/16] configs: Enable USB Gadget for rock-pi-n10 Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-20 18:51 ` [PATCH 10/16] configs: Enable USB 2.0 on Rock-PI-N8 Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-20 18:51 ` [PATCH 11/16] configs: Enable USB Gadget on rock-pi-n8 Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-20 18:51 ` [PATCH 12/16] rk3288: rock-pi-n8: Add console settings Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-20 18:51 ` [PATCH 13/16] configs: Enable HDMI output for rock-pi-n8 Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-20 18:51 ` [PATCH 14/16] rock-pi-n10: Enable PCI/NVME Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-20 18:51 ` [PATCH 15/16] arm64: dts: rockchip: Add u-boot, spl-boot-order for ROCKPi N10 Jagan Teki
2020-07-20 18:51   ` Jagan Teki
2020-07-20 18:51 ` [PATCH 16/16] rock-p-n8/n10: Disable RAM_ROCKCHIP_DEBUG Jagan Teki
2020-07-20 18:51   ` Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200720185120.671064-5-jagan@amarulasolutions.com \
    --to=jagan@amarulasolutions.com \
    --cc=kever.yang@rock-chips.com \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=philipp.tomsich@theobroma-systems.com \
    --cc=sjg@chromium.org \
    --cc=sunil@amarulasolutions.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.