[U-Boot] gen_atmel_mci freeze on at91sam9g45

eric cariat cariat.eric at gmail.com
Sat Dec 4 18:08:32 CET 2010


Hi,

I'm currently working on a custom board with an at91sam9g45 : I followed the
instruction in README.atmel_mci. In U-boot, if I use the command mmcinfo,
the system hang. The uSD is working correctly with at91bootstrap and linux.
In U-boot everything seems fine, the card exchange a few command and
response, and then freeze on the command 55 51 (the first command that will
receive some data on DAT0 ) :

U-Boot> mmcinfo
mci: bus_hz is 133333333, setting clock 150000 Hz, block size 512
mci: setting clock 260416 Hz, block size 512
mci: bus_hz is 133333333, setting clock 0 Hz, block size 512
mci: setting clock 260416 Hz, block size 512
mci: bus_hz is 133333333, setting clock 260416 Hz, block size 512
mci: setting clock 260416 Hz, block size 512
gen_atmel_mci: CMDR 00001000 ( 0) ARGR 00000000 (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 00001048 ( 8) ARGR 000001aa (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 00001077 (55) ARGR 00000000 (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 00001069 (41) ARGR 40300000 (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 00001077 (55) ARGR 00000000 (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 00001069 (41) ARGR 40300000 (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 00001082 ( 2) ARGR 00000000 (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 00001043 ( 3) ARGR 00000000 (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 00001089 ( 9) ARGR 88f70000 (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 000010c7 ( 7) ARGR 88f70000 (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 00001077 (55) ARGR 88f70000 (SR: 00000000) DEBUG
gen_atmel_mci: CMDR 00051073 (51) ARGR 00000000 (SR: 00000000) DEBUG
Read Data:
00000000: 02 25 00 00 00 00 00 00    .%......
filling rest of block...

then everything freeze ...
But if I add some printf to debug , just after the
mci_data_op=mci_data_read() in gen_atmel_mci, then everything is OK and I
can now use the uSD without any problem.
Here is where I add the printf, so uSD is correctly handled :

diff -crbN u-boot-2010.09.orig/drivers/mmc/gen_atmel_mci.c
u-boot-2010.09/drivers/mmc/gen_atmel_mci.c
*** u-boot-2010.09.orig/drivers/mmc/gen_atmel_mci.c    2010-09-28
23:20:55.000000000 +0200
--- u-boot-2010.09/drivers/mmc/gen_atmel_mci.c    2010-12-04
17:52:59.092770689 +0100
***************
*** 252,257 ****
--- 252,258 ----
              while (!status && word_count < (sys_blocksize / 4)) {
                  status = mci_data_op(mci, &dummy,
                      error_flags);
+                 printf("status=%x\n",status);
                  word_count++;
              }
              if (status) {

 The result (status) from mci_data_op (=mci_data_read()) is always 0.  It's
a bit like if there was a timeout not correctly handled. I had the same
sympton on different uSD. Actually U-boot is started by At91Bootstrap, so
some HMCI register are probably not at there default value ?
Any advice to investigate further ?

best regards,

Eric Cariat


More information about the U-Boot mailing list