On 8 May 2016 at 10:55, Haim Boot hayim@marvell.com wrote:
Hi
I’m trying to book BE image from UEFI. I got the following error message:
“Command Error Status: Unsupported”
We’ve noticed that the EFI header is wrong (no 0x5A4D signature and the rest of the stuff).
This is cause since when EFI config is not enabled when CPU_BIG_ENDIAN is configured.
· Is there a pending patch which enables EFI when Big endian is configured? Are there any plans for that?
There have been some discussions, but no concrete plans to support this. UEFI is little endian by specification, and the UEFI runtime services remain available to the OS after boot. This means we need to switch endianness in EL1, which is non-trivial (since all the runtime services arguments in memory need to be endian-swapped) and fragile (since the exception vector table is not set up to deal with foreign endianness)
This means that UEFI will be merely a bootloader rather than a full firmware interface when running under BE, and so the use of UEFI does not necessarily make a lot of sense.
· If not, what are the needed steps in order to enable it?
I did some preliminary work in the past to enable this https://git.linaro.org/people/ard.biesheuvel/linux-arm.git/shortlog/refs/hea...
This is unlikely to make it upstream, since it also requires part of the kernel (the UEFI stub) to be built in LE mode, while the rest of the kernel is in BE mode, so the refactoring of the makefiles and the reshuffling of the code is fairly complicated as well.
The best approach would be to rewrite the stub as a separate EFI application, which implements the same handover protocol as the UEFI stub in the kernel does (i.e., pass the memory map and system table addresses in the DT /chosen node). We would still need some code changes in the core kernel to deal with firmware tables that are little endian, but that would be something we could upstream.