0%

RK3399修改TypeC为USBA

系统:Android 7.1.2

项目中没有用到USB TypeC,改成了USB TypeA接口。需要在dts文件中做如下修改:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
&fusb0 {
- status = "okay";
+ status = "disabled";
};

&tcphy0 {
status = "okay";
+ /delete-property/ extcon;
};

&u2phy0 {
status = "okay";
- extcon = <&fusb0>;
+ /delete-property/ extcon;

u2phy0_otg: otg-port {
status = "okay";
+ vbus-supply = <&vcc5v0_otg>;
};
};

&usbdrd3_0 {
status = "okay";
- extcon = <&fusb0>;
+ extcon = <&u2phy0>;
};

&usbdrd_dwc3_0 {
status = "okay";
+ dr_mode = "otg";
};

fusb0 disabled;
tcphy0 和 u2phy0 删除 extcon 属性;
usbdrd3_0 的 extcon 设为 u2phy0;
usbdrd_dwc3_0 设为 otg模式;

另外,板子上USB供电的GPIO口做了修改,也需要在dtsi文件中做相应修改。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@@ -88,7 +88,7 @@
vcc5v0_host: vcc5v0-host-regulator {
compatible = "regulator-fixed";
enable-active-high;
- gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
+ gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&host_vbus_drv>;
regulator-name = "vcc5v0_host";
regulator-always-on;
};

+ vcc5v0_otg: vcc5v0-otg-regulator {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&otg_vbus_drv>;
+ regulator-name = "vcc5v0_otg";
+ regulator-always-on;
+ };

@@ -620,7 +592,7 @@
usb2 {
host_vbus_drv: host-vbus-drv {
rockchip,pins =
- <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
+ <1 0 RK_FUNC_GPIO &pcfg_pull_none>;
};

+ otg_vbus_drv: otg-vbus-drv {
+ rockchip,pins =
+ <1 1 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
};