forked from Minki/linux
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>
This commit is contained in:
parent
9b229fa095
commit
5b39d1548d
@ -788,3 +788,24 @@ void __init realview_timer_init(unsigned int timer_irq)
|
||||
realview_clocksource_init();
|
||||
realview_clockevents_init(timer_irq);
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup the memory banks.
|
||||
*/
|
||||
void realview_fixup(struct machine_desc *mdesc, struct tag *tags, char **from,
|
||||
struct meminfo *meminfo)
|
||||
{
|
||||
/*
|
||||
* Most RealView platforms have 512MB contiguous RAM at 0x70000000.
|
||||
* Half of this is mirrored at 0.
|
||||
*/
|
||||
#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET
|
||||
meminfo->bank[0].start = 0x70000000;
|
||||
meminfo->bank[0].size = SZ_512M;
|
||||
meminfo->nr_banks = 1;
|
||||
#else
|
||||
meminfo->bank[0].start = 0;
|
||||
meminfo->bank[0].size = SZ_256M;
|
||||
meminfo->nr_banks = 1;
|
||||
#endif
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <linux/amba/bus.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/leds.h>
|
||||
|
||||
#define AMBA_DEVICE(name,busid,base,plat) \
|
||||
@ -44,6 +45,8 @@ static struct amba_device name##_device = { \
|
||||
/* .dma = base##_DMA,*/ \
|
||||
}
|
||||
|
||||
struct machine_desc;
|
||||
|
||||
extern struct platform_device realview_flash_device;
|
||||
extern struct platform_device realview_cf_device;
|
||||
extern struct platform_device realview_i2c_device;
|
||||
@ -61,5 +64,8 @@ extern void realview_timer_init(unsigned int timer_irq);
|
||||
extern int realview_flash_register(struct resource *res, u32 num);
|
||||
extern int realview_eth_register(const char *name, struct resource *res);
|
||||
extern int realview_usb_register(struct resource *res);
|
||||
extern void realview_fixup(struct machine_desc *mdesc, struct tag *tags,
|
||||
char **from, struct meminfo *meminfo);
|
||||
extern void (*realview_reset)(char);
|
||||
|
||||
#endif
|
||||
|
@ -415,6 +415,7 @@ MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
|
||||
.phys_io = REALVIEW_EB_UART0_BASE,
|
||||
.io_pg_offst = (IO_ADDRESS(REALVIEW_EB_UART0_BASE) >> 18) & 0xfffc,
|
||||
.boot_params = PHYS_OFFSET + 0x00000100,
|
||||
.fixup = realview_fixup,
|
||||
.map_io = realview_eb_map_io,
|
||||
.init_irq = gic_init_irq,
|
||||
.timer = &realview_eb_timer,
|
||||
|
@ -300,6 +300,18 @@ static void realview_pb1176_reset(char mode)
|
||||
__raw_writel(REALVIEW_PB1176_SYS_LOCKVAL_RSTCTL, hdr_ctrl);
|
||||
}
|
||||
|
||||
static void realview_pb1176_fixup(struct machine_desc *mdesc,
|
||||
struct tag *tags, char **from,
|
||||
struct meminfo *meminfo)
|
||||
{
|
||||
/*
|
||||
* RealView PB1176 only has 128MB of RAM mapped at 0.
|
||||
*/
|
||||
meminfo->bank[0].start = 0;
|
||||
meminfo->bank[0].size = SZ_128M;
|
||||
meminfo->nr_banks = 1;
|
||||
}
|
||||
|
||||
static void __init realview_pb1176_init(void)
|
||||
{
|
||||
int i;
|
||||
@ -331,6 +343,7 @@ MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
|
||||
.phys_io = REALVIEW_PB1176_UART0_BASE,
|
||||
.io_pg_offst = (IO_ADDRESS(REALVIEW_PB1176_UART0_BASE) >> 18) & 0xfffc,
|
||||
.boot_params = PHYS_OFFSET + 0x00000100,
|
||||
.fixup = realview_pb1176_fixup,
|
||||
.map_io = realview_pb1176_map_io,
|
||||
.init_irq = gic_init_irq,
|
||||
.timer = &realview_pb1176_timer,
|
||||
|
@ -347,6 +347,7 @@ MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
|
||||
.phys_io = REALVIEW_PB11MP_UART0_BASE,
|
||||
.io_pg_offst = (IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE) >> 18) & 0xfffc,
|
||||
.boot_params = PHYS_OFFSET + 0x00000100,
|
||||
.fixup = realview_fixup,
|
||||
.map_io = realview_pb11mp_map_io,
|
||||
.init_irq = gic_init_irq,
|
||||
.timer = &realview_pb11mp_timer,
|
||||
|
@ -298,6 +298,7 @@ MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
|
||||
.phys_io = REALVIEW_PBA8_UART0_BASE,
|
||||
.io_pg_offst = (IO_ADDRESS(REALVIEW_PBA8_UART0_BASE) >> 18) & 0xfffc,
|
||||
.boot_params = PHYS_OFFSET + 0x00000100,
|
||||
.fixup = realview_fixup,
|
||||
.map_io = realview_pba8_map_io,
|
||||
.init_irq = gic_init_irq,
|
||||
.timer = &realview_pba8_timer,
|
||||
|
@ -345,6 +345,7 @@ MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
|
||||
.phys_io = REALVIEW_PBX_UART0_BASE,
|
||||
.io_pg_offst = (IO_ADDRESS(REALVIEW_PBX_UART0_BASE) >> 18) & 0xfffc,
|
||||
.boot_params = PHYS_OFFSET + 0x00000100,
|
||||
.fixup = realview_fixup,
|
||||
.map_io = realview_pbx_map_io,
|
||||
.init_irq = gic_init_irq,
|
||||
.timer = &realview_pbx_timer,
|
||||
|
Loading…
Reference in New Issue
Block a user