]> git.sur5r.net Git - u-boot/commitdiff
spl: fit: Fix load address of fit header
authorLokesh Vutla <lokeshvutla@ti.com>
Wed, 1 Jun 2016 04:58:31 +0000 (10:28 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 1 Jun 2016 11:12:38 +0000 (07:12 -0400)
When loading fit header, it should be loaded to a previous address
aligned to ARCH_DMA_MINALIGN and not 8. Fixing the same.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
common/spl/spl_fit.c

index a828f72da84fa798cfd4f903ab19d7501a8636d3..c9eb020bbce5d6fed21addada130c597bbcc445e 100644 (file)
@@ -156,8 +156,8 @@ int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fit)
         * In fact the FIT has its own load address, but we assume it cannot
         * be before CONFIG_SYS_TEXT_BASE.
         */
-       fit = (void *)(CONFIG_SYS_TEXT_BASE - size - info->bl_len);
-       fit = (void *)ALIGN((ulong)fit, 8);
+       fit = (void *)((CONFIG_SYS_TEXT_BASE - size - info->bl_len -
+                       align_len) & ~align_len);
        sectors = get_aligned_image_size(info, size, 0);
        count = info->read(info, sector, sectors, fit);
        debug("fit read sector %lx, sectors=%d, dst=%p, count=%lu\n",