summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-realview
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2008-04-18 22:43:10 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2008-04-18 22:43:10 +0100
commita44ddfd5bf5354281eebd0f0ae0d6dcf8818fc5c (patch)
tree9f377ae5af5ab2d1ec802dde4b3c2451b197b649 /arch/arm/mach-realview
parent073b6ff3b94c4737c91c45ed0f0c4d40cf1cb1c8 (diff)
downloadblackbird-op-linux-a44ddfd5bf5354281eebd0f0ae0d6dcf8818fc5c.tar.gz
blackbird-op-linux-a44ddfd5bf5354281eebd0f0ae0d6dcf8818fc5c.zip
RealView: Move the flash definitions out of platform.h
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>
Diffstat (limited to 'arch/arm/mach-realview')
-rw-r--r--arch/arm/mach-realview/core.c15
-rw-r--r--arch/arm/mach-realview/core.h1
-rw-r--r--arch/arm/mach-realview/realview_eb.c7
3 files changed, 14 insertions, 9 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 98aefc9f4df3..f3cf5712091c 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -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,
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 492a14c0d604..6fcaeae16db9 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -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
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 6848e5182994..860e3ca833ed 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -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();
OpenPOWER on IntegriCloud