Skip to contentSkip to conversation

ARM: dts: rockchip: Add USB for RockPI N8/N10

PATCH Applied Jagan Teki 3 participants 7 messages Jul 20, 2020 – Jul 22, 2020

Subsystems (2)
lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH 1/3 ARM: dts: rockchip: Add USB for RockPI N8/N10

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.

---
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(+)
arch/arm/boot/dts/rk3288-vmarc-som.dtsi +42 -0
index 0bcb9f067d66..abe3c01d13aa 100644
@@ -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# */
 };
arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi +18 -0
index 450e5bb5af0b..d2b6ead148a2 100644
@@ -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 {
arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi +78 -0

92 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/3 ARM: dts: rockchip: Add HDMI out for RockPI N8/N10

This patch adds support to enable HDMI out for
N10 and N8 combinations SBCs.

---
 arch/arm/boot/dts/rk3288-vmarc-som.dtsi       | 10 ++++++++++
 .../dts/rockchip-radxa-dalang-carrier.dtsi    | 20 +++++++++++++++++++
 .../dts/rockchip/rk3399pro-vmarc-som.dtsi     | 12 +++++++++++
 3 files changed, 42 insertions(+)
arch/arm/boot/dts/rk3288-vmarc-som.dtsi +10 -0
index abe3c01d13aa..ba2732ec72da 100644
@@ -38,6 +38,12 @@ &gmac {
 	snps,reset-gpio = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>;
 };
 
+&hdmi {
+	ddc-i2c-bus = <&i2c5>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&hdmi_cec_c0>;
+};
+
 &i2c0 {
 	clock-frequency = <400000>;
 	status = "okay";
@@ -225,6 +231,10 @@ regulator-state-mem {
 	};
 };
 
+&i2c5 {
+	status = "okay";
+};
+
 &io_domains {
 	bb-supply = <&vcc_io>;
 	flash0-supply = <&vccio_flash>;
arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi +20 -0
index d2b6ead148a2..26b53eac4706 100644
@@ -66,6 +66,10 @@ &gmac {
 	status = "okay";
 };
 
+&hdmi {
+	status = "okay";
+};
+
 &pwm0 {
 	status = "okay";
 };
@@ -94,3 +98,19 @@ &uart0 {
 &uart2 {
 	status = "okay";
 };
+
+&vopb {
+	status = "okay";
+};
+
+&vopb_mmu {
+	status = "okay";
+};
+
+&vopl {
+	status = "okay";
+};
+
+&vopl_mmu {
+	status = "okay";
+};
arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi +12 -0
index 111d6cf9a4e6..ebccc4a153a2 100644
@@ -39,6 +39,12 @@ &gmac {
 	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
 };
 
+&hdmi {
+	ddc-i2c-bus = <&i2c3>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&hdmi_cec>;
+};
+
 &i2c0 {
 	clock-frequency = <400000>;
 	i2c-scl-falling-time-ns = <30>;
@@ -285,6 +291,12 @@ hym8563: hym8563@51 {
 	};
 };
 
+&i2c3 {
+	i2c-scl-rising-time-ns = <450>;
+	i2c-scl-falling-time-ns = <15>;
+	status = "okay";
+};
+
 &io_domains {
 	status = "okay";
 	bt656-supply = <&vcca_1v8>;
Signature · 1 line
2.25.1
author
#2 lore raw

PATCH 3/3 arm64: dts: rockchip: Add PCIe for RockPI N10

In reply to Jagan Teki

This patch adds support to enable PCIe for RockPI N10.

---
 .../dts/rockchip/rk3399pro-vmarc-som.dtsi     | 41 ++++++++++++++++++-
 1 file changed, 39 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi +39 -2
index ebccc4a153a2..b415b8a16c78 100644
@@ -11,6 +11,19 @@
 
 / {
 	compatible = "vamrs,rk3399pro-vmarc-som", "rockchip,rk3399pro";
+
+
+	vcc3v3_pcie: vcc-pcie-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio4 RK_PD4 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pcie_pwr>;
+		regulator-name = "vcc3v3_pcie";
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&vcc5v0_sys>;
+	};
 };
 
 &cpu_l0 {
@@ -142,7 +155,8 @@ vcca_0v9: LDO_REG1 {
 				regulator-min-microvolt = <900000>;
 				regulator-max-microvolt = <900000>;
 				regulator-state-mem {
-					regulator-off-in-suspend;
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <900000>;
 				};
 			};
 
@@ -177,7 +191,8 @@ vcca_1v8: LDO_REG4 {
 				regulator-min-microvolt = <1850000>;
 				regulator-max-microvolt = <1850000>;
 				regulator-state-mem {
-					regulator-off-in-suspend;
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <1850000>;
 				};
 			};
 
@@ -304,6 +319,22 @@ &io_domains {
 	sdmmc-supply = <&vccio_sd>;
 };
 
+&pcie_phy {
+	status = "okay";
+};
+
+&pcie0 {
+	ep-gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
+	max-link-speed = <2>;
+	num-lanes = <4>;
+	pinctrl-0 = <&pcie_clkreqnb_cpm>;
+	pinctrl-names = "default";
+	vpcie0v9-supply = <&vcca_0v9>;	/* VCC_0V9_S0 */
+	vpcie1v8-supply = <&vcca_1v8>;	/* VCC_1V8_S0 */
+	vpcie3v3-supply = <&vcc3v3_pcie>;
+	status = "okay";
+};
+
 &pinctrl {
 	hym8563 {
 		hym8563_int: hym8563-int {
@@ -311,6 +342,12 @@ hym8563_int: hym8563-int {
 		};
 	};
 
+	pcie {
+		pcie_pwr: pcie-pwr {
+			rockchip,pins =	<4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
 	pmic {
 		pmic_int_l: pmic-int-l {
 			rockchip,pins = <1 RK_PC2 0 &pcfg_pull_up>;
Signature · 1 line
2.25.1
#5 lore raw
In reply to Jagan Teki
I love your patch! Yet something to improve:

Hi Jagan,

I love your patch! Yet something to improve:

[auto build test ERROR on rockchip/for-next]
[also build test ERROR on next-20200720]
[cannot apply to v5.8-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Jagan-Teki/ARM-dts-rockchip-Add-USB-for-RockPI-N8-N10/20200720-190757
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

>> Error: arch/arm/boot/dts/rk3288-vmarc-som.dtsi:292.1-16 Label or path usb_host0_ohci not found
>> FATAL ERROR: Syntax error parsing input tree

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

author
#3 lore raw

Re: [PATCH 3/3] arm64: dts: rockchip: Add PCIe for RockPI N10

In reply to Jagan Teki

Hi Heiko,

Quoted 13 lines · Jagan Teki

This patch adds support to enable PCIe for RockPI N10.

---
 .../dts/rockchip/rk3399pro-vmarc-som.dtsi     | 41 ++++++++++++++++++-
 1 file changed, 39 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi +0 -0
index ebccc4a153a2..b415b8a16c78 100644

arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi line 15

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi +2 -0
@@ -11,6 +11,19 @@
 
 / {
        compatible = "vamrs,rk3399pro-vmarc-som", "rockchip,rk3399pro";
+
+

Sorry for this extra space, let me know so that I can resend next version.

Jagan.

maintainer Applied
#6 lore raw
In reply to Jagan Teki
Quoted 8 lines · Jagan Teki

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.

Applied, thanks!

[1/3] ARM: dts: rockchip: Add USB for RockPI N8/N10

      commit: 417b188a985d3557b0ecb5623b27bd9843f03aec
[2/3] ARM: dts: rockchip: Add HDMI out for RockPI N8/N10
      commit: d0cb2f30e7c033f0a8bbe98ec73dbc1db4788942
[3/3] arm64: dts: rockchip: Add PCIe for RockPI N10
      commit: 93ca8ac2e8fcea6feb02a40edd2334144b62fc6e

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>
maintainer
#4 lore raw

Re: [PATCH 3/3] arm64: dts: rockchip: Add PCIe for RockPI N10

In reply to Jagan Teki

Am Mittwoch, 22. Juli 2020, 20:51:07 CEST schrieb Jagan Teki:

Quoted 17 lines

Hi Heiko,

Quoted 14 lines · Jagan Teki

This patch adds support to enable PCIe for RockPI N10.

---
 .../dts/rockchip/rk3399pro-vmarc-som.dtsi     | 41 ++++++++++++++++++-
 1 file changed, 39 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi +0 -0
index ebccc4a153a2..b415b8a16c78 100644
@@ -11,6 +11,19 @@
 
Quoted 6 lines

arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi line 15

Quoted 4 lines
arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi +2 -0
 / {
        compatible = "vamrs,rk3399pro-vmarc-som", "rockchip,rk3399pro";
+
+

Sorry for this extra space, let me know so that I can resend next version.

I fixed that up when applying the series.

Heiko