From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 16 Apr 2017 13:32:13 -0600 Subject: [U-Boot] [PATCH v5 05/16] disk: part: compute partition_entry_lba In-Reply-To: <1492077174-31148-6-git-send-email-patrick.delaunay@st.com> References: <1492077174-31148-1-git-send-email-patrick.delaunay@st.com> <1492077174-31148-6-git-send-email-patrick.delaunay@st.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 13 April 2017 at 03:52, Patrick Delaunay 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 > Reviewed-by: Christophe KERELLO > --- > 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