]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
poplar: Add build option for dram size
authorVictor Chong <victor.chong@linaro.org>
Mon, 29 Jan 2018 09:11:02 +0000 (18:11 +0900)
committerVictor Chong <victor.chong@linaro.org>
Wed, 7 Feb 2018 17:14:46 +0000 (02:14 +0900)
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
plat/hisilicon/poplar/include/platform_def.h
plat/hisilicon/poplar/platform.mk

index c0f83711c38a9e0f03d250cf662661b8ed07d615..941a84b504766de544ce5e54324e35c52fbbcd1b 100644 (file)
 #define MAX_IO_HANDLES                 (4)
 #define MAX_IO_BLOCK_DEVICES           (2)
 
+/* Memory size options */
+#define POPLAR_DRAM_SIZE_1G    0
+#define POPLAR_DRAM_SIZE_2G    1
+
 /* Memory map related constants */
 #define DDR_BASE                       (0x00000000)
+
+#if (POPLAR_DRAM_SIZE_ID == POPLAR_DRAM_SIZE_2G)
+#define DDR_SIZE                       (0x80000000)
+#elif (POPLAR_DRAM_SIZE_ID == POPLAR_DRAM_SIZE_1G)
 #define DDR_SIZE                       (0x40000000)
+#else
+#error "Currently unsupported POPLAR_DRAM_SIZE_ID value"
+#endif
 
 #define DEVICE_BASE                    (0xF0000000)
 #define DEVICE_SIZE                    (0x0F000000)
index 0fb8f6b25dc182da3b0011b1cce6186a1dd1755f..fca06220bc58964b40cbed22ba39d0296af16d66 100644 (file)
@@ -15,6 +15,16 @@ else
 endif
 $(eval $(call add_define,POPLAR_TSP_RAM_LOCATION_ID))
 
+POPLAR_DRAM_SIZE ?= two_gig
+ifeq (${POPLAR_DRAM_SIZE}, two_gig)
+  POPLAR_DRAM_SIZE_ID = POPLAR_DRAM_SIZE_2G
+else ifeq (${POPLAR_DRAM_SIZE}, one_gig)
+  POPLAR_DRAM_SIZE_ID = POPLAR_DRAM_SIZE_1G
+else
+  $(error "Currently unsupported POPLAR_DRAM_SIZE value")
+endif
+$(eval $(call add_define,POPLAR_DRAM_SIZE_ID))
+
 POPLAR_RECOVERY                := 0
 $(eval $(call add_define,POPLAR_RECOVERY))