Skip to content

Commit 417b188

Browse files
openedevmmind
authored andcommitted
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. Signed-off-by: Jagan Teki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 82540de commit 417b188

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed

arch/arm/boot/dts/rk3288-vmarc-som.dtsi

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,46 @@
267267
rockchip,pins = <6 RK_PC5 1 &pcfg_pull_up_drv_8ma>;
268268
};
269269
};
270+
271+
vbus_host {
272+
usb1_en_oc: usb1-en-oc {
273+
rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>;
274+
};
275+
};
276+
277+
vbus_typec {
278+
usb0_en_oc: usb0-en-oc {
279+
rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
280+
};
281+
};
282+
};
283+
284+
&usbphy {
285+
status = "okay";
286+
};
287+
288+
&usb_host0_ehci {
289+
status = "okay";
290+
};
291+
292+
&usb_host0_ohci {
293+
status = "okay";
294+
};
295+
296+
&usb_host1 {
297+
status = "okay";
298+
};
299+
300+
&usb_otg {
301+
status = "okay";
302+
};
303+
304+
&vbus_host {
305+
enable-active-high;
306+
gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; /* USB1_EN_OC# */
307+
};
308+
309+
&vbus_typec {
310+
enable-active-high;
311+
gpio = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>; /* USB0_EN_OC# */
270312
};

arch/arm/boot/dts/rockchip-radxa-dalang-carrier.dtsi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@
3333
regulator-max-microvolt = <5000000>;
3434
vin-supply = <&vcc12v_dcin>;
3535
};
36+
37+
vbus_host: vbus-host {
38+
compatible = "regulator-fixed";
39+
pinctrl-names = "default";
40+
pinctrl-0 = <&usb1_en_oc>;
41+
regulator-name = "vbus_host"; /* HOST-5V */
42+
regulator-always-on;
43+
vin-supply = <&vcc5v0_sys>;
44+
};
45+
46+
vbus_typec: vbus-typec {
47+
compatible = "regulator-fixed";
48+
pinctrl-names = "default";
49+
pinctrl-0 = <&usb0_en_oc>;
50+
regulator-name = "vbus_typec";
51+
regulator-always-on;
52+
vin-supply = <&vcc5v0_sys>;
53+
};
3654
};
3755

3856
&gmac {

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

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,18 @@
304304
rockchip,pins = <1 RK_PC2 0 &pcfg_pull_up>;
305305
};
306306
};
307+
308+
vbus_host {
309+
usb1_en_oc: usb1-en-oc {
310+
rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>;
311+
};
312+
};
313+
314+
vbus_typec {
315+
usb0_en_oc: usb0-en-oc {
316+
rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
317+
};
318+
};
307319
};
308320

309321
&pmu_io_domains {
@@ -324,8 +336,74 @@
324336
max-frequency = <150000000>;
325337
};
326338

339+
&tcphy0 {
340+
status = "okay";
341+
};
342+
327343
&tsadc {
328344
rockchip,hw-tshut-mode = <1>;
329345
rockchip,hw-tshut-polarity = <1>;
330346
status = "okay";
331347
};
348+
349+
&u2phy0 {
350+
status = "okay";
351+
352+
u2phy0_otg: otg-port {
353+
phy-supply = <&vbus_typec>;
354+
status = "okay";
355+
};
356+
357+
u2phy0_host: host-port {
358+
phy-supply = <&vbus_host>;
359+
status = "okay";
360+
};
361+
};
362+
363+
364+
&u2phy1 {
365+
status = "okay";
366+
367+
u2phy1_host: host-port {
368+
phy-supply = <&vbus_host>;
369+
status = "okay";
370+
};
371+
};
372+
373+
&usb_host0_ehci {
374+
status = "okay";
375+
};
376+
377+
&usb_host0_ohci {
378+
status = "okay";
379+
};
380+
381+
&usb_host1_ehci {
382+
status = "okay";
383+
};
384+
385+
&usb_host1_ohci {
386+
status = "okay";
387+
};
388+
389+
&usbdrd3_0 {
390+
status = "okay";
391+
};
392+
393+
&usbdrd_dwc3_0 {
394+
status = "okay";
395+
};
396+
397+
&vbus_host {
398+
enable-active-high;
399+
gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>; /* USB1_EN_OC# */
400+
pinctrl-names = "default";
401+
pinctrl-0 = <&usb1_en_oc>;
402+
};
403+
404+
&vbus_typec {
405+
enable-active-high;
406+
gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; /* USB0_EN_OC# */
407+
pinctrl-names = "default";
408+
pinctrl-0 = <&usb0_en_oc>;
409+
};

0 commit comments

Comments
 (0)