非cpu0启动linux,SD卡无法启动Linux的问题及解决

博主在Zynq平台上遇到一个问题,当尝试启动Linaro桌面系统时,系统无法打开SD卡的第二个分区,导致启动失败。深入分析后发现,问题在于SD卡被意外锁定,处于写保护状态。尽管SD卡在写保护状态下通过USB接口的读卡器仍能读取,但不能进行写操作。解锁SD卡后,系统成功启动。这个经验提醒我们在排查硬件问题时要注意检查基本的物理状态,如设备的锁定机制。
摘要由CSDN通过智能技术生成

最近在Zynq板上启动linaro桌面系统时,发现一个奇怪的问题,系统在启动到最后,已经打印了如下信息:[drm] Initialized axi_hdmi_drm 1.0.0 20120930 on minor 0,按理说后面就该是登录系统并显示shell提示符了,但后面显示:VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -30,即打不开SD卡的第二个分区,之前使用这张卡可正常启动的,而且没有做任何改动。于是我们重新制作桌面文件系统,结果问题依旧。很不解?!下面是启动信息:

U-Boot 2013.01 (Jun 04 2013 - 09:22:41)

DRAM:  512 MiB

WARNING: Caches not enabled

MMC:   zynq_sdhci: 0

SF: Detected S25FL256S with page size 64 KiB, total 32 MiB

*** Warning - bad CRC, using default environment

In:    serial

Out:   serial

Err:   serial

Net:   Gem.e000b000

Hit any key to stop autoboot:  0

Copying Linux from SD to RAM...

Device: zynq_sdhci

Manufacturer ID: 2

OEM: 544d

Name: SA08G

Tran Speed: 50000000

Rd Block Len: 512

SD version 2.0

High Capacity: Yes

Capacity: 7.3 GiB

Bus Width: 4-bit

reading uImage

3158312 bytes read in 485 ms (6.2 MiB/s)

reading devicetree.dtb

8172 bytes read in 13 ms (613.3 KiB/s)

## Booting kernel from Legacy Image at 03000000 ...

Image Name:   Linux-3.6.0

Image Type:   ARM Linux Kernel Image (uncompressed)

Data Size:    3158248 Bytes = 3 MiB

Load Address: 00008000

Entry Point:  00008000

Verifying Checksum ... OK

## Flattened Device Tree blob at 02a00000

Booting using the fdt blob at 0x02a00000

Loading Kernel Image ... OK

OK

Loading Device Tree to 1fb4f000, end 1fb53feb ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Booting Linux on physical CPU 0

Linux version 3.6.0 (ubuntu@ubuntu) (gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-50) ) #1 SMP PREEMPT Sun Jun 2 13:37:48 CST 2013

CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d

CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

Machine: Xilinx Zynq Platform, model: Xilinx Zynq ZED

bootconsole [earlycon0] enabled

cma: CMA: reserved 40 MiB at 1d000000

Memory policy: ECC disabled, Data cache writealloc

PERCPU: Embedded 7 pages/cpu @c0fcf000 s7872 r8192 d12608 u32768

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048

Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=0

PID hash table entries: 2048 (order: 1, 8192 bytes)

Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)

Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)

Memory: 512MB = 512MB total

Memory: 466556k/466556k available, 57732k reserved, 0K highmem

Virtual kernel memory layout:

vector  : 0xffff0000 - 0xffff1000   (   4 kB)

fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)

lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)

pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)

modules : 0xbf000000 - 0xbfe00000   (  14 MB)

.text : 0xc0008000 - 0xc0614ce4   (6196 kB)

.init : 0xc0615000 - 0xc063dec0   ( 164 kB)

.data : 0xc063e000 - 0xc06bcb80   ( 507 kB)

.bss : 0xc06bcba4 - 0xc0bc4850   (5152 kB)

Preemptible hierarchical RCU implementation.

RCU lockdep checking is enabled.

Dump stacks of tasks blocking RCU-preempt GP.

RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.

NR_IRQS:512

MIO pin 11 not assigned(00001760)

xslcr mapped to e0802000

Zynq clock init

timer #0 at e0804000, irq=43

sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms

Console: colour dummy device 80x30

Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar

... MAX_LOCKDEP_SUBCLASSES:  8

... MAX_LOCK_DEPTH:          48

... MAX_LOCKDEP_KEYS:        8191

... CLASSHASH_SIZE:          4096

... MAX_LOCKDEP_ENTRIES:     16384

... MAX_LOCKDEP_CHAINS:      32768

... CHAINHASH_SIZE:          16384

memory used by lock dependency info: 3695 kB

per task-struct memory footprint: 1152 bytes

Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

CPU0: thread -1, cpu 0, socket 0, mpidr 80000000

hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available

Setting up static identity map for 0x3a61a8 - 0x3a61dc

L310 cache controller enabled

l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x72360000, Cache size: 524288 B

CPU1: Booted secondary processor

CPU1: thread -1, cpu 1, socket 0, mpidr 80000001

Brought up 2 CPUs

SMP: Total of 2 processors activated (2664.03 BogoMIPS).

devtmpfs: initialized

NET: Registered protocol family 16

DMA: preallocated 256 KiB pool for atomic coherent allocations

xgpiops e000a000.gpio: gpio at 0xe000a000 mapped to 0xe080c000

hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.

hw-breakpoint: maximum watchpoint size is 4 bytes.

bio: create slab at 0

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

Linux video capture interface: v2.00

Advanced Linux Sound Architecture Driver Version 1.0.25.

Switching to clocksource xttcps_clocksource

NET: Registered protocol family 2

TCP established hash table entries: 16384 (order: 5, 131072 bytes)

TCP bind hash table entries: 16384 (order: 7, 589824 bytes)

TCP: Hash tables configured (established 16384 bind 16384)

TCP: reno registered

UDP hash table entries: 256 (order: 2, 20480 bytes)

UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)

NET: Registered protocol family 1

msgmni has been set to 991

io scheduler noop registered

io scheduler deadline registered

io scheduler cfq registered (default)

xuartps e0001000.uart: failed to get alias id, errno -19

e000console [ttyPS0] enabled, bootconsole disabled

console [ttyPS0] enabled, bootconsole disabled

xdevcfg f8007000.devcfg: ioremap f8007000 to e0814000 with size 1000

[drm] Initialized drm 1.1.0 20060810

platform 6c000000.axi_hdmi: Driver axi-hdmi requests probe deferral

brd: module loaded

loop: module loaded

xqspips e000d000.spi: master is unqueued, this is deprecated

xqspips e000d000.spi: at 0xE000D000 mapped to 0xE0816000, irq=51

libphy: XEMACPS mii bus: probed

xemacps e000b000.eth: pdev->id -1, baseaddr 0xe000b000, irq 54

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

ULPI transceiver vendor/product ID 0x0451/0x1507

Found TI TUSB1210 ULPI transceiver.

ULPI integrity check: passed.

xusbps-ehci xusbps-ehci.0: Xilinx PS USB EHCI Host Controller

xusbps-ehci xusbps-ehci.0: new USB bus registered, assigned bus number 1

xusbps-ehci xusbps-ehci.0: irq 53, io mem 0x00000000

xusbps-ehci xusbps-ehci.0: USB 2.0 started, EHCI 1.00

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 1 port detected

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

mousedev: PS/2 mouse device common for all mice

i2c /dev entries driver

usbcore: registered new interface driver uvcvideo

USB Video Class driver (1.1.1)

sdhci: Secure Digital Host Controller Interface driver

sdhci: Copyright(c) Pierre Ossman

sdhci-pltfm: SDHCI platform and OF driver helper

mmc0: Invalid maximum block size, assuming 512 bytes

mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

mmc0: new high speed SDHC card at address 1234

mmcblk0: mmc0:1234 SA08G 7.28 GiB (ro)

mmcblk0: p1 p2

adv7511 0-0039: Failed to add route AIFIN->TMDS

adv7511-hdmi-snd adv7511_hdmi_snd.4:  adv7511 75c00000.axi-spdif-tx mapping ok

INFO: task swapper/0:1 blocked for more than 20 seconds.

"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.

swapper/0       D c03a4a84     0     1      0 0x00000000

[] (__schedule+0x540/0x658) from [] (schedule_timeout+0x18/0x164)

[] (schedule_timeout+0x18/0x164) from [] (wait_for_common+0xe0/0x174)

[] (wait_for_common+0xe0/0x174) from [] (_request_firmware_load+0xe0/0x180)

[] (_request_firmware_load+0xe0/0x180) from [] (request_firmware+0x74/0xb0)

[] (request_firmware+0x74/0xb0) from [] (_process_sigma_firmware+0x1c/0x1b4)

[] (_process_sigma_firmware+0x1c/0x1b4) from [] (process_sigma_firmware_regmap+0x18/0x24)

[] (process_sigma_firmware_regmap+0x18/0x24) from [] (adau17x1_load_firmware+0x58/0x7c)

[] (adau17x1_load_firmware+0x58/0x7c) from [] (adau1761_probe+0x2a8/0x30c)

[] (adau1761_probe+0x2a8/0x30c) from [] (soc_probe_codec+0x18c/0x29c)

[] (soc_probe_codec+0x18c/0x29c) from [] (snd_soc_register_card+0x724/0x10f4)

[] (snd_soc_register_card+0x724/0x10f4) from [] (platform_drv_probe+0x14/0x18)

[] (platform_drv_probe+0x14/0x18) from [] (driver_probe_device+0xb4/0x1ec)

[] (driver_probe_device+0xb4/0x1ec) from [] (__driver_attach+0x68/0x8c)

[] (__driver_attach+0x68/0x8c) from [] (bus_for_each_dev+0x48/0x74)

[] (bus_for_each_dev+0x48/0x74) from [] (bus_add_driver+0x98/0x220)

[] (bus_add_driver+0x98/0x220) from [] (driver_register+0x9c/0x13c)

[] (driver_register+0x9c/0x13c) from [] (do_one_initcall+0x90/0x164)

[] (do_one_initcall+0x90/0x164) from [] (kernel_init+0xf8/0x1b8)

[] (kernel_init+0xf8/0x1b8) from [] (kernel_thread_exit+0x0/0x8)

4 locks held by swapper/0/1:

#0:  (&__lockdep_no_validate__){......}, at: [] __driver_attach+0x40/0x8c

#1:  (&__lockdep_no_validate__){......}, at: [] __driver_attach+0x50/0x8c

#2:  (&card->mutex){+.+.+.}, at: [] snd_soc_register_card+0x274/0x10f4

#3:  (umhelper_sem){++++.+}, at: [] usermodehelper_read_trylock+0x4c/0xb8

INFO: task swapper/0:1 blocked for more than 20 seconds.

"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.

swapper/0       D c03a4a84     0     1      0 0x00000000

[] (__schedule+0x540/0x658) from [] (schedule_timeout+0x18/0x164)

[] (schedule_timeout+0x18/0x164) from [] (wait_for_common+0xe0/0x174)

[] (wait_for_common+0xe0/0x174) from [] (_request_firmware_load+0xe0/0x180)

[] (_request_firmware_load+0xe0/0x180) from [] (request_firmware+0x74/0xb0)

[] (request_firmware+0x74/0xb0) from [] (_process_sigma_firmware+0x1c/0x1b4)

[] (_process_sigma_firmware+0x1c/0x1b4) from [] (process_sigma_firmware_regmap+0x18/0x24)

[] (process_sigma_firmware_regmap+0x18/0x24) from [] (adau17x1_load_firmware+0x58/0x7c)

[] (adau17x1_load_firmware+0x58/0x7c) from [] (adau1761_probe+0x2a8/0x30c)

[] (adau1761_probe+0x2a8/0x30c) from [] (soc_probe_codec+0x18c/0x29c)

[] (soc_probe_codec+0x18c/0x29c) from [] (snd_soc_register_card+0x724/0x10f4)

[] (snd_soc_register_card+0x724/0x10f4) from [] (platform_drv_probe+0x14/0x18)

[] (platform_drv_probe+0x14/0x18) from [] (driver_probe_device+0xb4/0x1ec)

[] (driver_probe_device+0xb4/0x1ec) from [] (__driver_attach+0x68/0x8c)

[] (__driver_attach+0x68/0x8c) from [] (bus_for_each_dev+0x48/0x74)

[] (bus_for_each_dev+0x48/0x74) from [] (bus_add_driver+0x98/0x220)

[] (bus_add_driver+0x98/0x220) from [] (driver_register+0x9c/0x13c)

[] (driver_register+0x9c/0x13c) from [] (do_one_initcall+0x90/0x164)

[] (do_one_initcall+0x90/0x164) from [] (kernel_init+0xf8/0x1b8)

[] (kernel_init+0xf8/0x1b8) from [] (kernel_thread_exit+0x0/0x8)

4 locks held by swapper/0/1:

#0:  (&__lockdep_no_validate__){......}, at: [] __driver_attach+0x40/0x8c

#1:  (&__lockdep_no_validate__){......}, at: [] __driver_attach+0x50/0x8c

#2:  (&card->mutex){+.+.+.}, at: [] snd_soc_register_card+0x274/0x10f4

#3:  (umhelper_sem){++++.+}, at: [] usermodehelper_read_trylock+0x4c/0xb8

adau1761 0-003b: Failed to firmware

zed-adau1761-snd zed_adau1761_snd.7:  adau-hifi 77600000.axi-i2s mapping ok

TCP: cubic registered

NET: Registered protocol family 17

VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4

Registering SWP/SWPB emulation handler

drivers/rtc/hctosys.c: unable to open rtc device (rtc0)

ALSA device list:

#0: HDMI monitor

#1: ZED ADAU1761

No connectors reported connected with modes

[drm] Cannot find any crtc or sizes - going 1024x768

Console: switching to colour frame buffer device 128x48

fb0:  frame buffer device

drm: registered panic notifier

[drm] Initialized axi_hdmi_drm 1.0.0 20120930 on minor 0

VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -30

Please append a correct "root=" boot option; here are the available partitions:

b300         7639040 mmcblk0  driver: mmcblk

b301          489274 mmcblk0p1 00000000-0000-0000-0000-000000000000

b302         7149581 mmcblk0p2 00000000-0000-0000-0000-000000000000

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)

[] (unwind_backtrace+0x0/0xe0) from [] (panic+0x88/0x1e0)

[] (panic+0x88/0x1e0) from [] (mount_block_root+0x238/0x288)

[] (mount_block_root+0x238/0x288) from [] (prepare_namespace+0x160/0x1c0)

[] (prepare_namespace+0x160/0x1c0) from [] (kernel_init+0x178/0x1b8)

[] (kernel_init+0x178/0x1b8) from [] (kernel_thread_exit+0x0/0x8)

CPU1: stopping

[] (unwind_backtrace+0x0/0xe0) from [] (ipi_cpu_stop+0x3c/0x6c)

[] (ipi_cpu_stop+0x3c/0x6c) from [] (handle_IPI+0x68/0xb4)

[] (handle_IPI+0x68/0xb4) from [] (gic_handle_irq+0x54/0x5c)

[] (gic_handle_irq+0x54/0x5c) from [] (__irq_svc+0x44/0x78)

Exception stack(0xdcc77fa0 to 0xdcc77fe8)

7fa0: dcc76000 0001eaf0 dcc77fd8 dcc6e0c0 1cc6006a 00000015 10c0387d c06bcf54

7fc0: 0000406a 413fc090 00000000 00000000 00000000 dcc77fe8 dcc76018 c000e36c

7fe0: 20000013 ffffffff

[] (__irq_svc+0x44/0x78) from [] (default_idle+0x28/0x30)

[] (default_idle+0x28/0x30) from [] (cpu_idle+0x8c/0xe4)

[] (cpu_idle+0x8c/0xe4) from [<0039c134>] (0x39c134)

panic occurred, switching back to text console

今天终于发现了问题的所在,原来是SD卡在使用过程中不小心被锁定了,SD卡处于写保护状态,将SD卡解锁,上面的问题就解决了。而且还发现,SD卡处于写保护状态时,如果直接使用笔记本自带的读卡器访问SD卡,则不可写入;但是如果使用USB接口的读卡器,则可以正常读写SD卡,而我们一直使用的是USB接口的SD卡读卡器,所以之前没有发现这个问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值