diff options
| author | Michael Trimarchi <[email protected]> | 2022-05-15 11:35:33 +0200 |
|---|---|---|
| committer | Stefano Babic <[email protected]> | 2022-05-20 12:36:48 +0200 |
| commit | cc980143c01e76ff17004021777c2a65dcde367a (patch) | |
| tree | 9af0b8c51d1dd9c9ef29b83c7350272986a34b57 | |
| parent | 37a7c374a6bd6cefe24516e5aef13d2bab6f133e (diff) | |
spl: spl_nand: Fix bad block handling in fitImage
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]>
| -rw-r--r-- | common/spl/spl_nand.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index fc61b447a52..82a10ffa63a 100644 --- a/common/spl/spl_nand.c +++ b/common/spl/spl_nand.c @@ -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; |
