summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-06-11 00:12:02 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-07-21 16:41:46 +0200
commit6872d79b7325c6ae82b79ab5c8a0b3eb0181e50f (patch)
tree74122bbb21568d778dd616e5f34cc9f8d24fe2ea
parent86ef24563b71107546feb26f041477ae57f47d9a (diff)
downloadbarebox-6872d79b7325c6ae82b79ab5c8a0b3eb0181e50f.tar.gz
barebox-6872d79b7325c6ae82b79ab5c8a0b3eb0181e50f.tar.xz
register sdram devices correctly
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--board/at91sam9260ek/init.c10
-rw-r--r--board/eco920/eco920.c10
-rw-r--r--board/freescale-mx35-3-stack/3stack.c10
-rw-r--r--board/imx21ads/imx21ads.c10
-rw-r--r--board/imx27ads/imx27ads.c10
-rw-r--r--board/ipe337/ipe337.c10
-rw-r--r--board/kp_ukd_r1_num/kp_ukd_r1_num.c10
-rw-r--r--board/mmccpu/init.c10
-rw-r--r--board/netx/netx.c10
-rw-r--r--board/omap/board-beagle.c14
-rw-r--r--board/omap/board-sdp343x.c11
-rw-r--r--board/pcm030/pcm030.c21
-rw-r--r--board/pcm038/pcm038.c17
-rw-r--r--board/pcm043/pcm043.c10
-rw-r--r--board/phycard-i.MX27/pca100.c10
-rw-r--r--board/phycore_mcf54xx/phyCore_MCF54xx.c10
-rw-r--r--board/pm9263/init.c10
-rw-r--r--board/scb9328/scb9328.c1
18 files changed, 129 insertions, 65 deletions
diff --git a/board/at91sam9260ek/init.c b/board/at91sam9260ek/init.c
index f6fb684d74..75149222d5 100644
--- a/board/at91sam9260ek/init.c
+++ b/board/at91sam9260ek/init.c
@@ -62,12 +62,16 @@ static struct device_d nand_dev = {
.platform_data = &nand_pdata,
};
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data sram_pdata = {
+ .name = "sram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0x20000000,
.size = 64 * 1024 * 1024,
+ .platform_data = &sram_pdata,
};
static struct at91sam_ether_platform_data macb_pdata = {
diff --git a/board/eco920/eco920.c b/board/eco920/eco920.c
index cf1a3c2b8e..103622e5a8 100644
--- a/board/eco920/eco920.c
+++ b/board/eco920/eco920.c
@@ -50,12 +50,16 @@ struct device_d cfi_dev = {
.platform_data = &cfi_info,
};
-struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0x20000000,
.size = 32 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
static struct device_d at91_ath_dev = {
diff --git a/board/freescale-mx35-3-stack/3stack.c b/board/freescale-mx35-3-stack/3stack.c
index 408ddf7f03..94cb9bb019 100644
--- a/board/freescale-mx35-3-stack/3stack.c
+++ b/board/freescale-mx35-3-stack/3stack.c
@@ -46,12 +46,16 @@ static struct device_d cfi_dev = {
.size = 64 * 1024 * 1024,
};
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0x80000000,
.size = 128 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
static struct fec_platform_data fec_info = {
diff --git a/board/imx21ads/imx21ads.c b/board/imx21ads/imx21ads.c
index 93b68ad680..20dd9676f1 100644
--- a/board/imx21ads/imx21ads.c
+++ b/board/imx21ads/imx21ads.c
@@ -44,12 +44,16 @@ static struct device_d cfi_dev = {
.size = 32 * 1024 * 1024,
};
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0xc0000000,
.size = 64 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
struct imx_nand_platform_data nand_info = {
diff --git a/board/imx27ads/imx27ads.c b/board/imx27ads/imx27ads.c
index b9543df2d1..2163fa1ba0 100644
--- a/board/imx27ads/imx27ads.c
+++ b/board/imx27ads/imx27ads.c
@@ -41,12 +41,16 @@ static struct device_d cfi_dev = {
.size = 32 * 1024 * 1024,
};
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0xa0000000,
.size = 128 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
static struct fec_platform_data fec_info = {
diff --git a/board/ipe337/ipe337.c b/board/ipe337/ipe337.c
index ea949b1274..3aa1be8924 100644
--- a/board/ipe337/ipe337.c
+++ b/board/ipe337/ipe337.c
@@ -12,12 +12,16 @@ static struct device_d cfi_dev = {
.size = 32 * 1024 * 1024,
};
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0x0,
.size = 128 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
static struct device_d smc911x_dev = {
diff --git a/board/kp_ukd_r1_num/kp_ukd_r1_num.c b/board/kp_ukd_r1_num/kp_ukd_r1_num.c
index 64f2e7aaae..dcfee2c1c2 100644
--- a/board/kp_ukd_r1_num/kp_ukd_r1_num.c
+++ b/board/kp_ukd_r1_num/kp_ukd_r1_num.c
@@ -95,12 +95,16 @@ static struct device_d network_dev1 = {
/*
* 128MiB of SDRAM, data width is 32 bit
*/
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram_dev = {
+ .name = "mem",
.map_base = CFG_SDRAM_ADDRESS,
.size = CFG_SDRAM_SIZE,
+ .platform_data = &ram_pdata,
};
static int mcfv4e_devices_init(void)
diff --git a/board/mmccpu/init.c b/board/mmccpu/init.c
index b51da70941..9f4a9900c6 100644
--- a/board/mmccpu/init.c
+++ b/board/mmccpu/init.c
@@ -35,12 +35,16 @@
#include <linux/mtd/nand.h>
#include <asm/arch/ether.h>
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0x20000000,
.size = 128 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
static struct device_d cfi_dev = {
diff --git a/board/netx/netx.c b/board/netx/netx.c
index 968d37ae49..d3fc6dc099 100644
--- a/board/netx/netx.c
+++ b/board/netx/netx.c
@@ -39,12 +39,16 @@ static struct device_d cfi_dev = {
.size = 32 * 1024 * 1024,
};
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0x80000000,
.size = 64 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
struct netx_eth_platform_data eth0_data = {
diff --git a/board/omap/board-beagle.c b/board/omap/board-beagle.c
index 58adc3ed18..b7b89f9e26 100644
--- a/board/omap/board-beagle.c
+++ b/board/omap/board-beagle.c
@@ -236,12 +236,16 @@ static int beagle_console_init(void)
console_initcall(beagle_console_init);
#endif /* CONFIG_DRIVER_SERIAL_NS16550 */
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data sram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
- .map_base = 0x80000000,
- .size = 128 * 1024 * 1024,
+static struct device_d sdram_dev = {
+ .name = "mem",
+ .map_base = 0x80000000,
+ .size = 128 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
#ifndef CONFIG_CMD_MEMORY
diff --git a/board/omap/board-sdp343x.c b/board/omap/board-sdp343x.c
index 96ecb98256..f6f389e3f2 100644
--- a/board/omap/board-sdp343x.c
+++ b/board/omap/board-sdp343x.c
@@ -634,12 +634,17 @@ static int sdp3430_flash_init(void)
#endif
return 0;
}
-struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+
+struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0x80000000,
.size = 128 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
/*------------------------- RAM Devices -------------------------------------*/
diff --git a/board/pcm030/pcm030.c b/board/pcm030/pcm030.c
index 73f1baecd3..e26af00da9 100644
--- a/board/pcm030/pcm030.c
+++ b/board/pcm030/pcm030.c
@@ -50,17 +50,16 @@ struct device_d cfi_dev = {
.size = 16 * 1024 * 1024,
};
-struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0x0,
.size = 64 * 1024 * 1024,
-};
-
-struct device_d scratch_dev = {
- .name = "ram",
- .id = "scratch0",
+ .platform_data = &ram_pdata,
};
static struct mpc5xxx_fec_platform_data fec_info = {
@@ -74,18 +73,12 @@ struct device_d eth_dev = {
.platform_data = &fec_info,
};
-#define SCRATCHMEM_SIZE (1024 * 1024 * 4)
-
static int devices_init (void)
{
register_device(&cfi_dev);
register_device(&sdram_dev);
register_device(&eth_dev);
- scratch_dev.map_base = (unsigned long)sbrk_no_zero(SCRATCHMEM_SIZE);
- scratch_dev.size = SCRATCHMEM_SIZE;
- register_device(&scratch_dev);
-
devfs_add_partition("nor0", 0x00f00000, 0x40000, PARTITION_FIXED, "self");
devfs_add_partition("nor0", 0x00f60000, 0x20000, PARTITION_FIXED, "env");
diff --git a/board/pcm038/pcm038.c b/board/pcm038/pcm038.c
index 6013ea949d..7866499686 100644
--- a/board/pcm038/pcm038.c
+++ b/board/pcm038/pcm038.c
@@ -46,17 +46,28 @@ static struct device_d cfi_dev = {
.size = 32 * 1024 * 1024,
};
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+
static struct device_d sdram_dev = {
- .name = "ram",
+ .name = "mem",
.map_base = 0xa0000000,
.size = 128 * 1024 * 1024,
+ .platform_data = &ram_pdata,
+};
+
+static struct memory_platform_data sram_pdata = {
+ .name = "sram0",
+ .flags = DEVFS_RDWR,
};
static struct device_d sram_dev = {
- .name = "ram",
- .id = "sram0",
+ .name = "mem",
.map_base = 0xc8000000,
.size = 512 * 1024, /* Can be up to 2MiB */
+ .platform_data = &sram_pdata,
};
static struct fec_platform_data fec_info = {
diff --git a/board/pcm043/pcm043.c b/board/pcm043/pcm043.c
index e8523b7db7..a01e94482c 100644
--- a/board/pcm043/pcm043.c
+++ b/board/pcm043/pcm043.c
@@ -66,12 +66,16 @@ static struct device_d fec_dev = {
.platform_data = &fec_info,
};
-static struct device_d sdram0_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram0_dev = {
+ .name = "mem",
.map_base = IMX_SDRAM_CS0,
.size = 128 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
struct imx_nand_platform_data nand_info = {
diff --git a/board/phycard-i.MX27/pca100.c b/board/phycard-i.MX27/pca100.c
index 00bbeb426f..160b8cea99 100644
--- a/board/phycard-i.MX27/pca100.c
+++ b/board/phycard-i.MX27/pca100.c
@@ -38,12 +38,16 @@
#include <asm/arch/imx-pll.h>
#include <gpio.h>
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0xa0000000,
.size = 128 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
static struct fec_platform_data fec_info = {
diff --git a/board/phycore_mcf54xx/phyCore_MCF54xx.c b/board/phycore_mcf54xx/phyCore_MCF54xx.c
index 2b0b52f1d5..279307788c 100644
--- a/board/phycore_mcf54xx/phyCore_MCF54xx.c
+++ b/board/phycore_mcf54xx/phyCore_MCF54xx.c
@@ -79,13 +79,17 @@ static struct device_d network_dev1 =
/*
* 128MiB of SDRAM, data width is 32 bit
*/
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+
static struct device_d sdram_dev =
{
- .name = "ram",
- .id = "ram0",
-
+ .name = "mem",
.map_base = CFG_SDRAM_ADDRESS,
.size = CFG_SDRAM_SIZE,
+ .platform_data = &ram_pdata,
};
static int mcfv4e_devices_init(void)
diff --git a/board/pm9263/init.c b/board/pm9263/init.c
index 29a87d7e47..fd0102edc7 100644
--- a/board/pm9263/init.c
+++ b/board/pm9263/init.c
@@ -35,12 +35,16 @@
#include <linux/mtd/nand.h>
#include <asm/arch/ether.h>
-static struct device_d sdram_dev = {
- .name = "ram",
- .id = "ram0",
+static struct memory_platform_data ram_pdata = {
+ .name = "ram0",
+ .flags = DEVFS_RDWR,
+};
+static struct device_d sdram_dev = {
+ .name = "mem",
.map_base = 0x20000000,
.size = 64 * 1024 * 1024,
+ .platform_data = &ram_pdata,
};
static struct device_d cfi_dev = {
diff --git a/board/scb9328/scb9328.c b/board/scb9328/scb9328.c
index 72938de6d7..80d60378d0 100644
--- a/board/scb9328/scb9328.c
+++ b/board/scb9328/scb9328.c
@@ -47,7 +47,6 @@ static struct memory_platform_data sdram_pdata = {
static struct device_d sdram_dev = {
.name = "mem",
-
.map_base = 0x08000000,
.size = 16 * 1024 * 1024,
.platform_data = &sdram_pdata,