Skip to contentSkip to conversation

spl: fit: Fix load address of fit header

PATCH New Lokesh Vutla 2 participants 2 messages Jun 1, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl: fit: Fix load address of fit header

When loading fit header, it should be loaded to a previous address aligned to ARCH_DMA_MINALIGN and not 8. Fixing the same.

---
 common/spl/spl_fit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/spl/spl_fit.c +2 -2
index a828f72..c9eb020 100644
@@ -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",
Signature · 1 line
2.8.2
#1 lore raw

PATCH 1/1 spl: fit: Fix load address of fit header

Quoted 4 lines · Lokesh Vutla

When loading fit header, it should be loaded to a previous address aligned to ARCH_DMA_MINALIGN and not 8. Fixing the same.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160601/8318cc50/attachment.sig>