U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Pohanka <xhpohanka@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] gen-atmel-mci driver bug?
Date: Wed, 01 Jun 2011 15:00:37 +0200	[thread overview]
Message-ID: <op.vweefb1nyxxkfz@localhost.localdomain> (raw)

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


-- 
Tato zpr?va byla vytvo?ena p?evratn?m po?tovn?m klientem Opery:  
http://www.opera.com/mail/

                 reply	other threads:[~2011-06-01 13:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.vweefb1nyxxkfz@localhost.localdomain \
    --to=xhpohanka@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox