Commit 9da3cbaf authored by Ville Syrjala's avatar Ville Syrjala Committed by Pierre Ossman

at91_mci: Cover more AT91RM9200 and AT91SAM9261 errata.

According to the documentation the AT91SAM9261 MCI shares the block size
limitations of the AT91RM9200 MCI. Also the errata documentation for
AT91RM9200 and AT91SAM9261 state that stream commands are not supported.
This has not been tested on actual hardware.
Signed-off-by: default avatarVille Syrjala <syrjala@sci.fi>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 5385edc5
...@@ -520,11 +520,19 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command ...@@ -520,11 +520,19 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command
if (data) { if (data) {
if ( cpu_is_at91rm9200() && (data->blksz & 0x3) ) { if (cpu_is_at91rm9200() || cpu_is_at91sam9261()) {
pr_debug("Unsupported block size\n"); if (data->blksz & 0x3) {
cmd->error = -EINVAL; pr_debug("Unsupported block size\n");
mmc_request_done(host->mmc, host->request); cmd->error = -EINVAL;
return; mmc_request_done(host->mmc, host->request);
return;
}
if (data->flags & MMC_DATA_STREAM) {
pr_debug("Stream commands not supported\n");
cmd->error = -EINVAL;
mmc_request_done(host->mmc, host->request);
return;
}
} }
block_length = data->blksz; block_length = data->blksz;
...@@ -577,7 +585,7 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command ...@@ -577,7 +585,7 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command
mr |= AT91_MCI_PDCMODE; mr |= AT91_MCI_PDCMODE;
at91_mci_write(host, AT91_MCI_MR, mr); at91_mci_write(host, AT91_MCI_MR, mr);
if (!cpu_is_at91rm9200()) if (!(cpu_is_at91rm9200() || cpu_is_at91sam9261()))
at91_mci_write(host, AT91_MCI_BLKR, at91_mci_write(host, AT91_MCI_BLKR,
AT91_MCI_BLKR_BCNT(blocks) | AT91_MCI_BLKR_BCNT(blocks) |
AT91_MCI_BLKR_BLKLEN(block_length)); AT91_MCI_BLKR_BLKLEN(block_length));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment