diff mbox

[U-Boot,5/6] pcm052: allow specifying onboard DDR size in configs

Message ID 20160926070808.17021-6-albert.aribaud@3adev.fr
State Accepted
Commit a7e5f7f3e5d2458090d8528a5a892a56911a11ce
Delegated to: Stefano Babic
Headers show

Commit Message

Albert ARIBAUD (3ADEV) Sept. 26, 2016, 7:08 a.m. UTC
PCM052 SoMs may be equipped with various sizes of DDR.
Keep default of 256MB; new PCM052-based targets will
specify their actual DDR size.

Linux command line is auto-adjusted to DDR size.

Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
---

 board/phytec/pcm052/Kconfig | 4 ++++
 include/configs/pcm052.h    | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/board/phytec/pcm052/Kconfig b/board/phytec/pcm052/Kconfig
index d67a69a..88524a3 100644
--- a/board/phytec/pcm052/Kconfig
+++ b/board/phytec/pcm052/Kconfig
@@ -12,4 +12,8 @@  config SYS_SOC
 config SYS_CONFIG_NAME
 	default "pcm052"
 
+config PCM052_DDR_SIZE
+	int
+	default 256
+
 endif
diff --git a/include/configs/pcm052.h b/include/configs/pcm052.h
index cd235cc..b3e5054 100644
--- a/include/configs/pcm052.h
+++ b/include/configs/pcm052.h
@@ -135,7 +135,8 @@ 
 	"tftptimeout=1000\0" \
 	"tftptimeoutcountmax=1000000\0" \
 	"mtdparts=" MTDPARTS_DEFAULT "\0" \
-	"bootargs_base=setenv bootargs rw mem=256M " \
+	"bootargs_base=setenv bootargs rw " \
+		" mem=" __stringify(CONFIG_PCM052_DDR_SIZE) "M " \
 		"console=ttyLP1,115200n8\0" \
 	"bootargs_sd=setenv bootargs ${bootargs} " \
 		"root=/dev/mmcblk0p2 rootwait\0" \
@@ -219,7 +220,7 @@ 
 /* Physical memory map */
 #define CONFIG_NR_DRAM_BANKS		1
 #define PHYS_SDRAM			(0x80000000)
-#define PHYS_SDRAM_SIZE			(256 * 1024 * 1024)
+#define PHYS_SDRAM_SIZE			(CONFIG_PCM052_DDR_SIZE * 1024 * 1024)
 
 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR