mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] ARM: i.MX: Allow disabling SDRAM autodetection
Date: Fri, 26 Apr 2013 23:48:35 +0200	[thread overview]
Message-ID: <1367012916-22780-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1367012916-22780-1-git-send-email-s.hauer@pengutronix.de>

Some boards setup more memory than they actually have. The real memory
size can then be detected later for example by reading a board id.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/esdctl.c              | 14 ++++++++++++++
 arch/arm/mach-imx/include/mach/esdctl.h |  1 +
 2 files changed, 15 insertions(+)

diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index cb57d45..e2025b3 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -39,6 +39,17 @@ struct imx_esdctl_data {
 	void (*add_mem)(void *esdctlbase, struct imx_esdctl_data *);
 };
 
+static int imx_esdctl_disabled;
+
+/*
+ * Boards can disable SDRAM detection if it doesn't work for them. In
+ * this case arm_add_mem_device has to be called by board code.
+ */
+void imx_esdctl_disable(void)
+{
+	imx_esdctl_disabled = 1;
+}
+
 /*
  * v1 - found on i.MX1
  */
@@ -239,6 +250,9 @@ static int imx_esdctl_probe(struct device_d *dev)
 	if (!base)
 		return -ENOMEM;
 
+	if (imx_esdctl_disabled)
+		return 0;
+
 	data->add_mem(base, data);
 
 	return 0;
diff --git a/arch/arm/mach-imx/include/mach/esdctl.h b/arch/arm/mach-imx/include/mach/esdctl.h
index 26436d9..b7219d9 100644
--- a/arch/arm/mach-imx/include/mach/esdctl.h
+++ b/arch/arm/mach-imx/include/mach/esdctl.h
@@ -136,6 +136,7 @@ void __naked __noreturn imx35_barebox_entry(uint32_t boarddata);
 void __naked __noreturn imx51_barebox_entry(uint32_t boarddata);
 void __naked __noreturn imx53_barebox_entry(uint32_t boarddata);
 void __naked __noreturn imx6_barebox_entry(uint32_t boarddata);
+void imx_esdctl_disable(void);
 #endif
 
 #endif /* __MACH_ESDCTL_V2_H */
-- 
1.8.2.rc2


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

  reply	other threads:[~2013-04-26 21:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26 10:21 [RFC only] ARM: i.MX: Fix SDRAM size detect Alexander Shiyan
2013-04-26 10:48 ` Sascha Hauer
2013-04-26 11:12   ` Re[2]: " Alexander Shiyan
2013-04-26 11:42     ` Sascha Hauer
2013-04-26 11:50       ` Re[2]: " Alexander Shiyan
2013-04-26 21:48         ` [PATCH] Fix ccxmx51 SDRAM size detection Sascha Hauer
2013-04-26 21:48           ` Sascha Hauer [this message]
2013-04-26 21:48           ` [PATCH 2/2] ARM: i.MX: ccxmx51: detect SDRAM size by board id Sascha Hauer
2013-05-07 11:45             ` Alexander Shiyan
2013-05-08  6:25               ` Sascha Hauer
2013-05-07 12:39             ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-07 12:46               ` Re[2]: " Alexander Shiyan
2013-05-07 16:06                 ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-27  4:41           ` [PATCH] Fix ccxmx51 SDRAM size detection Alexander Shiyan

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=1367012916-22780-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --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