您尚未登录。

楼主 #1 2019-05-27 22:19:15

605364021
会员
注册时间: 2018-10-23
已发帖子: 251
积分: 251

关于SD卡启动遇到的问题

在Kernel启动打印信息中,最后卡住在
Waiting for root device /dev/mmcblk0p2...
请问这通常会是原因导致呢?不是在V3s板子上运行,是我在335X跑linux4.14时遇到的问题,我按照V3S制作SD启动卡的方式进行大致制作,分成2个区,FAT32,EXT4。U-boot启动没问题,但是进行内核启动卡在了Waiting for root device /dev/mmcblk0p2...。如果不方便的话可以把帖子删了

离线

#2 2019-05-27 23:35:06

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 关于SD卡启动遇到的问题

看前面的 log,有没有生成 mtdX分区?





离线

楼主 #3 2019-05-28 10:36:36

605364021
会员
注册时间: 2018-10-23
已发帖子: 251
积分: 251

Re: 关于SD卡启动遇到的问题

晕哥 说:

看前面的 log,有没有生成 mtdX分区?

U-Boot 2014.10 (May 25 2019 - 20:29:07)
       Watchdog enabled
I2C:   ready
DRAM:  512 MiB
NAND:  1024 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Net:   <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** Unable to read file boot.scr **
222 bytes read in 2 ms (108.4 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc ...
Running uenvcmd ...
4107352 bytes read in 238 ms (16.5 MiB/s)
41278 bytes read in 6 ms (6.6 MiB/s)
Kernel image @ 0x82000000 [ 0x000000 - 0x3eac58 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8fff2000, end 8ffff13d ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.79-gbde58ab01e (zhang@zhang-virtual-machine) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)) #2 SMP Mon May 27 16:18:18 CST 2019
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: TI AM335x EVM
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 16 MiB at 0x9e800000
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon)
[    0.000000] percpu: Embedded 17 pages/cpu @df939000 s40872 r8192 d20568 u69632
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129412
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait rootdelay=2
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 479932K/522240K available (8192K kernel code, 818K rwdata, 2432K rodata, 1024K init, 7475K bss, 25924K 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 : 0xe0000000 - 0xff800000   ( 504 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdfe00000   ( 510 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0900000   (9184 kB)
[    0.000000]       .init : 0xc0c00000 - 0xc0d00000   (1024 kB)
[    0.000000]       .data : 0xc0d00000 - 0xc0dccad8   ( 819 kB)
[    0.000000]        .bss : 0xc0dce000 - 0xc151afc0   (7476 kB)
[    0.000000] Running RCU self tests
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU event tracing is enabled.
[    0.000000]  RCU lockdep checking is enabled.
[    0.000000]  RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[    0.000000] OMAP clockevent source: timer2 at 19200000 Hz
[    0.000023] sched_clock: 32 bits at 19MHz, resolution 52ns, wraps every 111848106981ns
[    0.000060] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 99544814920 ns
[    0.000141] OMAP clocksource: timer1 at 19200000 Hz
[    0.000870] timer_probe: no matching timers found
[    0.002087] Console: colour dummy device 80x30
[    0.002155] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[    0.002172] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.002188] ... MAX_LOCK_DEPTH:          48
[    0.002204] ... MAX_LOCKDEP_KEYS:        8191
[    0.002221] ... CLASSHASH_SIZE:          4096
[    0.002237] ... MAX_LOCKDEP_ENTRIES:     32768
[    0.002253] ... MAX_LOCKDEP_CHAINS:      65536
[    0.002268] ... CHAINHASH_SIZE:          32768
[    0.002284]  memory used by lock dependency info: 4655 kB
[    0.002300]  per task-struct memory footprint: 1536 bytes
[    0.002347] Calibrating delay loop... 795.44 BogoMIPS (lpj=3977216)
[    0.078191] pid_max: default: 32768 minimum: 301
[    0.078723] Security Framework initialized
[    0.078900] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.078931] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.083137] CPU: Testing write buffer coherency: ok
[    0.083392] CPU0: Spectre v2: using BPIALL workaround
[    0.085297] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.087395] Setting up static identity map for 0x80100000 - 0x80100078
[    0.088378] Hierarchical SRCU implementation.
[    0.090675] smp: Bringing up secondary CPUs ...
[    0.090711] smp: Brought up 1 node, 1 CPU
[    0.090733] SMP: Total of 1 processors activated (795.44 BogoMIPS).
[    0.090753] CPU: All CPU(s) started in SVC mode.
[    0.095889] devtmpfs: initialized
[    0.131856] random: get_random_u32 called from bucket_table_alloc+0xdc/0x260 with crng_init=0
[    0.133293] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.134367] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.134458] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.136785] pinctrl core: initialized pinctrl subsystem
[    0.143041] NET: Registered protocol family 16
[    0.151752] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.212095] omap_hwmod: debugss: _wait_target_disable failed
[    0.271652] cpuidle: using governor menu
[    0.287628] OMAP GPIO hardware version 0.1
[    0.317206] omap-gpmc 50000000.gpmc: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/nandflash_pins_s0, deferring probe
[    0.325978] No ATAGs?
[    0.326015] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.326464] omap4_sram_init:Unable to allocate sram needed to handle errata I688
[    0.326493] omap4_sram_init:Unable to get sram pool needed to handle errata I688
[    0.373976] edma 49000000.edma: TI EDMA DMA engine driver
[    0.383809] SCSI subsystem initialized
[    0.386129] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[    0.386287] omap_i2c 4802a000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c1_pins, deferring probe
[    0.386699] pps_core: LinuxPPS API ver. 1 registered
[    0.386722] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.386786] PTP clock support registered
[    0.392644] clocksource: Switched to clocksource timer1
[    0.541421] VFS: Disk quotas dquot_6.6.0
[    0.541702] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.573985] NET: Registered protocol family 2
[    0.576473] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.576603] TCP bind hash table entries: 4096 (order: 5, 147456 bytes)
[    0.577327] TCP: Hash tables configured (established 4096 bind 4096)
[    0.577879] UDP hash table entries: 256 (order: 2, 20480 bytes)
[    0.578018] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[    0.578479] NET: Registered protocol family 1
[    0.581190] RPC: Registered named UNIX socket transport module.
[    0.581255] RPC: Registered udp transport module.
[    0.581275] RPC: Registered tcp transport module.
[    0.581294] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.585447] hw perfevents: no interrupt-affinity property for /pmu, guessing.
[    0.586586] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.589994] audit: initializing netlink subsys (disabled)
[    0.593969] audit: type=2000 audit(0.579:1): state=initialized audit_enabled=0 res=1
[    0.594453] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.598533] NFS: Registering the id_resolver key type
[    0.599044] Key type id_resolver registered
[    0.599095] Key type id_legacy registered
[    0.599294] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.608645] io scheduler noop registered
[    0.608696] io scheduler deadline registered
[    0.608877] io scheduler cfq registered (default)
[    0.608902] io scheduler mq-deadline registered
[    0.608923] io scheduler kyber registered
[    0.611853] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[    0.621790] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled
[    0.630011] omap_uart 44e09000.serial: no wakeirq for uart0
[    0.630621] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a OMAP UART0
[    1.572509] console [ttyO0] enabled
[    1.579262] omap_uart 48022000.serial: no wakeirq for uart1
[    1.587307] 48022000.serial: ttyO1 at MMIO 0x48022000 (irq = 31, base_baud = 3000000) is a OMAP UART1
[    1.638653] brd: module loaded
[    1.674577] loop: module loaded
[    1.682246] mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.695960] libphy: Fixed MDIO Bus: probed
[    1.772711] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    1.782853] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[    1.796786] libphy: 4a101000.mdio: probed
[    1.802069] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Atheros 8035 ethernet
[    1.816303] cpsw 4a100000.ethernet: Detected MACID = 64:cf:d9:5c:87:ed
[    1.825731] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[    1.834220] cpsw 4a100000.ethernet: ALE Table size 1024
[    1.841207] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
[    1.854989] i2c /dev entries driver
[    1.863829] sdhci: Secure Digital Host Controller Interface driver
[    1.871917] sdhci: Copyright(c) Pierre Ossman
[    2.035184] ledtrig-cpu: registered to indicate activity on CPUs
[    2.047150] oprofile: using arm/armv7
[    2.053235] Initializing XFRM netlink socket
[    2.059448] NET: Registered protocol family 10
[    2.074395] Segment Routing with IPv6
[    2.079363] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.090201] NET: Registered protocol family 17
[    2.096319] NET: Registered protocol family 15
[    2.102716] Key type dns_resolver registered
[    2.108529] omap_voltage_late_init: Voltage driver support not added
[    2.116956] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize
[    2.127590] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize
[    2.138830] ThumbEE CPU extension supported.
[    2.144588] Registering SWP/SWPB emulation handler
[    2.150847] SmartReflex Class3 initialized
[    2.186748] omap-gpmc 50000000.gpmc: GPMC revision 6.0
[    2.194303] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    2.207784] nand: second ID read did not match 30,87 against be,e9
[    2.216224] nand: No NAND device found
[    2.221133] omap2-nand 8000000.nand: scan failed, may be bus-width mismatch
[    2.264245] tps65910 0-002d: No interrupt support, no core IRQ
[    2.275604] tps65910 0-002d: Error in configuring external control EN1
[    2.284338] tps65910 0-002d: Failed to initialise ext control config
[    2.292893] vrtc: supplied by vbat
[    2.298376] vrtc: failed to enable
[    2.303117] tps65910 0-002d: failed to register tps65910-pmic regulator
[    2.311900] tps65910-pmic: probe of tps65910-pmic failed with error -121
[    2.322219] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    2.335217] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
[    2.349510] hctosys: unable to open rtc device (rtc0)
[    2.356379] sr_init: No PMIC hook to init smartreflex
[    2.363423] sr_init: platform driver register failed for SR
[    2.371776] lis3_reg: disabling
[    2.376189] wlan-en-regulator: disabling
[    2.384774] Waiting 2 sec before mounting root device...
[    4.404088] Waiting for root device /dev/mmcblk0p2...
[    4.822786] random: fast init done

