RealView: Move the flash definitions out of platform.h
authorCatalin Marinas <catalin.marinas@arm.com>
Fri, 18 Apr 2008 21:43:10 +0000 (22:43 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 18 Apr 2008 21:43:10 +0000 (22:43 +0100)
This patch moves the patch definitions into board-eb.h and
realview_eb.c (from core.c) as they are different on the PB11MPCore
and PB1176 platforms.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm/mach-realview/core.c
arch/arm/mach-realview/core.h
arch/arm/mach-realview/realview_eb.c
include/asm-arm/arch-realview/board-eb.h
include/asm-arm/arch-realview/platform.h

index 98aefc9f4df3bb3b81e6237b900a61d3930429fb..f3cf5712091cd4325fd1fcdb81e3931596ebcedb 100644 (file)
@@ -109,22 +109,21 @@ static struct flash_platform_data realview_flash_data = {
        .set_vpp                = realview_flash_set_vpp,
 };
 
-static struct resource realview_flash_resource = {
-       .start                  = REALVIEW_FLASH_BASE,
-       .end                    = REALVIEW_FLASH_BASE + REALVIEW_FLASH_SIZE,
-       .flags                  = IORESOURCE_MEM,
-};
-
 struct platform_device realview_flash_device = {
        .name                   = "armflash",
        .id                     = 0,
        .dev                    = {
                .platform_data  = &realview_flash_data,
        },
-       .num_resources          = 1,
-       .resource               = &realview_flash_resource,
 };
 
+int realview_flash_register(struct resource *res, u32 num)
+{
+       realview_flash_device.resource = res;
+       realview_flash_device.num_resources = num;
+       return platform_device_register(&realview_flash_device);
+}
+
 static struct resource realview_i2c_resource = {
        .start          = REALVIEW_I2C_BASE,
        .end            = REALVIEW_I2C_BASE + SZ_4K - 1,
index 492a14c0d604baa39e8234f51e3b215aca41004e..6fcaeae16db98ea36d9165167163cf80999be1f9 100644 (file)
@@ -58,5 +58,6 @@ extern unsigned int twd_size;
 
 extern void realview_leds_event(led_event_t ledevt);
 extern void realview_timer_init(unsigned int timer_irq);
+extern int realview_flash_register(struct resource *res, u32 num);
 
 #endif
index 6848e51829948c96b8a86c405db30d3533d9477d..860e3ca833edc1144c3324e2db2304644f31e1e8 100644 (file)
@@ -223,6 +223,11 @@ static struct amba_device *amba_devs[] __initdata = {
 /*
  * RealView EB platform devices
  */
+static struct resource realview_eb_flash_resource = {
+       .start                  = REALVIEW_EB_FLASH_BASE,
+       .end                    = REALVIEW_EB_FLASH_BASE + REALVIEW_EB_FLASH_SIZE - 1,
+       .flags                  = IORESOURCE_MEM,
+};
 
 static struct resource realview_eb_eth_resources[] = {
        [0] = {
@@ -362,7 +367,7 @@ static void __init realview_eb_init(void)
 
        clk_register(&realview_clcd_clk);
 
-       platform_device_register(&realview_flash_device);
+       realview_flash_register(&realview_eb_flash_resource, 1);
        platform_device_register(&realview_i2c_device);
        eth_device_register();
 
index cacfdbbc2e4e338355642ff673adea3717177659..8adb81e7d1b97f15b4cca17065d413d18bd9f609 100644 (file)
@@ -29,6 +29,9 @@
 #define REALVIEW_EB_GIC_CPU_BASE       0x10040000      /* Generic interrupt controller CPU interface */
 #define REALVIEW_EB_GIC_DIST_BASE      0x10041000      /* Generic interrupt controller distributor */
 
+#define REALVIEW_EB_FLASH_BASE         0x40000000
+#define REALVIEW_EB_FLASH_SIZE         SZ_64M
+
 #ifdef CONFIG_REALVIEW_EB_ARM11MP_REVB
 #define REALVIEW_EB11MP_SCU_BASE       0x10100000      /* SCU registers */
 #define REALVIEW_EB11MP_GIC_CPU_BASE   0x10100100      /* Generic interrupt controller CPU interface */
index 5ff6c8b303b15016219d03d1d4ea4c615b37c959..08d6f05ce0a1f52ac5eb61898733a15aeab8b5de 100644 (file)
@@ -32,9 +32,6 @@
 #define REALVIEW_SSRAM_BASE           /* REALVIEW_SSMC_BASE ? */
 #define REALVIEW_SSRAM_SIZE           SZ_2M
 
-#define REALVIEW_FLASH_BASE           0x40000000
-#define REALVIEW_FLASH_SIZE           SZ_64M
-
 /* 
  *  SDRAM
  */