diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-07-19 09:58:32 +0200 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-07-18 20:32:45 +0800 |
commit | f928efa818adfe56a08350569a9b0f3c2fb791d2 (patch) | |
tree | 4fc754655afbd235d466a5c9d7a63ce89faed24b /arch/arm/mach-nomadik | |
parent | 88618eb5f12c27be7bb4400eb13768e4c2822ae7 (diff) | |
download | barebox-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/mach-nomadik')
-rw-r--r-- | arch/arm/mach-nomadik/8815.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/arch/arm/mach-nomadik/8815.c b/arch/arm/mach-nomadik/8815.c index e742a0981d..e5adafd017 100644 --- a/arch/arm/mach-nomadik/8815.c +++ b/arch/arm/mach-nomadik/8815.c @@ -31,30 +31,13 @@ static struct clk st8815_clk_48 = { .rate = 48 * 1000 * 1000, }; -static struct memory_platform_data ram_pdata = { - .name = "ram0", - .flags = IORESOURCE_MEM_WRITEABLE, -}; - -static struct resource sdram_dev_resources[] = { - [0] = { - .start = 0x00000000, - }, -}; - -static struct device_d sdram_dev = { - .id = -1, - .name = "mem", - .num_resources = ARRAY_SIZE(sdram_dev_resources), - .resource = sdram_dev_resources, - .platform_data = &ram_pdata, -}; - void st8815_add_device_sdram(u32 size) { - sdram_dev_resources[0].size = size; - register_device(&sdram_dev); - armlinux_add_dram(&sdram_dev); + struct device_d *sdram_dev; + + sdram_dev = add_mem_device("ram0", 0x00000000, size, + IORESOURCE_MEM_WRITEABLE); + armlinux_add_dram(sdram_dev); } static struct resource uart0_serial_resources[] = { |