20231222解决使用TYPE-C的数据线链接PC(WIN10)和NanoPC-T4(RK3399)开发板出现fusb302 4-0022: connection has disconnected的问题
2023/12/22 22:17
使用某些【劣质/老版本的】TYPE-C的数据线链接PC(WIN10)和NanoPC-T4(RK3399)开发板,出现LOG:
[ 1416.454553] fusb302 4-0022: connection has disconnected
[ 1416.908818] fusb302 4-0022: connection has disconnected
[ 1417.296931] fusb302 4-0022: connection has disconnected
[ 1417.693818] fusb302 4-0022: connection has disconnected
[ 1418.078981] fusb302 4-0022: connection has disconnected
[ 1418.517791] fusb302 4-0022: connection has disconnected
[ 1418.901827] fusb302 4-0022: connection has disconnected
[ 1419.287206] fusb302 4-0022: connection has disconnected
[ 1419.670758] fusb302 4-0022: connection has disconnected
[ 1420.053373] fusb302 4-0022: connection has disconnected
[ 1420.438883] fusb302 4-0022: connection has disconnected
[ 1420.822505] fusb302 4-0022: connection has disconnected
[ 1421.205280] fusb302 4-0022: connection has disconnected
[ 1421.586952] fusb302 4-0022: connection has disconnected
[ 1421.975504] fusb302 4-0022: connection has disconnected
[ 1422.359591] fusb302 4-0022: connection has disconnected
[ 1422.738568] fusb302 4-0022: connection has disconnected
[ 1423.127528] fusb302 4-0022: connection has disconnected
[ 1423.537652] fusb302 4-0022: connection has disconnected
[ 1423.922226] fusb302 4-0022: connection has disconnected
[ 1424.310524] fusb302 4-0022: connection has disconnected
http://www.thanksview.com/index.php/thread/19.html&wd=&eqid=9dcbd0e40000160f00000003647964fe
RK3399使用正常手机数据线无法连接adb的问题,显示fusb302 4-0022:
2020-06-23 10:14:57
ThanksView
访问次数: 195
注册日期: 2019-03-19
最后登录: 2023-12-18
RK3399刷入android系统时,开机后会一直显示fusb302 4-0022:connection has disconnected,这是因为RK3399开发板type-c口默认使用的OTG控制器,OTG线与常用的type-c数据线并不相同,普通的type-c充电线CC管脚通过56K电阻上拉到vbus,而OTG数据线通常是通过5.1K电阻下拉到地,因此主板电路,在插入OTG线时,将CC管脚的电平通过MOS管和三极管到ID管脚检测为0V,而插入普通充电线时,ID管脚检测大于1.8V即可,因此,若想用普通充电线做USB-adb使用,可采取将type-c控制器转为普通usb2.0 OTG方式。修改dts:
Z:\3TB\Rockchip_Android10.0_SDK_Release\kernel\arch\arm64\boot\dts\rockchip\rk3399-sapphire.dtsi
&i2c4 {
status = "okay";
i2c-scl-rising-time-ns = <475>;
i2c-scl-falling-time-ns = <26>;
fusb0: fusb30x@22 {
compatible = "fairchild,fusb302";
reg = <0x22>;
pinctrl-names = "default";
pinctrl-0 = <&fusb0_int>;
int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
vbus-5v-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
status = "disabled";
};
};
&i2c4 {
status = "okay";
i2c-scl-rising-time-ns = <475>;
i2c-scl-falling-time-ns = <26>;
fusb0: fusb30x@22 {
compatible = "fairchild,fusb302";
reg = <0x22>;
pinctrl-names = "default";
pinctrl-0 = <&fusb0_int>;
int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
vbus-5v-gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>;
status = "okay";
};
};
修改为:
&i2c4 {
status = "okay";
i2c-scl-rising-time-ns = <475>;
i2c-scl-falling-time-ns = <26>;
fusb0: fusb30x@22 {
compatible = "fairchild,fusb302";
reg = <0x22>;
pinctrl-names = "default";
pinctrl-0 = <&fusb0_int>;
int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
vbus-5v-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
status = "disabled";
};
};
Z:\3TB\Rockchip_Android10.0_SDK_Release\kernel\arch\arm64\boot\dts\rockchip\rk3399-sapphire.dtsi
&tcphy0 {
extcon = <&fusb0>;
status = "disabled";
};
&u2phy0 {
status = "okay";
//extcon = <&fusb0>;
otg-vbus-gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>; /* Vbus GPIO配置 */
u2phy0_otg: otg-port {
status = "okay";
};
u2phy0_host: host-port {
phy-supply = <&vcc5v0_host>;
status = "okay";
};
};
&tcphy0 {
extcon = <&fusb0>;
status = "okay";
};
&tcphy1 {
status = "okay";
};
&tsadc {
/* tshut mode 0:CRU 1:GPIO */
rockchip,hw-tshut-mode = <1>;
/* tshut polarity 0:LOW 1:HIGH */
rockchip,hw-tshut-polarity = <1>;
status = "okay";
};
&u2phy0 {
status = "okay";
extcon = <&fusb0>;
u2phy0_otg: otg-port {
status = "okay";
};
u2phy0_host: host-port {
phy-supply = <&vcc5v0_host>;
status = "okay";
};
};
修改为:
&tcphy0 {
extcon = <&fusb0>;
status = "disabled";
};
&tcphy1 {
status = "okay";
};
&tsadc {
/* tshut mode 0:CRU 1:GPIO */
rockchip,hw-tshut-mode = <1>;
/* tshut polarity 0:LOW 1:HIGH */
rockchip,hw-tshut-polarity = <1>;
status = "okay";
};
&u2phy0 {
status = "okay";
//extcon = <&fusb0>;
otg-vbus-gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>; /* Vbus GPIO配置 */
u2phy0_otg: otg-port {
status = "okay";
};
u2phy0_host: host-port {
phy-supply = <&vcc5v0_host>;
status = "okay";
};
};
Z:\3TB\Rockchip_Android10.0_SDK_Release\kernel\arch\arm64\boot\dts\rockchip\rk3399-sapphire.dtsi
需要将u2phy0的extcon注释掉,增加otg-vbus-gpios引脚控制,再继续修改usbdrd3_0和usbdrd_dwc3_0:
&usbdrd3_0 {
status = "okay";
//extcon = <&fusb0>;
extcon = <&u2phy0>;
};
&usbdrd_dwc3_0 {
status = "okay";
dr_mode = "otg"; /* Micro USB3控制器的dr_mode配置为otg */
maximum-speed = "high-speed"; /* maximum-speed 属性配置为high-speed */
phys = <&u2phy0_otg>; /* phys 属性只引用USB2 PHY节点 */
phy-names = "usb2-phy";
};
&usbdrd3_0 {
status = "okay";
};
&usbdrd_dwc3_0 {
status = "okay";
dr_mode = "otg";
extcon = <&fusb0>;
};
修改为:
&usbdrd3_0 {
status = "okay";
};
&usbdrd_dwc3_0 {
status = "okay";
dr_mode = "otg";
//extcon = <&fusb0>;
extcon = <&u2phy0>;
maximum-speed = "high-speed"; /* maximum-speed 属性配置为high-speed */
phys = <&u2phy0_otg>; /* phys 属性只引用USB2 PHY节点 */
phy-names = "usb2-phy";
};
Z:\3TB\Rockchip_Android10.0_SDK_Release\kernel\arch\arm64\boot\dts\rockchip\rk3399-sapphire-excavator-edp.dtsi
另外还需要将其他的配置设置为disabled:
&cdn_dp {
status = "disabled";
extcon = <&fusb0>;
phys = <&tcphy0_dp>;
};
&rt5651 {
status = "okay";
};
&cdn_dp {
status = "okay";
extcon = <&fusb0>;
phys = <&tcphy0_dp>;
};
&hdmi_dp_sound {
status = "okay";
};
修改为:
&rt5651 {
status = "okay";
};
&cdn_dp {
status = "disabled";
extcon = <&fusb0>;
phys = <&tcphy0_dp>;
};
&hdmi_dp_sound {
status = "okay";
};
重新编译kernel与resource之后烧录进开发板,便可以看到开机之后已经可以正常连接adb
http://www.thanksview.com/index.php/thread/19.html&wd=&eqid=9dcbd0e40000160f00000003647964fe