SD/MMC card on Olimex EP9302

Everything ARM and LPC

Moderator: phalanx

SD/MMC card on Olimex EP9302

Postby theta » Thu Aug 23, 2007 6:33 am

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
theta
 
Posts: 4
Joined: Sat Aug 11, 2007 1:51 am

MMC/SD support for CS-E9302

Postby ivanovp » Wed Jan 16, 2008 7:28 am

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/
ivanovp
 
Posts: 5
Joined: Sun Jul 01, 2007 12:52 am
Location: Hungary/Budapest

Postby FPGA » Wed Feb 13, 2008 2:53 pm

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:
Code: Select all
+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"
FPGA
 
Posts: 22
Joined: Mon Feb 11, 2008 2:53 pm

Postby tequilaguru » Sat Mar 01, 2008 6:58 pm

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?.
tequilaguru
 
Posts: 21
Joined: Wed May 24, 2006 8:49 am

Postby bolatd » Thu Mar 06, 2008 8:41 am

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
bolatd
 
Posts: 11
Joined: Thu Mar 06, 2008 7:46 am

Postby FPGA » Fri Mar 28, 2008 4:10 pm

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 ? :)
FPGA
 
Posts: 22
Joined: Mon Feb 11, 2008 2:53 pm

Postby bolatd » Wed Apr 16, 2008 4:57 pm

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
bolatd
 
Posts: 11
Joined: Thu Mar 06, 2008 7:46 am

Postby FPGA » Sat Apr 19, 2008 10:36 am

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 :)
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!!! =(
Code: Select all
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...

2) 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:
Code: Select all
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?
FPGA
 
Posts: 22
Joined: Mon Feb 11, 2008 2:53 pm

Postby bolatd » Sat May 17, 2008 12:31 pm

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
bolatd
 
Posts: 11
Joined: Thu Mar 06, 2008 7:46 am

Postby FPGA » Mon May 19, 2008 1:39 pm

Oh, thanks for info :)
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:
FPGA
 
Posts: 22
Joined: Mon Feb 11, 2008 2:53 pm

Postby bolatd » Tue May 20, 2008 4:40 pm

Hi,
Sorry for the latency.
Sincerely.
Bolat DINC
bolatd
 
Posts: 11
Joined: Thu Mar 06, 2008 7:46 am

Postby FPGA » Wed May 21, 2008 11:43 am

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... :)
FPGA
 
Posts: 22
Joined: Mon Feb 11, 2008 2:53 pm

Postby bolatd » Wed May 21, 2008 2:24 pm

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 ;)
Thanks
Bolat DINC
bolatd
 
Posts: 11
Joined: Thu Mar 06, 2008 7:46 am

Postby FPGA » Sat May 24, 2008 1:10 pm

bolatd wrote: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 ;)
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...
FPGA
 
Posts: 22
Joined: Mon Feb 11, 2008 2:53 pm

Re: MMC/SD support for CS-E9302

Postby Carlov » Sat Nov 01, 2008 2:29 pm

Message removed by Carlov
Last edited by Carlov on Sat Apr 18, 2009 6:05 am, edited 2 times in total.
Carlov
 
Posts: 16
Joined: Thu Apr 10, 2008 2:33 pm

Next

Return to Everything ARM and LPC

Who is online

Users browsing this forum: No registered users and 0 guests