spl: fit: nand: fix fit loading on bad blocks
Subsystems (3)
PATCH 1/1 spl: fit: nand: fix fit loading on bad blocks
From: Tien Fong Chee <[email protected]>
The offset at which the image to be loaded from NAND is located is retrieved from the itb header. The presence of bad blocks in the area of the NAND where the itb image is located could invalidate the offset which must therefore be adjusted taking into account the state of the sectors concerned.
Signed-off-by Tien Fong Chee <[email protected]>
Signed-off-by Jit Loon Lim <[email protected]>
--- common/spl/spl_nand.c | 3 +- drivers/mtd/nand/raw/denali.c | 91 ++++++++++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 2 deletions(-)
common/spl/spl_nand.c +2 -1
@@ -45,10 +45,11 @@ static ulong spl_nand_fit_read(struct spl_load_info *load, ulong offs,int err;ulong sector; - sector = *(int *)load->priv; offs *= load->bl_len; size *= load->bl_len; + sector = *(int *)load->priv; offs = sector +nand_spl_adjust_offset (sector, offs - sector); + err =nand_spl_load_image (offs, size, dst);if (err)return 0 ;
drivers/mtd/nand/raw/denali.c +90 -1
100 lines not on this page · raw message
Signature · 1 line
2.26.2