参照置顶帖【f1c100s linux 5.2 USB已完美驱动,host+device完美运行 (https://whycan.com/t_3087.html)】,修改设备树、musb的sunxi.c驱动、phy驱动,复制的置顶帖.config,编译加载内核后反复重启不进rootfs,见如下日志,大佬们帮忙看一下:
[BEGIN] 2024/1/20 14:04:10
U-Boot SPL 2018.01 (Nov 18 2023 - 20:47:54)
DRAM: 64 MiB
Trying to boot from MMC1
U-Boot 2018.01 (Nov 18 2023 - 20:47:54 +0800) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
reading suniv-f1c100s-licheepi-nano.dtb
7172 bytes read in 27 ms (258.8 KiB/s)
reading zImage
3897368 bytes read in 202 ms (18.4 MiB/s)
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 816fb000, end 816ffc03 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.2.0-licheepi-nano (root@arm-embedding) (gcc version 7.5.0 (Linaro GCC 7.5-2019.12)) #6 Sat Jan 20 14:03:02 CST 2024
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Nano
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: console=tty0 console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw vt.global_cursor_default=0
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Memory: 55188K/65536K available (6144K kernel code, 235K rwdata, 1472K rodata, 1024K init, 228K bss, 10348K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x254/0x42c with crng_init=0
[ 0.000046] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000120] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000631] Console: colour dummy device 80x30
[ 0.001253] printk: console [tty0] enabled
[ 0.001348] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[ 0.070265] pid_max: default: 32768 minimum: 301
[ 0.070730] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070800] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.072439] CPU: Testing write buffer coherency: ok
[ 0.074402] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.076695] devtmpfs: initialized
[ 0.083041] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.083208] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.083556] pinctrl core: initialized pinctrl subsystem
[ 0.085560] NET: Registered protocol family 16
[ 0.087096] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.089201] cpuidle: using governor menu
[ 0.137580] SCSI subsystem initialized
[ 0.138022] usbcore: registered new interface driver usbfs
[ 0.138243] usbcore: registered new interface driver hub
[ 0.138475] usbcore: registered new device driver usb
[ 0.138997] pps_core: LinuxPPS API ver. 1 registered
[ 0.139076] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.139655] Advanced Linux Sound Architecture Driver Initialized.
[ 0.141558] clocksource: Switched to clocksource timer
[ 0.169958] NET: Registered protocol family 2
[ 0.171533] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[ 0.171843] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.171954] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.172040] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.172369] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.172485] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.173047] NET: Registered protocol family 1
[ 0.175684] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.177815] Initialise system trusted keyrings
[ 0.178422] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.205080] Key type asymmetric registered
[ 0.205188] Asymmetric key parser 'x509' registered
[ 0.205404] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 0.205494] io scheduler mq-deadline registered
[ 0.205541] io scheduler kyber registered
[ 0.218818] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.395098] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.400540] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[ 0.402517] printk: console [ttyS0] disabled
[ 0.422837] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 22, base_baud = 6250000) is a 16550A
[ 0.805150] printk: console [ttyS0] enabled
[ 0.817615] SCSI Media Changer driver v0.25
[ 0.825573] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.832311] ehci-platform: EHCI generic platform driver
[ 0.837873] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.844262] ohci-platform: OHCI generic platform driver
[ 0.849942] usbcore: registered new interface driver usb-storage
[ 0.857088] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
U-Boot SPL 2018.01 (Nov 18 2023 - 20:47:54)
DRAM: 64 MiB
Trying to boot from MMC1
U-Boot 2018.01 (Nov 18 2023 - 20:47:54 +0800) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Net: No ethernet found.
starting USB...
No controllers found
[END] 2024/1/20 14:04:21
离线
改了下内核配置文件,将原来的DUAL_ROLE注释,只保留了MUSB_GADGET,可以进入root了。
新的问题是,/sys/class/cdc下没有对应设备类,且接入PC也未发现不了USB设备。。。截图和 启动日志 附上:
[BEGIN] 2024/1/21 16:13:15
Connecting to COM5...
Connected.
reading suniv-f1c100s-licheepi-nano.dtb
7160 bytes read in 27 ms (258.8 KiB/s)
reading zImage
3884120 bytes read in 202 ms (18.3 MiB/s)
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 816fb000, end 816ffbf7 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.2.0-licheepi-nano (root@arm-embedding) (gcc version 7.5.0 (Linaro GCC 7.5-2019.12)) #12 Sun Jan 21 16:02:54 CST 2024
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Nano
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: console=tty0 console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw vt.global_cursor_default=0
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Memory: 55192K/65536K available (6144K kernel code, 235K rwdata, 1464K rodata, 1024K init, 227K bss, 10344K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x254/0x42c with crng_init=0
[ 0.000046] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000123] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000634] Console: colour dummy device 80x30
[ 0.001262] printk: console [tty0] enabled
[ 0.001363] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[ 0.070269] pid_max: default: 32768 minimum: 301
[ 0.070726] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070798] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.072445] CPU: Testing write buffer coherency: ok
[ 0.074383] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.076660] devtmpfs: initialized
[ 0.082955] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.083126] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.083480] pinctrl core: initialized pinctrl subsystem
[ 0.085483] NET: Registered protocol family 16
[ 0.087001] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.089065] cpuidle: using governor menu
[ 0.135768] SCSI subsystem initialized
[ 0.136196] usbcore: registered new interface driver usbfs
[ 0.136418] usbcore: registered new interface driver hub
[ 0.136658] usbcore: registered new device driver usb
[ 0.137163] pps_core: LinuxPPS API ver. 1 registered
[ 0.137244] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.137818] Advanced Linux Sound Architecture Driver Initialized.
[ 0.139536] clocksource: Switched to clocksource timer
[ 0.167280] NET: Registered protocol family 2
[ 0.168870] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[ 0.169046] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.169152] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.169236] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.169689] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.169814] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.170397] NET: Registered protocol family 1
[ 0.172997] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.175083] Initialise system trusted keyrings
[ 0.175689] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.202103] Key type asymmetric registered
[ 0.202212] Asymmetric key parser 'x509' registered
[ 0.202426] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 0.202520] io scheduler mq-deadline registered
[ 0.202570] io scheduler kyber registered
[ 0.215756] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.388198] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.393789] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[ 0.395616] printk: console [ttyS0] disabled
[ 0.415947] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 22, base_baud = 6250000) is a 16550A
[ 0.798717] printk: console [ttyS0] enabled
[ 0.811221] SCSI Media Changer driver v0.25
[ 0.819009] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.825750] ehci-platform: EHCI generic platform driver
[ 0.831386] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.837679] ohci-platform: OHCI generic platform driver
[ 0.843451] usbcore: registered new interface driver usb-storage
[ 0.850108] musb-sunxi 1c13000.usb: Invalid or missing 'dr_mode' property
[ 0.857005] musb-sunxi: probe of 1c13000.usb failed with error -22
[ 0.863731] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[ 0.872934] i2c /dev entries driver
[ 0.878147] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[ 0.916244] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 0.925610] usbcore: registered new interface driver usbhid
[ 0.931381] usbhid: USB HID core driver
[ 0.935490] fbtft_of_value: buswidth = 8
[ 0.939475] fbtft_of_value: debug = 1
[ 0.943281] fbtft_of_value: rotate = 270
[ 0.947249] fbtft_of_value: fps = 30
[ 0.951940] fb_st7735r spi0.0: fbtft_request_one_gpio: 'reset' = GPIO138
[ 0.958865] fb_st7735r spi0.0: fbtft_request_one_gpio: 'dc' = GPIO139
[ 1.001384] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.014595] mmc0: new high speed SDHC card at address aaaa
[ 1.023331] mmcblk0: mmc0:aaaa SC32G 29.7 GiB
[ 1.034025] mmcblk0: p1 p2
[ 2.002188] random: fast init done
[ 2.014132] Console: switching to colour frame buffer device 20x10
[ 2.022200] graphics fb0: fb_st7735r frame buffer, 160x80, 25 KiB video memory, 4 KiB buffer memory, fps=33, spi0.0 at 48 MHz
[ 2.050934] NET: Registered protocol family 17
[ 2.056655] Key type dns_resolver registered
[ 2.070285] Loading compiled-in X.509 certificates
[ 2.084985] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 2.105000] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 2.113435] ALSA device list:
[ 2.117209] #0: Loopback 1
[ 2.121840] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 2.132438] cfg80211: failed to load regulatory.db
[ 2.364703] EXT4-fs (mmcblk0p2): recovery complete
[ 2.374214] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 2.384478] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 2.397773] devtmpfs: mounted
[ 2.406211] Freeing unused kernel memory: 1024K
[ 2.417857] Run /sbin/init as init process
[ 3.254954] systemd[1]: System time before build time, advancing clock.
[ 3.301673] systemd[1]: Failed to lookup module alias 'autofs4': Function not implemented
[ 3.360861] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[ 3.388893] systemd[1]: Detected architecture arm.
Welcome to Debian GNU/Linux 10 (buster)!
[ 3.433765] systemd[1]: Set hostname to <impulse-debian>.
[ 6.898350] systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[ 6.919333] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[ 8.100506] random: systemd: uninitialized urandom read (16 bytes read)
[ 8.136807] random: systemd: uninitialized urandom read (16 bytes read)
[ 8.151532] systemd[1]: Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ 8.194091] random: systemd: uninitialized urandom read (16 bytes read)
[ 8.207107] systemd[1]: Listening on udev Control Socket.
[ OK ] Listening on udev Control Socket.
[ 8.251552] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ OK ] Started Dispatch Password …ts to Console Directory Watch.
[ 8.302673] systemd[1]: Listening on Syslog Socket.
[ OK ] Listening on Syslog Socket.
[ 8.344281] systemd[1]: Reached target Remote File Systems.
[ OK ] Reached target Remote File Systems.
[ 8.449045] systemd[1]: Condition check resulted in Journal Audit Socket being skipped.
[ 8.461494] systemd[1]: Listening on udev Kernel Socket.
[ OK ] Listening on udev Kernel Socket.
[ 8.503092] systemd[1]: Listening on Journal Socket.
[ OK ] Listening on Journal Socket.
[ 8.540351] random: crng init done
[ 8.544592] random: 5 urandom warning(s) missed due to ratelimiting
[ 8.555745] systemd[1]: Condition check resulted in POSIX Message Queue File System being skipped.
[ 8.610043] systemd[1]: Starting Load Kernel Modules...
Starting Load Kernel Modules...
[ 8.652568] systemd[1]: Condition check resulted in Huge Pages File System being skipped.
[ 8.713349] systemd[1]: Starting udev Coldplug all Devices...
Starting udev Coldplug all Devices...
[ 8.735609] systemd[1]: Condition check resulted in Arbitrary Executable File Formats File System Automount Point being skipped.
[ 8.790364] systemd[1]: Reached target Swap.
[ OK ] Reached target Swap.
[ 8.821715] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ OK ] Started Forward Password R…uests to Wall Directory Watch.
Mounting Kernel Debug File System...
Starting Remount Root and Kernel File Systems...
[ OK ] Listening on Journal Socket (/dev/log).
[ OK ] Reached target Local Encrypted Volumes.
Starting Journal Service...
[ OK ] Created slice system-serial\x2dgetty.slice.
[ OK ] Created slice system-getty.slice.
[ OK ] Reached target Slices.
[ OK ] Reached target Paths.
[ OK ] Reached target Sockets.
[ OK ] Mounted Kernel Debug File System.
[ OK ] Started Load Kernel Modules.
Mounting Kernel Configuration File System...
Starting Apply Kernel Variables...
[ OK ] Mounted Kernel Configuration File System.
[ OK ] Started Remount Root and Kernel File Systems.
Starting Load/Save Random Seed...
Starting Create System Users...
[ OK ] Started Journal Service.
Starting Flush Journal to Persistent Storage...
[ OK ] Started Apply Kernel Variables.
[ OK ] Started Load/Save Random Seed.
[ OK ] Started Create System Users.
Starting Create Static Device Nodes in /dev...
[ 12.541478] systemd-journald[100]: Received request to flush runtime journal from PID 1
[ OK ] Started Flush Journal to Persistent Storage.
[ OK ] Started Create Static Device Nodes in /dev.
Starting udev Kernel Device Manager...
[ OK ] Reached target Local File Systems (Pre).
[ OK ] Reached target Local File Systems.
Starting Create Volatile Files and Directories...
[ OK ] Started udev Kernel Device Manager.
[ OK ] Started Create Volatile Files and Directories.
Starting Update UTMP about System Boot/Shutdown...
Starting Network Time Synchronization...
[ OK ] Started Update UTMP about System Boot/Shutdown.
[ OK ] Started Network Time Synchronization.
[ OK ] Started udev Coldplug all Devices.
[ OK ] Found device /dev/ttyS0.
[ OK ] Reached target Sound Card.
Starting Helper to synchronize boot up for ifupdown...
[ OK ] Reached target System Time Synchronized.
[ OK ] Reached target System Initialization.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Started Daily apt download activities.
[ OK ] Started Daily rotation of log files.
[ OK ] Reached target Basic System.
[ OK ] Started Regular background program processing daemon.
Starting System Logging Service...
Starting getty on tty2-tty…nd logind are not available...
[ OK ] Started Daily apt upgrade and clean activities.
[ OK ] Reached target Timers.
[ OK ] Started Helper to synchronize boot up for ifupdown.
Starting Raise network interfaces...
[ OK ] Started System Logging Service.
[ OK ] Started Raise network interfaces.
[ OK ] Started getty on tty2-tty6… and logind are not available.
[ OK ] Reached target Network.
Starting Permit User Sessions...
[ OK ] Started Permit User Sessions.
[ OK ] Started Serial Getty on ttyS0.
[ OK ] Started Getty on tty6.
[ OK ] Started Getty on tty3.
[ OK ] Started Getty on tty2.
[ OK ] Started Getty on tty1.
[ OK ] Started Getty on tty5.
[ OK ] Started Getty on tty4.
[ OK ] Reached target Login Prompts.
[ OK ] Reached target Multi-User System.
[ OK ] Reached target Graphical Interface.
Starting Update UTMP about System Runlevel Changes...
[ OK ] Started Update UTMP about System Runlevel Changes.
Debian GNU/Linux 10 impulse-debian ttyS0
[END] 2024/1/21 16:14:25
离线
usb gadget使用在linux下使用要通过configfs去配置 的,你可以找下或者gpt帮你生成一个shell脚本,运行脚本才会枚举
离线
usb gadget使用在linux下使用要通过configfs去配置 的,你可以找下或者gpt帮你生成一个shell脚本,运行脚本才会枚举
是的,最开始参考的这个大佬的帖子,使用configfs搞的,帖子【全志平台上通过configfs(libcomposite)配置RNDIS Gadget(u_ether)及Windows下的驱动】(https://whycan.com/t_6242.html)
离线