mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Shiyan <shc_work@mail.ru>
To: barebox@lists.infradead.org
Subject: [PATCH 6/7] ARM: pcm038: Using "get_ram_size" for determine SRAM size
Date: Sun, 24 Feb 2013 13:23:58 +0400	[thread overview]
Message-ID: <1361697839-14310-6-git-send-email-shc_work@mail.ru> (raw)
In-Reply-To: <1361697839-14310-1-git-send-email-shc_work@mail.ru>


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/pcm038/pcm038.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index f6de8f3..587ace8 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -21,6 +21,7 @@
 #include <environment.h>
 #include <mach/imx27-regs.h>
 #include <fec.h>
+#include <sizes.h>
 #include <notifier.h>
 #include <mach/gpio.h>
 #include <asm/armlinux.h>
@@ -186,6 +187,7 @@ static int pcm038_devices_init(void)
 	int i;
 	u64 uid = 0;
 	char *envdev;
+	long sram_size;
 
 	unsigned int mode[] = {
 		PD0_AIN_FEC_TXD0,
@@ -270,9 +272,11 @@ static int pcm038_devices_init(void)
 	/* configure SRAM on cs1 */
 	imx27_setup_weimcs(1, 0x0000d843, 0x22252521, 0x22220a00);
 
-	/* Can be up to 2MiB */
-	add_mem_device("ram1", 0xc8000000, 512 * 1024,
-				   IORESOURCE_MEM_WRITEABLE);
+	/* SRAM can be up to 2MiB */
+	sram_size = get_ram_size((ulong *)MX27_CS1_BASE_ADDR, SZ_2M);
+	if (sram_size)
+		add_mem_device("ram1", MX27_CS1_BASE_ADDR, sram_size,
+			       IORESOURCE_MEM_WRITEABLE);
 
 	/* initizalize gpios */
 	for (i = 0; i < ARRAY_SIZE(mode); i++)
-- 
1.7.12.4


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

  parent reply	other threads:[~2013-02-24  9:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24  9:23 [PATCH 1/7] ARM: pcm038: Select IIM by default Alexander Shiyan
2013-02-24  9:23 ` [PATCH 2/7] ARM: pcm038: Fix serial number IIM-address Alexander Shiyan
2013-02-24  9:23 ` [PATCH 3/7] ARM: pcm970: Fix bug with CompactFlash Alexander Shiyan
2013-02-24  9:23 ` [PATCH 4/7] ARM: pcm970: Replace #ifdef with IS_ENABLED() Alexander Shiyan
2013-02-24  9:23 ` [PATCH 5/7] ARM: i.MX27: Use DEVICE_ID_SINGLE for IIM, CCM and ESDCTL Alexander Shiyan
2013-02-24  9:23 ` Alexander Shiyan [this message]
2013-02-24  9:23 ` [PATCH 7/7] ARM: pcm038: Update defconfig Alexander Shiyan
2013-02-24 12:32   ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-25  7:58 ` [PATCH 1/7] ARM: pcm038: Select IIM by default Sascha Hauer

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=1361697839-14310-6-git-send-email-shc_work@mail.ru \
    --to=shc_work@mail.ru \
    --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