2

I'm using an embedded board ARM9 SAM9G25. I want to boot from SD card.

When I build a linux kernel with a built-in rootfs (initramfs) then it boots.

I want to separate the kernel from rootfs and I generated a rootfs.squashfs.

The kernel command line is:

console=ttyAT0,115200 root=/dev/mmcblk0 ro rootfstype=squashfs

When I then boot my system the following kernel panic occurs:

VFS: Cannot open root device "mmcblk0" or unknown-block(0,0) Please append a correct "root=" boot option; here are the available partitions: Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Regression

I believe that partitioning doesn't lead to the solution, since booting with the same settings but with an initramfs is possible.

When booting with the initramfs image $ ls /dev doesn't list mmcblk or sdb.

$ dmesg
mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0
atmel_mci atmel_mci.0: Atmel MCI controller at 0xf0008000 irq 12, 1 slots 
mmc_host mmc0: card is not present 
mmc1: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0 
atmel_mci atmel_mci.1: Atmel MCI controller at 0xf000c000 irq 26, 1 slots
mmc_host mmc1: card is not present

(Yes the card is in the slot ;)

So what I think happens now is, that U-Boot can read the SD device but the kernel doesn't. Since an initramfs is bootable, a single kernel can be loaded too but the rootfs, opened from kernel, cannot be found. In make linux menuconfig I already enabled

Device Drivers

  • <*> MMC/SD/SDIO card support

    • <*> MMC block device driver
    • <*> MMC host test driver
    • <*> Atmel SD/MMC Driver (Atmel Multimedia Card Interface support)
    • [ * ] Atmel MCI DMA support (Exp.)
    • Secure Digital Host Controller Interface support

but still with this setting it seems that he's not able to use the SD device.

I'm a bit clueless at this point, can someone give me a hint?

1
  • With what you're posted, the necessity of a module would be the most common problem. What does the initramfs do before mounting the SD card? How is the SD card partitioned (output of cat /proc/partitions)? Posting your kernel .config might inspire someone too. Commented Feb 12, 2014 at 23:03

3 Answers 3

1

Boot your system using the known working kernel and initramfs, and then do an lsmod to see what modules are loaded. I would bet one of those is something it needs that isn't built into your kernel. I know you can pass command line options to modules when insmoding - maybe there's some command line option that the initramfs passes that you're not passing from the kernel command line.

Also make sure squashfs support is built into your kernel as well.

1
  • lsmod is empty. Squashfs support should actually not play a role, since the kernel isn't able to read the card at all (that's what i assume from the dmesg output) Commented Feb 12, 2014 at 12:53
1

I found out the driver uses different pins (in the board header file, of the device drivers) than the actual hardware for the SD device. Thank you for your help, I thought it was a more generic error

0

It should be..

console=ttyAT0,115200 root=/dev/mmcblk0<partition number of rootfs> ro rootfstype=squashfs
2
  • Welcome to unix.SE. You can format your answer so that it's easier to read by surrounding the code segments in backticks: "`". Alternatively, you can place it on its own line and indent it four spaces, as was done in the question.
    – drs
    Commented May 16, 2014 at 15:50
  • yes you were right the partition mmcblk0 p2 was missing too Commented May 19, 2014 at 6:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .