[ARM] 5396/1: RealView: Use PATA_PLATFORM to access the CompactFlash
authorCatalin Marinas <catalin.marinas@arm.com>
Thu, 12 Feb 2009 14:59:21 +0000 (15:59 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 19 Feb 2009 11:30:26 +0000 (11:30 +0000)
This driver adds the platform_device definitions to allow the use of
CompactFlash on the RealView PB11MPCore and PB-A8 platforms. Note that
the CompactFlash controller is expected to be initialised by the Boot
Monitor and support the True IDE mode.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-realview/Kconfig
arch/arm/mach-realview/core.c
arch/arm/mach-realview/core.h
arch/arm/mach-realview/include/mach/board-pba8.h
arch/arm/mach-realview/include/mach/platform.h
arch/arm/mach-realview/realview_pb11mp.c
arch/arm/mach-realview/realview_pba8.c

index ad911854eb4cfd51558e9666db9359205b132674..b6ec106277762dbf71fdccc95d943750e4a5792f 100644 (file)
@@ -35,6 +35,7 @@ config MACH_REALVIEW_PB11MP
        bool "Support RealView/PB11MPCore platform"
        select CPU_V6
        select ARM_GIC
+       select HAVE_PATA_PLATFORM
        help
          Include support for the ARM(R) RealView MPCore Platform Baseboard.
          PB11MPCore is a platform with an on-board ARM11MPCore and has
@@ -51,6 +52,7 @@ config MACH_REALVIEW_PBA8
        bool "Support RealView/PB-A8 platform"
        select CPU_V7
        select ARM_GIC
+       select HAVE_PATA_PLATFORM
        help
          Include support for the ARM(R) RealView Cortex-A8 Platform Baseboard.
          PB-A8 is a platform with an on-board Cortex-A8 and has support for
index 27b48be73676077e57f1e57433917331a4dcccfc..51972ecfc5069b9c1ac71eae9c1442aff1a82395 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/clockchips.h>
 #include <linux/io.h>
 #include <linux/smc911x.h>
+#include <linux/ata_platform.h>
 
 #include <asm/clkdev.h>
 #include <asm/system.h>
@@ -150,6 +151,33 @@ int realview_eth_register(const char *name, struct resource *res)
        return platform_device_register(&realview_eth_device);
 }
 
