Problems detecting SD card by kernel

xieliwei
I seem to be unable to boot my mini2440 using my own compiled kernel.
U-boot has no problems detecting the SD card containing the kernel but the
kernel has problems detecting the SD card and hence fails mounting the
rootfs:

s3c-sdi s3c2440-sdi: powered down.
s3c-sdi s3c2440-sdi: mmc0 - using pio, hw SDIO IRQ
...
Waiting 3sec before mounting root device...
...
VFS: Cannot open root device "mmcblk0p3" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available
partitions:
1f00             256 mtdblock0 (driver?)
1f01             128 mtdblock1 (driver?)
1f02            5120 mtdblock2 (driver?)
1f03         1043072 mtdblock3 (driver?)
1f04         1048576 mtdblock4 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(2,0)
Backtrace:
[<c0045140>] (dump_backtrace+0x0/0x114) from [<c05af5d8>]
(dump_stack+0x18/0x1c)
 r7:00008000 r6:c399c000 r5:c002f808 r4:c07c2910
....

Those two are the only lines related to the SD driver that shows up. I've
tried other kernels supplied by friendlyarm but it seems like none of them
has SD support compiled in or they aren't compiled for my A70 LCD. I've
also tried different options under the SD configuration section in
menuconfig.

I've tried multiple cards ranging from 512MB to 8GB, microSD (with
converter), miniSD (with converter) and SD. There were a few (2?)occasions
when the card was detected but I couldn't replicate it after a reboot.

The kernel source is the 2.6.32.2 one provided on the friendlyarm
downloads. The .config file can be found here: http://pastebin.com/HbiGtyzw

(Yes I know, a lot of bloat in the kernel)

bob
This is not a board problem , but related to the kernel.......


you have asked that it boot from  the flashcard partition 3:

mmcblk0p3


1. Have you compiled IN the correct FS code (it CANNOT BE A MODULE)
2. Have you correctly configured your "boot"
3. is the drivers loaded
4. is the card correctly formatted?

the system seems to think you only have the onboard nand flash mounted.

xieliwei
Thanks for the reply bob.

1. Yes, I've compiled in the FS code for the S3C2440 SD reader and not as a
module.
2. Yes, the boot parameters should be correct as I've successfully booted
it before.
3. Yes, it is loaded since the boot log shows the sdi initialising.
4. Yes, it because I've successfully booted it before.

Screwface
Hi xieliwei

Could you confirm your 8Gb SD card was detected by U-boot?
Could you indicate the version of U-boot you use?
What kind of SD card do you use? Was it a SDHC? What is the brand of the
card?

I have a 4Gb SDHC card and it is not detected by U-boot. The same card is
correctly detected by qtopia or WinCE. I'm looking for help.

Thank you for your information

xieliwei
Hello Screwface

Yes, the cards are detected by U-boot, here is an example:

U-Boot 1.3.2-mini2440 (May 16 2010 - 10:01:57)

I2C:   ready
DRAM:  64 MB
NOR Flash not found. Use hardware switch and 'flinit'
Flash:  0 kB
NAND:  1024 MiB
Found Environment offset in OOB..
USB:   S3C2410 USB Deviced
In:    serial
Out:   serial
Err:   serial
MAC: 08:08:11:18:00:01
Hit any key to stop autoboot:  0
mmc: Probing for SDHC ...
mmc: SD 2.0 or later card found
trying to detect SD Card...
Manufacturer:       0x02, OEM "TM"
Product name:       "SA08G", revision 0.3
Serial number:      2622702341
Manufacturing date: 1/2010
CRC:                0x23, b0 = 1
READ_BL_LEN=15, C_SIZE_MULT=0, C_SIZE=365
size = 0
SD Card detected RCA: 0x1234 type: SDHC

3894936 bytes read
## Booting kernel from Legacy Image at 31000000 ...
   Image Name:
   Created:      2010-05-22   2:46:46 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3894872 Bytes =  3.7 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing
Linux...........................................................................
................................................................................
................................................................................
................
done, booting the kernel.
Linux version 2.6.32.2-Boomer (root@ultima) (gcc version 4.3.2 (Sourcery
G++ Lite 2008q3-72) ) #10 Sat May 22 10:46:29 SGT 2010

I have numerous cards, two are SD (2Gb) (Kingston and Sandisk), the third
is SDHC (8Gb) (Kingston). 

That's the weird part, U-boot has no problems detecting the card most of
the time, but linux just refuses to find it. I'm starting to think its
either some kind of software timing issue or my board isn't meeting the
specifications for SD.

Screwface
Hi xieliwei,

Thank you for the information. I use the same version of u-boot and my SD
card is not detected. It is a IT Works 4Gb SDHC. I do not know where my
problem comes from :

- First I suspected this old version of U-boot was not able to deal with
SDHC cards
- My card is correctly detected by WinCE or Linux/Qtopia

So the card is not in fault, it works, the socket on the mini is also OK,
and U-boot works for you. So... I don't know what's the problem...

Regards

stereo_m
I also get the following error: 
Please append a correct "root=" boot option; here are the available
partitions:
1f00             256 mtdblock0 (driver?)
1f01             128 mtdblock1 (driver?)
1f02            5120 mtdblock2 (driver?)
1f03         1043072 mtdblock3 (driver?)
1f04         1048576 mtdblock4 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(2,0)

And it just hangs there, and if I reset the board from the reset-button, it
works just normally. So it hangs at the first start but if I reset it, it
works fine after that. Why is it like that?

Xristos
The answer is here:
http://billforums.station51.net/viewtopic.php?f=1&t=5

see the bootargs
I still have problem with the kingston but the takeMS card works fine.

flavioalsoares
In my case I can boot doing :

setenv bootargs console=ttySAC0,115200 root=/dev/mmcblk0p1 rootfstype=ext3
mini2440=3tb ro rootwait

Now, when I need to change the filesystem I need to do :

mount -o remount,rw /

using "rw" instead "ro" caused the kernel panic
But I don't know why using "rw" cause the kernel panic.

stereo_m
I'm still having some problems detecting my SD card on my mini2440, it
stops after it has loaded the kernel from its own partition, then it won't
continue loading the rootfs from its partition.

It stops like this:

Waiting for root device /dev/mmcblk0p3...
s3c-sdi s3c2440-sdi: running at 398kHz (requested: 400kHz).
s3c-sdi s3c2440-sdi: powered down.
mmc0: error -110 whilst initialising SD card
s3c-sdi s3c2440-sdi: powered down.


I looked in mini2440_defconfig and found something about SD cards, is there
something worth trying to change? Probably that is not the problem, but
does someone have any ideas?

It looks like:

# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_SDIO_UART=y
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_S3C=y
CONFIG_MMC_SDHCI_S3C_DMA=y
# CONFIG_MMC_AT91 is not set
# CONFIG_MMC_ATMELMCI is not set
CONFIG_MMC_SPI=y
CONFIG_MMC_S3C=y
# CONFIG_MMC_S3C_HW_SDIO_IRQ is not set
CONFIG_MMC_S3C_PIO=y
# CONFIG_MMC_S3C_DMA is not set
# CONFIG_MMC_S3C_PIODMA is not set
# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y

stereo_m
I forgot to add that it doesn't hang every time - it happens just
sometimes. 95% of the times I try to boot the mini2440 it boots just fine,
but then sometimes it hangs with:
 
s3c-sdi s3c2440-sdi: powered down.
mmc0: error -110 whilst initialising SD card
s3c-sdi s3c2440-sdi: powered down.

I have tried with rootwait and bootdelay=4 but none of them actually seem
to help. Would it be possible to do so that the mini2440 would reboot
itself if the kernel hangs like that?

stereo_m
Doesn't anyone else have experienced this problem with "mmc0: error -110
whilst initialising SD card"? Or does someone have any ideas?

jeeper74
We had this problem on our S3C2440 board every time we removed the SD card
and inserted it back in.  It would never come back up unless we shut down
power and rebooted.  And then it would only come up sometimes.  
We modified the 2.6.29.6 Kernel and placed the following in
/drivers/mmc/core/sd.c in the  mmc_sd_init_card(...) function to delay the
initialization of the card which solved our SD card problems on our S3c2440
board :

mdelay(10);

Placed right before:

err = mmc_read_switch(card);

It cleaned up all of our error -110.

ehsan.latifi
not boot ( v3 ???? ) new boot ??

ehsan.latifi
helppppppppppppppppppppppppp