svn commit: r187603 - head/sys/arm/at91
Warner Losh
imp at FreeBSD.org
Thu Jan 22 14:29:22 PST 2009
Author: imp
Date: Thu Jan 22 22:29:21 2009
New Revision: 187603
URL: http://svn.freebsd.org/changeset/base/187603
Log:
Don't over-commit the DMA. Use the passed in size of the transfer
rather than a fixed 512... This fixes the mount root problem on at91.
Prior to the SD card reorg, all data transfers were 512 bytes, so we
didn't notice.
Modified:
head/sys/arm/at91/at91_mci.c
Modified: head/sys/arm/at91/at91_mci.c
==============================================================================
--- head/sys/arm/at91/at91_mci.c Thu Jan 22 21:56:41 2009 (r187602)
+++ head/sys/arm/at91/at91_mci.c Thu Jan 22 22:29:21 2009 (r187603)
@@ -313,7 +313,6 @@ at91_mci_start_cmd(struct at91_mci_softc
int i;
struct mmc_data *data;
struct mmc_request *req;
- size_t block_size = 1 << 9; // Fixed, per mmc/sd spec for 2GB cards
void *vaddr;
bus_addr_t paddr;
@@ -355,7 +354,7 @@ at91_mci_start_cmd(struct at91_mci_softc
// Set block size and turn on PDC mode for dma xfer and disable
// PDC until we're ready.
mr = RD4(sc, MCI_MR) & ~MCI_MR_BLKLEN;
- WR4(sc, MCI_MR, mr | (block_size << 16) | MCI_MR_PDCMODE);
+ WR4(sc, MCI_MR, mr | (data->len << 16) | MCI_MR_PDCMODE);
WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS);
if (cmdr & MCI_CMDR_TRCMD_START) {
if (cmdr & MCI_CMDR_TRDIR)
More information about the svn-src-head
mailing list