Skip to content

Commit

Permalink
spl: spl_nand: Fix bad block handling in fitImage
Browse files Browse the repository at this point in the history
If the fitImage has some bad block in fit image area, the
offset must be recalulcated. This should be done always.
After implementing it in mxs now is possible to call the function
even for that platform.

Cc: Fabio Estevam <[email protected]>
Tested-By: Tim Harvey <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
  • Loading branch information
panicking authored and sbabic committed May 20, 2022
1 parent 37a7c37 commit cc98014
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions common/spl/spl_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,12 @@ static ulong spl_nand_fit_read(struct spl_load_info *load, ulong offs,
ulong size, void *dst)
{
int err;
#ifdef CONFIG_SYS_NAND_BLOCK_SIZE
ulong sector;

sector = *(int *)load->priv;
offs = sector + nand_spl_adjust_offset(sector, offs - sector);
#else
offs *= load->bl_len;
size *= load->bl_len;
#endif
offs = sector + nand_spl_adjust_offset(sector, offs - sector);
err = nand_spl_load_image(offs, size, dst);
if (err)
return 0;
Expand Down

0 comments on commit cc98014

Please sign in to comment.