From: Reinhard Meyer <u-boot@emk-elektronik.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [Question]AT91: MMC read and multiple read failed
Date: Mon, 11 Jul 2011 12:27:01 +0200 [thread overview]
Message-ID: <4E1ACFF5.2010208@emk-elektronik.de> (raw)
In-Reply-To: <4C79549CB6F772498162A641D92D5328021822AD@penmb01.corp.atmel.com>
Dear Song, Elen,
> [snip]
>>> static int mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
>>> {
>>> ...
>>> cmdr = mci_encode_cmd(cmd, data,&error_flags);
>>>
>>> /* Send the command */
>>>
>>> +if ((cmd->cmdidx == MMC_CMD_READ_MULTIPLE_BLOCK) ||(cmd->cmdidx == MMC_CMD_WRITE_MULTIPLE_BLOCK))
>>> +{
>>> + writel(data->blocks|mmc->read_bl_len<<16,&mci->blkr);
>>> +}
>
>> can't we write that register for all commands (remove the if)?
> I guess no. Other place ,like "sd_switch" function use it ,but it is not a real read or write.so do not need to set block count.I've tested,the code will stuck.
>>>
>>> writel(cmd->cmdarg,&mci->argr);
>>> writel(cmdr,&mci->cmdr);
I do not think that the code gets stuck while writing a parameter register
with any value, since a command has not been issued to the chip.
It might be that the command gets stuck when an unsuitable value is in one of the
parameter registers.
That itself would require to write another value to BLKR in case of such commands
and not let the value be undefined or residual from a previous command.
>>> [snip]
Another observation: it must be ensured that data->blocks is less than 65536!
Best Regards,
Reinhard
next prev parent reply other threads:[~2011-07-11 10:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-11 8:42 [U-Boot] [Question]AT91: MMC read and multiple read failed Song, Elen
2011-07-11 9:05 ` Reinhard Meyer
2011-07-11 10:13 ` Song, Elen
2011-07-11 10:27 ` Reinhard Meyer [this message]
2011-07-12 2:52 ` Song, Elen
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=4E1ACFF5.2010208@emk-elektronik.de \
--to=u-boot@emk-elektronik.de \
--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