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.
This commit is contained in:
Warner Losh 2009-01-22 22:29:21 +00:00
parent 5999bbbf41
commit d78f78230d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187603

View File

@ -313,7 +313,6 @@ at91_mci_start_cmd(struct at91_mci_softc *sc, struct mmc_command *cmd)
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 *sc, struct mmc_command *cmd)
// 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)