20241007给荣品RD-RK3588-AHD开发板刷Rockchip原厂的Buildroot时使用ADB
2024/10/7 17:35
缘起:由于荣品RD-RK3588-AHD开发板使用的是9针的USB-A口,没有使用EVB4默认的type C口。
因此需要拿掉fusb302的驱动/DTS配置部分。
同时,为了简单起见,直接将type C0降级为USB2.0使用了。
【当然要比对 荣品RD-RK3588-AHD开发板 linux的SDK中的DTS】
Z:\source\kernel\arch\arm64\boot\dts\rockchip\rk3588\rd-rk3588s-ahd.dts
1、关闭i2c8的usbc0部分:
Z:\rk3588s_20230620\kernel\arch\arm64\boot\dts\rockchip\rk3588s-evb4-lp4x.dtsi
&i2c8 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c8m2_xfer>;
usbc0: fusb302@22 {
compatible = "fcs,fusb302";
reg = <0x22>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PC6 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&usbc0_int>;
vbus-supply = <&vbus5v0_typec>;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usbc0_role_sw: endpoint@0 {
remote-endpoint = <&dwc3_0_role_switch>;
};
};
};
usb_con: connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
power-role = "dual";
try-power-role = "sink";
op-sink-microwatt = <1000000>;
sink-pdos =
<PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
source-pdos =
<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
altmodes {
#address-cells = <1>;
#size-cells = <0>;
altmode@0 {
reg = <0>;
svid = <0xff01>;
vdo = <0xffffffff>;
};
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
usbc0_orien_sw: endpoint {
remote-endpoint = <&usbdp_phy0_orientation_switch>;
};
};
port@1 {
reg = <1>;
dp_altmode_mux: endpoint {
remote-endpoint = <&usbdp_phy0_dp_altmode_mux>;
};
};
};
};
};
hym8563: hym8563@51 {
compatible = "haoyu,hym8563";
reg = <0x51>;
#clock-cells = <0>;
clock-frequency = <32768>;
clock-output-names = "hym8563";
pinctrl-names = "default";
pinctrl-0 = <&hym8563_int>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>;
wakeup-source;
status = "okay";
};
};
&mipi_dcphy0 {
status = "okay";
};
&mipi_dcphy1 {
status = "disabled";
};
修改为:
&i2c8 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c8m2_xfer>;
//usbc0: fusb302@22 {
// compatible = "fcs,fusb302";
// reg = <0x22>;
// interrupt-parent = <&gpio0>;
// interrupts = <RK_PC6 IRQ_TYPE_LEVEL_LOW>;
// pinctrl-names = "default";
// pinctrl-0 = <&usbc0_int>;
// vbus-supply = <&vbus5v0_typec>;
// status = "okay";
//
// ports {
// #address-cells = <1>;
// #size-cells = <0>;
//
// port@0 {
// reg = <0>;
// usbc0_role_sw: endpoint@0 {
// //remote-endpoint = <&dwc3_0_role_switch>;
// };
// };
// };
//
// usb_con: connector {
// compatible = "usb-c-connector";
// label = "USB-C";
// data-role = "dual";
// power-role = "dual";
// try-power-role = "sink";
// op-sink-microwatt = <1000000>;
// sink-pdos =
// <PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
// source-pdos =
// <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
//
// altmodes {
// #address-cells = <1>;
// #size-cells = <0>;
//
// altmode@0 {
// reg = <0>;
// svid = <0xff01>;
// vdo = <0xffffffff>;
// };
// };
//
// ports {
// #address-cells = <1>;
// #size-cells = <0>;
//
// port@0 {
// reg = <0>;
// usbc0_orien_sw: endpoint {
// remote-endpoint = <&usbdp_phy0_orientation_switch>;
// };
// };
//
// port@1 {
// reg = <1>;
// dp_altmode_mux: endpoint {
// remote-endpoint = <&usbdp_phy0_dp_altmode_mux>;
// };
// };
// };
// };
//};
hym8563: hym8563@51 {
compatible = "haoyu,hym8563";
reg = <0x51>;
#clock-cells = <0>;
clock-frequency = <32768>;
clock-output-names = "hym8563";
pinctrl-names = "default";
pinctrl-0 = <&hym8563_int>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>;
wakeup-source;
status = "okay";
};
};
&mipi_dcphy0 {
status = "okay";
};
&mipi_dcphy1 {
status = "disabled";
};
2、关闭usbdp_phy0,将EVB4上的type-C0改为USB2.0模式的ADB了。
&uart8 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&uart8m1_xfer &uart8m1_ctsn>;
};
&usbdp_phy0 {
orientation-switch;
svid = <0xff01>;
sbu1-dc-gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>;
sbu2-dc-gpios = <&gpio1 RK_PB7 GPIO_ACTIVE_HIGH>;
port {
#address-cells = <1>;
#size-cells = <0>;
usbdp_phy0_orientation_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_orien_sw>;
};
usbdp_phy0_dp_altmode_mux: endpoint@1 {
reg = <1>;
remote-endpoint = <&dp_altmode_mux>;
};
};
};
&usbdrd_dwc3_0 {
usb-role-switch;
port {
#address-cells = <1>;
#size-cells = <0>;
dwc3_0_role_switch: endpoint@0 {
reg = <0>;
remote-endpoint = <&usbc0_role_sw>;
};
};
};
&usbhost3_0 {
status = "disabled";
};
&usbhost_dwc3_0 {
status = "disabled";
};
修改为:
&uart8 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&uart8m1_xfer &uart8m1_ctsn>;
};
//&usbdp_phy0 {
// orientation-switch;
// svid = <0xff01>;
// sbu1-dc-gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>;
// sbu2-dc-gpios = <&gpio1 RK_PB7 GPIO_ACTIVE_HIGH>;
//
// port {
// #address-cells = <1>;
// #size-cells = <0>;
// usbdp_phy0_orientation_switch: endpoint@0 {
// reg = <0>;
// remote-endpoint = <&usbc0_orien_sw>;
// };
//
// usbdp_phy0_dp_altmode_mux: endpoint@1 {
// reg = <1>;
// remote-endpoint = <&dp_altmode_mux>;
// };
// };
//};
&usbdrd_dwc3_0 {
dr_mode = "otg";
extcon=<&u2phy0>;
usb-role-switch;
status="okay";
};
&u2phy0 {
status = "okay";
};
&usbhost3_0 {
status = "disabled";
};
&usbhost_dwc3_0 {
status = "disabled";
};
效果图:
Microsoft Windows [版本 10.0.22621.3296]
(c) Microsoft Corporation。保留所有权利。
C:\Users\QQ>adb shell
root@rk3588s-buildroot:/#