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/pcm043/pcm043.c | |
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/pcm043/pcm043.c')
-rw-r--r-- | arch/arm/boards/pcm043/pcm043.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/arch/arm/boards/pcm043/pcm043.c b/arch/arm/boards/pcm043/pcm043.c index ab88617d3e..0cfd6751fb 100644 --- a/arch/arm/boards/pcm043/pcm043.c +++ b/arch/arm/boards/pcm043/pcm043.c @@ -61,19 +61,6 @@ static struct fec_platform_data fec_info = { .xcv_type = MII100, }; -static struct memory_platform_data ram_pdata = { - .name = "ram0", - .flags = IORESOURCE_MEM_WRITEABLE, -}; - -static struct device_d sdram0_dev = { - .id = -1, - .name = "mem", - .map_base = IMX_SDRAM_CS0, - .size = 128 * 1024 * 1024, - .platform_data = &ram_pdata, -}; - struct imx_nand_platform_data nand_info = { .width = 1, .hw_ecc = 1, @@ -149,6 +136,7 @@ struct gpio_led led0 = { static int imx35_devices_init(void) { + struct device_d *sdram_dev; uint32_t reg; /* CS0: Nor Flash */ @@ -189,10 +177,12 @@ static int imx35_devices_init(void) } } - register_device(&sdram0_dev); + + sdram_dev = add_mem_device("ram0", IMX_SDRAM_CS0, 128 * 1024 * 1024, + IORESOURCE_MEM_WRITEABLE); + armlinux_add_dram(sdram_dev); imx35_add_fb(&ipu_fb_data); - armlinux_add_dram(&sdram0_dev); armlinux_set_bootparams((void *)0x80000100); armlinux_set_architecture(MACH_TYPE_PCM043); |