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/karo-tx28 | |
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/karo-tx28')
-rw-r--r-- | arch/arm/boards/karo-tx28/tx28.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/arch/arm/boards/karo-tx28/tx28.c b/arch/arm/boards/karo-tx28/tx28.c index 095b1bf0d3..b9d5454301 100644 --- a/arch/arm/boards/karo-tx28/tx28.c +++ b/arch/arm/boards/karo-tx28/tx28.c @@ -23,19 +23,6 @@ #include <mach/imx-regs.h> #include <asm/mmu.h> -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 = IMX_MEMORY_BASE, - .size = 128 * 1024 * 1024, - .platform_data = &ram_pdata, -}; - /* setup the CPU card internal signals */ static const uint32_t tx28_pad_setup[] = { /* NAND interface */ @@ -103,15 +90,16 @@ postcore_initcall(tx28_mmu_init); static int tx28_devices_init(void) { int i; + struct device_d *sdram_dev; /* initizalize gpios */ for (i = 0; i < ARRAY_SIZE(tx28_pad_setup); i++) imx_gpio_mode(tx28_pad_setup[i]); - register_device(&sdram_dev); - - armlinux_add_dram(&sdram_dev); - armlinux_set_bootparams((void *)(sdram_dev.map_base + 0x100)); + sdram_dev = add_mem_device("ram0", IMX_MEMORY_BASE, 128 * 1024 * 1024, + IORESOURCE_MEM_WRITEABLE); + armlinux_add_dram(sdram_dev); + armlinux_set_bootparams(dev_get_mem_region(sdram_dev, 0) + 0x100); armlinux_set_architecture(MACH_TYPE_TX28); base_board_init(); |