Commit 4ce521977f79a883f9c47984ef675c4b2267b7ad

Authored by Maxime Ripard
1 parent aba3924927

part: efi: Add a Kconfig option for the number of partition entries

On some SoCs, the SPL needs to be located right in the middle of the GPT
partition entries.

One way to work around that is to create partition entries for a smaller
number of partitions to accomodate with where the SPL will be. Create a
Kconfig option to allow to do that.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Showing 2 changed files with 14 additions and 1 deletions Side-by-side Diff

... ... @@ -78,6 +78,19 @@
78 78 common when EFI is the bootloader. Note 2TB partition limit;
79 79 see disk/part_efi.c
80 80  
  81 +config EFI_PARTITION_ENTRIES_NUMBERS
  82 + int "Number of the EFI partition entries"
  83 + depends on EFI_PARTITION
  84 + default 128
  85 + help
  86 + Specify the number of partition entries in the GPT. This is
  87 + meant to allow less than the standard specifies for devices
  88 + that might need to place their first-stage bootloader in the
  89 + middle of a regular GPT.
  90 +
  91 + If unsure, leave at 128 entries, which is the standard
  92 + number.
  93 +
81 94 config EFI_PARTITION_ENTRIES_OFF
82 95 int "Offset (in bytes) of the EFI partition entries"
83 96 depends on EFI_PARTITION
... ... @@ -27,7 +27,7 @@
27 27 #define GPT_HEADER_SIGNATURE 0x5452415020494645ULL
28 28 #define GPT_HEADER_REVISION_V1 0x00010000
29 29 #define GPT_PRIMARY_PARTITION_TABLE_LBA 1ULL
30   -#define GPT_ENTRY_NUMBERS 128
  30 +#define GPT_ENTRY_NUMBERS CONFIG_EFI_PARTITION_ENTRIES_NUMBERS
31 31 #define GPT_ENTRY_SIZE 128
32 32  
33 33 #define PARTITION_SYSTEM_GUID \