diff options
author | Takeshi Saito <takeshi.saito.xv@renesas.com> | 2019-02-21 20:38:05 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2019-02-26 10:01:49 +0100 |
commit | 5603731a15ef9ca317c122cc8c959f1dee1798b4 (patch) | |
tree | ccfd515046ddb145f736fefb3fe2e39a00259766 /drivers/mmc/host/tmio_mmc.h | |
parent | 5c27ff5db1491a947264d6d4e4cbe43ae6535bae (diff) | |
download | linux-5603731a15ef9ca317c122cc8c959f1dee1798b4.tar.gz linux-5603731a15ef9ca317c122cc8c959f1dee1798b4.tar.bz2 linux-5603731a15ef9ca317c122cc8c959f1dee1798b4.zip |
mmc: tmio: fix access width of Block Count Register
In R-Car Gen2 or later, the maximum number of transfer blocks are
changed from 0xFFFF to 0xFFFFFFFF. Therefore, Block Count Register
should use iowrite32().
If another system (U-boot, Hypervisor OS, etc) uses bit[31:16], this
value will not be cleared. So, SD/MMC card initialization fails.
So, check for the bigger register and use apropriate write. Also, mark
the register as extended on Gen2.
Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
[wsa: use max_blk_count in if(), add Gen2, update commit message]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: stable@kernel.org
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
[Ulf: Fixed build error]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/tmio_mmc.h')
-rw-r--r-- | drivers/mmc/host/tmio_mmc.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index c03529e3f01a..2adb0d24360f 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -277,6 +277,11 @@ static inline void sd_ctrl_write32_as_16_and_16(struct tmio_mmc_host *host, iowrite16(val >> 16, host->ctl + ((addr + 2) << host->bus_shift)); } +static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val) +{ + iowrite32(val, host->ctl + (addr << host->bus_shift)); +} + static inline void sd_ctrl_write32_rep(struct tmio_mmc_host *host, int addr, const u32 *buf, int count) { |