diff mbox

[U-Boot,V4,6/6] omap-common: fixes BSS overwriting problem

Message ID 1314960636-19279-7-git-send-email-simonschwarzcor@gmail.com
State Superseded, archived
Headers show

Commit Message

Simon Schwarz Sept. 2, 2011, 10:50 a.m. UTC
spl_nand overwrote BSS section because it reads a whole block everytime. Now
loads the block to spare area and just copy the needed junk to destination.
Whole block read is necessary for ecc check!

Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
---

V2 changes:
nothing

V3 changes:
nothing
---
 arch/arm/cpu/armv7/omap-common/spl_nand.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c
index 93f5183..ec56565 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_nand.c
+++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c
@@ -72,7 +72,8 @@  void spl_nand_load_image(void)
 			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
 		spl_parse_image_header(header);
 		nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
-			spl_image.size, (void *)spl_image.load_addr);
+			spl_image.size,
+			(void *)spl_image.load_addr - sizeof(header));
 	} else
 #endif
 	{