[U-Boot] [PATCH v8 1/3] armv8: Support loading 32-bit OS in AArch32 execution state

Alexander Graf agraf at suse.de
Mon Nov 21 21:39:54 CET 2016



On 21/11/2016 21:23, york sun wrote:
> On 11/09/2016 07:02 PM, 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 <ebony.zhu at nxp.com>
>> Signed-off-by: Alison Wang <alison.wang at nxp.com>
>> Signed-off-by: Chenhui Zhao <chenhui.zhao at nxp.com>
>> ---
>> Changes in v8:
>> - Fix the issue when U-Boot is running in EL2 or EL1.
>>
>
> Alison,
>
> There is a conflict when merging with upstream code. Alex Graf merged
> his change to support EFI booting. See commit
> 69bd459d343fe1e5a68a6f187d8c99c78c6fc6ce. Specifically these lines
>
>
>          if (current_el() == 3) {
>                  smp_kick_all_cpus();
>                  dcache_disable();
>                  armv8_switch_to_el2();
>                  dcache_enable();
>          }
>
> Function armv8_switch_to_el2() didn't take any argument before you
> change. With your proposed change to support 32-bit OS, you added
> arguments to this function, and presume this function always load OS.
> This may be flawed. Would it be possible to keep armv8_switch_to_el2()
> but introduce another function to carry out switching EL while loading OS?

Alison introduced it based on my comments - and I'd prefer if we only 
have the function call based version :).

It should be reasonably straight forward to move to it here. Just create 
a new helper stub that enables the dcache and calls entry().


Alex


More information about the U-Boot mailing list