summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2016-05-24 10:34:37 +0530
committerKlaus Goger <klaus.goger@theobroma-systems.com>2016-09-18 20:22:04 +0200
commit457cee011e92f2bc102fe7700b8d6a2c46be2b43 (patch)
tree9af66e867d0e2d23dbef62bf59ffce5c9911b973
parenta88ebdcf8a3db33cce7a94c0180c7e561cc18dfa (diff)
spl: fit: Fix the number of bytes read when reading fdt from fit
sectors field is not being updated when reading fdt from fit image. Because of this size_of(u-boot.bin) is being read when reading fdt. Fixing it by updating the sectors field properly. Tested-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
-rw-r--r--common/spl/spl_fit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 90acbb2d8a..79cc06ed0b 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -182,6 +182,7 @@ int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fit)
*/
dst = load_ptr + data_size;
fdt_offset += base_offset;
+ sectors = (fdt_len + info->bl_len - 1) / info->bl_len;
count = info->read(info, sector + fdt_offset / info->bl_len, sectors,
dst);
debug("fit read %x sectors to %x, dst %p, data_offset %x\n",