All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v8 1/3] armv8: Support loading 32-bit OS in AArch32 execution state
Date: Tue, 22 Nov 2016 18:09:28 +0100	[thread overview]
Message-ID: <58347BC8.6080109@suse.de> (raw)
In-Reply-To: <AM4PR0401MB1732D8D2039AD983CB3D16989AB40@AM4PR0401MB1732.eurprd04.prod.outlook.com>

On 11/22/2016 06:07 PM, york sun wrote:
> On 11/22/2016 09:02 AM, Alexander Graf wrote:
>> On 11/21/2016 10:48 PM, york sun wrote:
>>> On 11/21/2016 01:07 PM, Alexander Graf wrote:
>>>> On 21/11/2016 21:45, york sun wrote:
>>>>> On 11/21/2016 12:40 PM, Alexander Graf wrote:
>>>>>> 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@nxp.com>
>>>>>>>> Signed-off-by: Alison Wang <alison.wang@nxp.com>
>>>>>>>> Signed-off-by: Chenhui Zhao <chenhui.zhao@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,
>>>>>
>>>>> Do you always load OS when calling armv8_switch_to_el2()? In this case
>>>>> of efi booting, kernel entry point needs to be passed to the new
>>>>> armv8_switch_to_el2 function. The new armv8_switch_to_el2 function
>>>>> doesn't return, so you cannot continue to run the code.
>>>> We always call some random function pointer in the new flow. That can be
>>>> a kernel entry point, but it can also just be a function pointer. In
>>>> this case, the code would basically look like this:
>>>>
>>>> static ulong efi_run_in_el2(ulong (*entry), void *arg1, void *arg2)
>>>> {
>>>>        dcache_enable();
>>>>        return entry(arg1, arg2);
>>>> }
>>>>
>>>> if (current_el() == 3) {
>>>>        ...
>>>>        return armv8_switch_to_el2(efi_run_in_el2, entry,
>>>> &loaded_image_info, &systab);
>>>> }
>>>>
>>> Alex,
>>>
>>> Since you are most familiar with EFI boot code, can you send a patch to
>>> address this? I can squash it with Alison's patch after testing. My
>>> current test branch is
>>> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit.denx.de%2F%3Fp%3Du-boot%2Fu-boot-fsl-qoriq.git%3Ba%3Dshortlog%3Bh%3Drefs%2Fheads%2Ftest_qoriq&data=01%7C01%7Cyork.sun%40nxp.com%7C0b9b6fdb53c94e1a953d08d412f9502f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=ALW8GdHxkPJghve%2BxbKQ1E9ssjFxSOf35PvVuY34ZiA%3D&reserved=0.
>> While trying to fix this up, I ran across another compile breakage:
>>
>> arch/arm/cpu/armv8/fsl-layerscape/mp.c:114: undefined reference to
>> `initiator_type'
>> arch/arm/cpu/armv8/fsl-layerscape/mp.c:123: undefined reference to
>> `initiator_type'
>>
> Possibly cause by a new set of patches sent by Priyanka for LS2088A.
> Let's use upstream master branch plus Alison's three patches.

No worries, the patch below fixes it. Just wanted to let you know.

Alex


diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index 59b0870..d6ee546 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -191,7 +191,7 @@ void enable_caches(void)
  }
  #endif

-inline u32 initiator_type(u32 cluster, int init_id)
+u32 initiator_type(u32 cluster, int init_id)
  {
         struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
         u32 idx = (cluster >> (init_id * 8)) & TP_CLUSTER_INIT_MASK;

  reply	other threads:[~2016-11-22 17:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10  2:49 [U-Boot] [PATCH v8 0/3] armv8: Support loading 32-bit OS in AArch32 execution state Alison Wang
2016-11-10  2:49 ` [U-Boot] [PATCH v8 1/3] " Alison Wang
2016-11-21 20:23   ` york sun
2016-11-21 20:39     ` Alexander Graf
2016-11-21 20:45       ` york sun
2016-11-21 21:07         ` Alexander Graf
2016-11-21 21:48           ` york sun
2016-11-22  5:05             ` Alison Wang
2016-11-22 17:02             ` Alexander Graf
2016-11-22 17:07               ` york sun
2016-11-22 17:09                 ` Alexander Graf [this message]
2016-11-22 17:32             ` Alexander Graf
2016-11-22 17:36               ` york sun
2017-01-11  8:59   ` Ryan Harkin
2017-01-12  5:55     ` Alison Wang
2016-11-10  2:49 ` [U-Boot] [PATCH v8 2/3] armv8: fsl-layerscape: SMP support for loading 32-bit OS Alison Wang
2016-11-10  2:49 ` [U-Boot] [PATCH v8 3/3] armv8: fsl-layerscape: Support loading 32-bit OS with PSCI enabled Alison Wang
2016-11-11 13:58 ` [U-Boot] [PATCH v8 0/3] armv8: Support loading 32-bit OS in AArch32 execution state Ryan Harkin
2016-11-11 16:00   ` york sun
2016-11-14  1:17   ` Alison Wang
2016-11-23  0:59 ` york sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58347BC8.6080109@suse.de \
    --to=agraf@suse.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.