summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/a9m2440
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-07-29 11:43:48 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-08-01 16:32:00 +0200
commitf9f35ee93821048bbace895c5c688bafbda2c3f3 (patch)
treeadab257c88226972d58ae3e47aeea7f7a3ae36b5 /arch/arm/boards/a9m2440
parent2222dbc28668e478ec27cff13f8d4c9498d8519a (diff)
downloadbarebox-f9f35ee93821048bbace895c5c688bafbda2c3f3.tar.gz
barebox-f9f35ee93821048bbace895c5c688bafbda2c3f3.tar.xz
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 <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'arch/arm/boards/a9m2440')
-rw-r--r--arch/arm/boards/a9m2440/a9m2440.c18
1 files changed, 12 insertions, 6 deletions
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;