@@ -111,7 +111,9 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
if (ret != 0)
goto err;
}
-
+ davinci_sysmodbase = ioremap_nocache(DAVINCI_SYSTEM_MODULE_BASE, 0x800);
+ if (!davinci_sysmodbase)
+ return;
return;
err:
@@ -33,6 +33,8 @@
#define DM365_MMCSD0_BASE 0x01D11000
#define DM365_MMCSD1_BASE 0x01D00000
+void __iomem *davinci_sysmodbase;
+
static struct resource i2c_resources[] = {
{
.start = DAVINCI_I2C_BASE,
@@ -209,9 +211,7 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
davinci_cfg_reg(DM355_SD1_DATA2);
davinci_cfg_reg(DM355_SD1_DATA3);
} else if (cpu_is_davinci_dm365()) {
- void __iomem *pupdctl1 =
- IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE + 0x7c);
-
+ void __iomem *pupdctl1 = DAVINCI_SYSMODULE_VIRT(0x7c);
/* Configure pull down control */
__raw_writel((__raw_readl(pupdctl1) & ~0xfc0),
pupdctl1);
@@ -243,9 +243,7 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0;
} else if (cpu_is_davinci_dm644x()) {
/* REVISIT: should this be in board-init code? */
- void __iomem *base =
- IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
-
+ void __iomem *base = DAVINCI_SYSMODULE_VIRT(0);
/* Power-on 3.3V IO cells */
__raw_writel(0, base + DM64XX_VDD3P3V_PWDN);
/*Set up the pull regiter for MMC */
@@ -24,6 +24,11 @@
/* System control register offsets */
#define DM64XX_VDD3P3V_PWDN 0x48
+#ifndef __ASSEMBLER__
+ extern void __iomem *davinci_sysmodbase;
+ #define DAVINCI_SYSMODULE_VIRT(x) (davinci_sysmodbase+(x))
+#endif
+
/*
* I/O mapping
*/