summaryrefslogtreecommitdiffstats
path: root/arch/x86/boards
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/x86/boards
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/x86/boards')
-rw-r--r--arch/x86/boards/x86_generic/generic_pc.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/arch/x86/boards/x86_generic/generic_pc.c b/arch/x86/boards/x86_generic/generic_pc.c
index efd081d436..fa2975f016 100644
--- a/arch/x86/boards/x86_generic/generic_pc.c
+++ b/arch/x86/boards/x86_generic/generic_pc.c
@@ -30,19 +30,6 @@
#include <asm/syslib.h>
#include <ns16550.h>
-static struct memory_platform_data ram_pdata = {
- .name = "ram0",
- .flags = IORESOURCE_MEM_WRITEABLE,
-};
-
-static struct device_d sdram_dev = {
- .id = -1,
- .name = "mem",
- .size = 16 * 1024 * 1024,
- .map_base = 0,
- .platform_data = &ram_pdata,
-};
-
static struct device_d bios_disk_dev = {
.id = -1,
.name = "biosdrive",
@@ -70,7 +57,8 @@ static int devices_init(void)
sdram_dev.size = bios_get_memsize(); /* extended memory only */
sdram_dev.size <<= 10;
- register_device(&sdram_dev);
+ add_mem_device("ram0", 0x0, 16 * 1024 * 1024,
+ IORESOURCE_MEM_WRITEABLE);
register_device(&bios_disk_dev);
if (pers_env_size != PATCH_AREA_PERS_SIZE_UNUSED) {