xlat v2: Split MMU setup and enable
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>
Fri, 27 Apr 2018 14:06:57 +0000 (15:06 +0100)
committerJeenu Viswambharan <jeenu.viswambharan@arm.com>
Wed, 27 Jun 2018 10:31:30 +0000 (11:31 +0100)
commit0cc7aa896465ad7ecd8c253a4dc970508d96724c
treebee4d9dbf4f3eed1d8563d831a1da5a7f83bfa2c
parentf790cc0a9c492cf3615c82574e2c3f1ff8af0a3d
xlat v2: Split MMU setup and enable

At present, the function provided by the translation library to enable
MMU constructs appropriate values for translation library, and programs
them to the right registers. The construction of initial values,
however, is only required once as both the primary and secondaries
program the same values.

Additionally, the MMU-enabling function is written in C, which means
there's an active stack at the time of enabling MMU. On some systems,
like Arm DynamIQ, having active stack while enabling MMU during warm
boot might lead to coherency problems.

This patch addresses both the above problems by:

  - Splitting the MMU-enabling function into two: one that sets up
    values to be programmed into the registers, and another one that
    takes the pre-computed values and writes to the appropriate
    registers. With this, the primary effectively calls both functions
    to have the MMU enabled, but secondaries only need to call the
    latter.

  - Rewriting the function that enables MMU in assembly so that it
    doesn't use stack.

This patch fixes a bunch of MISRA issues on the way.

Change-Id: I0faca97263a970ffe765f0e731a1417e43fbfc45
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
14 files changed:
include/common/aarch32/asm_macros.S
include/common/aarch64/asm_macros.S
include/lib/aarch32/arch.h
include/lib/utils_def.h
include/lib/xlat_tables/xlat_mmu_helpers.h
include/lib/xlat_tables/xlat_tables_v2.h
include/lib/xlat_tables/xlat_tables_v2_helpers.h
lib/xlat_tables_v2/aarch32/enable_mmu.S [new file with mode: 0644]
lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
lib/xlat_tables_v2/aarch64/enable_mmu.S [new file with mode: 0644]
lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
lib/xlat_tables_v2/xlat_tables.mk
lib/xlat_tables_v2/xlat_tables_internal.c
lib/xlat_tables_v2/xlat_tables_private.h