diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 97950fa1920e0765b8031ac2066f5804c0b50402..2e17da8a7a44766d8431ee8510c15f710caa2b92 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();
 }