+static struct pata_platform_info pata_platform_data = {
+       .ioport_shift           = 1,
+};
+
+static struct resource pata_resources[] = {
+       [0] = {
+               .start          = REALVIEW_CF_BASE,
+               .end            = REALVIEW_CF_BASE + 0xff,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = REALVIEW_CF_BASE + 0x100,
+               .end            = REALVIEW_CF_BASE + SZ_4K - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
+struct platform_device realview_cf_device = {
+       .name                   = "pata_platform",
+       .id                     = -1,
+       .num_resources          = ARRAY_SIZE(pata_resources),
+       .resource               = pata_resources,
+       .dev                    = {
+               .platform_data  = &pata_platform_data,
+       },
+};
+
 static struct resource realview_i2c_resource = {
        .start          = REALVIEW_I2C_BASE,
        .end            = REALVIEW_I2C_BASE + SZ_4K - 1,
index 44269b162d4918e468542ab58a3627cda43c014d..0ba1bfb1fe6bed61c6576754be40c858a15d394d 100644 (file)
@@ -45,6 +45,7 @@ static struct amba_device name##_device = {                   \
 }
 
 extern struct platform_device realview_flash_device;
+extern struct platform_device realview_cf_device;
 extern struct platform_device realview_i2c_device;
 extern struct mmc_platform_data realview_mmc0_plat_data;
 extern struct mmc_platform_data realview_mmc1_plat_data;
index c8bed8f58bab403b6eae9b61960002f51dc74f54..307f97b16e5b85425c9cd6a300200537035a3973 100644 (file)
@@ -45,8 +45,6 @@
 #define REALVIEW_PBA8_DMC_BASE                 0x100E0000      /* DMC configuration */
 #define REALVIEW_PBA8_SMC_BASE                 0x100E1000      /* SMC configuration */
 #define REALVIEW_PBA8_CAN_BASE                 0x100E2000      /* CAN bus */
-#define REALVIEW_PBA8_CF_BASE                  0x18000000      /* Compact flash */
-#define REALVIEW_PBA8_CF_MEM_BASE              0x18003000      /* SMC for Compact flash */
 #define REALVIEW_PBA8_GIC_CPU_BASE             0x1E000000      /* Generic interrupt controller CPU interface */
 #define REALVIEW_PBA8_FLASH0_BASE              0x40000000
 #define REALVIEW_PBA8_FLASH0_SIZE              SZ_64M
index 793a3a3327121152072645828237c9d3f17c9e8d..c8f50835fed2fcd69f76cdfb98fe6749411b2541 100644 (file)
 #define REALVIEW_SDRAM67_BASE         0x70000000       /* SDRAM banks 6 and 7 */
 #define REALVIEW_LT_BASE              0x80000000       /* Logic Tile expansion */
 
+/*
+ * CompactFlash
+ */
+#define REALVIEW_CF_BASE               0x18000000      /* CompactFlash */
+#define REALVIEW_CF_MEM_BASE           0x18003000      /* SMC for CompactFlash */
+
 /*
  * Disk on Chip
  */
index 3ebdb2dadd6f02c2430fc657a8fc9e51b81d85cb..ff50ec2e4320b646af9b49e16233c79e9394a136 100644 (file)
@@ -230,31 +230,6 @@ static struct resource realview_pb11mp_smsc911x_resources[] = {
        },
 };
 
-struct resource realview_pb11mp_cf_resources[] = {
-       [0] = {
-               .start          = REALVIEW_PB11MP_CF_BASE,
-               .end            = REALVIEW_PB11MP_CF_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = REALVIEW_PB11MP_CF_MEM_BASE,
-               .end            = REALVIEW_PB11MP_CF_MEM_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start          = -1,           /* FIXME: Find correct irq */
-               .end            = -1,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-struct platform_device realview_pb11mp_cf_device = {
-       .name           = "compactflash",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(realview_pb11mp_cf_resources),
-       .resource       = realview_pb11mp_cf_resources,
-};
-
 static void __init gic_init_irq(void)
 {
        unsigned int pldctrl;
@@ -308,7 +283,7 @@ static void __init realview_pb11mp_init(void)
                                ARRAY_SIZE(realview_pb11mp_flash_resource));
        realview_eth_register(NULL, realview_pb11mp_smsc911x_resources);
        platform_device_register(&realview_i2c_device);
-       platform_device_register(&realview_pb11mp_cf_device);
+       platform_device_register(&realview_cf_device);
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
                struct amba_device *d = amba_devs[i];
index 34c94435d2d83c716a532dcd0b03c3ba342c5155..c6147cba25782d847048766518cfa329582a8bde 100644 (file)
@@ -221,31 +221,6 @@ static struct resource realview_pba8_smsc911x_resources[] = {
        },
 };
 
-struct resource realview_pba8_cf_resources[] = {
-       [0] = {
-               .start          = REALVIEW_PBA8_CF_BASE,
-               .end            = REALVIEW_PBA8_CF_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start          = REALVIEW_PBA8_CF_MEM_BASE,
-               .end            = REALVIEW_PBA8_CF_MEM_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start          = -1,           /* FIXME: Find correct irq */
-               .end            = -1,
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-struct platform_device realview_pba8_cf_device = {
-       .name           = "compactflash",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(realview_pba8_cf_resources),
-       .resource       = realview_pba8_cf_resources,
-};
-
 static void __init gic_init_irq(void)
 {
        /* ARM PB-A8 on-board GIC */
@@ -276,7 +251,7 @@ static void __init realview_pba8_init(void)
                                ARRAY_SIZE(realview_pba8_flash_resource));
        realview_eth_register(NULL, realview_pba8_smsc911x_resources);
        platform_device_register(&realview_i2c_device);
-       platform_device_register(&realview_pba8_cf_device);
+       platform_device_register(&realview_cf_device);
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
                struct amba_device *d = amba_devs[i];