summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/panda/board.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-07-19 09:58:32 +0200
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-07-18 20:32:45 +0800
commitf928efa818adfe56a08350569a9b0f3c2fb791d2 (patch)
tree4fc754655afbd235d466a5c9d7a63ce89faed24b /arch/arm/boards/panda/board.c
parent88618eb5f12c27be7bb4400eb13768e4c2822ae7 (diff)
downloadbarebox-f928efa818adfe56a08350569a9b0f3c2fb791d2.tar.gz
barebox-f928efa818adfe56a08350569a9b0f3c2fb791d2.tar.xz
add a add_mem_device function
Add a helper function for boards to register their memory devices. This makes the board code smaller and also helps getting rid of map_base and struct memory_platform_data. And switch all of the memory to it 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/panda/board.c')
-rw-r--r--arch/arm/boards/panda/board.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index 43fa0d9a99..c5b1e5cc6e 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -52,19 +52,6 @@ static int panda_console_init(void)
}
console_initcall(panda_console_init);
-static struct memory_platform_data sram_pdata = {
- .name = "ram0",
- .flags = IORESOURCE_MEM_WRITEABLE,
-};
-
-static struct device_d sdram_dev = {
- .id = -1,
- .name = "mem",
- .map_base = 0x80000000,
- .size = SZ_1G,
- .platform_data = &sram_pdata,
-};
-
#ifdef CONFIG_MMU
static int panda_mmu_init(void)
{
@@ -145,6 +132,8 @@ static struct device_d hsmmc_dev = {
static int panda_devices_init(void)
{
+ struct device_d *sdram_dev;
+
panda_boardrev_init();
if (gpio_get_value(182)) {
@@ -171,11 +160,12 @@ static int panda_devices_init(void)
sr32(OMAP44XX_SCRM_ALTCLKSRC, 2, 2, 0x3);
}
- register_device(&sdram_dev);
+ sdram_dev = add_mem_device("ram0", 0x80000000, SZ_1G,
+ IORESOURCE_MEM_WRITEABLE);
+ armlinux_add_dram(sdram_dev);
register_device(&hsmmc_dev);
panda_ehci_init();
- armlinux_add_dram(&sdram_dev);
armlinux_set_bootparams((void *)0x80000100);
armlinux_set_architecture(MACH_TYPE_OMAP4_PANDA);