Qi didn't work with my uSD, workaround found

Paul Fertser fercerpav at gmail.com
Sat Dec 13 15:55:27 CET 2008


Hi,

I've recently bought a new uSD card, Transcend TS8GUSDHC4 (8Gb, class
4) and was quite surprised it doesn't work with Qi. Having no debug
board, i spent considerable time debugging by trial-and-error and
found that Qi is able to load a kernel from it only after reboot (i
have another kernel in NAND, that is loaded after uSD fails) but not
after power-on. A strategically placed udelay solves the issue for me:

--- a/src/drivers/glamo-mmc.c
+++ b/src/drivers/glamo-mmc.c
@@ -674,14 +674,15 @@ int mmc_init(int verbose)
        /* Well, either way let's say hello in SD card protocol */
 
        while (retries--) {
 
                udelay(100000);
                udelay(100000);
                udelay(100000);
+               udelay(300000);
 
                resp = mmc_cmd(MMC_APP_CMD, 0x00000000,
                        MMC_CMD_AC | MMC_RSP_R1, 0, 0, 0,
                        (u16 *)&response[0]);


I've tried lower values, 200000 never works and 250000 works
unreliably. Also the "stable" kernel has problems mounting this card
as root (unless started with logverbose=8), but andy-tracking works
without problems.

BTW, do i understand it correct, that i need to press AUX at exactly
the right time to enable verbose kernel logging? If i press too early,
i just skip the kernel, and if the red led is off, then it's already
too late. I was able to trigger it several times, but it was very
tricky, guessing just the right time just before the red led turns off
is almost impossible. I hope somebody will eventually describe the Qi
UI in the README, but i'm too shy to send a patch as my english is
quite clumsy.

Another question: what s3c2442/s3c24xx-mci.c is for? On gta02 we have WLAN
attached to this interface, why do we have this code at all?

Here are some snippets (a bit lengthy) that might give an insight to
the root of the problem (if at all necessary as 0.3s delay on startup
doesn't matter too much):

dmesg:
[21474539.890000] glamo-mci glamo-mci.0: powered (vdd = 20) clk: 0kHz
div=255 (req: 0kHz). Bus width=0
[21474539.900000] SD power -> 3200mV
[21474539.900000] glamo-mci glamo-mci.0: powered (vdd = 20) clk:
195kHz div=255 (req: 195kHz). Bus width=0
[21474539.900000] glamo-mci glamo-mci.0: powered (vdd = 20) clk:
195kHz div=255 (req: 195kHz). Bus width=0
[21474539.905000] glamo-mci glamo-mci.0: powered (vdd = 20) clk:
195kHz div=255 (req: 195kHz). Bus width=0
[21474539.905000] glamo-mci glamo-mci.0: Error after cmd: 0x8120
[21474539.905000] glamo-mci glamo-mci.0: Error after cmd: 0x120
[21474539.905000] glamo-mci glamo-mci.0: Error after cmd: 0x8120
[21474539.905000] glamo-mci glamo-mci.0: Error after cmd: 0x120
[21474540.090000] SD power -> 2700mV
[21474540.090000] glamo-mci glamo-mci.0: powered (vdd = 15) clk:
195kHz div=255 (req: 195kHz). Bus width=0
[21474540.090000] glamo-mci glamo-mci.0: powered (vdd = 15) clk:
195kHz div=255 (req: 195kHz). Bus width=0
[21474540.090000] glamo-mci glamo-mci.0: powered (vdd = 15) clk:
195kHz div=255 (req: 195kHz). Bus width=0
[21474540.110000] glamo-mci glamo-mci.0: powered (vdd = 15) clk:
195kHz div=255 (req: 195kHz). Bus width=0
[21474540.160000] glamo-mci glamo-mci.0: powered (vdd = 15) clk:
195kHz div=255 (req: 195kHz). Bus width=0
[21474540.160000] glamo-mci glamo-mci.0: powered (vdd = 15) clk:
16666kHz div=2 (req: 16666kHz). Bus width=0
[21474540.160000] glamo-mci glamo-mci.0: powered (vdd = 15) clk:
16666kHz div=2 (req: 16666kHz). Bus width=2
[21474540.160000] mmc1: new high speed SDHC card at address b368
[21474540.170000] mmcblk0: mmc1:b368 USD   3.51 GiB 
[21474540.175000]  mmcblk0: p1

And some info from the driver:
debian-gta02:/sys/bus/mmc/drivers/mmcblk/mmc1:b368# cat cid
1c5356555344202010051a09de008a5b
debian-gta02:/sys/bus/mmc/drivers/mmcblk/mmc1:b368# cat csd
400e00325f5900003c1b7f800a40003f
debian-gta02:/sys/bus/mmc/drivers/mmcblk/mmc1:b368# cat scr
0235000000000000
debian-gta02:/sys/bus/mmc/drivers/mmcblk/mmc1:b368# cat name
USD  
debian-gta02:/sys/bus/mmc/drivers/mmcblk/mmc1:b368# cat fwrev 
0x0
debian-gta02:/sys/bus/mmc/drivers/mmcblk/mmc1:b368# cat hwrev 
0x1

Hope this helps. At least it works for me with an increased delay :)

Happy hacking! :)
-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav at gmail.com




More information about the openmoko-kernel mailing list