aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-11-04 07:19:04 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2009-11-05 05:10:36 -0500
commit5b39d1548dc2751f8de89e6f429b6560a137eebb (patch)
treec121a4118a4da4441b8dad03362ebaab98a1867a /arch
parent9b229fa0951fb47cbc178be4bd8e9ef185b38802 (diff)
RealView: Add default memory configuration
This patch adds a realview_fixup() function called during booting to set up the memory banks. This way there is no need to pass a "mem=" argument on the kernel command line. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-realview/core.c21
-rw-r--r--arch/arm/mach-realview/core.h6
-rw-r--r--arch/arm/mach-realview/realview_eb.c1
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c13
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c1
-rw-r--r--arch/arm/mach-realview/realview_pba8.c1
-rw-r--r--arch/arm/mach-realview/realview_pbx.c1
7 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index a2083b60e3fb..c21b0fd39652 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -788,3 +788,24 @@ void __init realview_timer_init(unsigned int timer_irq)
788 realview_clocksource_init(); 788 realview_clocksource_init();
789 realview_clockevents_init(timer_irq); 789 realview_clockevents_init(timer_irq);
790} 790}
791
792/*
793 * Setup the memory banks.
794 */
795void realview_fixup(struct machine_desc *mdesc, struct tag *tags, char **from,
796 struct meminfo *meminfo)
797{
798 /*
799 * Most RealView platforms have 512MB contiguous RAM at 0x70000000.
800 * Half of this is mirrored at 0.
801 */
802#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET
803 meminfo->bank[0].start = 0x70000000;
804 meminfo->bank[0].size = SZ_512M;
805 meminfo->nr_banks = 1;
806#else
807 meminfo->bank[0].start = 0;
808 meminfo->bank[0].size = SZ_256M;
809 meminfo->nr_banks = 1;
810#endif
811}
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 699671fa6e0b..781bca68a9fa 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -25,6 +25,7 @@
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/io.h> 26#include <linux/io.h>
27 27
28#include <asm/setup.h>
28#include <asm/leds.h> 29#include <asm/leds.h>
29 30
30#define AMBA_DEVICE(name,busid,base,plat) \ 31#define AMBA_DEVICE(name,busid,base,plat) \
@@ -44,6 +45,8 @@ static struct amba_device name##_device = { \
44 /* .dma = base##_DMA,*/ \ 45 /* .dma = base##_DMA,*/ \
45} 46}
46 47
48struct machine_desc;
49
47extern struct platform_device realview_flash_device; 50extern struct platform_device realview_flash_device;
48extern struct platform_device realview_cf_device; 51extern struct platform_device realview_cf_device;
49extern struct platform_device realview_i2c_device; 52extern struct platform_device realview_i2c_device;
@@ -61,5 +64,8 @@ extern void realview_timer_init(unsigned int timer_irq);
61extern int realview_flash_register(struct resource *res, u32 num); 64extern int realview_flash_register(struct resource *res, u32 num);
62extern int realview_eth_register(const char *name, struct resource *res); 65extern int realview_eth_register(const char *name, struct resource *res);
63extern int realview_usb_register(struct resource *res); 66extern int realview_usb_register(struct resource *res);
67extern void realview_fixup(struct machine_desc *mdesc, struct tag *tags,
68 char **from, struct meminfo *meminfo);
64extern void (*realview_reset)(char); 69extern void (*realview_reset)(char);
70
65#endif 71#endif
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 1d65e64ae571..917f8ca3abff 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -415,6 +415,7 @@ MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
415 .phys_io = REALVIEW_EB_UART0_BASE, 415 .phys_io = REALVIEW_EB_UART0_BASE,
416 .io_pg_offst = (IO_ADDRESS(REALVIEW_EB_UART0_BASE) >> 18) & 0xfffc, 416 .io_pg_offst = (IO_ADDRESS(REALVIEW_EB_UART0_BASE) >> 18) & 0xfffc,
417 .boot_params = PHYS_OFFSET + 0x00000100, 417 .boot_params = PHYS_OFFSET + 0x00000100,
418 .fixup = realview_fixup,
418 .map_io = realview_eb_map_io, 419 .map_io = realview_eb_map_io,
419 .init_irq = gic_init_irq, 420 .init_irq = gic_init_irq,
420 .timer = &realview_eb_timer, 421 .timer = &realview_eb_timer,
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index a6ba147692c1..7fb726d5f8b9 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -300,6 +300,18 @@ static void realview_pb1176_reset(char mode)
300 __raw_writel(REALVIEW_PB1176_SYS_LOCKVAL_RSTCTL, hdr_ctrl); 300 __raw_writel(REALVIEW_PB1176_SYS_LOCKVAL_RSTCTL, hdr_ctrl);
301} 301}
302 302
303static void realview_pb1176_fixup(struct machine_desc *mdesc,
304 struct tag *tags, char **from,
305 struct meminfo *meminfo)
306{
307 /*
308 * RealView PB1176 only has 128MB of RAM mapped at 0.
309 */
310 meminfo->bank[0].start = 0;
311 meminfo->bank[0].size = SZ_128M;
312 meminfo->nr_banks = 1;
313}
314
303static void __init realview_pb1176_init(void) 315static void __init realview_pb1176_init(void)
304{ 316{
305 int i; 317 int i;
@@ -331,6 +343,7 @@ MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
331 .phys_io = REALVIEW_PB1176_UART0_BASE, 343 .phys_io = REALVIEW_PB1176_UART0_BASE,
332 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB1176_UART0_BASE) >> 18) & 0xfffc, 344 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB1176_UART0_BASE) >> 18) & 0xfffc,
333 .boot_params = PHYS_OFFSET + 0x00000100, 345 .boot_params = PHYS_OFFSET + 0x00000100,
346 .fixup = realview_pb1176_fixup,
334 .map_io = realview_pb1176_map_io, 347 .map_io = realview_pb1176_map_io,
335 .init_irq = gic_init_irq, 348 .init_irq = gic_init_irq,
336 .timer = &realview_pb1176_timer, 349 .timer = &realview_pb1176_timer,
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 070d284ce96e..9bbbfc05f225 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -347,6 +347,7 @@ MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
347 .phys_io = REALVIEW_PB11MP_UART0_BASE, 347 .phys_io = REALVIEW_PB11MP_UART0_BASE,
348 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE) >> 18) & 0xfffc, 348 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE) >> 18) & 0xfffc,
349 .boot_params = PHYS_OFFSET + 0x00000100, 349 .boot_params = PHYS_OFFSET + 0x00000100,
350 .fixup = realview_fixup,
350 .map_io = realview_pb11mp_map_io, 351 .map_io = realview_pb11mp_map_io,
351 .init_irq = gic_init_irq, 352 .init_irq = gic_init_irq,
352 .timer = &realview_pb11mp_timer, 353 .timer = &realview_pb11mp_timer,
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index 941beb2b9709..fe861e96c566 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -298,6 +298,7 @@ MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
298 .phys_io = REALVIEW_PBA8_UART0_BASE, 298 .phys_io = REALVIEW_PBA8_UART0_BASE,
299 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBA8_UART0_BASE) >> 18) & 0xfffc, 299 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBA8_UART0_BASE) >> 18) & 0xfffc,
300 .boot_params = PHYS_OFFSET + 0x00000100, 300 .boot_params = PHYS_OFFSET + 0x00000100,
301 .fixup = realview_fixup,
301 .map_io = realview_pba8_map_io, 302 .map_io = realview_pba8_map_io,
302 .init_irq = gic_init_irq, 303 .init_irq = gic_init_irq,
303 .timer = &realview_pba8_timer, 304 .timer = &realview_pba8_timer,
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 7e4bc6cdca52..5d09d8b4a1cb 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -345,6 +345,7 @@ MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
345 .phys_io = REALVIEW_PBX_UART0_BASE, 345 .phys_io = REALVIEW_PBX_UART0_BASE,
346 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBX_UART0_BASE) >> 18) & 0xfffc, 346 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBX_UART0_BASE) >> 18) & 0xfffc,
347 .boot_params = PHYS_OFFSET + 0x00000100, 347 .boot_params = PHYS_OFFSET + 0x00000100,
348 .fixup = realview_fixup,
348 .map_io = realview_pbx_map_io, 349 .map_io = realview_pbx_map_io,
349 .init_irq = gic_init_irq, 350 .init_irq = gic_init_irq,
350 .timer = &realview_pbx_timer, 351 .timer = &realview_pbx_timer,