ARM: OMAP4+: Make control module register structure generic

A seperate omap_sys_ctrl_regs structure is defined for
omap4 & 5. If there is any change in control module for
any of the ES versions, a new structure needs to be created.
In order to remove this dependency, making the register
structure generic for all the omap4+ boards.

Signed-off-by: R Sricharan <r.sricharan@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@ti.com>
This commit is contained in:
Lokesh Vutla
2013-02-04 04:22:04 +00:00
committed by Tom Rini
parent e05a4f1f54
commit c43c8339fe
11 changed files with 269 additions and 206 deletions

View File

@@ -95,18 +95,15 @@ static inline int omap_mmc_setup_gpio_in(int gpio, const char *label)
static void omap4_vmmc_pbias_config(struct mmc *mmc)
{
u32 value = 0;
struct omap_sys_ctrl_regs *const ctrl =
(struct omap_sys_ctrl_regs *) SYSCTRL_GENERAL_CORE_BASE;
value = readl(&ctrl->control_pbiaslite);
value = readl((*ctrl)->control_pbiaslite);
value &= ~(MMC1_PBIASLITE_PWRDNZ | MMC1_PWRDNZ);
writel(value, &ctrl->control_pbiaslite);
writel(value, (*ctrl)->control_pbiaslite);
/* set VMMC to 3V */
twl6030_power_mmc_init();
value = readl(&ctrl->control_pbiaslite);
value = readl((*ctrl)->control_pbiaslite);
value |= MMC1_PBIASLITE_VMODE | MMC1_PBIASLITE_PWRDNZ | MMC1_PWRDNZ;
writel(value, &ctrl->control_pbiaslite);
writel(value, (*ctrl)->control_pbiaslite);
}
#endif
@@ -114,26 +111,24 @@ static void omap4_vmmc_pbias_config(struct mmc *mmc)
static void omap5_pbias_config(struct mmc *mmc)
{
u32 value = 0;
struct omap_sys_ctrl_regs *const ctrl =
(struct omap_sys_ctrl_regs *) SYSCTRL_GENERAL_CORE_BASE;
value = readl(&ctrl->control_pbias);
value = readl((*ctrl)->control_pbias);
value &= ~(SDCARD_PWRDNZ | SDCARD_BIAS_PWRDNZ);
value |= SDCARD_BIAS_HIZ_MODE;
writel(value, &ctrl->control_pbias);
writel(value, (*ctrl)->control_pbias);
twl6035_mmc1_poweron_ldo();
value = readl(&ctrl->control_pbias);
value = readl((*ctrl)->control_pbias);
value &= ~SDCARD_BIAS_HIZ_MODE;
value |= SDCARD_PBIASLITE_VMODE | SDCARD_PWRDNZ | SDCARD_BIAS_PWRDNZ;
writel(value, &ctrl->control_pbias);
writel(value, (*ctrl)->control_pbias);
value = readl(&ctrl->control_pbias);
value = readl((*ctrl)->control_pbias);
if (value & (1 << 23)) {
value &= ~(SDCARD_PWRDNZ | SDCARD_BIAS_PWRDNZ);
value |= SDCARD_BIAS_HIZ_MODE;
writel(value, &ctrl->control_pbias);
writel(value, (*ctrl)->control_pbias);
}
}
#endif