From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Thu, 26 May 2016 09:54:17 -0700 Subject: [U-Boot] [PATCH v3 1/2] armv8: Support loading 32-bit OS in AArch32 execution state In-Reply-To: <1464252083-32083-2-git-send-email-b18965@freescale.com> References: <1464252083-32083-1-git-send-email-b18965@freescale.com> <1464252083-32083-2-git-send-email-b18965@freescale.com> Message-ID: <57472A39.2050202@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/26/2016 01:51 AM, Alison Wang wrote: > To support loading a 32-bit OS, the execution state will change from > AArch64 to AArch32 when jumping to kernel. > > The architecture information will be got through checking FIT > image, then U-Boot will load 32-bit OS or 64-bit OS automatically. > > Signed-off-by: Ebony Zhu > Signed-off-by: Alison Wang > Signed-off-by: Chenhui Zhao > --- > Changes in v3: > - Comments the functions and the arguments. > - Rename the real parameters. > - Use the macros instead of the magic values. > - Remove the redundant codes. > - Clean up all of the mess in boot_jump_linux(). > - Add CONFIG_ARM64_SUPPORT_AARCH32 to detect for some ARM64 system doesn't support AArch32 state. > > Changes in v2: > - armv8_switch_to_el2_aarch32() is removed. armv8_switch_to_el2_m is used > to switch to AArch64 EL2 or AArch32 Hyp. > - armv8_switch_to_el1_aarch32() is removed. armv8_switch_to_el1_m is used > to switch to AArch64 EL1 or AArch32 SVC. > > arch/arm/Kconfig | 6 ++ > arch/arm/cpu/armv8/transition.S | 8 +- > arch/arm/include/asm/macro.h | 174 ++++++++++++++++++++++++++++++---------- > arch/arm/include/asm/system.h | 118 ++++++++++++++++++++++++++- > arch/arm/lib/bootm.c | 19 ++++- > common/image-fit.c | 14 +++- > 6 files changed, 287 insertions(+), 52 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index 729b181..794cb4f 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -77,6 +77,12 @@ config SYS_L2CACHE_OFF > If SoC does not support L2CACHE or one do not want to enable > L2CACHE, choose this option. > > +config ARM64_SUPPORT_AARCH32 > + bool "ARM64 system support AArch32 execution state" > + default y if ARM64 && !CONFIG_THUNDERX > + help > + This ARM64 system supports AArch32 execution state. > + > choice > prompt "Target select" > default TARGET_HIKEY > diff --git a/arch/arm/cpu/armv8/transition.S b/arch/arm/cpu/armv8/transition.S > index 253a39b..417e8b4 100644 > --- a/arch/arm/cpu/armv8/transition.S > +++ b/arch/arm/cpu/armv8/transition.S > @@ -11,13 +11,13 @@ > #include > > ENTRY(armv8_switch_to_el2) > - switch_el x0, 1f, 0f, 0f > + switch_el x4, 1f, 0f, 0f > 0: ret > -1: armv8_switch_to_el2_m x0 > +1: armv8_switch_to_el2_m x0, x1, x2, x3, x4 > ENDPROC(armv8_switch_to_el2) Alison, I see you are chaning macro armv8_switch_to_el2. You may have missed one in start.S. This is the code you can't test with our ARMv8 chip. York