diff options
| author | Alexey Brodkin <[email protected]> | 2013-11-27 17:00:52 +0400 |
|---|---|---|
| committer | Pantelis Antoniou <[email protected]> | 2013-12-08 14:08:47 +0200 |
| commit | 9108b315f228b464379211be26f594ea3dc82cc5 (patch) | |
| tree | c7bebfc6eccdf271667a4dc65bda7809cd482007 /drivers | |
| parent | 18ab67559736335d743503d92b49129e505e1baf (diff) | |
mmc/dwmmc: modify FIFO threshold only if value explicitly set
If platform provides "host->fifoth_val" it will be used for
initialization of DWMCI_FIFOTH register. Otherwise default value will be
used.
This implementation allows:
* escape unclear and recursive calculations that are currently in use
* use whatever custom value for DWMCI_FIFOTH initialization if any
particular SoC requires it
Signed-off-by: Alexey Brodkin <[email protected]>
Cc: Mischa Jonker <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Rajeshwari Shinde <[email protected]>
Cc: Jaehoon Chung <[email protected]>
Cc: Amar <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Minkyu Kang <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Pantelis Antoniou <[email protected]>
Cc: Andy Fleming <[email protected]>
Acked-by: Jaehoon Chung <[email protected]>
Acked-by: Pantelis Antoniou <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/mmc/dw_mmc.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 38f50ce0d8c..19d9b0b899c 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -299,7 +299,6 @@ static void dwmci_set_ios(struct mmc *mmc) static int dwmci_init(struct mmc *mmc) { struct dwmci_host *host = (struct dwmci_host *)mmc->priv; - u32 fifo_size; if (host->board_init) host->board_init(host); @@ -322,13 +321,9 @@ static int dwmci_init(struct mmc *mmc) dwmci_writel(host, DWMCI_IDINTEN, 0); dwmci_writel(host, DWMCI_BMOD, 1); - if (!host->fifoth_val) { - fifo_size = dwmci_readl(host, DWMCI_FIFOTH); - fifo_size = ((fifo_size & RX_WMARK_MASK) >> RX_WMARK_SHIFT) + 1; - host->fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size / 2 - 1) | - TX_WMARK(fifo_size / 2); + if (host->fifoth_val) { + dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val); } - dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val); dwmci_writel(host, DWMCI_CLKENA, 0); dwmci_writel(host, DWMCI_CLKSRC, 0); |
