Hi Sascha<div><br></div><div>Thanks for your reply.<br><br></div><div>> No information available:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>
> MCI card not probed yet<br>
> Parameters:<br>
> probe = 0<br>
> sid1-noah:/ mci0.probe=1<br>
> imx-esdhc@imx-esdhc0: timeout 1<br>
> Cannot reset the SD/MMC card<br>
> set parameter: Connection timed out<br>
> sid1-noah:/<br>
><br>
> Any ideas? What are possible causes of this?<br>
<br>
</div></div>Does the SD card work in the first stage loader? If yes, you could try<br>
to remove the mux setup from barebox, so that you can be sure that you<br>
do not misconfigure things that were already configured correctly.<br>
I have no hardware handy to test the driver on a i.MX25, but Erics<br>
Eukrea board has MMC support, so I believe the driver should work in<br>
general.<br><font color="#888888"><br></font></blockquote><div><br></div><div>I have sprinkled some printf's over the code and enabled DEBUG in the mci driver. It goes into timeout:</div><div><br></div><div><div>Board: SID1 NOAH</div>
<div>registered netconsole as cs1</div><div>imx-esdhc@mci0: registered as mci0</div><div>esdhc_init: enble cache snooping</div><div>esdhc_init: reset host controller</div><div>esdhc_init: controller available</div><div>esdhc_init: set clock</div>
<div>esdhc_init: disable BRR and BWR bits</div><div>esdhc_init: Put PROCTL reg back</div><div>esdhc_init: Set timeout to max value</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div>
<div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=0</div><div>esdhc_send_cmd: wait on timeout</div><div>imx-esdhc@imx-esdhc0: timeout 1</div><div>mci_go_idle: send command returned with -110</div>
<div>mci@mci0: Activating IDLE state failed: -110</div><div>Cannot reset the SD/MMC card</div><div>ehci@ehci0: USB EHCI 1.00</div><div>cfi_flash@cfi_flash0: found cfi flash at a0000000, size 67108864</div><div>Malloc space: 0x83b00000 -> 0x83efffff (size 4 MB)</div>
<div>Stack space : 0x83af8000 -> 0x83b00000 (size 32 kB)</div><div>envfs: wrong magic on /dev/env0</div><div>no valid environment found on /dev/env0. Using default environment</div><div>running /env/bin/init...</div></div>
<div><br></div><div>Checking drivers/mci/imx-esdhc.c:</div><div><br></div><div> /* Wait for the command to complete */</div><div> ret = wait_on_timeout(100 * MSECOND,</div><div> esdhc_read32(®s->irqstat) & IRQSTAT_CC);</div>
<div> if (ret) {</div><div> dev_err(host->dev, "timeout 1\n");</div><div> return -ETIMEDOUT;</div><div> }</div><div><br></div><div>One would suppose that 100msecs should be more than enough, considering the slow speed one would see. Could there be an issue with the dozen or so errata from Freescale with regard to SD card? What else could cause the card not to reply within the large timeout specified?</div>
<div><br></div><div>Funny enough, commenting the following IOMUX pad settings specific to the ESDHC:</div><div> </div><div><div> // MX25_PAD_SD1_CMD__SD1_CMD,</div><div> // MX25_PAD_SD1_CLK__SD1_CLK,</div><div>
// MX25_PAD_SD1_DATA0__SD1_DATA0,</div><div> // MX25_PAD_SD1_DATA1__SD1_DATA1,</div><div> // MX25_PAD_SD1_DATA2__SD1_DATA2,</div><div> // MX25_PAD_SD1_DATA3__SD1_DATA3,</div></div><div><br></div>
<div>
shows promising results:</div>
<div><br></div><div><div>Board: SID1 NOAH</div><div>registered netconsole as cs1</div><div>imx-esdhc@mci0: registered as mci0</div><div>esdhc_init: enble cache snooping</div><div>esdhc_init: reset host controller</div><div>
esdhc_init: controller available</div><div>esdhc_init: set clock</div><div>esdhc_init: disable BRR and BWR bits</div><div>esdhc_init: Put PROCTL reg back</div><div>esdhc_init: Set timeout to max value</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div>
<div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=0</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div>
<div>mci_go_idle: send command returned with 0</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=426</div><div>esdhc_send_cmd: send transfer type=135921664</div>
<div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>mci@mci0: SD Card Rev. 2.00 or later detected</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div>
<div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=924450816</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div>
<div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=1077280768</div><div>esdhc_send_cmd: send transfer type=687996928</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div>
<div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=924450816</div><div>esdhc_send_cmd: wait on timeout</div>
<div>esdhc_send_cmd: wait for command to complete</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=1077280768</div><div>
esdhc_send_cmd: send transfer type=687996928</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div>
<div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=924450816</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div>
<div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=1077280768</div><div>esdhc_send_cmd: send transfer type=687996928</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div>
<div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=924450816</div><div>esdhc_send_cmd: wait on timeout</div>
<div>esdhc_send_cmd: wait for command to complete</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=1077280768</div><div>
esdhc_send_cmd: send transfer type=687996928</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div>
<div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=924450816</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div>
<div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=1077280768</div><div>esdhc_send_cmd: send transfer type=687996928</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div>
<div>mci@mci0: Put the Card in Identify Mode</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=34144256</div>
<div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>mci@mci0: Card's identification data is: 1B534D30-30303030-101ABB6A-9500AB00</div><div>mci@mci0: Get/Set relative address</div>
<div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=52035584</div><div>esdhc_send_cmd: wait on timeout</div>
<div>esdhc_send_cmd: wait for command to complete</div><div>mci@mci0: Get card's specific data</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>
esdhc_send_cmd: send command=131072</div><div>esdhc_send_cmd: send transfer type=151584768</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>mci@mci0: Card's specific data is: 007FFF32-5B5A83BA-F6DBDFFF-0E800000</div>
<div>mci@mci0: Transfer speed: 25000000</div><div>mci@mci0: Max. block length are: Write=1024, Read=1024 Bytes</div><div>mci@mci0: Capacity: 1910 MiB</div><div>mci@mci0: Limiting max. read block size down to 512</div><div>
mci@mci0: Limiting max. write block size down to 512</div><div>mci@mci0: Read block length: 512, Write block length: 512</div><div>mci@mci0: Select the card, and put it into Transfer Mode</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div>
<div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=131072</div><div>esdhc_send_cmd: send transfer type=119209984</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div>
<div>mci@mci0: Changing transfer frequency</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=131072</div><div>esdhc_send_cmd: send transfer type=924450816</div>
<div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>mci@mci0: Trying to read the SCR (try 1 of 3)</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: setup data transfer</div>
<div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=859439121</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div>
<div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: setup data transfer</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=16777201</div><div>esdhc_send_cmd: send transfer type=104464401</div>
<div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: setup data transfer</div><div>esdhc_send_cmd: figure out transfer arguments</div>
<div>esdhc_send_cmd: send command=-2130706447</div><div>esdhc_send_cmd: send transfer type=104464401</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>mci@mci0: Prepare for bus width change</div>
<div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>esdhc_send_cmd: send command=131072</div><div>esdhc_send_cmd: send transfer type=924450816</div><div>
esdhc_send_cmd: wait on timeout</div>
<div>esdhc_send_cmd: wait for command to complete</div><div>mci@mci0: Set SD bus width to 4 bit</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div><div>
esdhc_send_cmd: send command=2</div>
<div>esdhc_send_cmd: send transfer type=102367232</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: figure out transfer arguments</div>
<div>esdhc_send_cmd: send command=512</div><div>esdhc_send_cmd: send transfer type=270139392</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>mci@mci0: Card is up and running now, registering as a disk</div>
<div>mci@mci0: registered disk0</div><div>mci@mci0: mci_sd_read: Read 1 block(s), starting at 0</div><div>esdhc_send_cmd: wait at least 8 SD clock cycles</div><div>esdhc_send_cmd: setup data transfer</div><div>esdhc_send_cmd: figure out transfer arguments</div>
<div>esdhc_send_cmd: send command=0</div><div>esdhc_send_cmd: send transfer type=289013777</div><div>esdhc_send_cmd: wait on timeout</div><div>esdhc_send_cmd: wait for command to complete</div><div>mci@mci0: No partition table found</div>
<div>mci@mci0: SD Card successfully added</div><div>ehci@ehci0: USB EHCI 1.00</div><div>cfi_flash@cfi_flash0: found cfi flash at a0000000, size 67108864</div><div>Malloc space: 0x83b00000 -> 0x83efffff (size 4 MB)</div>
<div>Stack space : 0x83af8000 -> 0x83b00000 (size 32 kB)</div><div>envfs: wrong magic on /dev/env0</div><div>no valid environment found on /dev/env0. Using default environment</div><div>running /env/bin/init...</div><div>
id1-noah:/ devinfo mci0</div><div>resources:</div><div>driver: mci</div><div><br></div><div> Card:</div><div> Attached is an SD Card (Version: 2.0)</div><div> Capacity: 1910 MiB</div><div> CID: 1B534D30-30303030-101ABB6A-9500AB00</div>
<div> CSD: 007FFF32-5B5A83BA-F6DBDFFF-0E800000</div><div> Max. transfer speed: 25000000 Hz</div><div> Manufacturer ID: 1B</div><div> OEM/Application ID: 534D</div><div> Product name: '00000'</div><div> Product revision: 1.0</div>
<div> Serial no: 448490133</div><div> Manufacturing date: 11.2010</div><div>no parameters available</div></div><div><br></div><div>What's going on here? I'll investigate this further, because in real life I have massive SD card write speed issues on my mx25 device on any kernel tested from 2.6.37 to 3.3.4 so far.</div>
<div><br></div><div>Best regards</div><div>Roberto</div></div></div>