[U-Boot] [PATCH v5 05/16] disk: part: compute partition_entry_lba

Simon Glass sjg at chromium.org
Sun Apr 16 19:32:13 UTC 2017


On 13 April 2017 at 03:52, Patrick Delaunay <patrick.delaunay at st.com> wrote:
> the value for partition_entry_lba of secondary GPT (last usable lba + 1)
> is not correct with MTD support as last usable LBA need to be erase size
> aligned
>
> The correct location of partition entry is always recomputed with
> the formula :
> partition_entry_lba =
>    alternate_lba -
>    num_pte * sizeof_partition_entry / lba_size
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
> Reviewed-by: Christophe KERELLO <christophe.kerello at st.com>
> ---
> the device mapping is
>
> 1/ for block case:
>
>   last_usable_lba     -> partition_entry_lba - 1
>   partition_entry_lba ->  PTE table (num * sizeof(PTE))
>   alternate_lba       ->  secondary GPT
>   -> end of device
>
> 2/ for MTD case : end of the last good block
>
>   -------------
>
>   last_usable_lba     -> last good erase block - 1
>   -------------erase BLOCK aligned
>   XXXXXXXXXXXXXXXXXX  -> skipped LBA for MTD case
>   partition_entry_lba ->  PTE table (num * sizeof(PTE))
>   alternate_lba       ->  secondary GPT
>   -------------erase BLOCK aligned
>   xxxxx skipping bad block
>   ->end of device
>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  disk/part_efi.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list