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 5/5] pcm037: convert to multiple mem resources
Date: Fri, 12 Nov 2010 19:18:58 +0100	[thread overview]
Message-ID: <1289585938-22813-5-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/pcm037/pcm037.c |   45 ++++++++++++--------------------------
 1 files changed, 14 insertions(+), 31 deletions(-)

diff --git a/arch/arm/boards/pcm037/pcm037.c b/arch/arm/boards/pcm037/pcm037.c
index 38725a2..a1783af 100644
--- a/arch/arm/boards/pcm037/pcm037.c
+++ b/arch/arm/boards/pcm037/pcm037.c
@@ -102,46 +102,35 @@ static struct device_d network_dev = {
 #define SDRAM0	256
 #endif
 
-static struct resource sdram0_dev_resources[] = {
-	[0] = {
-		.name	= "ram0",
-		.start	= IMX_SDRAM_CS0,
-		.size	= SDRAM0 * 1024 * 1024,	/* fix size */
-		.flags	= DEVFS_RDWR,
-	},
-};
-
-static struct device_d sdram0_dev = {
-	.id	  = -1,
-	.name     = "mem",
-	.num_resources	= ARRAY_SIZE(sdram0_dev_resources),
-	.resource	= sdram0_dev_resources,
-};
-
-#ifndef CONFIG_PCM037_SDRAM_BANK1_NONE
-
 #if defined CONFIG_PCM037_SDRAM_BANK1_128MB
 #define SDRAM1	128
 #elif defined CONFIG_PCM037_SDRAM_BANK1_256MB
 #define SDRAM1	256
 #endif
 
-static struct resource sdram1_dev_resources[] = {
+static struct resource sdram_dev_resources[] = {
 	[0] = {
+		.name	= "ram0",
+		.start	= IMX_SDRAM_CS0,
+		.size	= SDRAM0 * 1024 * 1024,	/* fix size */
+		.flags	= DEVFS_RDWR,
+	},
+#ifndef CONFIG_PCM037_SDRAM_BANK1_NONE
+	[1] = {
 		.name	= "ram1",
 		.start	= IMX_SDRAM_CS1,
 		.size	= SDRAM1 * 1024 * 1024,	/* fix size */
 		.flags	= DEVFS_RDWR,
 	},
+#endif
 };
 
-static struct device_d sdram1_dev = {
+static struct device_d sdram_dev = {
 	.id	  = -1,
 	.name     = "mem",
-	.num_resources	= ARRAY_SIZE(sdram1_dev_resources),
-	.resource	= sdram1_dev_resources,
+	.num_resources	= ARRAY_SIZE(sdram_dev_resources),
+	.resource	= sdram_dev_resources,
 };
-#endif
 
 struct imx_nand_platform_data nand_info = {
 	.width = 1,
@@ -328,20 +317,14 @@ static int imx31_devices_init(void)
 	imx31_add_nand(&nand_info);
 	register_device(&network_dev);
 
-	register_device(&sdram0_dev);
-#ifndef CONFIG_PCM037_SDRAM_BANK1_NONE
-	register_device(&sdram1_dev);
-#endif
+	register_device(&sdram_dev);
 #ifdef CONFIG_USB
 	pcm037_usb_init();
 	register_device(&usbotg_dev);
 	register_device(&usbh2_dev);
 #endif
 
-	armlinux_add_dram(&sdram0_dev);
-#ifndef CONFIG_PCM037_SDRAM_BANK1_NONE
-	armlinux_add_dram(&sdram1_dev);
-#endif
+	armlinux_add_dram(&sdram_dev);
 	armlinux_set_bootparams((void *)0x80000100);
 	armlinux_set_architecture(MACH_TYPE_PCM037);
 
-- 
1.7.1


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

  parent reply	other threads:[~2010-11-12 18:22 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 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
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 ` [PATCH 2/2] mem: convert to DEVFS_MEM_BAREBOX_ONLY for freescale-mx25-3-stack/pcm037/pvm038 Jean-Christophe PLAGNIOL-VILLARD
2010-11-17 14:09   ` 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=1289585938-22813-5-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