]> git.sur5r.net Git - u-boot/commitdiff
board: samsung: reserve memory for the secure firmware
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Tue, 17 Feb 2015 13:50:25 +0000 (14:50 +0100)
committerMinkyu Kang <mk7.kang@samsung.com>
Wed, 4 Mar 2015 12:25:35 +0000 (21:25 +0900)
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@samsung.com>
Cc: Akshay Saraswat <akshay.s@samsung.com>
Cc: Hyungwon Hwang <human.hwang@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
board/samsung/common/board.c

index 97950fa1920e0765b8031ac2066f5804c0b50402..2e17da8a7a44766d8431ee8510c15f710caa2b92 100644 (file)
@@ -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();
 }