]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmLib/ArmV7/ArmV7Mmu.c
ArmPkg: Configure TTBCR register
[mirror_edk2.git] / ArmPkg / Library / ArmLib / ArmV7 / ArmV7Mmu.c
index fc8ea42843b382509b107b9e10e5268793592414..74a7c177df6cef680ab2395a30d5ce42efd73fb0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 *  File managing the MMU for ARMv7 architecture\r
 *\r
-*  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2016, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -347,6 +347,17 @@ ArmConfigureMmu (
 \r
   ArmSetTTBR0 ((VOID *)(UINTN)(((UINTN)TranslationTable & ~TRANSLATION_TABLE_SECTION_ALIGNMENT_MASK) | (TTBRAttributes & 0x7F)));\r
 \r
+  //\r
+  // The TTBCR register value is undefined at reset in the Non-Secure world.\r
+  // Writing 0 has the effect of:\r
+  //   Clearing EAE: Use short descriptors, as mandated by specification.\r
+  //   Clearing PD0 and PD1: Translation Table Walk Disable is off.\r
+  //   Clearing N: Perform all translation table walks through TTBR0.\r
+  //               (0 is the default reset value in systems not implementing\r
+  //               the Security Extensions.)\r
+  //\r
+  ArmSetTTBCR (0);\r
+\r
   ArmSetDomainAccessControl (DOMAIN_ACCESS_CONTROL_NONE(15) |\r
                              DOMAIN_ACCESS_CONTROL_NONE(14) |\r
                              DOMAIN_ACCESS_CONTROL_NONE(13) |\r