20240613解决飞凌的OK3588-C的核心板的USB3.0接口不读U盘的问题

发布于:2024-07-01 ⋅ 阅读:(12) ⋅ 点赞:(0)

20240613解决飞凌的OK3588-C的核心板的USB3.0接口不读U盘的问题
2024/6/13 15:21


缘起,由于USB3.0的CC芯片在飞凌的OK3588-C的开发板的底板上,一切正常。
如果你单独使用核心板,很容易出现这个问题【省成本没有使用CC芯片】:不读USB3.0的U盘。

Z:\versions\fpga_OK3588_Linux_fs\kernel\arch\arm64\boot\dts\rockchip\OK3588-C-common.dtsi

&usbdrd_dwc3_0 {
    dr_mode = "otg";
    usb-role-switch;
    status = "okay";
    port {
        #address-cells = <1>;
        #size-cells = <0>;
        dwc3_0_role_switch: endpoint@0 {
            reg = <0>;
            remote-endpoint = <&usbc0_role_sw>;
        };
    };
};

修改为:

&usbdrd_dwc3_0 {
    dr_mode = "peripheral";
    usb-role-switch;
    status = "okay";
    port {
        #address-cells = <1>;
        #size-cells = <0>;
        dwc3_0_role_switch: endpoint@0 {
            reg = <0>;
            remote-endpoint = <&usbc0_role_sw>;
        };
    };
};


确认的LOG:

root@ok3588:/mnt# 
root@ok3588:/mnt# lsusb
Bus 005 Device 001: ID 1d6b:0002
Bus 003 Device 001: ID 1d6b:0001
Bus 001 Device 001: ID 1d6b:0002
Bus 008 Device 001: ID 1d6b:0003
Bus 006 Device 001: ID 1d6b:0003
Bus 004 Device 001: ID 1d6b:0001
Bus 002 Device 001: ID 1d6b:0002
Bus 007 Device 002: ID 0781:5595
Bus 007 Device 001: ID 1d6b:0002
root@ok3588:/mnt# 
root@ok3588:/mnt# 
root@ok3588:/mnt# lsusb
Bus 005 Device 001: ID 1d6b:0002
Bus 003 Device 001: ID 1d6b:0001
Bus 001 Device 001: ID 1d6b:0002
Bus 008 Device 001: ID 1d6b:0003
Bus 006 Device 001: ID 1d6b:0003
Bus 004 Device 001: ID 1d6b:0001
Bus 002 Device 001: ID 1d6b:0002
Bus 007 Device 001: ID 1d6b:0002
root@ok3588:/mnt# 


root@ok3588:/# dmesg

