Re: [U-Boot] [RFC PATCH] SPL: FIT: Align loading address for header
Hi, On 2.5.2016 05:46, Lokesh Vutla wrote: > > > On Thursday 28 April 2016 02:06 PM, Michal Simek wrote: >> If bl_len is not aligned it can caused a problem because another code >> expects that start is aligned. > > What about loading of U-boot image and dtb image? I have posted a > similar patch for solving this[1]. Can you see if it helps? > > [1] http://patchwork.ozlabs.org/patch/606958/ I have created this before I saw your patch. I am happy with your patch. Please ignore this one. Thanks, Michal ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH] SPL: FIT: Align loading address for header
On Thursday 28 April 2016 02:06 PM, Michal Simek wrote: > If bl_len is not aligned it can caused a problem because another code > expects that start is aligned. What about loading of U-boot image and dtb image? I have posted a similar patch for solving this[1]. Can you see if it helps? [1] http://patchwork.ozlabs.org/patch/606958/ Thanks and regards, Lokesh > > Signed-off-by: Michal Simek> --- > > Not sure if this is the right way how to ensure it. > But patch is pointing to the problem. For example if bl_len is 1. > --- > 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 e301927c87ac..08e432a52dbb 100644 > --- a/common/spl/spl_fit.c > +++ b/common/spl/spl_fit.c > @@ -119,6 +119,7 @@ int spl_load_simple_fit(struct spl_load_info *info, ulong > sector, void *fit) >* be before CONFIG_SYS_TEXT_BASE. >*/ > fit = (void *)(CONFIG_SYS_TEXT_BASE - size - info->bl_len); > + fit = (void *)ALIGN((ulong)fit, 8); > sectors = (size + info->bl_len - 1) / info->bl_len; > count = info->read(info, sector, sectors, fit); > debug("fit read sector %lx, sectors=%d, dst=%p, count=%lu\n", > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH] SPL: FIT: Align loading address for header
On 28 April 2016 at 02:36, Michal Simekwrote: > If bl_len is not aligned it can caused a problem because another code > expects that start is aligned. > > Signed-off-by: Michal Simek > --- > > Not sure if this is the right way how to ensure it. > But patch is pointing to the problem. For example if bl_len is 1. I suppose this is a non-block device. OK. > --- > 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 e301927c87ac..08e432a52dbb 100644 > --- a/common/spl/spl_fit.c > +++ b/common/spl/spl_fit.c > @@ -119,6 +119,7 @@ int spl_load_simple_fit(struct spl_load_info *info, ulong > sector, void *fit) > * be before CONFIG_SYS_TEXT_BASE. > */ > fit = (void *)(CONFIG_SYS_TEXT_BASE - size - info->bl_len); > + fit = (void *)ALIGN((ulong)fit, 8); > sectors = (size + info->bl_len - 1) / info->bl_len; > count = info->read(info, sector, sectors, fit); > debug("fit read sector %lx, sectors=%d, dst=%p, count=%lu\n", > -- > 1.9.1 > Reviewed-by: Simon Glass ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RFC PATCH] SPL: FIT: Align loading address for header
If bl_len is not aligned it can caused a problem because another code expects that start is aligned. Signed-off-by: Michal Simek--- Not sure if this is the right way how to ensure it. But patch is pointing to the problem. For example if bl_len is 1. --- 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 e301927c87ac..08e432a52dbb 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -119,6 +119,7 @@ int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fit) * be before CONFIG_SYS_TEXT_BASE. */ fit = (void *)(CONFIG_SYS_TEXT_BASE - size - info->bl_len); + fit = (void *)ALIGN((ulong)fit, 8); sectors = (size + info->bl_len - 1) / info->bl_len; count = info->read(info, sector, sectors, fit); debug("fit read sector %lx, sectors=%d, dst=%p, count=%lu\n", -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot