Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31654
b: refs/heads/master
c: bab7696
h: refs/heads/master
v: v3
  • Loading branch information
Pierre Ossman authored and Russell King committed Jul 2, 2006
1 parent d4d0374 commit e5575b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a406f5a3b68ee1db2306a2ba1c9b00dbd3505d05
refs/heads/master: bab7696184bbf0ea48d56902bd1f9ac983079ad2
13 changes: 9 additions & 4 deletions trunk/drivers/mmc/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
DBG("tsac %d ms nsac %d clk\n",
data->timeout_ns / 1000000, data->timeout_clks);

/* Sanity checks */
BUG_ON(data->blksz * data->blocks > 524288);

/* timeout in us */
target_timeout = data->timeout_ns / 1000 +
data->timeout_clks / host->clock;
Expand Down Expand Up @@ -375,7 +378,9 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
host->remain = host->cur_sg->length;
}

writew(data->blksz, host->ioaddr + SDHCI_BLOCK_SIZE);
/* We do not handle DMA boundaries, so set it to max (512 KiB) */
writew(SDHCI_MAKE_BLKSZ(7, data->blksz),
host->ioaddr + SDHCI_BLOCK_SIZE);
writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT);
}

Expand Down Expand Up @@ -1188,10 +1193,10 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
mmc->max_phys_segs = 16;

/*
* Maximum number of sectors in one transfer. Limited by sector
* count register.
* Maximum number of sectors in one transfer. Limited by DMA boundary
* size (512KiB), which means (512 KiB/512=) 1024 entries.
*/
mmc->max_sectors = 0x3FFF;
mmc->max_sectors = 1024;

/*
* Maximum segment size. Could be one segment with the maximum number
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/mmc/sdhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define SDHCI_DMA_ADDRESS 0x00

#define SDHCI_BLOCK_SIZE 0x04
#define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF))

#define SDHCI_BLOCK_COUNT 0x06

Expand Down

0 comments on commit e5575b0

Please sign in to comment.