diff mbox

[U-Boot] spl: fit: Fix load address of fit header

Message ID 1464757111-30965-1-git-send-email-lokeshvutla@ti.com
State Accepted
Commit 8b528709c5bba6a8d0ec83b20545bbd75f082704
Delegated to: Tom Rini
Headers show

Commit Message

Lokesh Vutla June 1, 2016, 4:58 a.m. UTC
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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tom Rini June 1, 2016, 11:13 a.m. UTC | #1
On Wed, Jun 01, 2016 at 10:28:31AM +0530, Lokesh Vutla wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index a828f72..c9eb020 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -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",