From: Lokesh Vutla Date: Tue, 24 May 2016 10:34:37 +0530 Subject: [U-Boot] [PATCH v6 1/8] spl: fit: Fix the number of bytes read when reading fdt from fit In-Reply-To: <1464066284-24677-1-git-send-email-lokeshvutla@ti.com> References: <1464066284-24677-1-git-send-email-lokeshvutla@ti.com> Message-ID: <1464066284-24677-2-git-send-email-lokeshvutla@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Reviewed-by: Simon Glass Reviewed-by: Tom Rini Signed-off-by: Lokesh Vutla --- common/spl/spl_fit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 26842ba..e5c7ea2 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -181,6 +181,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", -- 2.8.2