armv8: Add tlb_allocated to arch global data
authorYork Sun <york.sun@nxp.com>
Fri, 24 Jun 2016 23:46:19 +0000 (16:46 -0700)
committerYork Sun <york.sun@nxp.com>
Fri, 15 Jul 2016 16:01:43 +0000 (09:01 -0700)
When secure ram is used, MMU tables have to be put into secure ram.
To use common MMU code, gd->arch.tlb_addr will be used to host TLB
entry pointer. To save allocated memory for later use, tlb_allocated
variable is added to global data structure.

Signed-off-by: York Sun <york.sun@nxp.com>
arch/arm/include/asm/global_data.h
common/board_f.c

index 2d76cd477d497b3cd2121ef640bc10b1315c845d..10550174df4bddc9f73e32ea89e8fd66e49f9d78 100644 (file)
@@ -57,6 +57,7 @@ struct arch_global_data {
         *             0x2 maintained
         */
        phys_addr_t secure_ram;
+       unsigned long tlb_allocated;
 #endif
 
 #ifdef CONFIG_OMAP_COMMON
index 0fc96bd4c6cc9cba742d6c7069603c53f9075270..a1138b0a129cdc6a30679ac7d30d0b1ba7c122eb 100644 (file)
@@ -432,6 +432,15 @@ static int reserve_mmu(void)
        gd->arch.tlb_addr = gd->relocaddr;
        debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
              gd->arch.tlb_addr + gd->arch.tlb_size);
+
+#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
+       /*
+        * Record allocated tlb_addr in case gd->tlb_addr to be overwritten
+        * with location within secure ram.
+        */
+       gd->arch.tlb_allocated = gd->arch.tlb_addr;
+#endif
+
        return 0;
 }
 #endif