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/boards/imx21ads | |
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/boards/imx21ads')
-rw-r--r-- | arch/arm/boards/imx21ads/imx21ads.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/arm/boards/imx21ads/imx21ads.c b/arch/arm/boards/imx21ads/imx21ads.c index 2ff3d4bb77..ab47a8d8a9 100644 --- a/arch/arm/boards/imx21ads/imx21ads.c +++ b/arch/arm/boards/imx21ads/imx21ads.c @@ -48,19 +48,6 @@ static struct device_d cfi_dev = { .size = 32 * 1024 * 1024, }; -static struct memory_platform_data ram_pdata = { - .name = "ram0", - .flags = IORESOURCE_MEM_WRITEABLE, -}; - -static struct device_d sdram_dev = { - .id = -1, - .name = "mem", - .map_base = 0xc0000000, - .size = 64 * 1024 * 1024, - .platform_data = &ram_pdata, -}; - struct imx_nand_platform_data nand_info = { .width = 1, .hw_ecc = 1, @@ -145,6 +132,7 @@ core_initcall(imx21ads_timing_init); static int mx21ads_devices_init(void) { int i; + struct device_d *sdram_dev; unsigned int mode[] = { PA5_PF_LSCLK, PA6_PF_LD0, @@ -184,12 +172,13 @@ static int mx21ads_devices_init(void) imx_gpio_mode(mode[i]); register_device(&cfi_dev); - register_device(&sdram_dev); + sdram_dev = add_mem_device("ram0", 0xc0000000, 64 * 1024 * 1024, + IORESOURCE_MEM_WRITEABLE); + armlinux_add_dram(sdram_dev); imx21_add_nand(&nand_info); register_device(&cs8900_dev); imx21_add_fb(&imx_fb_data); - armlinux_add_dram(&sdram_dev); armlinux_set_bootparams((void *)0xc0000100); armlinux_set_architecture(MACH_TYPE_MX21ADS); |