Add support for 32-bit kernel

This patch adds an --enable-aarch32-kernel parameter to ./configure,
which enables dropping into AArch32 state at EL2. Notable differences
with AArch64 boot are:

* SCR.RW is set to 0, to declare all lower levels as AArch32,
* SPSR_EL2 has a 32-bit M[4:0] field,
* kernel parameters are different, but we can still put them into x0-x2,
  because those registers are mapped to r0-r2 (ARM ARM v8 D1.20.1)
* SCTLR.CP15BEN is set, to allow the Linux decompressor to keep using
  its legacy CP15 barriers.
* We also need to make sure MMU is disabled at EL1: hyp-stub in arm64
  resets SCTLR_EL1, but the 32-bit hyp-stub doesn't. Leaving SCTRL.M set
  would break hotplug when no hypervisor is present.
* PSCI function ID for CPU_ON differs.

We don't plan to support spin method on 32-bit. PSCI is automatically
enabled by ./configure, and this patch forbids disabling it.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
7 files changed