]> xenbits.xensource.com Git - xen.git/commit
xen/mpu: Map early uart when earlyprintk on
authorAyan Kumar Halder <ayan.kumar.halder@amd.com>
Wed, 4 Dec 2024 17:22:42 +0000 (17:22 +0000)
committerJulien Grall <jgrall@amazon.com>
Fri, 6 Dec 2024 19:06:27 +0000 (19:06 +0000)
commit214f9cc67b8cd179df0f5ab460413e9be46ff148
tree1721abad09d14cf601b39531a24334d896c04493
parentdc8e1b33a525d31989c0d1ffe6ae7794484e1d99
xen/mpu: Map early uart when earlyprintk on

CONFIG_EARLY_UART_SIZE is introduced to let user provide physical size of
early UART. Unlike MMU where we map a page in the virtual address space,
here we need to know the exact physical size to be mapped.
As VA == PA in case of MPU, the memory layout follows exactly the hardware
configuration. As a consequence, we set  EARLY_UART_VIRTUAL_ADDRESS as physical
address.

EARLY_UART_BASE_ADDRESS and EARLY_UART_SIZE should be aligned to the minimum
size of MPU region (ie 64 bits) as per the hardware restrictions. Refer ARM
DDI 0600A.d ID120821 A1.3 "A minimum protection region size of 64 bytes.".

UART is mapped as nGnRE region (as specified by ATTR=100 , refer G1.3.13,
MAIR_EL2, "---0100 Device memory nGnRE"). Also, it is mapped as outer shareable,
RW at EL2 only and execution of instructions from the region is not permitted.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/Kconfig.debug
xen/arch/arm/arm64/mpu/head.S
xen/arch/arm/include/asm/early_printk.h