[PATCH 2/9] arm64/efi: refactor EFI init and runtime code for reuse by 32-bit ARM

Ard Biesheuvel ard.biesheuvel at linaro.org
Wed Nov 4 03:44:19 PST 2015


On 10 October 2015 at 23:00, Matt Fleming <matt at codeblueprint.co.uk> wrote:
> On Thu, 01 Oct, at 07:04:16PM, Ard Biesheuvel wrote:
>> This refactors the EFI init and runtime code that will be shared
>> between arm64 and ARM so that it can be built for both archs.
>>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
>> ---
>>  arch/arm64/include/asm/efi.h       |  16 ++++
>>  arch/arm64/kernel/efi.c            |  51 ++++++++++
>>  drivers/firmware/efi/arm-init.c    |  11 ++-
>>  drivers/firmware/efi/arm-runtime.c | 101 ++++++--------------
>>  drivers/firmware/efi/efi.c         |   4 +-
>>  5 files changed, 105 insertions(+), 78 deletions(-)
>
> [...]
>
>> diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
>> index 56987a5b9033..235677b86e4e 100644
>> --- a/drivers/firmware/efi/arm-init.c
>> +++ b/drivers/firmware/efi/arm-init.c
>> @@ -66,7 +66,7 @@ static int __init uefi_init(void)
>>  {
>>       efi_char16_t *c16;
>>       void *config_tables;
>> -     u64 table_size;
>> +     int table_size;
>>       char vendor[100] = "unknown";
>>       int i, retval;
>
> Perhaps 'table_size' should be unsigned long? At the very least it
> should be size_t, not int.
>

OK, I will change that.

>> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
>> index f5e586bd3b24..2eb31e28a35c 100644
>> --- a/drivers/firmware/efi/efi.c
>> +++ b/drivers/firmware/efi/efi.c
>> @@ -23,6 +23,8 @@
>>  #include <linux/io.h>
>>  #include <linux/platform_device.h>
>>
>> +#include <asm/efi.h>
>> +
>>  struct efi __read_mostly efi = {
>>       .mps                    = EFI_INVALID_TABLE_ADDR,
>>       .acpi                   = EFI_INVALID_TABLE_ADDR,
>
> Hmm... not quite sure why this new include is required?
>

I need this or the file won't build on ARM.

We are currently relying on a transitive include of
<asm/early_ioremap.h>, which does not exist on IA-64. This is a bit of
a kludge, and I am open to better ways of dealing with this.
(IA-64 declares early_ioremap() in asm/io.h, and #define's
early_memremap() as an alias of it) and I am reluctant to include
asm/early_ioremap.h in ARM's asm/io.h (as the other archs do)

-- 
Ard.



More information about the linux-arm-kernel mailing list