Commit 4fb213f8 authored by Adrian Hunter's avatar Adrian Hunter Committed by Ulf Hansson

mmc: sdhci: Define maximum segments

Define the maximum number of segments instead of
having the constant 128 appearing in the code in
various places.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 76fe379a
...@@ -2877,8 +2877,8 @@ int sdhci_add_host(struct sdhci_host *host) ...@@ -2877,8 +2877,8 @@ int sdhci_add_host(struct sdhci_host *host)
* descriptor for each segment, plus 1 for a nop end descriptor, * descriptor for each segment, plus 1 for a nop end descriptor,
* all multipled by the descriptor size. * all multipled by the descriptor size.
*/ */
host->adma_table_sz = (128 * 2 + 1) * 8; host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) * 8;
host->align_buffer_sz = 128 * 4; host->align_buffer_sz = SDHCI_MAX_SEGS * 4;
host->desc_sz = 8; host->desc_sz = 8;
host->align_sz = 4; host->align_sz = 4;
host->align_mask = 3; host->align_mask = 3;
...@@ -3192,11 +3192,11 @@ int sdhci_add_host(struct sdhci_host *host) ...@@ -3192,11 +3192,11 @@ int sdhci_add_host(struct sdhci_host *host)
* can do scatter/gather or not. * can do scatter/gather or not.
*/ */
if (host->flags & SDHCI_USE_ADMA) if (host->flags & SDHCI_USE_ADMA)
mmc->max_segs = 128; mmc->max_segs = SDHCI_MAX_SEGS;
else if (host->flags & SDHCI_USE_SDMA) else if (host->flags & SDHCI_USE_SDMA)
mmc->max_segs = 1; mmc->max_segs = 1;
else /* PIO */ else /* PIO */
mmc->max_segs = 128; mmc->max_segs = SDHCI_MAX_SEGS;
/* /*
* Maximum number of sectors in one transfer. Limited by DMA boundary * Maximum number of sectors in one transfer. Limited by DMA boundary
......
...@@ -266,6 +266,12 @@ ...@@ -266,6 +266,12 @@
#define SDHCI_DEFAULT_BOUNDARY_SIZE (512 * 1024) #define SDHCI_DEFAULT_BOUNDARY_SIZE (512 * 1024)
#define SDHCI_DEFAULT_BOUNDARY_ARG (ilog2(SDHCI_DEFAULT_BOUNDARY_SIZE) - 12) #define SDHCI_DEFAULT_BOUNDARY_ARG (ilog2(SDHCI_DEFAULT_BOUNDARY_SIZE) - 12)
/*
* Maximum segments assuming a 512KiB maximum requisition size and a minimum
* 4KiB page size.
*/
#define SDHCI_MAX_SEGS 128
struct sdhci_ops { struct sdhci_ops {
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
u32 (*read_l)(struct sdhci_host *host, int reg); u32 (*read_l)(struct sdhci_host *host, int reg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment