提交 f4670dae 编写于 作者: U Ulf Hansson 提交者: Russell King

ARM: 7623/1: mmc: mmci: Fixup clock gating when freq is 0 for ST-variants

In the ST Micro variant, the MMCICLOCK register must not be used to
gate the clock. Instead use MMCIPOWER register and by clearing the
PWR_ON bit to do this.
Signed-off-by: NJohan Rudholm <johan.rudholm@stericsson.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 8259293a
...@@ -60,6 +60,7 @@ static unsigned int fmax = 515633; ...@@ -60,6 +60,7 @@ static unsigned int fmax = 515633;
* @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register
* @pwrreg_powerup: power up value for MMCIPOWER register * @pwrreg_powerup: power up value for MMCIPOWER register
* @signal_direction: input/out direction of bus signals can be indicated * @signal_direction: input/out direction of bus signals can be indicated
* @pwrreg_clkgate: MMCIPOWER register must be used to gate the clock
*/ */
struct variant_data { struct variant_data {
unsigned int clkreg; unsigned int clkreg;
...@@ -72,6 +73,7 @@ struct variant_data { ...@@ -72,6 +73,7 @@ struct variant_data {
bool blksz_datactrl16; bool blksz_datactrl16;
u32 pwrreg_powerup; u32 pwrreg_powerup;
bool signal_direction; bool signal_direction;
bool pwrreg_clkgate;
}; };
static struct variant_data variant_arm = { static struct variant_data variant_arm = {
...@@ -96,6 +98,7 @@ static struct variant_data variant_u300 = { ...@@ -96,6 +98,7 @@ static struct variant_data variant_u300 = {
.sdio = true, .sdio = true,
.pwrreg_powerup = MCI_PWR_ON, .pwrreg_powerup = MCI_PWR_ON,
.signal_direction = true, .signal_direction = true,
.pwrreg_clkgate = true,
}; };
static struct variant_data variant_nomadik = { static struct variant_data variant_nomadik = {
...@@ -107,6 +110,7 @@ static struct variant_data variant_nomadik = { ...@@ -107,6 +110,7 @@ static struct variant_data variant_nomadik = {
.st_clkdiv = true, .st_clkdiv = true,
.pwrreg_powerup = MCI_PWR_ON, .pwrreg_powerup = MCI_PWR_ON,
.signal_direction = true, .signal_direction = true,
.pwrreg_clkgate = true,
}; };
static struct variant_data variant_ux500 = { static struct variant_data variant_ux500 = {
...@@ -119,6 +123,7 @@ static struct variant_data variant_ux500 = { ...@@ -119,6 +123,7 @@ static struct variant_data variant_ux500 = {
.st_clkdiv = true, .st_clkdiv = true,
.pwrreg_powerup = MCI_PWR_ON, .pwrreg_powerup = MCI_PWR_ON,
.signal_direction = true, .signal_direction = true,
.pwrreg_clkgate = true,
}; };
static struct variant_data variant_ux500v2 = { static struct variant_data variant_ux500v2 = {
...@@ -132,6 +137,7 @@ static struct variant_data variant_ux500v2 = { ...@@ -132,6 +137,7 @@ static struct variant_data variant_ux500v2 = {
.blksz_datactrl16 = true, .blksz_datactrl16 = true,
.pwrreg_powerup = MCI_PWR_ON, .pwrreg_powerup = MCI_PWR_ON,
.signal_direction = true, .signal_direction = true,
.pwrreg_clkgate = true,
}; };
/* /*
...@@ -1150,6 +1156,13 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -1150,6 +1156,13 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
} }
} }
/*
* If clock = 0 and the variant requires the MMCIPOWER to be used for
* gating the clock, the MCI_PWR_ON bit is cleared.
*/
if (!ios->clock && variant->pwrreg_clkgate)
pwr &= ~MCI_PWR_ON;
spin_lock_irqsave(&host->lock, flags); spin_lock_irqsave(&host->lock, flags);
mmci_set_clkreg(host, ios->clock); mmci_set_clkreg(host, ios->clock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册