From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Date: Fri, 20 May 2016 10:29:03 +0200 Subject: [U-Boot] [PATCH v2 1/2] armv8: Support loading 32-bit OS in AArch32 execution state In-Reply-To: References: <1463646362-15531-1-git-send-email-b18965@freescale.com> <1463646362-15531-2-git-send-email-b18965@freescale.com> <573D804F.9000801@suse.de> <485afb1e-a21e-d38f-94b1-81a3846f1bc5@suse.de> Message-ID: <73bbaad4-e3df-40c0-4f59-78f8e8d532bd@suse.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 20.05.16 10:26, Huan Wang wrote: >> On 20.05.16 08:53, Huan Wang wrote: >>>> On 05/19/2016 10:26 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 >>>>> --- [...] >>>>> --- a/common/image-fit.c >>>>> +++ b/common/image-fit.c >>>>> @@ -1163,7 +1163,8 @@ int fit_image_check_arch(const void *fit, int >>>> noffset, uint8_t arch) >>>>> if (fit_image_get_arch(fit, noffset, &image_arch)) >>>>> return 0; >>>>> return (arch == image_arch) || >>>>> - (arch == IH_ARCH_I386 && image_arch == IH_ARCH_X86_64); >>>>> + (arch == IH_ARCH_I386 && image_arch == IH_ARCH_X86_64) || >>>>> + (arch == IH_ARCH_ARM64 && image_arch == IH_ARCH_ARM); >>>> >>>> This should be a Kconfig option. ThunderX doesn't support AArch32 >>>> execution. >>> [Alison Wang] I can't understand your meaning. Can you clarify it? >> >> U-Boot supports the ThunderX SoC which uses Cavium's own ARMv8 core >> implementation. That core does not support running AArch32 code. >> > [Alison Wang] Oh, I think your concern is that this function will not > detect FIT image is wrong when loading 32-bit kernel on ThunderX, right? > > Then what is your suggestion to fix this issue? My suggestion is to introduce a new Kconfig option that says "this arm64 system can execute aarch32 code" which is set as default y. CONFIG_THUNDERX would then set it to n if that's possible - or you'd just set it to n in the thunderx defconfig. Alex