summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/esdctl.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-07-14 10:14:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-07-16 09:46:01 +0200
commit9435c2ede68d3edb63500755aff01dc9da634583 (patch)
treec4e6e2b93c1ec477c1f2e8ffb163420ead4ff0a1 /arch/arm/mach-imx/esdctl.c
parent71a2ad25b1aaa73e7da3b59850fb708a703fa5b3 (diff)
downloadbarebox-9435c2ede68d3edb63500755aff01dc9da634583.tar.gz
barebox-9435c2ede68d3edb63500755aff01dc9da634583.tar.xz
ARM: i.MX6: Add i.MX6 entry function
Add a i.MX6 specific entry function which automatically detects the SDRAM size. The prototype has already been present, but it was never implemented. Rename it to imx6q_ since the other variants need other functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/esdctl.c')
-rw-r--r--arch/arm/mach-imx/esdctl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index a8ef854700..2f9f5e971e 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -576,3 +576,14 @@ void __noreturn imx53_barebox_entry(void *boarddata)
barebox_arm_entry(base, size, boarddata);
}
+
+void __noreturn imx6q_barebox_entry(void *boarddata)
+{
+ u64 size_cs0 = imx6_mmdc_sdram_size((void *)MX6_MMDC_P0_BASE_ADDR, 0);
+ u64 size_cs1 = imx6_mmdc_sdram_size((void *)MX6_MMDC_P0_BASE_ADDR, 1);
+ u64 total = size_cs0 + size_cs1;
+
+ resource_size_t size = min(total, (u64)IMX6_MAX_SDRAM_SIZE);
+
+ barebox_arm_entry(0x10000000, size, boarddata);
+}