aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTim Harvey <tharvey@gateworks.com>2021-03-01 14:33:27 -0800
committerStefano Babic <sbabic@denx.de>2021-04-08 20:29:53 +0200
commit39cb85043cdbc98d10b49f0b86596043d5f8e3f8 (patch)
tree00e7819aa28cab81b01de5c4aa84d0e5d4523ab0 /common
parent09d86eab149ccaa387f0061521179605a600a9c3 (diff)
downloadu-boot-39cb85043cdbc98d10b49f0b86596043d5f8e3f8.zip
u-boot-39cb85043cdbc98d10b49f0b86596043d5f8e3f8.tar.gz
u-boot-39cb85043cdbc98d10b49f0b86596043d5f8e3f8.tar.bz2
spl: fit: nand: skip bad block handling if NAND chip not fully defined
commit 9f6a14c47ff9 ("spl: fit: nand: fix fit loading in case of bad blocks") added support for adjusting the image offset to account for bad blocks. However this requires nand_spl_adjust_offset() which requires fully defined specifics of the NAND chip being used may not be avialable. Allow skipping this support for drivers or configs which don't specify the NAND chip details statically with defines. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_nand.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index d13a524..8213836 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -42,11 +42,13 @@ static int spl_nand_load_image(struct spl_image_info *spl_image,
static ulong spl_nand_fit_read(struct spl_load_info *load, ulong offs,
ulong size, void *dst)
{
- ulong sector;
int err;
+#ifdef CONFIG_SYS_NAND_BLOCK_SIZE
+ ulong sector;
sector = *(int *)load->priv;
offs = sector + nand_spl_adjust_offset(sector, offs - sector);
+#endif
err = nand_spl_load_image(offs, size, dst);
if (err)
return 0;