[U-Boot] [PATCH 1/3] board: samsung: reserve memory for the secure firmware

Przemyslaw Marczak p.marczak at samsung.com
Tue Feb 17 14:50:25 CET 2015


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 <p.marczak at samsung.com>
Cc: Akshay Saraswat <akshay.s at samsung.com>
Cc: Hyungwon Hwang <human.hwang at samsung.com>
Cc: Minkyu Kang <mk7.kang at samsung.com>
---
 board/samsung/common/board.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index da2245f..a2123cd 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();
 }
 
-- 
1.9.1



More information about the U-Boot mailing list