mmc: sdhci: Let a vendor driver supply and update ADMA descriptor size
Let a vendor driver supply the maximum descriptor size that it can operate on. ADMA descriptor table would be allocated using this supplied size. If any SD Host controller is of version prior to v4.10 spec but supports 16byte descriptor, this change allows them to supply correct descriptor size for ADMA table allocation. Also let a vendor driver update the descriptor size by overriding sdhc_host->desc_size if it has to operates on a different descriptor sizes in different conditions. Suggested-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/1579531122-28341-1-git-send-email-vbadigan@codeaurora.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:

committed by
Ulf Hansson

parent
80c7482356
commit
a663f64bf1
@@ -4043,15 +4043,13 @@ int sdhci_setup_host(struct sdhci_host *host)
|
||||
dma_addr_t dma;
|
||||
void *buf;
|
||||
|
||||
if (host->flags & SDHCI_USE_64_BIT_DMA) {
|
||||
host->adma_table_sz = host->adma_table_cnt *
|
||||
SDHCI_ADMA2_64_DESC_SZ(host);
|
||||
host->desc_sz = SDHCI_ADMA2_64_DESC_SZ(host);
|
||||
} else {
|
||||
host->adma_table_sz = host->adma_table_cnt *
|
||||
SDHCI_ADMA2_32_DESC_SZ;
|
||||
host->desc_sz = SDHCI_ADMA2_32_DESC_SZ;
|
||||
}
|
||||
if (!(host->flags & SDHCI_USE_64_BIT_DMA))
|
||||
host->alloc_desc_sz = SDHCI_ADMA2_32_DESC_SZ;
|
||||
else if (!host->alloc_desc_sz)
|
||||
host->alloc_desc_sz = SDHCI_ADMA2_64_DESC_SZ(host);
|
||||
|
||||
host->desc_sz = host->alloc_desc_sz;
|
||||
host->adma_table_sz = host->adma_table_cnt * host->desc_sz;
|
||||
|
||||
host->align_buffer_sz = SDHCI_MAX_SEGS * SDHCI_ADMA2_ALIGN;
|
||||
/*
|
||||
|
Reference in New Issue
Block a user