Commit 50e93b95653da44b9743357dfa3701e8482fd167

Authored by York Sun
1 parent e61a7534e3

armv8: Add tlb_allocated to arch global data

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>

Showing 2 changed files with 10 additions and 0 deletions Side-by-side Diff

arch/arm/include/asm/global_data.h
... ... @@ -57,6 +57,7 @@
57 57 * 0x2 maintained
58 58 */
59 59 phys_addr_t secure_ram;
  60 + unsigned long tlb_allocated;
60 61 #endif
61 62  
62 63 #ifdef CONFIG_OMAP_COMMON
... ... @@ -432,6 +432,15 @@
432 432 gd->arch.tlb_addr = gd->relocaddr;
433 433 debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
434 434 gd->arch.tlb_addr + gd->arch.tlb_size);
  435 +
  436 +#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
  437 + /*
  438 + * Record allocated tlb_addr in case gd->tlb_addr to be overwritten
  439 + * with location within secure ram.
  440 + */
  441 + gd->arch.tlb_allocated = gd->arch.tlb_addr;
  442 +#endif
  443 +
435 444 return 0;
436 445 }
437 446 #endif