mmc: tmio: fix access width of Block Count Register
authorTakeshi Saito <takeshi.saito.xv@renesas.com>
Thu, 21 Feb 2019 19:38:05 +0000 (20:38 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 26 Feb 2019 09:01:49 +0000 (10:01 +0100)
commit5603731a15ef9ca317c122cc8c959f1dee1798b4
treeccfd515046ddb145f736fefb3fe2e39a00259766
parent5c27ff5db1491a947264d6d4e4cbe43ae6535bae
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>
drivers/mmc/host/renesas_sdhi_sys_dmac.c
drivers/mmc/host/tmio_mmc.h
drivers/mmc/host/tmio_mmc_core.c