summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/phycard-i.MX27/pca100.c
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/arm/boards/phycard-i.MX27/pca100.c
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/arm/boards/phycard-i.MX27/pca100.c')
-rw-r--r--arch/arm/boards/phycard-i.MX27/pca100.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c
index 2eba3e4959..63216f523e 100644
--- a/arch/arm/boards/phycard-i.MX27/pca100.c
+++ b/arch/arm/boards/phycard-i.MX27/pca100.c
@@ -41,19 +41,6 @@
#include <mach/iomux-mx27.h>
#include <mach/devices-imx27.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 = 0xa0000000,
- .size = 128 * 1024 * 1024,
- .platform_data = &ram_pdata,
-};
-
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.phy_addr = 1,
@@ -150,6 +137,7 @@ static int pca100_devices_init(void)
{
int i;
struct device_d *nand;
+ struct device_d *sdram_dev;
unsigned int mode[] = {
PD0_AIN_FEC_TXD0,
@@ -224,7 +212,9 @@ static int pca100_devices_init(void)
imx_gpio_mode(mode[i]);
imx27_add_nand(&nand_info);
- register_device(&sdram_dev);
+ sdram_dev = add_mem_device("ram0", 0xa0000000, 128 * 1024 * 1024,
+ IORESOURCE_MEM_WRITEABLE);
+ armlinux_add_dram(sdram_dev);
imx27_add_fec(&fec_info);
imx27_add_mmc0(NULL);
@@ -241,7 +231,6 @@ static int pca100_devices_init(void)
devfs_add_partition("nand0", 0x40000, 0x20000, PARTITION_FIXED, "env_raw");
dev_add_bb_dev("env_raw", "env0");
- armlinux_add_dram(&sdram_dev);
armlinux_set_bootparams((void *)0xa0000100);
armlinux_set_architecture(2149);