[   11.271522] LUN: removable file: (no medium)
[   11.317590] read descriptors
[   11.317601] read strings
[   12.544148] dwc3 fc000000.usb: device reset
[   12.605904] android_work: sent uevent USB_STATE=CONNECTED
[   12.611095] android_work: sent uevent USB_STATE=CONFIGURED
[   35.216918] vbus5v0_typec0: disabling
[   35.216931] vbus5v0_typec1: disabling
[   81.549087] rk_gmac-dwmac fe1c0000.ethernet eth0: no phy at addr -1
[   81.549098] rk_gmac-dwmac fe1c0000.ethernet eth0: stmmac_open: Cannot attach to PHY (error: -19)
[   92.084365] rk_gmac-dwmac fe1c0000.ethernet eth0: no phy at addr -1
[   92.084375] rk_gmac-dwmac fe1c0000.ethernet eth0: stmmac_open: Cannot attach to PHY (error: -19)
[  142.700202] usb 7-1: new high-speed USB device number 2 using xhci-hcd
[  142.841160] usb 7-1: New USB device found, idVendor=0781, idProduct=5595, bcdDevice= 1.00
[  142.841170] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  142.841177] usb 7-1: Product: Ultra USB 3.0
[  142.841184] usb 7-1: Manufacturer: SanDisk
[  142.841192] usb 7-1: SerialNumber: 01012f2ab4eab2c923ae19fd86b9a0a59abf0f880e5b25d951e6d5299438be04129c00000000000000000000ec90460f001d230095558107ab26447a
[  142.843467] usb-storage 7-1:1.0: USB Mass Storage device detected
[  142.844732] scsi host0: usb-storage 7-1:1.0
[  142.846351] typec_fusb302 2-0022: Looking up vbus-supply from device tree
[  143.857823] scsi 0:0:0:0: Direct-Access     SanDisk  Ultra USB 3.0    1.00 PQ: 0 ANSI: 6
[  143.859766] sd 0:0:0:0: [sda] 240353280 512-byte logical blocks: (123 GB/115 GiB)
[  143.860595] sd 0:0:0:0: [sda] Write Protect is off
[  143.860604] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[  143.861472] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  143.893864]  sda: sda1
[  143.897374] sd 0:0:0:0: [sda] Attached SCSI removable disk
[  143.898436] typec_fusb302 2-0022: Looking up vbus-supply from device tree
[  143.937120] FAT-fs (sda): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[  144.051404] FAT-fs (sda1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[  144.056170] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

root@ok3588:/# 
root@ok3588:/# 
root@ok3588:/# 

root@ok3588:/# 
root@ok3588:/# fdisk -l
Found valid GPT with protective MBR; using GPT

Disk /dev/mmcblk0: 120832000 sectors, 1656M
Logical sector size: 512
Disk identifier (GUID): 13650000-0000-446f-8000-5e9c000013c2
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 120831966

Number  Start (sector)    End (sector)  Size Name
     1           16384           24575 4096K uboot
     2           24576           32767 4096K misc
     3           32768          163839 64.0M boot
     4          163840          425983  128M recovery
     5          425984          491519 32.0M backup
     6          491520        29851647 14.0G rootfs
     7        29851648        30113791  128M oem
     8        30113792       120831935 43.2G userdata
Disk /dev/sda: 115 GB, 123060879360 bytes, 240353280 sectors
14961 cylinders, 255 heads, 63 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device  Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/sda1 *  0,32,33     1023,254,63       2048  240353279  240351232  114G  c Win95 FAT32 (LBA)
root@ok3588:/# 

root@ok3588:/# 
root@ok3588:/# 
root@ok3588:/# mount /dev/sda1 /mnt
root@ok3588:/# ls -l
total 100
drwxr-xr-x   2 root root  4096 Mar  9  2023 bin
-rw-r--r--   1 root root   351 Mar  9  2023 busybox.fragment
lrwxrwxrwx   1 root root     8 Mar  9  2023 data -> userdata
drwxr-xr-x  15 root root  3880 Jan  1 08:02 dev
drwxr-xr-x  23 root root  4096 Jan  1 08:00 etc
drwxr-xr-x   4 root root  4096 Jan  1 08:00 home
drwxr-xr-x   6 root root  4096 Aug 17  2023 lib
lrwxrwxrwx   1 root root     3 Mar  9  2023 lib64 -> lib
lrwxrwxrwx   1 root root    11 Mar  9  2023 linuxrc -> bin/busybox
drwx------   2 root root 16384 Mar  9  2023 lost+found
drwxr-xr-x  14 root root  4096 Mar  9  2023 media
lrwxrwxrwx   1 root root    23 Mar  9  2023 misc -> /dev/block/by-name/misc
drwxr-xr-x  15 root root 32768 Jan  1 08:00 mnt
drwxr-xr-x   3 root root  4096 Jun 13  2024 oem
drwxr-xr-x   2 root root  4096 Mar  9  2023 opt
dr-xr-xr-x 256 root root     0 Jan  1 08:00 proc
drwx------   2 root root  4096 Mar  9  2023 root
drwxr-xr-x   7 root root   340 Jan  1 08:00 run
drwxr-xr-x   2 root root  4096 Sep 14  2023 sbin
lrwxrwxrwx   1 root root    10 Mar  9  2023 sdcard -> mnt/sdcard
dr-xr-xr-x  14 root root     0 Jan  1 08:00 sys
drwxrwxrwt   8 root root   440 Jan  1 08:02 tmp
lrwxrwxrwx   1 root root     9 Mar  9  2023 udisk -> mnt/udisk
drwxr-xr-x   5 root root  4096 Jan  1 08:00 userdata
drwxr-xr-x  11 root root  4096 Sep 14  2023 usr
drwxr-xr-x   5 root root  4096 Mar  9  2023 var
root@ok3588:/# 
root@ok3588:/# cd /mnt/
root@ok3588:/mnt# 
root@ok3588:/mnt# ls -l
total 1416928
-rwxr-xr-x 1 root root 1131762455 Mar 10  2022  1.mp4
-rwxr-xr-x 1 root root         33 Jan  1  1980  1.txt

-rwxr-xr-x 1 root root         33 Jan  1  1980  20240528USB.txt
-rwxr-xr-x 1 root root  235026155 Oct 17  2023  4kl.mp4
drwxr-xr-x 3 root root      32768 Dec 17  2023  EFI
drwxr-xr-x 2 root root      32768 May 28  2024  FOUND.000
-rwxr-xr-x 1 root root     233258 Apr 18  2024  KMS_VL_ALL_AIO_v39_CNcmd
drwxr-xr-x 2 root root      32768 Dec 17  2023 'System Volume Information'
drwxr-xr-x 4 root root      32768 Feb  9  2024  X99+RTX4090
-rwxr-xr-x 1 root root      34494 Dec 17  2023  autorun.ico
-rwxr-xr-x 1 root root        254 Dec 17  2023  autorun.inf
drwxr-xr-x 3 root root      32768 Dec 17  2023  boot
drwxr-xr-x 2 root root      32768 Dec 17  2023  casper
drwxr-xr-x 3 root root      32768 Dec 17  2023  dists
drwxr-xr-x 2 root root      32768 Dec 17  2023  install
drwxr-xr-x 2 root root      32768 Dec 17  2023  isolinux
-r-xr-xr-x 1 root root      69145 Dec 17  2023  ldlinux.sys
-rwxr-xr-x 1 root root      67599 Dec 17  2023  md5sum.txt
drwxr-xr-x 4 root root      32768 Dec 17  2023  pool
drwxr-xr-x 2 root root      32768 Dec 17  2023  preseed
-rwxr-xr-x 1 root root         94 Dec 17  2023  syslinux.cfg
-rwxr-xr-x 1 root root          1 Dec 17  2023  ubuntu
-rwxr-xr-x 1 root root   46730293 Apr 17  2024 'video(16).mp4'
-rwxr-xr-x 1 root root   36259983 Apr 17  2024 'video(17).mp4'
-rwxr-xr-x 1 root root          0 Apr 18  2024 ''$'\346\226\260\345\273\272'' '$'\346\226\207\346\234\254\346\226\207\346\241\243''.txt'
drwxr-xr-x 3 root root      32768 Jan 19  2024 ''$'\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271'
root@ok3588:/mnt# 
root@ok3588:/mnt# 
parse ! mppvideodec ! waylandsink "render-rectangle=<0,0,1920,1080>"queue ! h264 
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:04:51.958690626
Setting pipeline to NULL ...
Freeing pipeline ...
root@ok3588:/mnt# 


root@ok3588:/mnt# 
root@ok3588:/mnt# cp 1.mp4 /
root@ok3588:/mnt# cd /
root@ok3588:/# ls -l
total 1105344
-rwxr-xr-x   1 root root 1131762455 Jan  1 08:10 1.mp4
drwxr-xr-x   2 root root       4096 Mar  9  2023 bin
-rw-r--r--   1 root root        351 Mar  9  2023 busybox.fragment
lrwxrwxrwx   1 root root          8 Mar  9  2023 data -> userdata
drwxr-xr-x  15 root root       3880 Jan  1 08:02 dev
drwxr-xr-x  23 root root       4096 Jan  1 08:00 etc
drwxr-xr-x   4 root root       4096 Jan  1 08:00 home
drwxr-xr-x   6 root root       4096 Aug 17  2023 lib
lrwxrwxrwx   1 root root          3 Mar  9  2023 lib64 -> lib
lrwxrwxrwx   1 root root         11 Mar  9  2023 linuxrc -> bin/busybox
drwx------   2 root root      16384 Mar  9  2023 lost+found
drwxr-xr-x  14 root root       4096 Mar  9  2023 media
lrwxrwxrwx   1 root root         23 Mar  9  2023 misc -> /dev/block/by-name/misc
drwxr-xr-x  15 root root      32768 Jan  1 08:00 mnt
drwxr-xr-x   3 root root       4096 Jun 13  2024 oem
drwxr-xr-x   2 root root       4096 Mar  9  2023 opt
dr-xr-xr-x 243 root root          0 Jan  1 08:00 proc
drwx------   2 root root       4096 Mar  9  2023 root
drwxr-xr-x   7 root root        340 Jan  1 08:04 run
drwxr-xr-x   2 root root       4096 Sep 14  2023 sbin
lrwxrwxrwx   1 root root         10 Mar  9  2023 sdcard -> mnt/sdcard
dr-xr-xr-x  14 root root          0 Jan  1 08:00 sys
drwxrwxrwt   8 root root        440 Jan  1 08:02 tmp
lrwxrwxrwx   1 root root          9 Mar  9  2023 udisk -> mnt/udisk
drwxr-xr-x   5 root root       4096 Jan  1 08:00 userdata
drwxr-xr-x  11 root root       4096 Sep 14  2023 usr
drwxr-xr-x   5 root root       4096 Mar  9  2023 var
root@ok3588:/# cd -
/mnt
root@ok3588:/mnt# 
root@ok3588:/mnt# 
root@ok3588:/mnt# ls -l
total 1416928
-rwxr-xr-x 1 root root 1131762455 Mar 10  2022  1.mp4
-rwxr-xr-x 1 root root         33 Jan  1  1980  1.txt
-rwxr-xr-x 1 root root         33 Jan  1  1980  20240528USB.txt
-rwxr-xr-x 1 root root  235026155 Oct 17  2023  4kl.mp4
drwxr-xr-x 3 root root      32768 Dec 17  2023  EFI
drwxr-xr-x 2 root root      32768 May 28  2024  FOUND.000
-rwxr-xr-x 1 root root     233258 Apr 18  2024  KMS_VL_ALL_AIO_v39_CNcmd
drwxr-xr-x 2 root root      32768 Dec 17  2023 'System Volume Information'
drwxr-xr-x 4 root root      32768 Feb  9  2024  X99+RTX4090
-rwxr-xr-x 1 root root      34494 Dec 17  2023  autorun.ico
-rwxr-xr-x 1 root root        254 Dec 17  2023  autorun.inf
drwxr-xr-x 3 root root      32768 Dec 17  2023  boot
drwxr-xr-x 2 root root      32768 Dec 17  2023  casper
drwxr-xr-x 3 root root      32768 Dec 17  2023  dists
drwxr-xr-x 2 root root      32768 Dec 17  2023  install
drwxr-xr-x 2 root root      32768 Dec 17  2023  isolinux
-r-xr-xr-x 1 root root      69145 Dec 17  2023  ldlinux.sys
-rwxr-xr-x 1 root root      67599 Dec 17  2023  md5sum.txt
drwxr-xr-x 4 root root      32768 Dec 17  2023  pool
drwxr-xr-x 2 root root      32768 Dec 17  2023  preseed
-rwxr-xr-x 1 root root         94 Dec 17  2023  syslinux.cfg
-rwxr-xr-x 1 root root          1 Dec 17  2023  ubuntu
-rwxr-xr-x 1 root root   46730293 Apr 17  2024 'video(16).mp4'
-rwxr-xr-x 1 root root   36259983 Apr 17  2024 'video(17).mp4'
-rwxr-xr-x 1 root root          0 Apr 18  2024 ''$'\346\226\260\345\273\272'' '$'\346\226\207\346\234\254\346\226\207\346\241\243''.txt'
drwxr-xr-x 3 root root      32768 Jan 19  2024 ''$'\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271'
root@ok3588:/mnt# 
root@ok3588:/mnt# 
root@ok3588:/mnt# mkdir /wyb
root@ok3588:/mnt# 
root@ok3588:/mnt# cp 1.mp4 /wyb/
root@ok3588:/mnt# sync

root@ok3588:/mnt# sync
root@ok3588:/mnt# sync
root@ok3588:/mnt# 

USB3.0的U盘可以写入文件。

电脑拷贝文件速度 20M-30MBps

RK3588 在 飞凌的LINUX R4版本下,拷贝1.1GB的MP4视频,耗时不到50秒钟。和电脑 拷入速度接近


参考资料:
https://blog.csdn.net/cornerstone1/article/details/111472616
type-c转type A 3.0线以及otg线序


https://blog.csdn.net/weixin_43245753/article/details/123496262#TypeC_to_TypeA_USB_20DP_DTS__345
Rockchip RK3588 kernel dts解析之USB模块


0,0 到不了 左上角,有你们的nx App Launcher V2 p1标题栏
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux ! queue ! h264parse ! mppvideodec ! waylandsink "render-rectangle=<0,0,426,400>"

这个是直接通过wayland显示的窗口,跟桌面上的应用是没关系的,应该是播放窗口的纵横比跟视频纵横比不一致导致的


这个 参数满屏了。解码4K录像(通过OV13855录像的)
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux ! queue ! h264parse ! mppvideodec ! waylandsink "render-rectangle=<0,0,1024,600>"

gst-launch-1.0 filesrc location=1.mp4 ! qtdemux ! queue ! h264parse ! mppvideodec ! waylandsink "render-rectangle=<0,0,1920,1080>"