SPL: FIT: Align loading address for header
authorMichal Simek <michal.simek@xilinx.com>
Thu, 28 Apr 2016 08:36:11 +0000 (10:36 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 27 May 2016 13:56:20 +0000 (09:56 -0400)
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>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/spl/spl_fit.c

index 26842ba285cea51eeae81c73fd290300f447d6ab..90acbb2d8a399a3590f6b2d409aaa47cbee7b40e 100644 (file)
@@ -123,6 +123,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",