WhyCan Forum

人过留名,雁过留声,感谢各位朋友不离不弃地支持。 QQ: 516333132 (挖坑网/填坑网) admin@whycan.cn

您尚未登录。

#1 2018-10-28 18:32:57

msr06rr
会员
所在地: 苏州
注册时间: 2018-01-11
累计积分: 143

f1c100s使用linux4.19可以正常reboot,但是otg该怎么配置才正确啊?

f1c100s 的otg该怎么配置啊?
这是我的log输出:

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.19.0 suda-morris (wendy@wendy-PC) (gcc version 8.2.0 (morris)) #7 Sun Oct 28 18:14:55 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] cma: Reserved 16 MiB at 0x81000000
[    0.000000] random: get_random_bytes called from start_kernel+0x84/0x398 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: console=tty0 console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=jffs2
[    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: 7352K/32768K available (5120K kernel code, 200K rwdata, 1248K rodata, 1024K init, 215K bss, 9032K reserved, 16384K 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)   (6112 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   ( 201 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 216 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.000050] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000137] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000666] Console: colour dummy device 80x30
[    0.001684] console [tty0] enabled
[    0.001811] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[    0.070312] pid_max: default: 32768 minimum: 301
[    0.070849] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070957] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.072750] CPU: Testing write buffer coherency: ok
[    0.074948] Setting up static identity map for 0x80100000 - 0x80100058
[    0.077697] devtmpfs: initialized
[    0.084447] VFP support v0.3: not present
[    0.085040] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.085193] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.089662] pinctrl core: initialized pinctrl subsystem
[    0.092071] NET: Registered protocol family 16
[    0.095550] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.119424] usbcore: registered new interface driver usbfs
[    0.119694] usbcore: registered new interface driver hub
[    0.119982] usbcore: registered new device driver usb
[    0.120641] pps_core: LinuxPPS API ver. 1 registered
[    0.120735] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.121508] Advanced Linux Sound Architecture Driver Initialized.
[    0.123630] clocksource: Switched to clocksource timer
[    0.154835] NET: Registered protocol family 2
[    0.156495] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[    0.156681] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.156787] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.156875] TCP: Hash tables configured (established 1024 bind 1024)
[    0.157210] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.157327] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.157952] NET: Registered protocol family 1
[    0.161372] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[    0.181229] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.187030] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.187170] io scheduler noop registered
[    0.187225] io scheduler deadline registered
[    0.187849] io scheduler cfq registered (default)
[    0.187948] io scheduler mq-deadline registered
[    0.188003] io scheduler kyber registered
[    0.188900] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[    0.200619] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.389261] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.396777] console [ttyS0] disabled
[    0.417118] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 23, base_baud = 6250000) is a 16550A
[    0.847290] console [ttyS0] enabled
[    0.873450] 1c25400.serial: ttyS1 at MMIO 0x1c25400 (irq = 24, base_baud = 6250000) is a 16550A
[    0.891992] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.897985] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.904541] Creating 4 MTD partitions on "spi0.0":
[    0.909403] 0x000000000000-0x000000100000 : "u-boot"
[    0.917413] 0x000000100000-0x000000110000 : "dtb"
[    0.925036] 0x000000110000-0x000000510000 : "kernel"
[    0.932813] 0x000000510000-0x000001000000 : "rootfs"
[    0.941097] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.947845] ehci-platform: EHCI generic platform driver
[    0.953454] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.959890] ohci-platform: OHCI generic platform driver
[    0.966004] musb-sunxi 1c13000.usb: Invalid or missing 'dr_mode' property
[    0.972919] musb-sunxi: probe of 1c13000.usb failed with error -22
[    0.980201] i2c /dev entries driver
[    0.986300] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.996461] sunxi-mmc 1c0f000.mmc: Linked as a consumer to regulator.1
[    1.030407] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.039981] usbcore: registered new interface driver usbhid
[    1.045769] usbhid: USB HID core driver
[    1.053554] NET: Registered protocol family 17
[    1.058329] Key type dns_resolver registered
[    1.075720] hctosys: unable to open rtc device (rtc0)
[    1.081606] ALSA device list:
[    1.084772]   No soundcards found.
[    1.091808] random: fast init done
[    1.193590] random: crng init done
[    1.920846] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[    1.930040] devtmpfs: mounted
[    1.937759] Freeing unused kernel memory: 1024K
[    1.942460] Run /sbin/init as init process
Starting logging: OK
Initializing random number generator... done.
Starting network: OK

Welcome to Buildroot

其中的

[    0.966004] musb-sunxi 1c13000.usb: Invalid or missing 'dr_mode' property
[    0.972919] musb-sunxi: probe of 1c13000.usb failed with error -22

是什么原因造成的?要怎么填坑?

离线

#2 2018-10-28 18:57:54

晕哥
Administrator
注册时间: 2017-09-06
累计积分: 7,862

Re: f1c100s使用linux4.19可以正常reboot,但是otg该怎么配置才正确啊?

你用的是 @chong 的linux4.19 补丁吗?

离线

#3 2018-10-28 19:05:01

msr06rr
会员
所在地: 苏州
注册时间: 2018-01-11
累计积分: 143

Re: f1c100s使用linux4.19可以正常reboot,但是otg该怎么配置才正确啊?

晕哥 说:

你用的是 @chong 的linux4.19 补丁吗?

是的晕哥,请问需要电路上做什么改动吗?

离线

#4 2018-10-28 19:23:36

晕哥
Administrator
注册时间: 2017-09-06
累计积分: 7,862

Re: f1c100s使用linux4.19可以正常reboot,但是otg该怎么配置才正确啊?

那个 4.19 我还没来得及测试.


我猜设备树 usb缺一个 dr_mode 属性

https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/fsl-usb.txt
http://processors.wiki.ti.com/index.php/MUSB_Linux_Porting_Guide

- dr_mode : indicates the working mode for "fsl-usb2-dr" compatible
   controllers.  Can be "host", "peripheral", or "otg".  Default to
   "host" if not defined for backward compatibility.

&usb1 {
                status = "okay";
                dr_mode = "host";
        };

你按上面这样配置一下, 看看效果.

离线

#5 2018-10-28 20:04:35

ippen
会员
注册时间: 2018-07-22
累计积分: 225

Re: f1c100s使用linux4.19可以正常reboot,但是otg该怎么配置才正确啊?

不用改动,直接打了patch就能用

离线

#6 2018-11-11 01:17:40

msr06rr
会员
所在地: 苏州
注册时间: 2018-01-11
累计积分: 143

Re: f1c100s使用linux4.19可以正常reboot,但是otg该怎么配置才正确啊?

貌似reboot还是会失败。。。
这该怎么整?没经验,求指教?
BTW,U盘可以工作了

[  222.924928] usb 1-1: new high-speed USB device number 4 using musb-hdrc
[  223.114261] usb-storage 1-1:1.0: USB Mass Storage device detected
[  223.121517] scsi host0: usb-storage 1-1:1.0
[  224.167779] scsi 0:0:0:0: Direct-Access     Generic  Flash Disk       8.07 PQ: 0 ANSI: 4
[  224.179307] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  224.186829] sd 0:0:0:0: [sda] 15974400 512-byte logical blocks: (8.18 GB/7.62 GiB)
[  224.196136] sd 0:0:0:0: [sda] Write Protect is off
[  224.202626] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  224.225297]  sda: sda1
[  224.233192] sd 0:0:0:0: [sda] Attached SCSI removable disk

离线

#7 2018-11-11 01:19:18

msr06rr
会员
所在地: 苏州
注册时间: 2018-01-11
累计积分: 143

Re: f1c100s使用linux4.19可以正常reboot,但是otg该怎么配置才正确啊?

该死的reboot

# reboot 
# Stopping network: OK
Saving random seed... done.
Stopping logging: OK
umount: devtmpfs busy - remounted read-only
[  317.181833] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system reboot
[  319.197161] reboot: Restarting system
[  320.196866] Reboot failed -- System halted

离线

#8 2019-09-20 09:55:44

晕哥
Administrator
注册时间: 2017-09-06
累计积分: 7,862

Re: f1c100s使用linux4.19可以正常reboot,但是otg该怎么配置才正确啊?

全志的官方bsp开看门狗重启的: https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/arch/arm/mach-sunxi/sun4i.c

static void sunxi_restart(char mode, const char *cmd)
{
	if (!wdt_base)
		return;

	/* Enable timer and set reset bit in the watchdog */
	writel(3, wdt_base + WATCHDOG_MODE_REG);
	writel(0xa57 << 1 | 1, wdt_base + WATCHDOG_CTRL_REG);
	while(1) {
		mdelay(5);
		writel(3, wdt_base + WATCHDOG_MODE_REG);
	}
}
DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
	.init_machine	= sunxi_dt_init,
	.map_io		= sunxi_map_io,
	.init_irq	= sunxi_init_irq,
	.handle_irq	= sunxi_handle_irq,
	.restart	= sunxi_restart,
	.timer		= &sunxi_timer,
	.dt_compat	= sunxi_board_dt_compat,
MACHINE_END

离线

#9 2019-09-23 16:13:23

mayourt
会员
注册时间: 2019-08-28
累计积分: 1

Re: f1c100s使用linux4.19可以正常reboot,但是otg该怎么配置才正确啊?

mainline 中是一样的做法的。不过电路异常的话,相关的看门狗设置会出现问题,目前h3就遇到了一块那样的板子。需要自己改一下重启看门狗相关的参数。

离线

#10 2019-09-23 16:15:05

晕哥
Administrator
注册时间: 2017-09-06
累计积分: 7,862

Re: f1c100s使用linux4.19可以正常reboot,但是otg该怎么配置才正确啊?

应该如何修改呢?

离线

页脚