From f9f35ee93821048bbace895c5c688bafbda2c3f3 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 29 Jul 2011 11:43:48 +0200 Subject: ARM boards: move sdram setup before mmu setup The new MMU setup will need SDRAM base addresses and sizes. For this reason convert the MMU enabled ARM boards: - move mem setup to mem_initcall. This is early but still makes sure that we already have the console available - move MMU setup in this initcall temporary as after the mmu_init will generic Signed-off-by: Sascha Hauer Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- arch/arm/boards/a9m2440/a9m2440.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'arch/arm/boards/a9m2440') diff --git a/arch/arm/boards/a9m2440/a9m2440.c b/arch/arm/boards/a9m2440/a9m2440.c index c5b467a603..89c9cdf57e 100644 --- a/arch/arm/boards/a9m2440/a9m2440.c +++ b/arch/arm/boards/a9m2440/a9m2440.c @@ -72,11 +72,8 @@ static void a9m2440_disable_second_sdram_bank(void) writel(readl(MISCCR) | (1 << 18), MISCCR); /* disable clock */ } -static int a9m2440_devices_init(void) +static int a9m2440_mem_init(void) { - uint32_t reg; - struct device_d *sdram_dev; - /* * The special SDRAM setup code for this machine will always enable * both SDRAM banks. But the second SDRAM device may not exists! @@ -106,6 +103,16 @@ static int a9m2440_devices_init(void) break; } + arm_add_mem_device("ram0", CS6_BASE, s3c24x0_get_memory_size()); + + return 0; +} +mem_initcall(a9m2440_mem_init); + +static int a9m2440_devices_init(void) +{ + uint32_t reg; + /* ----------- configure the access to the outer space ---------- */ reg = readl(BWSCON); @@ -128,7 +135,6 @@ static int a9m2440_devices_init(void) /* ----------- the devices the boot loader should work with -------- */ add_generic_device("s3c24x0_nand", -1, NULL, S3C24X0_NAND_BASE, 0, IORESOURCE_MEM, &nand_info); - sdram_dev = arm_add_mem_device("ram0", CS6_BASE, s3c24x0_get_memory_size()); /* * cs8900 network controller onboard * Connected to CS line 5 + A24 and interrupt line EINT9, @@ -145,7 +151,7 @@ static int a9m2440_devices_init(void) devfs_add_partition("nand0", 0x40000, 0x20000, PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); #endif - armlinux_set_bootparams(dev_get_mem_region(sdram_dev, 0) + 0x100); + armlinux_set_bootparams((void*)CS6_BASE + 0x100); armlinux_set_architecture(MACH_TYPE_A9M2440); return 0; -- cgit v1.2.3