From 65504828dd886292380ae422bf15a070baaa387b Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 22 Aug 2013 20:39:29 +0200 Subject: ARM: omap: fix omap_save_bootinfo omap_save_bootinfo derefences the argument passed to barebox without checking it for validity. This breaks 2nd stage booting where r0 is undefined. The best we can do is to check whether the pointer is somewhere in SRAM and is word aligned. This at least makes sure that we do not oops. This introduces SoC specific xxx_save_bootinfo variants since the SRAM addresses/sizes differ between SoCs. Additionally fix the prototype for omap_save_bootinfo. It uses r0, so it must be passed this variable. Signed-off-by: Sascha Hauer --- arch/arm/boards/omap343xdsp/lowlevel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/arm/boards/omap343xdsp') diff --git a/arch/arm/boards/omap343xdsp/lowlevel.c b/arch/arm/boards/omap343xdsp/lowlevel.c index 61b7f99a17..fcb9571506 100644 --- a/arch/arm/boards/omap343xdsp/lowlevel.c +++ b/arch/arm/boards/omap343xdsp/lowlevel.c @@ -10,6 +10,7 @@ #include #include #include +#include #include /** @@ -549,7 +550,7 @@ static int sdp343x_board_init(void) void __naked __bare_init barebox_arm_reset_vector(uint32_t *data) { - omap_save_bootinfo(); + omap3_save_bootinfo(data); arm_cpu_lowlevel_init(); -- cgit v1.2.3