]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
spl: fit: Fix the number of bytes read when reading fdt from fit
authorLokesh Vutla <lokeshvutla@ti.com>
Tue, 24 May 2016 05:04:37 +0000 (10:34 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 27 May 2016 19:41:39 +0000 (15:41 -0400)
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>
common/spl/spl_fit.c

index 90acbb2d8a399a3590f6b2d409aaa47cbee7b40e..79cc06ed0b548bd86c635ba28772bcc06f401ae2 100644 (file)
@@ -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",