gen-atmel-mci driver bug?
Hello,
I'm playing with mmc/sd card on a custom board with at91sam9g20 processor. U-boot v2011.3 now runs well as I added support for AT45DB041 dataflash, which is used on my board. It's size is only 512kB so I need sd card for Linux image and rootfs. Unfortunately I still can't get mmc/sd suport working. I have a micro sd (not hc) card connected to a MCI interface port A.
It seems that it is correctly detected and initialized,
U-Boot> mmcinfo
mci: bus_hz is 132096000, setting clock 150000 Hz, block size 512
mci: setting clock 258000 Hz, block size 512
mci: bus_hz is 132096000, setting clock 0 Hz, block size 512
mci: setting clock 258000 Hz, block size 512
mci: bus_hz is 132096000, setting clock 258000 Hz, block size 512
mci: setting clock 258000 Hz, block size 512
Device: mci
Manufacturer ID: 3
OEM: 5344
Name: SU02G
Tran Speed: 25000000
Rd Block Len: 512
SD version 2.0
High Capacity: No
Capacity: 1977614336
Bus Width: 4-bit
U-Boot> fatinfo mmc 0
Interface: MMC
Device 0: Vendor: Man 035344 Snr 413f90a9 Rev: 8.0 Prod: SU02G
Type: Removable Hard Disk
Capacity: 1886.0 MB = 1.8 GB (3862528 x 512)
Partition 1: Filesystem: FAT16 " "
but there is some problem with block reading. When I try to read 1 block using eg. mmc read 0 0xaddr 0 1 it works and correct data are returned, but when reading more blocks
U-Boot> mmc read 0 0xaddr 0 3,
U-Boot> mmc read 0 0x20000000 5 3
MMC read: dev # 0, block # 5, count 3 ... mci: bus_hz is 132096000, setting clock 150002
mci: setting clock 258000 Hz, block size 512
mci: bus_hz is 132096000, setting clock 25000000 Hz, block size 512
mci: setting clock 22016000 Hz, block size 512
mci: bus_hz is 132096000, setting clock 258000 Hz, block size 512
mci: setting clock 258000 Hz, block size 512
gen_atmel_mci: CMDR 000d1052 (18) ARGR 00000a00 (SR: 0000c0d7) XFER DTIP never unset, ignoring.
the read function returns still the same data from the starting block (as I see from debug info) and it hangs then on polling while (!((status = readl(&mci->sr)) & MMCI_BIT(CMDRDY))); in gen-atmel-mci.c.
I have tried to search the source of problem, but I was not successful yet. I'm not very familiar with u-boot code so I can be missing something obvious.
Does please someone has any solution?
Here is my config regarding mmc
/* SD/MMC card */
#define CONFIG_MMC 1
#define CONFIG_GENERIC_MMC 1
#define CONFIG_GENERIC_ATMEL_MCI 1
#define CONFIG_ATMEL_MCI_PORTA 1
#define CONFIG_CMD_MMC 1
The same situation is on at91sam9260ek board, except that the card is on MCI port B. Reinhard Meyer stated that he has mmc working on this board...
best regards
Jan
Signature · 2 lines
Tato zpr?va byla vytvo?ena p?evratn?m po?tovn?m klientem Opery: http://www.opera.com/mail/