diff options
author | Alexey Brodkin <Alexey.Brodkin@synopsys.com> | 2013-11-27 17:00:52 +0400 |
---|---|---|
committer | Pantelis Antoniou <panto@antoniou-consulting.com> | 2013-12-08 14:08:47 +0200 |
commit | 9108b315f228b464379211be26f594ea3dc82cc5 (patch) | |
tree | c7bebfc6eccdf271667a4dc65bda7809cd482007 /drivers | |
parent | 18ab67559736335d743503d92b49129e505e1baf (diff) | |
download | u-boot-imx-9108b315f228b464379211be26f594ea3dc82cc5.zip u-boot-imx-9108b315f228b464379211be26f594ea3dc82cc5.tar.gz u-boot-imx-9108b315f228b464379211be26f594ea3dc82cc5.tar.bz2 |
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 <abrodkin@synopsys.com>
Cc: Mischa Jonker <mjonker@synopsys.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Amar <amarendra.xt@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Andy Fleming <afleming@freescale.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
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 38f50ce..19d9b0b 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); |