_20190528103224.png
上面分别是Kernel启动时的打印信息已经uboot 中的mtdparts,但是这个mtd是nand的,我不知道跟SD卡启动有没有关系,谢谢晕哥

离线

#4 2019-05-28 11:22:25

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 关于SD卡启动遇到的问题

不好意思, 我看错了, 应该是没有生成 /dev/mmcblk0pX分区.





离线

#5 2019-05-28 11:26:01

无情一刀
会员
注册时间: 2018-09-04
已发帖子: 716
积分: 698

Re: 关于SD卡启动遇到的问题

605364021 说:

在Kernel启动打印信息中,最后卡住在
Waiting for root device /dev/mmcblk0p2...
请问这通常会是原因导致呢?不是在V3s板子上运行,是我在335X跑linux4.14时遇到的问题,我按照V3S制作SD启动卡的方式进行大致制作,分成2个区,FAT32,EXT4。U-boot启动没问题,但是进行内核启动卡在了Waiting for root device /dev/mmcblk0p2...。如果不方便的话可以把帖子删了

是分为FAT16哦哦

离线

#6 2019-05-28 11:28:10

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 关于SD卡启动遇到的问题

无情一刀 说:
605364021 说:

在Kernel启动打印信息中,最后卡住在
Waiting for root device /dev/mmcblk0p2...
请问这通常会是原因导致呢?不是在V3s板子上运行,是我在335X跑linux4.14时遇到的问题,我按照V3S制作SD启动卡的方式进行大致制作,分成2个区,FAT32,EXT4。U-boot启动没问题,但是进行内核启动卡在了Waiting for root device /dev/mmcblk0p2...。如果不方便的话可以把帖子删了

是分为FAT16哦哦

FAT32 虽然没有试过, 应该也没问题.

烧我这个固件试一试: https://whycan.cn/t_2039.html

然后一个一个文件替换排除问题。





离线

楼主 #7 2019-05-28 17:17:38

605364021
会员
注册时间: 2018-10-23
已发帖子: 251
积分: 251

Re: 关于SD卡启动遇到的问题

晕哥,这个问题是我在其他板子上面运行的时候遇到的,可能跟V3有点区别,在uboot中进行mmc测试有以下的结果

U-Boot# mmc part

Partition Map for MMC device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            143360          923c2b58-01     0c Boot
  2     145408          30939136        923c2b58-02     83

U-Boot# mmc dev 0
switch to partitions #0, OK
mmc0 is current device
U-Boot# mmcinfo 
Device: OMAP SD/MMC
Manufacturer ID: 3
OEM: 5344
Name: SL16G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.8 GiB
Bus Width: 4-bit

我认为Uboot已经找到了MMC0并且分区为2个分区,但是启动的时候就是会卡在Waiting for root device /dev/mmcblk0p2上,我在控制台也可以输出。。。。

离线

#8 2019-05-28 17:46:46

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 关于SD卡启动遇到的问题

Linux设备树有没有启动 mmc, 比如这种:

&mmc0 {
    pinctrl-0 = <&mmc0_pins_a>;
    pinctrl-names = "default";
    broken-cd;
    bus-width = <4>;
    vmmc-supply = <&reg_vcc3v3>;
    status = "okay";
};





离线

楼主 #9 2019-05-28 19:54:13

605364021
会员
注册时间: 2018-10-23
已发帖子: 251
积分: 251

Re: 关于SD卡启动遇到的问题

mmc1_pins: pinmux_mmc1_pins {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7)		/* spi0_cs1.gpio0_6 */
			AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat0.mmc0_dat0 */
			AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat1.mmc0_dat1 */
			AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat2.mmc0_dat2 */
			AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat3.mmc0_dat3 */
			AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_cmd.mmc0_cmd */
			AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_clk.mmc0_clk */
			AM33XX_IOPAD(0x9a0, PIN_INPUT | MUX_MODE4)		/* mcasp0_aclkr.mmc0_sdwp */
		>;
	};

&mmc1{
     status = "okay";
     vmmc-supply = <&vmmc_reg>;
     bus-width = <4>;
     pinctrl-names = "default";
     pinctrl-0 = <&mmc1_pins>;
	 broken-cd;
     //cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };

vmmc_reg: regulator@12 {                                            
             regulator-min-microvolt = <1800000>;
             regulator-max-microvolt = <3300000>;
             regulator-always-on;
         };

这是我从运行设备树中提取出来的一部分,我在网上查找资料有说到DTS中的MMC1代表的是MMC0

离线

#10 2019-05-28 20:47:40

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 关于SD卡启动遇到的问题

你看下 mmc1_pins 这组 io的定义和手册对比一下





离线

楼主 #11 2019-05-30 17:31:27

605364021
会员
注册时间: 2018-10-23
已发帖子: 251
积分: 251

Re: 关于SD卡启动遇到的问题

我通过NFS文件系统进行启动,发现/dev目录下没有mmcblk设备,这是设备树注册MMC失败?

离线

#12 2019-07-16 18:09:07

晕哥小弟
会员
注册时间: 2019-04-04
已发帖子: 309
积分: 299.5

Re: 关于SD卡启动遇到的问题

晕哥,SD卡启动的时候要分区,论坛上面说分为fat16,分为fat32行不行?我没有试过,直接上贴问你了。

离线

#13 2019-07-16 18:21:31

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 关于SD卡启动遇到的问题

我也没有试过,但是我觉得应该是可以的





离线

#14 2021-07-06 17:44:10

mmcblk0p2
会员
注册时间: 2021-07-06
已发帖子: 14
积分: 16.5

Re: 关于SD卡启动遇到的问题

各位大哥们 你们解决了这个问题吗?我现在也卡在这里,我是用的sd卡,内核是自己编译的。
后来用了别人的设备树和内核控制变量法逐个替换,定位到了内核的问题。
所以这到底是怎么回事啊

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn