2009-06-04 05:03:00     MMC error...

Document created by Aaronwu Employee on Aug 15, 2013
Version 1Show Document
  • View in full screen mode

2009-06-04 05:03:00     MMC error...

Nikolay Chokoev (IRELAND)

Message: 75198   

Hi,

 

I'm trying to move the kernel and the rootfs in two files on the MMC card under fat (like   www.denx.de/wiki/view/DULG/RootFileSystemInAReadOnlyFile)

Ihave a kernel image with min fs attached and rootfs ext2 image files on the fat partition on the card. The kernel image is runnng the init script file:

 

#!/bin/busybox sh

sleep 1

echo Mounting /proc filesystem

mount -t proc /proc /proc

#echo Creating block devices

#mkdevices /dev

#echo Creating root device

#mkrootdev /dev/root

#echo 0x0100 > /proc/sys/kernel/real-root-dev

mknod /dev/mmcbkl0 b 179 0

mknod /dev/mmcblk0p1 b 179 1

mknod /dev/loop0 b 7 0

echo Mounting flash card

mount -o noatime -t vfat /dev/mmcblk0p1 /mnt

echo losetup for filesystem image

losetup /dev/loop0 /mnt/rootfs.ext2

mkdir sysroot

echo Mounting root filesystem image

mount -o defaults --ro -t ext2 /dev/loop0 /sysroot

#cd sysroot

echo Running switch_root

exec switch_root -c /dev/console /sysroot /sbin/init

 

and here is the first question - 'sleep 1' at the beginning of the script is needed because the mmc card seems to need some time to mount/initialize. Is there a beter way to do that waiting?

 

After the rootfs is switched I have a number of mmc errors:

mmcblk0: p1

Mounting /proc filesystem

Mounting flash card

losetup for filesystem image

Mounting root filesystem image

Running switch_root

mmcblk0: error -84 transferring data

end_request: I/O error, dev mmcblk0, sector 2993

mmcblk0: error -84 transferring data

end_request: I/O error, dev mmcblk0, sector 16921

mmcblk0: error -84 transferring data

end_request: I/O error, dev mmcblk0, sector 19465

mmcblk0: error -84 transferring data

end_request: I/O error, dev mmcblk0, sector 36401

mmcblk0: error -84 transferring data

end_request: I/O error, dev mmcblk0, sector 36945

mmcblk0: error -84 transferring data

end_request: I/O error, dev mmcblk0, sector 36337

 

The card seems to work well under U-Boot as it reads the kernel images and boots it. What could be the problem here?

 

After that the linux is running and the rootfs seems to be switched, but when I try to run a file  have the same mmc errors...

Regards,

Nikolay

QuoteReplyEditDelete

 

 

2009-06-04 05:07:08     Re: MMC error...

Mike Frysinger (UNITED STATES)

Message: 75199   

 

you can either write a real piece of code that listens to netlink events, or take the cheap way out and put the mount into a loop

 

while ! mount -o noatime -t vfat /dev/mmcblk0p1 /mnt ; do :; done

 

you didnt say what your hardware platform was exactly, or how you've hooked up the mmc, or what version of software you're using ...

QuoteReplyEditDelete

 

 

2009-06-04 05:20:02     Re: MMC error...

Nikolay Chokoev (IRELAND)

Message: 75201   

Hi Mike,

 

Thanks for the suggestion. I'll try that.

 

The linux is:

 

Linux version 2.6.28.7-ADI-2009R1-pre-svn6218 (root@dlnx764) (gcc version 4.1.2

(ADI svn)) #142 Thu Jun 4 09:33:42 IST 2009

 

The hardware is a BF527 based board.

 

The configuration is:

 

static struct bfin5xx_spi_chip  mmc_spi_chip_info = {

        .enable_dma = 0,

        .bits_per_word = 8,

        .cs_gpio = GPIO_PH3,

};

static struct spi_board_info bfin_spi_board_info[] __initdata = {

...

        .modalias = "mmc_spi",

        .max_speed_hz = 20000000, 

        .bus_num = 0,

        .chip_select = 0, /* use GPIO */

        .controller_data = &mmc_spi_chip_info,

        .mode = SPI_MODE_3,

...

 

 

 

I've tried with '.max_speed_hz = 10000000,' also, but it's the same.

QuoteReplyEditDelete

 

 

2009-06-04 05:24:10     Re: MMC error...

Mike Frysinger (UNITED STATES)

Message: 75202   

 

so you're using a pretty outdated kernel snapshot.  if you're going to track trunk, you really need to stay up to date.  we dont generally address bugs in trunk unless you're using the latest.

QuoteReplyEditDelete

 

 

2009-06-04 05:31:19     Re: MMC error...

Nikolay Chokoev (IRELAND)

Message: 75203   

 

Thanks Mike,

 

Yes, it's a little bit old. I'll update ...

QuoteReplyEditDelete

 

 

2009-06-04 11:56:56     Re: MMC error...

Nikolay Chokoev (IRELAND)

Message: 75215   

... updated to:

 

Linux version 2.6.28.10-ADI-2010R1-pre-svn6580 (root@dlnx764) (gcc version 4.1.2 (ADI svn)) #43 Thu Jun 4 16:49:36 IST 2009

 

It's the same. It seems that with small (2-3 MB) rootfs.ext2 file the errors disapears (or at least I can't see them). The curent file size is 24 MB.

QuoteReplyEditDelete

 

 

2009-06-04 19:15:58     Re: MMC error...

Frank Van Hooft (CANADA)

Message: 75222   

 

Is the MMC card the only device on the SPI port?  Are you using a serial flash or anything else on SPI?

QuoteReplyEditDelete

 

 

2009-06-05 04:22:56     Re: MMC error...

Nikolay Chokoev (IRELAND)

Message: 75248   

 

Yes, it's on the SPI. There is a SPI FLASH and the MMC card on the chain.

 

Could that be the problem? What's the solution?

Attachments

    Outcomes