[PATCH 13/20] mini2440: Add SDRAM size autodetection

Juergen Beisert jbe at pengutronix.de
Wed Feb 16 13:13:38 EST 2011


From: Juergen Beisert <juergen at kreuzholzen.de>

If the SDRAM type will change in the future, only the 'config.h' must be
adapted to the new settings. The real size will be read back from this setting.

Signed-off-by: Juergen Beisert <juergen at kreuzholzen.de>
---
 arch/arm/boards/mini2440/mini2440.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boards/mini2440/mini2440.c b/arch/arm/boards/mini2440/mini2440.c
index 46581cc..2aeb09e 100644
--- a/arch/arm/boards/mini2440/mini2440.c
+++ b/arch/arm/boards/mini2440/mini2440.c
@@ -48,7 +48,6 @@ static struct device_d sdram_dev = {
 	.id		= -1,
 	.name		= "mem",
 	.map_base	= CS6_BASE,
-	.size		= 64 * 1024 * 1024,
 	.platform_data	= &ram_pdata,
 };
 
@@ -87,6 +86,8 @@ static int mini2440_devices_init(void)
 {
 	uint32_t reg;
 
+	sdram_dev.size = s3c24x0_get_memory_size();
+
 	reg = readl(BWSCON);
 
 	/* CS#4 to access the network controller */
-- 
1.7.2.3




More information about the barebox mailing list