Commit e3c418f1 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Chris Ball

mmc: SDHI: add SoC specific workaround via HW version

One of Renesas SDHI chip needs workaround to use it, and, we can judge
it based on chip version.  This patch adds very quick-hack workaround
method, since we still don't know how many chips need workaround in
the future.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 5d60e500
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include "tmio_mmc.h" #include "tmio_mmc.h"
#define EXT_ACC 0xe4
struct sh_mobile_sdhi_of_data { struct sh_mobile_sdhi_of_data {
unsigned long tmio_flags; unsigned long tmio_flags;
}; };
...@@ -137,6 +139,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -137,6 +139,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
int irq, ret, i = 0; int irq, ret, i = 0;
bool multiplexed_isr = true; bool multiplexed_isr = true;
struct tmio_mmc_dma *dma_priv; struct tmio_mmc_dma *dma_priv;
u16 ver;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) if (!res)
...@@ -218,6 +221,14 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -218,6 +221,14 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto eprobe; goto eprobe;
/*
* FIXME:
* this Workaround can be more clever method
*/
ver = sd_ctrl_read16(host, CTL_VERSION);
if (ver == 0xCB0D)
sd_ctrl_write16(host, EXT_ACC, 1);
/* /*
* Allow one or more specific (named) ISRs or * Allow one or more specific (named) ISRs or
* one or more multiplexed (un-named) ISRs. * one or more multiplexed (un-named) ISRs.
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define CTL_SDIO_IRQ_MASK 0x38 #define CTL_SDIO_IRQ_MASK 0x38
#define CTL_DMA_ENABLE 0xd8 #define CTL_DMA_ENABLE 0xd8
#define CTL_RESET_SD 0xe0 #define CTL_RESET_SD 0xe0
#define CTL_VERSION 0xe2
#define CTL_SDIO_REGS 0x100 #define CTL_SDIO_REGS 0x100
#define CTL_CLK_AND_WAIT_CTL 0x138 #define CTL_CLK_AND_WAIT_CTL 0x138
#define CTL_RESET_SDIO 0x1e0 #define CTL_RESET_SDIO 0x1e0
......
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