mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
mmc: sdhci: add adma_table_cnt member to struct sdhci_host
This patch adds adma_table_cnt member to struct sdhci_host to give more flexibility to drivers to control the ADMA table count. Default value of adma_table_cnt is set to (SDHCI_MAX_SEGS * 2 + 1). Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
1ff537bd5d
commit
e93be38af1
2 changed files with 12 additions and 8 deletions
|
@ -3324,6 +3324,13 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
|
||||||
|
|
||||||
host->sdma_boundary = SDHCI_DEFAULT_BOUNDARY_ARG;
|
host->sdma_boundary = SDHCI_DEFAULT_BOUNDARY_ARG;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The DMA table descriptor count is calculated as the maximum
|
||||||
|
* number of segments times 2, to allow for an alignment
|
||||||
|
* descriptor for each segment, plus 1 for a nop end descriptor.
|
||||||
|
*/
|
||||||
|
host->adma_table_cnt = SDHCI_MAX_SEGS * 2 + 1;
|
||||||
|
|
||||||
return host;
|
return host;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3569,18 +3576,12 @@ int sdhci_setup_host(struct sdhci_host *host)
|
||||||
dma_addr_t dma;
|
dma_addr_t dma;
|
||||||
void *buf;
|
void *buf;
|
||||||
|
|
||||||
/*
|
|
||||||
* The DMA descriptor table size is calculated as the maximum
|
|
||||||
* number of segments times 2, to allow for an alignment
|
|
||||||
* descriptor for each segment, plus 1 for a nop end descriptor,
|
|
||||||
* all multipled by the descriptor size.
|
|
||||||
*/
|
|
||||||
if (host->flags & SDHCI_USE_64_BIT_DMA) {
|
if (host->flags & SDHCI_USE_64_BIT_DMA) {
|
||||||
host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) *
|
host->adma_table_sz = host->adma_table_cnt *
|
||||||
SDHCI_ADMA2_64_DESC_SZ;
|
SDHCI_ADMA2_64_DESC_SZ;
|
||||||
host->desc_sz = SDHCI_ADMA2_64_DESC_SZ;
|
host->desc_sz = SDHCI_ADMA2_64_DESC_SZ;
|
||||||
} else {
|
} else {
|
||||||
host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) *
|
host->adma_table_sz = host->adma_table_cnt *
|
||||||
SDHCI_ADMA2_32_DESC_SZ;
|
SDHCI_ADMA2_32_DESC_SZ;
|
||||||
host->desc_sz = SDHCI_ADMA2_32_DESC_SZ;
|
host->desc_sz = SDHCI_ADMA2_32_DESC_SZ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -564,6 +564,9 @@ struct sdhci_host {
|
||||||
/* Host SDMA buffer boundary. */
|
/* Host SDMA buffer boundary. */
|
||||||
u32 sdma_boundary;
|
u32 sdma_boundary;
|
||||||
|
|
||||||
|
/* Host ADMA table count */
|
||||||
|
u32 adma_table_cnt;
|
||||||
|
|
||||||
u64 data_timeout;
|
u64 data_timeout;
|
||||||
|
|
||||||
unsigned long private[0] ____cacheline_aligned;
|
unsigned long private[0] ____cacheline_aligned;
|
||||||
|
|
Loading…
Add table
Reference in a new issue