SD/MMC card on Olimex EP9302

My EP9302 board works very well. Only the SD/MMC card doesn’t

work. I tried some kernels, one compiled by myself with this

options enabled, but nothing happened:

MMC/SD Card Support —>

<*> MMC Support

<*> MMC block device driver

<*> ARM AMBA Multimedia Card Interface support

Is the SD/MMC slot supported by 2.6 kernels?

Regards

Hello,

I created a patch for Linux-2.6.24-rc7. After that you can mount your MMC/SD card. The patch and more info: http://dev.ivanov.eu/projects/cs-e9302/

Hello!

I have CS-EP9302 Rev.A board and have some trouble with newest kernels…

Original 2.6.8 kernel works fine + customized by myself and compiled with Crater - 2.6.17 kernel also works fine. BUT, when I using 2.6.20 Linux do not starting… =(

I found this nice document about 2.6.24 kernel and patch at http://dev.ivanov.eu/projects/cs-e9302/ and followed it excatly line by line with the only exception zImage instead of uImage, because I’m using original RedBoot from the board with no changes. The compiler was used is /usr/local/arm/4.1.1-920t/bin/arm-linux-

I successfully received zImage - I put it in place of old-robustly-working 2.6.8 linux image but it’s no working… Help me, please, I’m newbie and can’t solve this trouble…

Here is output from minicom:

+Ethernet eth0: MAC address 00:00:00:00:54:33
IP: 192.168.0.4/255.255.255.0, Gateway: 192.168.0.3
Default server: 192.168.0.3, DNS server IP: 192.168.0.3

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v2_0 - built 08:14:43, Aug 22 2006

Platform: Cirrus Logic EDB9302 Board (ARM920T) Rev A
Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

RAM: 0x00000000-0x02000000, 0x00041e68-0x01fdd000 available
FLASH: 0x60000000 - 0x61000000, 128 blocks of 0x00020000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
RedBoot> ping -n 5 -h 192.168.0.3
Network PING - from 192.168.0.4 to 192.168.0.3
PING - received 5 of 5 expected
RedBoot> load -v -r -m tftp -h 192.168.0.3 zImage -b 0x00042000
|
Raw file loaded 0x00042000-0x001cb4bf, assumed entry at 0x00042000
RedBoot> load -v -r -m tftp -h 192.168.0.3 ramdisk.gz -b 0x00800000
\
Raw file loaded 0x00800000-0x00ae6290, assumed entry at 0x00800000
RedBoot> exec -r 0x00800000 -s 0x00300000 -b 0x00042000 -l 0x00200000 -c "console=ttyAM root=/dev/ram"
Uncompressing Linux...................................................................................................... done, booting the kernel.

And nothing more happening…

Command line args to kernel is the same as for 2.6.8 and 2.6.14 kernels I used before, “console=ttyAM root=/dev/ram”

If you have the filesystem in the card, you should point root to it. then it should boot.

exec -c “console=ttyAM root=/dev/mmcblk0p1 rootdelay=5”

I noticed there is a bug when reading/writing the rootfs, after some load the card stops responding. Could someone reproduce this?.

Hi,

If you would like to use SD/MMC memory support for CS-E9302 without any problem as in http://dev.ivanov.eu/projects/cs-e9302/, you should use edb9302 patched U-Boot as bootloader and install eldk (Embedded Linux Development Kit) to compile both linux kernel and U-boot succesfully.

ELDK and U-boot can be obtained from http://www.glomationinc.com/support.html

The compiler you used “/usr/local/arm/4.1.1-920t/bin/arm-linux-” is not capable to create uImage from zImage, so you must install eldk in your system.

You may edit “u-boot-1.2.0/include/configs/edb9302.h” file to determine default u-boot environment varibles.

You may use cirrus logic download utility to burn u-boot.bin into strata flash memory.

~$./download -b 57600 -o 0k -p S0 u-boot.bin

Some USB to Serial converter provide some problems doe to its voltage converter.

Sincerely

Bolat DINC

tequilaguru and bolatd, thank you very much for your reply!

I have downloaded U-boot from http://www.glomationinc.com/Support/u-b … 02.tar.bz2 but there are no ELDK on this page. But I found ELDK on this site: http://www.denx.de/wiki/view/DULG/ELDKAvailability

Is this: http://mirror.switch.ch/ftp/mirror/eldk … -linux-x86 - exaсtly what I need? I should download arm-2007-01-21.iso or arm-2007-01-21-src.iso ? :slight_smile:

Hi FPGA,

You can use arm-2007-01-21.iso.

Mount arm-2007-01-21.iso file into a temporary directory. (as a root user)

You can see the installation instructions and the install scripts in this directory.

Sincerely.

Bolat DINC

10x bolatd

I have already downloaded this. But… I found that the kernel could be built without any special software. uImage for u-boot built without ELDK with help of plain “/usr/local/arm/4.1.1-920t/bin/arm-linux-” + path to “mkimage” from u-boot in PATH environment variable.

So, I have successfully boot my new uImage with u-boot and it works :slight_smile:

Unfortunately, I encountered with several problems…

  1. prepatched for EDB9302 u-boot 1.2.0 works fine through serial port and TFTP, BUT… utility for y-modem download and kermit is not working… and any second (2nd) TFTP transfer through TFTP hangs!!! =(
U-Boot 1.2.0 (Apr  7 2008 - 01:56:38)

DRAM:  32 MB
Flash: 16 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
TFTP from server 192.168.1.1; our IP address is 192.168.1.2
Filename 'uImage'.
Load address: 0x200000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #######################################################
done
Bytes transferred = 1610992 (1894f0 hex)
EDB9302> tftp 0x400000 ramdisk
TFTP from server 192.168.1.1; our IP address is 192.168.1.2
Filename 'ramdisk'.
Load address: 0x400000
Loading: #

And nothing more…

How to solve this problem? Where I can obtain latest version of u-boot with support of EDB9302??? Or how to move support for EDB9302 to latest u-boot 1.3.1?..

So, I can only download my kernel, but there are no possibility to send ramdisk image… =(((

With old redboot my tftp server could serve many many files many times…

  1. Then I tried to place root fs in SD card…

I bought Kingston 1 GB SD card and formatted it as in instruction (and placed Debian on it). Then I downloaded kernel image with help of TFTP (tftp working only once in my u-boot build, only one file… =((( ) and changed bootargs to place root fs at SD card…

Card itself works fine through my USB card reader on my desktop Linux, but when boot it shows me:

Waiting 5sec before mounting root device...
mmc_attach_sd
mmc_attach_sd BUG_ON(!host);
mmc_attach_sd WARN_ON(!host->claimed);
mmc_attach_bus(host, &mmc_sd_ops);
err = mmc_sd_init_card(host, host->ocr, NULL);
SD ERROR!!!
mmc0: error -84 whilst initialising SD card

And then kernel panic, no rootfs of course…

I heavily commented with printk sd card driver and searching place of error and it’s reasons, but is there someone who know how to fix that?

Hi,

There is a bug in tftp routines in u-boot in this version, so you cannot download binary images via tftp twice.

Now I have been trying to figure out what is bug in u-boot via arm-linux-gdb.

Another issues about SD/MMC card patch that there is a bug read/write block routines in the patch. I have ran into same problem, so i left sd/mmc root file system support and i use USB stick as a root file system by enabling USB mass storage support kernel configuration.

That is all for now.

Take Care.

Bolat DINC

Oh, thanks for info :slight_smile:

P.S. How often you visiting this forum and this topic?

Fri Mar 28, Wed Apr 16, Sat Apr 19, Sat May 17 and 20 May… :roll:

Hi,

Sorry for the latency.

Sincerely.

Bolat DINC

Dou you know how to fix this problem with SD/MMC driver?

BTW, author of the patch, ivanovp, is not responding on mail messages and not visiting this forum, sad… =(

P.S.

I’m also using my SD card for rootfs through USB card reader as “USB mass storage” + using NFS as rootfs - very convenient thing, it’s better than any flash during development time… :slight_smile:

Hi FPGA,

I actually don`t know what is the problem SD/MMC patch.

I am trying to figure out what is the problems in both u-boot and SD/MMC patch for the linux kernel by using arm-linux-gdb and OpenOCD.

As you know OpenOCD has a GDB server and by using the elf file with arm-linux-gdb, you can manage to debug a remote embedded system.

Now i crashed into remote debug problem, cause i cannot insert a hardware break point in u-boot flash resident code.

If you know any information about remote debugging using OpenOCD and arm-linux-gdb, it will be so FINE :wink:

Thanks

Bolat DINC

bolatd:
Hi FPGA,

I actually don`t know what is the problem SD/MMC patch.

I am trying to figure out what is the problems in both u-boot and SD/MMC patch for the linux kernel by using arm-linux-gdb and OpenOCD.

As you know OpenOCD has a GDB server and by using the elf file with arm-linux-gdb, you can manage to debug a remote embedded system.

Now i crashed into remote debug problem, cause i cannot insert a hardware break point in u-boot flash resident code.

If you know any information about remote debugging using OpenOCD and arm-linux-gdb, it will be so FINE :wink:

Try to use printk :wink:

Have you already inserted printk in most important parts of MMC driver? I think this simple approach could be helpful…

Sorry, I have J-link clone JTAG adapter but on my way to get it works in my desktop Linux (originally it available only in windows)… So, I dont have practice with GDB + OpenOCD yet…

Message removed by Carlov

Carlov:
Hello,

The patch for 2.6.24-rc8 seems to introduce a problem: ttyAM1 doesn’t function any more. Can you give any clue how to make it work again? with the patch that came on the CD of Olimex, kernel version 2.6.20.4, the second serial port still works OK. Thank you in advance.

Carlov

It's seems that something bad happened with author of patch... He doesn't reply... =(

BTW I’m using 2.6.27 Linux kernel on my CS-E9302 :slight_smile:

I think, someone from us must recreate a patch for SD/MMC and post it to main kernel…

Hello FPGA,

Thank you for your response, perhaps we can make te MMC work again in kernel version 2.6.27.

Does everything else, like ttyAM1, work OK on your CS-E9302 board?

If so, can you give me your .config file? I can’t get it compiled right at the moment.

Does your kernel still work with the file system we used for 2.6.24-rc8 or should I also build a new root file system?

Thanks, Carlov

FPGA:

Carlov:
Hello,

The patch for 2.6.24-rc8 seems to introduce a problem: ttyAM1 doesn’t function any more. Can you give any clue how to make it work again? with the patch that came on the CD of Olimex, kernel version 2.6.20.4, the second serial port still works OK. Thank you in advance.

Carlov

It's seems that something bad happened with author of patch... He doesn't reply... =(

BTW I’m using 2.6.27 Linux kernel on my CS-E9302 :slight_smile:

I think, someone from us must recreate a patch for SD/MMC and post it to main kernel…

Carlov:
Hello FPGA,

Thank you for your response, perhaps we can make te MMC work again in kernel version 2.6.27.

Does everything else, like ttyAM1, work OK on your CS-E9302 board?

If so, can you give me your .config file? I can’t get it compiled right at the moment.

Does your kernel still work with the file system we used for 2.6.24-rc8 or should I also build a new root file system?

No, I didn’t test ttyAM1 yet, but ttyAM0 works fine :slight_smile:

Just use make xconfig and then select edb9302 default config from stock Linux kernel. Then save config and it will compile OK. But in 2.6.27 somebody kicked some important code about ethernet, so you must include these changes manually =(

http://linux.derkeiler.com/Mailing-List … 07002.html

I hope in 2.6.27.* updates this problem solved :slight_smile:

Fliesystem? Yes, I use this old filesystem, and it works fine, so no need to create new filesystem :slight_smile:

Hello FPGA,

Could you please send my the .config file you used to build kernel version 2.6.27? I copied the ep93xx_defconfig from the /arch/arm/configs directory, but after compiling a few times, I never get the USB working. Therefore I can’t mount the file system… kernel panic.

Thank you for your help.

Carlov

FPGA:

Carlov:
No, I didn’t test ttyAM1 yet, but ttyAM0 works fine :slight_smile:

Just use make xconfig and then select edb9302 default config from stock Linux kernel. Then save config and it will compile OK. But in 2.6.27 somebody kicked some important code about ethernet, so you must include these changes manually =(

http://linux.derkeiler.com/Mailing-List … 07002.html

I hope in 2.6.27.* updates this problem solved :slight_smile:

Fliesystem? Yes, I use this old filesystem, and it works fine, so no need to create new filesystem :slight_smile:

Carlov:
Hello FPGA,

Could you please send my the .config file you used to build kernel version 2.6.27? I copied the ep93xx_defconfig from the /arch/arm/configs directory, but after compiling a few times, I never get the USB working. Therefore I can’t mount the file system… kernel panic.

Thank you for your help.

Hmmm… I use same config as you use… I didnt tested USB deeply, but probably it’s working wrong on my board too…

I wiil test it tomorrow and I’ll show you my results.

P.S.

I’m from Russia, so when in USA night, we have a daylight :slight_smile: