summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/pcm049/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/pcm049/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/pcm049/board.c')
-rw-r--r--arch/arm/boards/pcm049/board.c36
1 files changed, 7 insertions, 29 deletions
diff --git a/arch/arm/boards/pcm049/board.c b/arch/arm/boards/pcm049/board.c
index b5d22bb9b3..1b7923f234 100644
--- a/arch/arm/boards/pcm049/board.c
+++ b/arch/arm/boards/pcm049/board.c
@@ -63,32 +63,6 @@ static int pcm049_console_init(void)
}
console_initcall(pcm049_console_init);
-static struct memory_platform_data sram_pdata = {
- .name = "sram0",
- .flags = IORESOURCE_MEM_WRITEABLE,
-};
-
-static struct device_d sram_dev = {
- .id = -1,
- .name = "mem",
- .map_base = 0x40300000,
- .size = 48 * 1024,
- .platform_data = &sram_pdata,
-};
-
-static struct memory_platform_data sdram_pdata = {
- .name = "ram0",
- .flags = IORESOURCE_MEM_WRITEABLE,
-};
-
-static struct device_d sdram_dev = {
- .id = -1,
- .name = "mem",
- .map_base = 0x80000000,
- .size = SZ_512M,
- .platform_data = &sdram_pdata,
-};
-
#ifdef CONFIG_MMU
static int pcm049_mmu_init(void)
{
@@ -141,8 +115,13 @@ static void pcm049_network_init(void)
static int pcm049_devices_init(void)
{
- register_device(&sdram_dev);
- register_device(&sram_dev);
+ struct device_d *sdram_dev;
+
+ sdram_dev = add_mem_device("ram0", 0x80000000, SZ_512M,
+ IORESOURCE_MEM_WRITEABLE);
+ armlinux_add_dram(sdram_dev);
+ add_mem_device("ram0", 0x40300000, 48 * 1024,
+ IORESOURCE_MEM_WRITEABLE);
register_device(&hsmmc_dev);
gpmc_generic_init(0x10);
@@ -160,7 +139,6 @@ static int pcm049_devices_init(void)
dev_add_bb_dev("env_raw", "env0");
#endif
- armlinux_add_dram(&sdram_dev);
armlinux_set_bootparams((void *)0x80000100);
armlinux_set_architecture(MACH_TYPE_PCM049);