diff options
author | Venkatraman S <svenkatr@ti.com> | 2012-01-30 10:33:30 -0600 |
---|---|---|
committer | Dan Murphy <dmurphy@ti.com> | 2012-02-15 08:33:42 -0600 |
commit | 2f7103765c3511916f4bbe3cebcd27f16946041c (patch) | |
tree | ea6c34a753850d8c43feb38a2b851deabdd6acb9 /drivers/mmc/host | |
parent | 2218ae411bea76776515bb29e6a454a482eed7eb (diff) | |
download | kernel_samsung_espresso10-2f7103765c3511916f4bbe3cebcd27f16946041c.zip kernel_samsung_espresso10-2f7103765c3511916f4bbe3cebcd27f16946041c.tar.gz kernel_samsung_espresso10-2f7103765c3511916f4bbe3cebcd27f16946041c.tar.bz2 |
mmc: omap: align adma and dma table entries
mmc->max_segs to core layer was set to 1024, but
adma table entry could only hold 512 entries. Increase
adma table entry size to 1024 from 512 to avoid mismatch.
Also set max_blk_count, max_req_size to what adma can
handle.
Change-Id: I8e08ee39bfa966bdf8a6c4374aea82b34fedcc62
Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 44b79c9..e8472c1 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -125,9 +125,9 @@ #define ADMA_ERR (1 << 25) #define ADMA_XFER_INT (1 << 3) -#define ADMA_TABLE_SZ (PAGE_SIZE) -#define ADMA_TABLE_NUM_ENTRIES \ - (ADMA_TABLE_SZ / sizeof(struct adma_desc_table)) +#define DMA_TABLE_NUM_ENTRIES 1024 +#define ADMA_TABLE_SZ \ + (DMA_TABLE_NUM_ENTRIES * sizeof(struct adma_desc_table)) #define SDMA_XFER 1 #define ADMA_XFER 2 @@ -1562,6 +1562,7 @@ static int mmc_populate_adma_desc_table(struct omap_hsmmc_host *host, ADMA_XFER_VALID); } else { + dev_err(mmc_dev(host->mmc), "unexpected dmalen %d\n", dmalen); /* Each descritpor row can only support * transfer upto ADMA_MAX_XFER_PER_ROW. * If the current segment is bigger, it has to be @@ -1584,7 +1585,7 @@ static int mmc_populate_adma_desc_table(struct omap_hsmmc_host *host, } /* Setup last entry to terminate */ pdesc[i + j - 1].attr |= ADMA_XFER_END; - WARN_ON((i + j - 1) > ADMA_TABLE_NUM_ENTRIES); + WARN_ON((i + j - 1) > DMA_TABLE_NUM_ENTRIES); dev_dbg(mmc_dev(host->mmc), "ADMA table has %d entries from %d sglist\n", i + j, host->dma_len); @@ -2385,11 +2386,18 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) /* Since we do only SG emulation, we can have as many segs * as we want. */ - mmc->max_segs = 1024; + mmc->max_segs = DMA_TABLE_NUM_ENTRIES; - mmc->max_blk_size = 512; /* Block Length at max can be 1024 */ - mmc->max_blk_count = 0xFFFF; /* No. of Blocks is 16 bits */ - mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; + if (host->dma_type == ADMA_XFER) { + mmc->max_blk_size = 512; /* Block Length at max can be 1024 */ + mmc->max_blk_count = 120; /* ADMA Block size is 16 bits wide */ + mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count + * DMA_TABLE_NUM_ENTRIES; + } else { + mmc->max_blk_size = 512; /* Block Length at max can be 1024 */ + mmc->max_blk_count = 0xFFFF; /* No. of Blocks is 16 bits */ + mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; + } mmc->max_seg_size = mmc->max_req_size; mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | |