mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] mem: convert to DEVFS_MEM_BAREBOX_ONLY for freescale-mx25-3-stack/pcm037/pvm038
Date: Wed, 17 Nov 2010 14:59:25 +0100	[thread overview]
Message-ID: <1290002365-22712-2-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20101112180228.GC13661@game.jcrosoft.org>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/freescale-mx25-3-stack/3stack.c |   35 ++++++++---------------
 arch/arm/boards/pcm037/pcm037.c                 |   33 +++++++--------------
 arch/arm/boards/pcm038/pcm038.c                 |   23 ++++-----------
 3 files changed, 29 insertions(+), 62 deletions(-)

diff --git a/arch/arm/boards/freescale-mx25-3-stack/3stack.c b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
index cb9ce79..434bd7f 100644
--- a/arch/arm/boards/freescale-mx25-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
@@ -113,8 +113,14 @@ static struct fec_platform_data fec_info = {
 	.phy_addr	= 1,
 };
 
-static struct resource sdram0_dev_resources[] = {
+static struct resource sdram_dev_resources[] = {
 	[0] = {
+		.name	= "sram0",
+		.start	= 0x78000000,
+		.size	= 128 * 1024,
+		.flags	= DEVFS_RDWR | DEVFS_MEM_BAREBOX_ONLY,
+	},
+	[1] = {
 		.name	= "ram0",
 		.start	= IMX_SDRAM_CS0,
 #if defined CONFIG_FREESCALE_MX25_3STACK_SDRAM_64MB_DDR2
@@ -128,27 +134,11 @@ static struct resource sdram0_dev_resources[] = {
 	},
 };
 
-static struct device_d sdram0_dev = {
-	.id	  = -1,
-	.name     = "mem",
-	.num_resources	= ARRAY_SIZE(sdram0_dev_resources),
-	.resource	= sdram0_dev_resources,
-};
-
-static struct resource sram0_dev_resources[] = {
-	[0] = {
-		.name	= "sram0",
-		.start	= 0x78000000,
-		.size	= 128 * 1024,
-		.flags	= DEVFS_RDWR,
-	},
-};
-
-static struct device_d sram0_dev = {
+static struct device_d sdram_dev = {
 	.id	  = -1,
 	.name     = "mem",
-	.num_resources	= ARRAY_SIZE(sram0_dev_resources),
-	.resource	= sram0_dev_resources,
+	.num_resources	= ARRAY_SIZE(sdram_dev_resources),
+	.resource	= sdram_dev_resources,
 };
 
 struct imx_nand_platform_data nand_info = {
@@ -266,13 +256,12 @@ static int imx25_devices_init(void)
 	devfs_add_partition("nand0", 0x40000, 0x20000, PARTITION_FIXED, "env_raw");
 	dev_add_bb_dev("env_raw", "env0");
 
-	register_device(&sdram0_dev);
-	register_device(&sram0_dev);
+	register_device(&sdram_dev);
 
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
 	imx25_add_i2c0(NULL);
 
-	armlinux_add_dram(&sdram0_dev);
+	armlinux_add_dram(&sdram_dev);
 	armlinux_set_bootparams((void *)0x80000100);
 	armlinux_set_architecture(MACH_TYPE_MX25_3DS);
 	armlinux_set_serial(imx_uid());
diff --git a/arch/arm/boards/pcm037/pcm037.c b/arch/arm/boards/pcm037/pcm037.c
index a1783af..1045950 100644
--- a/arch/arm/boards/pcm037/pcm037.c
+++ b/arch/arm/boards/pcm037/pcm037.c
@@ -58,26 +58,6 @@ static struct device_d cfi_dev = {
 };
 
 /*
- * up to 2MiB static RAM type memory, connected
- * to CS4, data width is 16 bit
- */
-static struct resource sram_dev_resources[] = {
-	[0] = {
-		.name	= "sram0",
-		.start	= IMX_CS4_BASE,
-		.size	= IMX_CS4_RANGE,	/* area size */
-		.flags	= DEVFS_RDWR,
-	},
-};
-
-static struct device_d sram_dev = {
-	.id	  = -1,
-	.name     = "mem",
-	.num_resources	= ARRAY_SIZE(sram_dev_resources),
-	.resource	= sram_dev_resources,
-};
-
-/*
  * SMSC 9217 network controller
  * connected to CS line 1 and interrupt line
  * GPIO3, data width is 16 bit
@@ -109,14 +89,24 @@ static struct device_d network_dev = {
 #endif
 
 static struct resource sdram_dev_resources[] = {
+/*
+ * up to 2MiB static RAM type memory, connected
+ * to CS4, data width is 16 bit
+ */
 	[0] = {
+		.name	= "sram0",
+		.start	= IMX_CS4_BASE,
+		.size	= IMX_CS4_RANGE,	/* area size */
+		.flags	= DEVFS_RDWR | DEVFS_MEM_BAREBOX_ONLY,
+	},
+	[1] = {
 		.name	= "ram0",
 		.start	= IMX_SDRAM_CS0,
 		.size	= SDRAM0 * 1024 * 1024,	/* fix size */
 		.flags	= DEVFS_RDWR,
 	},
 #ifndef CONFIG_PCM037_SDRAM_BANK1_NONE
-	[1] = {
+	[2] = {
 		.name	= "ram1",
 		.start	= IMX_SDRAM_CS1,
 		.size	= SDRAM1 * 1024 * 1024,	/* fix size */
@@ -313,7 +303,6 @@ static int imx31_devices_init(void)
 
 	protect_file("/dev/env0", 1);
 
-	register_device(&sram_dev);
 	imx31_add_nand(&nand_info);
 	register_device(&network_dev);
 
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index 1306f27..401b161 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -63,6 +63,12 @@ static struct device_d cfi_dev = {
 
 static struct resource sdram_dev_resources[] = {
 	[0] = {
+		.name	= "sram0",
+		.start	= 0xc8000000,
+		.size	= 512 * 1024, /* Can be up to 2MiB */
+		.flags	= DEVFS_RDWR | DEVFS_MEM_BAREBOX_ONLY,
+	},
+	[1] = {
 		.name 	= "ram0",
 		.start	= 0xa0000000,
 		.size	= 128 * 1024 * 1024,
@@ -77,22 +83,6 @@ static struct device_d sdram_dev = {
 	.resource	= sdram_dev_resources,
 };
 
-static struct resource sram_dev_resources[] = {
-	[0] = {
-		.name	= "sram0",
-		.start	= 0xc8000000,
-		.size	= 512 * 1024, /* Can be up to 2MiB */
-		.flags	= DEVFS_RDWR,
-	},
-};
-
-static struct device_d sram_dev = {
-	.id	  = -1,
-	.name     = "mem",
-	.num_resources	= ARRAY_SIZE(sram_dev_resources),
-	.resource	= sram_dev_resources,
-};
-
 static struct fec_platform_data fec_info = {
 	.xcv_type = MII100,
 	.phy_addr = 1,
@@ -320,7 +310,6 @@ static int pcm038_devices_init(void)
 	register_device(&cfi_dev);
 	imx27_add_nand(&nand_info);
 	register_device(&sdram_dev);
-	register_device(&sram_dev);
 	imx27_add_fb(&pcm038_fb_data);
 
 #ifdef CONFIG_USB
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2010-11-17 14:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12 18:02 [To test] [PATCH 0/5] device: introduce resource structure Jean-Christophe PLAGNIOL-VILLARD
2010-11-12 18:18 ` [PATCH 1/5] device: introduce resource structure to simplify resource delaration Jean-Christophe PLAGNIOL-VILLARD
2010-11-19  8:00   ` Sascha Hauer
2010-11-19 11:30     ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 13:40       ` Sascha Hauer
2010-11-20 13:58         ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-21  4:28           ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-21  6:46             ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-23  7:36             ` Sascha Hauer
2010-11-23  8:25               ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-23 11:34                 ` Sascha Hauer
2011-01-27  8:20   ` Sascha Hauer
2010-11-12 18:18 ` [PATCH 2/5] mem: add multiple resource support Jean-Christophe PLAGNIOL-VILLARD
2010-11-12 18:18 ` [PATCH 3/5] arm/setup_memory_tags: " Jean-Christophe PLAGNIOL-VILLARD
2010-11-12 18:18 ` [PATCH 4/5] edb93xx: convert to multiple mem resources Jean-Christophe PLAGNIOL-VILLARD
2010-11-12 18:18 ` [PATCH 5/5] pcm037: " Jean-Christophe PLAGNIOL-VILLARD
2010-11-17 13:59 ` [PATCH 1/2] mem: multiple resource support allow exclude a resource Jean-Christophe PLAGNIOL-VILLARD
2010-11-19  8:24   ` Sascha Hauer
2010-11-19 11:31     ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-17 13:59 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2010-11-17 14:09   ` [PATCH 2/2] mem: convert to DEVFS_MEM_BAREBOX_ONLY for freescale-mx25-3-stack/pcm037/pvm038 Baruch Siach
2010-11-17 14:02 ` [To test] [PATCH 0/5] device: introduce resource structure Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290002365-22712-2-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox