summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-04-26 23:48:35 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-05-08 08:24:43 +0200
commitef0299f1722e3bef20aa73ec3bc3aefd26a91b18 (patch)
treed16ac7cff189ccd871b516e3b7a755cbae7de7a2
parent8fd1f24bffc587154a0304c61698c8fada164a40 (diff)
downloadbarebox-ef0299f1722e3bef20aa73ec3bc3aefd26a91b18.tar.gz
barebox-ef0299f1722e3bef20aa73ec3bc3aefd26a91b18.tar.xz
ARM: i.MX: Allow disabling SDRAM autodetection
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>
-rw-r--r--arch/arm/mach-imx/esdctl.c14
-rw-r--r--arch/arm/mach-imx/include/mach/esdctl.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index cb57d45654..e2025b3327 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 26436d9850..b7219d9c4e 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 */