public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH] SPL: FIT: Align loading address for header
@ 2016-04-28  8:36 Michal Simek
  2016-05-01 18:54 ` Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Michal Simek @ 2016-04-28  8:36 UTC (permalink / raw)
  To: u-boot

If bl_len is not aligned it can caused a problem because another code
expects that start is aligned.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-05-31 14:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-28  8:36 [U-Boot] [RFC PATCH] SPL: FIT: Align loading address for header Michal Simek
2016-05-01 18:54 ` Simon Glass
2016-05-02  3:46 ` Lokesh Vutla
2016-05-02  7:53   ` Michal Simek
2016-05-30 17:56 ` [U-Boot] [U-Boot, RFC] " Tom Rini
2016-05-31  4:29   ` Lokesh Vutla
2016-05-31 14:09     ` Tom Rini
2016-05-31 14:12       ` Lokesh Vutla
2016-05-31 14:15         ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox