diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-11-26 09:53:34 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-12-10 14:35:34 +0100 |
commit | ee7f5d5d506e40b9707611eba6e40d76f8049b3b (patch) | |
tree | b766030d5e37dac79be2dd44d37dd1bd09a2d634 /arch/arm/mach-omap/omap_generic.c | |
parent | b037240d1fcf1ab974946514f7ef5f24c34b9fa0 (diff) | |
download | barebox-ee7f5d5d506e40b9707611eba6e40d76f8049b3b.tar.gz barebox-ee7f5d5d506e40b9707611eba6e40d76f8049b3b.tar.xz |
ARM: OMAP: Safe boot info in fixed SRAM address
Storing the boot information in the image itself and passing a pointer
around between images is cumbersome and doesn't fit well with multiimage
support where the pointer we pass around is already occupied by the
devicetree.
Do the same as U-Boot does and store the boot information at the bottom
of the SRAM public stack.
To maintain the compatibility between new xloaders and older barebox
binaries we still pass the boot information to the next stage via pointer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap/omap_generic.c')
-rw-r--r-- | arch/arm/mach-omap/omap_generic.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c index 47fa9ba958..3d302f3efa 100644 --- a/arch/arm/mach-omap/omap_generic.c +++ b/arch/arm/mach-omap/omap_generic.c @@ -45,15 +45,24 @@ static void *omap_sram_start(void) return NULL; } +static void *omap_scratch_space_start(void) +{ + if (cpu_is_am33xx()) + return (void *)AM33XX_SRAM_SCRATCH_SPACE; + if (cpu_is_omap3()) + return (void *)OMAP3_SRAM_SCRATCH_SPACE; + if (cpu_is_omap4()) + return (void *)OMAP44XX_SRAM_SCRATCH_SPACE; + return NULL; +} + void __noreturn omap_start_barebox(void *barebox) { int (*func)(void *) = barebox; - uint32_t *arg; void *sramadr = omap_sram_start(); + void *scratch = omap_scratch_space_start(); - arg = (uint32_t *)&omap_bootinfo; - - memcpy(sramadr, &omap_bootinfo, sizeof(uint32_t) * 3); + memcpy(sramadr, scratch, sizeof(uint32_t) * 3); shutdown_barebox(); func(sramadr); |