summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2015-12-14 20:27:23 -0500
committerTom Rini <trini@konsulko.com>2015-12-14 20:27:23 -0500
commite6e3faa5c2da591cd3e0f2047a74cfc832e7b738 (patch)
tree08c12b0c61cb4edd70df347c61ea36d2088274d3 /common
parent312db9f75f50b339310474d72c8524cef2bd7931 (diff)
parent989c5f0a8f8694ac92eb0d6cff8745ae8659364f (diff)
downloadtalos-obmc-uboot-e6e3faa5c2da591cd3e0f2047a74cfc832e7b738.tar.gz
talos-obmc-uboot-e6e3faa5c2da591cd3e0f2047a74cfc832e7b738.zip
Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq
Diffstat (limited to 'common')
-rw-r--r--common/board_f.c32
-rw-r--r--common/cmd_bdinfo.c6
-rw-r--r--common/cmd_blob.c6
3 files changed, 33 insertions, 11 deletions
diff --git a/common/board_f.c b/common/board_f.c
index b40735438b..8094ac4efe 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -317,6 +317,15 @@ __weak ulong board_get_usable_ram_top(ulong total_size)
return gd->ram_top;
}
+__weak phys_size_t board_reserve_ram_top(phys_size_t ram_size)
+{
+#ifdef CONFIG_SYS_MEM_TOP_HIDE
+ return ram_size - CONFIG_SYS_MEM_TOP_HIDE;
+#else
+ return ram_size;
+#endif
+}
+
static int setup_dest_addr(void)
{
debug("Monitor len: %08lX\n", gd->mon_len);
@@ -324,19 +333,26 @@ static int setup_dest_addr(void)
* Ram is setup, size stored in gd !!
*/
debug("Ram size: %08lX\n", (ulong)gd->ram_size);
-#if defined(CONFIG_SYS_MEM_TOP_HIDE)
+#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
+ /* Reserve memory for secure MMU tables, and/or security monitor */
+ gd->ram_size -= CONFIG_SYS_MEM_RESERVE_SECURE;
+ /*
+ * Record secure memory location. Need recalcuate if memory splits
+ * into banks, or the ram base is not zero.
+ */
+ gd->secure_ram = gd->ram_size;
+#endif
/*
* Subtract specified amount of memory to hide so that it won't
* get "touched" at all by U-Boot. By fixing up gd->ram_size
* the Linux kernel should now get passed the now "corrected"
- * memory size and won't touch it either. This should work
- * for arch/ppc and arch/powerpc. Only Linux board ports in
- * arch/powerpc with bootwrapper support, that recalculate the
- * memory size from the SDRAM controller setup will have to
- * get fixed.
+ * memory size and won't touch it either. This has been used
+ * by arch/powerpc exclusively. Now ARMv8 takes advantage of
+ * thie mechanism. If memory is split into banks, addresses
+ * need to be calculated.
*/
- gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
-#endif
+ gd->ram_size = board_reserve_ram_top(gd->ram_size);
+
#ifdef CONFIG_SYS_SDRAM_BASE
gd->ram_top = CONFIG_SYS_SDRAM_BASE;
#endif
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index adda55a263..deed6d8255 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -382,6 +382,12 @@ static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
print_num("-> size", bd->bi_dram[i].size);
}
+#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
+ if (gd->secure_ram & MEM_RESERVE_SECURE_SECURED) {
+ print_num("Secure ram",
+ gd->secure_ram & MEM_RESERVE_SECURE_ADDR_MASK);
+ }
+#endif
#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
print_eths();
#endif
diff --git a/common/cmd_blob.c b/common/cmd_blob.c
index d3f22a1afc..ac8b268e0b 100644
--- a/common/cmd_blob.c
+++ b/common/cmd_blob.c
@@ -73,9 +73,9 @@ static int do_blob(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
len = simple_strtoul(argv[4], NULL, 16);
key_addr = simple_strtoul(argv[5], NULL, 16);
- km_ptr = (uint8_t *)key_addr;
- src_ptr = (uint8_t *)src_addr;
- dst_ptr = (uint8_t *)dst_addr;
+ km_ptr = (uint8_t *)(uintptr_t)key_addr;
+ src_ptr = (uint8_t *)(uintptr_t)src_addr;
+ dst_ptr = (uint8_t *)(uintptr_t)dst_addr;
if (enc)
ret = blob_encap(km_ptr, src_ptr, dst_ptr, len);
OpenPOWER on IntegriCloud