aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-realview
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2008-04-18 17:43:10 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2008-04-18 17:43:10 -0400
commita44ddfd5bf5354281eebd0f0ae0d6dcf8818fc5c (patch)
tree9f377ae5af5ab2d1ec802dde4b3c2451b197b649 /arch/arm/mach-realview
parent073b6ff3b94c4737c91c45ed0f0c4d40cf1cb1c8 (diff)
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 = {
109 .set_vpp = realview_flash_set_vpp, 109 .set_vpp = realview_flash_set_vpp,
110}; 110};
111 111
112static struct resource realview_flash_resource = {
113 .start = REALVIEW_FLASH_BASE,
114 .end = REALVIEW_FLASH_BASE + REALVIEW_FLASH_SIZE,
115 .flags = IORESOURCE_MEM,
116};
117
118struct platform_device realview_flash_device = { 112struct platform_device realview_flash_device = {
119 .name = "armflash", 113 .name = "armflash",
120 .id = 0, 114 .id = 0,
121 .dev = { 115 .dev = {
122 .platform_data = &realview_flash_data, 116 .platform_data = &realview_flash_data,
123 }, 117 },
124 .num_resources = 1,
125 .resource = &realview_flash_resource,
126}; 118};
127 119
120int realview_flash_register(struct resource *res, u32 num)
121{
122 realview_flash_device.resource = res;
123 realview_flash_device.num_resources = num;
124 return platform_device_register(&realview_flash_device);
125}
126
128static struct resource realview_i2c_resource = { 127static struct resource realview_i2c_resource = {
129 .start = REALVIEW_I2C_BASE, 128 .start = REALVIEW_I2C_BASE,
130 .end = REALVIEW_I2C_BASE + SZ_4K - 1, 129 .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;
58 58
59extern void realview_leds_event(led_event_t ledevt); 59extern void realview_leds_event(led_event_t ledevt);
60extern void realview_timer_init(unsigned int timer_irq); 60extern void realview_timer_init(unsigned int timer_irq);
61extern int realview_flash_register(struct resource *res, u32 num);
61 62
62#endif 63#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 = {
223/* 223/*
224 * RealView EB platform devices 224 * RealView EB platform devices
225 */ 225 */
226static struct resource realview_eb_flash_resource = {
227 .start = REALVIEW_EB_FLASH_BASE,
228 .end = REALVIEW_EB_FLASH_BASE + REALVIEW_EB_FLASH_SIZE - 1,
229 .flags = IORESOURCE_MEM,
230};
226 231
227static struct resource realview_eb_eth_resources[] = { 232static struct resource realview_eb_eth_resources[] = {
228 [0] = { 233 [0] = {
@@ -362,7 +367,7 @@ static void __init realview_eb_init(void)
362 367
363 clk_register(&realview_clcd_clk); 368 clk_register(&realview_clcd_clk);
364 369
365 platform_device_register(&realview_flash_device); 370 realview_flash_register(&realview_eb_flash_resource, 1);
366 platform_device_register(&realview_i2c_device); 371 platform_device_register(&realview_i2c_device);
367 eth_device_register(); 372 eth_device_register();
368 373