]> xenbits.xensource.com Git - people/dwmw2/xen.git/commit
xen/arm64: head: Rework UART initialization on boot CPU
authorJulien Grall <julien.grall@arm.com>
Mon, 22 Jul 2019 21:39:27 +0000 (22:39 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 29 Jul 2019 23:17:58 +0000 (16:17 -0700)
commit2a24c40da66a67d0220096a1cc390a8f60b0b75b
tree2084169c8b2346aeb37cbafa5b913d85c3fa4cb2
parent1396dabdfd6c050d6b2ed3593dbabb81a4ac41d6
xen/arm64: head: Rework UART initialization on boot CPU

Anything executed after the label common_start can be executed on all
CPUs. However most of the instructions executed between the label
common_start and init_uart are not executed on the boot CPU.

The only instructions executed are to lookup the CPUID so it can be
printed on the console (if earlyprintk is enabled). Printing the CPUID
is not entirely useful to have for the boot CPU and requires a
conditional branch to bypass unused instructions.

Furthermore, the function init_uart is only called for boot CPU
requiring another conditional branch. This makes the code a bit tricky
to follow.

The UART initialization is now moved before the label common_start. This
now requires to have a slightly altered print for the boot CPU and set
the early UART base address in each the two path (boot CPU and
secondary CPUs).

This has the nice effect to remove a couple of conditional branch in
the code.

After this rework, the CPUID is only used at the very beginning of the
secondary CPUs boot path. So there is no need to "reserve" x24 for the
CPUID.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/arm64/head.S