summaryrefslogtreecommitdiff
path: root/src/arch/arm64/include
diff options
context:
space:
mode:
authorT Michael Turney <mturney@codeaurora.org>2018-04-25 14:49:49 -0700
committerPatrick Georgi <pgeorgi@google.com>2018-04-30 06:25:15 +0000
commit6e0f0f7f9c91f41eb40f4ef6979937caee168bdf (patch)
treeead474907ea6f7b4bd0af1cf65d01803d4ec8d2a /src/arch/arm64/include
parent7850b5836bfe250f31cc32ca3cde70077fcbd887 (diff)
downloadcoreboot-6e0f0f7f9c91f41eb40f4ef6979937caee168bdf.tar.xz
arm64: Add mmu context save/restore APIs
New API required by sdm845 DDR init/training protocol TEST=build & run Change-Id: I8442442c0588dd6fb5e461b399e48a761f7bbf29 Signed-off-by: T Michael Turney <mturney@codeaurora.org> Reviewed-on: https://review.coreboot.org/25818 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/arch/arm64/include')
-rw-r--r--src/arch/arm64/include/armv8/arch/mmu.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/arch/arm64/include/armv8/arch/mmu.h b/src/arch/arm64/include/armv8/arch/mmu.h
index f0e551e52d..6c83749e95 100644
--- a/src/arch/arm64/include/armv8/arch/mmu.h
+++ b/src/arch/arm64/include/armv8/arch/mmu.h
@@ -148,8 +148,17 @@
#define TCR_TBI_USED (0x0 << TCR_TBI_SHIFT)
#define TCR_TBI_IGNORED (0x1 << TCR_TBI_SHIFT)
+struct mmu_context {
+ uint64_t mair; /* MAIR attributes */
+ uint64_t tcr; /* TCR Attributes */
+};
+
/* Initialize MMU registers and page table memory region. */
void mmu_init(void);
+/* Desc : Save mmu context (registers and ttbr base/size). */
+void mmu_save_context(struct mmu_context *mmu_context);
+/* Desc : Restore mmu context using input backed-up context */
+void mmu_restore_context(const struct mmu_context *mmu_context);
/* Change a memory type for a range of bytes at runtime. */
void mmu_config_range(void *start, size_t size, uint64_t tag);
/* Enable the MMU (need previous mmu_init() and configured ranges!). */