网友 @chong 大神提供的f1c100s mainline linux usb 补丁包,支持usb otg(host & device)
本站下载地址: f1c100s_linux_4_19_patch_by_chong.7z
git clone https://github.com/torvalds/linux.git
cd linux
git reset --hard5e335542de83558e46d28de1008a1c37d5d6679a
patch -p1 < lichee_nano_upstream_patch.patch
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make
2018-10-22 更新
---------------------------------
大神的补丁下载: lichee_pi_nano_usbok_patch_5e335542de83558e46d.7z
操作步骤:
git clone https://github.com/torvalds/linux.git
cd linux
7z x lichee_pi_nano_usbok_patch_5e335542de83558e46d.7z
git reset --hard 5e335542de83558e46d28de1008a1c37d5d6679a
patch -p1 < lichee_pi_nano_usbok_patch_5e335542de83558e46d.patch
离线
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 816fb000, end 816ffd8e ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.19.0-rc3-licheepi-nano+ (chong@chong-ThinkPad-X230) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #14 Wed Sep 12 22:21:00 CST 2018
[ 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] random: get_random_bytes called from start_kernel+0x84/0x3f8 with crng_init=0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Memory: 22676K/32768K available (6144K kernel code, 248K rwdata, 1516K rodata, 1024K init, 239K bss, 10092K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc2800000 - 0xff800000 ( 976 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc2000000 ( 32 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (7136 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 249 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 240 kB)
[ 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.000048] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000131] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000657] Console: colour dummy device 80x30
[ 0.000757] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[ 0.070256] pid_max: default: 32768 minimum: 301
[ 0.070721] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070766] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.072268] CPU: Testing write buffer coherency: ok
[ 0.074137] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.079617] devtmpfs: initialized
[ 0.085938] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.086004] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.086316] pinctrl core: initialized pinctrl subsystem
[ 0.088526] NET: Registered protocol family 16
[ 0.089794] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.091904] cpuidle: using governor menu
[ 0.117884] SCSI subsystem initialized
[ 0.118233] usbcore: registered new interface driver usbfs
[ 0.118391] usbcore: registered new interface driver hub
[ 0.118580] usbcore: registered new device driver usb
[ 0.119044] pps_core: LinuxPPS API ver. 1 registered
[ 0.119072] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.119137] PTP clock support registered
[ 0.119626] Advanced Linux Sound Architecture Driver Initialized.
[ 0.121243] clocksource: Switched to clocksource timer
[ 0.150756] NET: Registered protocol family 2
[ 0.152382] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[ 0.152458] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.152517] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.152567] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.152840] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.152902] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.153426] NET: Registered protocol family 1
[ 0.154826] RPC: Registered named UNIX socket transport module.
[ 0.154870] RPC: Registered udp transport module.
[ 0.154886] RPC: Registered tcp transport module.
[ 0.154902] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.157132] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.159167] Initialise system trusted keyrings
[ 0.159773] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[ 0.180920] NFS: Registering the id_resolver key type
[ 0.181020] Key type id_resolver registered
[ 0.181040] Key type id_legacy registered
[ 0.195352] Key type asymmetric registered
[ 0.195392] Asymmetric key parser 'x509' registered
[ 0.195571] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.195602] io scheduler noop registered
[ 0.195621] io scheduler deadline registered
[ 0.196103] io scheduler cfq registered (default)
[ 0.196138] io scheduler mq-deadline registered
[ 0.196156] io scheduler kyber registered
[ 0.197787] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[ 0.208366] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.391937] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.398786] console [ttyS0] disabled
[ 0.419039] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 23, base_baud = 6250000) is a 16550A
[ 0.897963] console [ttyS0] enabled
[ 0.908851] panel-simple panel: panel supply power not found, using dummy regulator
[ 0.916836] panel-simple panel: Linked as a consumer to regulator.0
[ 0.924868] SCSI Media Changer driver v0.25
[ 0.932269] spidev spi0.0: buggy DT: spidev listed directly in DT
[ 0.938384] ------------[ cut here ]------------
[ 0.943154] WARNING: CPU: 0 PID: 1 at drivers/spi/spidev.c:730 spidev_probe+0x188/0x1fc
[ 0.951138] Modules linked in:
[ 0.954272] CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.0-rc3-licheepi-nano+ #14
[ 0.961776] Hardware name: Allwinner suniv Family
[ 0.966554] [<c010e918>] (unwind_backtrace) from [<c010bb80>] (show_stack+0x10/0x14)
[ 0.974381] [<c010bb80>] (show_stack) from [<c0117230>] (__warn+0xcc/0xf4)
[ 0.981320] [<c0117230>] (__warn) from [<c011736c>] (warn_slowpath_null+0x3c/0x48)
[ 0.988894] [<c011736c>] (warn_slowpath_null) from [<c04601c0>] (spidev_probe+0x188/0x1fc)
[ 0.997237] [<c04601c0>] (spidev_probe) from [<c045cbb4>] (spi_drv_probe+0x80/0xa4)
[ 1.004989] [<c045cbb4>] (spi_drv_probe) from [<c04170ac>] (really_probe+0x228/0x3fc)
[ 1.012897] [<c04170ac>] (really_probe) from [<c0417428>] (driver_probe_device+0x6c/0x1bc)
[ 1.021166] [<c0417428>] (driver_probe_device) from [<c0415110>] (bus_for_each_drv+0x54/0xb8)
[ 1.029743] [<c0415110>] (bus_for_each_drv) from [<c0416de0>] (__device_attach+0xc8/0x164)
[ 1.038062] [<c0416de0>] (__device_attach) from [<c041606c>] (bus_probe_device+0x84/0x8c)
[ 1.046287] [<c041606c>] (bus_probe_device) from [<c0412c98>] (device_add+0x3f8/0x630)
[ 1.054252] [<c0412c98>] (device_add) from [<c045d52c>] (spi_add_device+0xb8/0x168)
[ 1.061956] [<c045d52c>] (spi_add_device) from [<c045ded0>] (spi_register_controller+0x400/0x8e8)
[ 1.070820] [<c045ded0>] (spi_register_controller) from [<c045e3e8>] (devm_spi_register_controller+0x30/0x70)
[ 1.080770] [<c045e3e8>] (devm_spi_register_controller) from [<c04616bc>] (sun6i_spi_probe+0x1e8/0x2ac)
[ 1.090215] [<c04616bc>] (sun6i_spi_probe) from [<c0418ff4>] (platform_drv_probe+0x48/0x98)
[ 1.098629] [<c0418ff4>] (platform_drv_probe) from [<c04170ac>] (really_probe+0x228/0x3fc)
[ 1.106948] [<c04170ac>] (really_probe) from [<c0417428>] (driver_probe_device+0x6c/0x1bc)
[ 1.115265] [<c0417428>] (driver_probe_device) from [<c0417680>] (__driver_attach+0x108/0x130)
[ 1.123925] [<c0417680>] (__driver_attach) from [<c0415064>] (bus_for_each_dev+0x70/0xb4)
[ 1.132153] [<c0415064>] (bus_for_each_dev) from [<c041634c>] (bus_add_driver+0x1a0/0x260)
[ 1.140418] [<c041634c>] (bus_add_driver) from [<c0418038>] (driver_register+0x74/0x108)
[ 1.148568] [<c0418038>] (driver_register) from [<c0102ba0>] (do_one_initcall+0x48/0x1a0)
[ 1.156807] [<c0102ba0>] (do_one_initcall) from [<c0900df8>] (kernel_init_freeable+0x104/0x1c4)
[ 1.165562] [<c0900df8>] (kernel_init_freeable) from [<c0694734>] (kernel_init+0x8/0x110)
[ 1.173796] [<c0694734>] (kernel_init) from [<c01010e0>] (ret_from_fork+0x14/0x34)
[ 1.181395] Exception stack(0xc1831fb0 to 0xc1831ff8)
[ 1.186447] 1fa0: 00000000 00000000 00000000 00000000
[ 1.194657] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1.202858] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 1.209476] ---[ end trace 88ef56b3121bb31e ]---
[ 1.216315] i2c /dev entries driver
[ 1.222067] sunxi-mmc 1c0f000.mmc: Linked as a consumer to regulator.1
[ 1.255556] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 1.264906] usbcore: registered new interface driver usbhid
[ 1.270483] usbhid: USB HID core driver
[ 1.290060] NET: Registered protocol family 17
[ 1.294854] Key type dns_resolver registered
[ 1.301607] Loading compiled-in X.509 certificates
[ 1.317842] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.328886] usb_phy_generic usb_phy_generic.0.auto: Linked as a consumer to regulator.0
[ 1.337872] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.343802] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[ 1.354120] hub 1-0:1.0: USB hub found
[ 1.358103] hub 1-0:1.0: 1 port detected
[ 1.364852] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 1.383483] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 1.390257] ALSA device list:
[ 1.393353] #0: Loopback 1
[ 1.397331] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 1.406045] cfg80211: failed to load regulatory.db
[ 1.411830] Waiting for root device /dev/mmcblk0p2...
[ 1.423629] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.434650] mmc0: new high speed SDHC card at address 1234
[ 1.443164] mmcblk0: mmc0:1234 SA04G 3.64 GiB
[ 1.451518] mmcblk0: p1 p2
[ 1.477749] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem
[ 1.485176] EXT4-fs (mmcblk0p2): write access will be enabled during recovery
[ 2.169099] random: fast init done
[ 2.853622] EXT4-fs (mmcblk0p2): recovery complete
[ 3.458697] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 3.466987] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 3.484174] devtmpfs: mounted
[ 3.491760] Freeing unused kernel memory: 1024K
[ 3.496406] Run /sbin/init as init process
starting pid 59, tty '': '/bin/mount -t proc proc /proc'
starting pid 61, tty '': '/bin/mount -t sysfs sysfs /sys'
starting pid 62, tty '': '/bin/mount -t devtmpfs devtmpfs /dev'
mount: /dev: devtmpfs already mounted on /dev.
starting pid 63, tty '': '/bin/mount -o remount,rw /'
[ 3.701434] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
starting pid 64, tty '': '/bin/mkdir -p /dev/pts'
starting pid 65, tty '': '/bin/mount -t devpts devpts /dev/pts'
starting pid 66, tty '': '/bin/mount -a'
starting pid 67, tty '': '/etc/init.d/rcS'
Starting Dropbear SSH server: [ 3.940139] random: dropbear: uninitialized urandom read (32 bytes read)
dropbear.
[ 4.106245] using random self ethernet address
[ 4.110720] using random host ethernet address
[ 4.116632] usb0: HOST MAC a6:59:86:da:d1:36
[ 4.121021] usb0: MAC 2a:80:e1:49:a2:53
[ 4.125057] using random self ethernet address
[ 4.129511] using random host ethernet address
[ 4.134385] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[ 4.140994] g_ether gadget: g_ether ready
ifconfig: SIOCSIFADDR: Invalid argument
starting pid 81, tty '/dev/ttyS0': '/sbin/getty 115200 ttyS0'
micro-iot 0.1 pinano /dev/ttyS0
pinano login: [ 4.580654] g_ether gadget: high-speed config #1: CDC Ethernet (EEM)
这是网友 @chong 发给我的.
离线
离线
晕哥 说:现在还不确定,他这几天回家。
应该基本上都在一楼了,如果有修改也会很小。这是他前几天发给我的tf卡zImage和dtb, 你加个u-boot和ext4 根文件系统试一试.
试了一下,这个内核和dtb也是一样的,用otg插入U盘没反应,usb插入pc也没反应,我猜@chong大神的板子和我们的不同
这就奇怪了,我问下他用什么板子。
离线
离线
晕哥 说:他直接烧到FLASH也不行, 他原来用 sunxi-fel 的 uboot 命令启动系统了,直接绕开了 BROM的 USB初始化.
@ippen 你也试一试这样启动,看USB是否正常.
晕倒了,这样没法做产品啊,难道要换芯片?
所以为什么叫有坑, 他也在解决中.
离线
git clone https://github.com/torvalds/linux.git
cd linux
git reset --hard 5e335542de83558e46d28de1008a1c37d5d6679a ###恢复到指定版本
patch -p1 < lichee_pi_nano_usbok_patch_5e335542de83558e46d.patch ###打补丁ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make sunxi_defconfig ###使用默认配置
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make -j4 ###四进程编译
离线
晕哥 说:git clone https://github.com/torvalds/linux.git
cd linux
git reset --hard 5e335542de83558e46d28de1008a1c37d5d6679a ###恢复到指定版本
patch -p1 < lichee_pi_nano_usbok_patch_5e335542de83558e46d.patch ###打补丁ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make sunxi_defconfig ###使用默认配置
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make -j4 ###四进程编译
默认配置编译出来不是f系列cpu的内核
是的,suniv系列
离线
晕哥,怎么编译出dtb呀,我参考nano.lichee.pro。
使用make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- dtbs
结果,在目录下arch/arm/boot/dts目录,找不到dtb文件
用这个命令找找: find . |grep \\.dtb$
离线
晕哥 说:迪卡 说:晕哥,怎么编译出dtb呀,我参考nano.lichee.pro。
使用make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- dtbs
结果,在目录下arch/arm/boot/dts目录,找不到dtb文件用这个命令找找: find . |grep \\.dtb$
确认,没有需要的dtb,都是sun45678i
难道是我用的linux源码不对??
我下载的4.19.5
我在下载个4.19.0试试
一楼的补丁包我试过的,肯定没有问题.
后面的补丁包没有来得及测试, 按上面网友应该也是没有问题,注意姿势。
离线
smartcar 说:jiangming1399 说:花了一点时间对Icenowy的patch和chong的patch进行了比较,结果发现chong的patch包基本上就是在Icenowy的基础上更改了下面的这个文件:
--- ../linux/drivers/clk/sunxi-ng/ccu-suniv.c 2019-01-15 22:48:18.824587965 +0800
+++ drivers/clk/sunxi-ng/ccu-suniv.c 2019-01-23 09:05:17.959348454 +0800
@@ -238,7 +238,7 @@
/* The BSP header file has a CIR_CFG, but no mod clock uses this definition */static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M",
- 0x0cc, BIT(8), 0);
+ 0x0cc, BIT(1), 0);static SUNXI_CCU_GATE(dram_ve_clk, "dram-ve", "pll-ddr",
0x100, BIT(0), 0);理论上将上面这个patch应用到Icenowy的4.14内核中,USB应该也就能跑了。
有nano的朋友可以试一试这位的想法, 这种 bug 还真难找
自己尝试了一下,真的可以跑了。
感谢填坑, 看来就是一个 bit 影响了 USB 的工作.
离线