nommu: Add MMU-less support for Integrator platforms
authorCatalin Marinas <catalin.marinas@arm.com>
Fri, 24 Jul 2009 11:34:57 +0000 (12:34 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 24 Jul 2009 11:34:57 +0000 (12:34 +0100)
This patch redefines the IO_ADDRESS macro in
include/asm-arm/hardware.h.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm/mach-integrator/include/mach/hardware.h
arch/arm/mach-integrator/integrator_cp.c

index 1251319..d795642 100644 (file)
 #define PCIO_BASE              PCI_IO_VADDR
 #define PCIMEM_BASE            PCI_MEMORY_VADDR
 
+#ifdef CONFIG_MMU
 /* macro to get at IO space when running virtually */
 #define IO_ADDRESS(x) (((x) >> 4) + IO_BASE) 
+#else
+#define IO_ADDRESS(x) (x)
+#endif
 
 #define pcibios_assign_all_busses()    1
 
index 4ac0405..452931b 100644 (file)
 
 #define INTCP_PA_CLCD_BASE             0xc0000000
 
-#define INTCP_VA_CIC_BASE              0xf1000040
-#define INTCP_VA_PIC_BASE              0xf1400000
-#define INTCP_VA_SIC_BASE              0xfca00000
+#define INTCP_VA_CIC_BASE              IO_ADDRESS(INTEGRATOR_HDR_BASE) + 0x40
+#define INTCP_VA_PIC_BASE              IO_ADDRESS(INTEGRATOR_IC_BASE)
+#define INTCP_VA_SIC_BASE              IO_ADDRESS(0xca000000)
 
 #define INTCP_PA_ETH_BASE              0xc8000000
 #define INTCP_ETH_SIZE                 0x10
 
-#define INTCP_VA_CTRL_BASE             0xfcb00000
+#define INTCP_VA_CTRL_BASE             IO_ADDRESS(0xcb000000)
 #define INTCP_FLASHPROG                        0x04
 #define CINTEGRATOR_FLASHPROG_FLVPPEN  (1 << 0)
 #define CINTEGRATOR_FLASHPROG_FLWREN   (1 << 1)
@@ -121,12 +121,12 @@ static struct map_desc intcp_io_desc[] __initdata = {
                .length         = SZ_4K,
                .type           = MT_DEVICE
        }, {
-               .virtual        = 0xfca00000,
+               .virtual        = IO_ADDRESS(0xca000000),
                .pfn            = __phys_to_pfn(0xca000000),
                .length         = SZ_4K,
                .type           = MT_DEVICE
        }, {
-               .virtual        = 0xfcb00000,
+               .virtual        = IO_ADDRESS(0xcb000000),
                .pfn            = __phys_to_pfn(0xcb000000),
                .length         = SZ_4K,
                .type           = MT_DEVICE
@@ -394,8 +394,8 @@ static struct platform_device *intcp_devs[] __initdata = {
  */
 static unsigned int mmc_status(struct device *dev)
 {
-       unsigned int status = readl(0xfca00004);
-       writel(8, 0xfcb00008);
+       unsigned int status = readl(IO_ADDRESS(0xca000000) + 4);
+       writel(8, IO_ADDRESS(0xcb000000) + 8);
 
        return status & 8;
 }