From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Simek Date: Wed, 4 May 2016 15:56:02 +0200 Subject: [U-Boot] [PATCH v5 1/3] spl: fit: Fix the number of bytes read when reading fdt from fit In-Reply-To: <1462363477-20445-2-git-send-email-lokeshvutla@ti.com> References: <1462363477-20445-1-git-send-email-lokeshvutla@ti.com> <1462363477-20445-2-git-send-email-lokeshvutla@ti.com> Message-ID: <5729FF72.40200@xilinx.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 4.5.2016 14:04, Lokesh Vutla wrote: > 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. > > 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 1a5c027..b1cfa97 100644 > --- a/common/spl/spl_fit.c > +++ b/common/spl/spl_fit.c > @@ -176,6 +176,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", > Tested-by: Michal Simek Thanks, Michal