From: Przemyslaw Marczak
Date: Tue, 17 Feb 2015 13:50:25 +0000 (+0100)
Subject: board: samsung: reserve memory for the secure firmware
X-Git-Tag: v2015.04-rc4~125^2~2
X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a0643e227ad98fbc34b1950ddc6d1d2a0f5aadad;p=u-boot
board: samsung: reserve memory for the secure firmware
Since more than one board requires memory reservation
for the secure firmware, the reservation code can be
made in a common code.
Now, to reserve some part of the the last bank,
board config should define:
- CONFIG_TZSW_RESERVED_DRAM - len in bytes
- CONFIG_NR_DRAM_BANKS - number of memory banks
Signed-off-by: Przemyslaw Marczak
Cc: Akshay Saraswat
Cc: Hyungwon Hwang
Cc: Minkyu Kang
Signed-off-by: Minkyu Kang
---
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 97950fa192..2e17da8a7a 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -82,7 +82,13 @@ int board_init(void)
}
boot_temp_check();
#endif
+#ifdef CONFIG_TZSW_RESERVED_DRAM_SIZE
+ /* The last few MB of memory can be reserved for secure firmware */
+ ulong size = CONFIG_TZSW_RESERVED_DRAM_SIZE;
+ gd->ram_size -= size;
+ gd->bd->bi_dram[CONFIG_NR_DRAM_BANKS - 1].size -= size;
+#endif
return exynos_init();
}