diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2015-12-08 10:39:31 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-12-10 08:49:52 +0100 |
commit | 6c42710ae03bd642f68220dea4dac60b6cbd6d23 (patch) | |
tree | 884fe42be56203c7ef309e8708b7f627cef1b96d /arch/arm/include/asm | |
parent | 9280600522a5ec6c3618683cd5ca9f7973bffbe3 (diff) | |
download | barebox-6c42710ae03bd642f68220dea4dac60b6cbd6d23.tar.gz barebox-6c42710ae03bd642f68220dea4dac60b6cbd6d23.tar.xz |
arm: Add RAMOOPS memory area
RAMOOPS is a driver that uses a reserved static memory region to store
the data from the last panic or boot. This helps to debug crashes at the
next boot while preserving the boot messages.
To guarantee a memory area that is not altered by barebox or the kernel,
this area is located at the end of the RAM right after barebox and
before the STACK. This ensures that changing barebox sizes do not
interfere with RAMOOPS.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r-- | arch/arm/include/asm/barebox-arm.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h index 8d52882981..67133265d1 100644 --- a/arch/arm/include/asm/barebox-arm.h +++ b/arch/arm/include/asm/barebox-arm.h @@ -122,11 +122,23 @@ static inline unsigned long arm_mem_early_malloc_end(unsigned long membase, return arm_mem_ttb(membase, endmem); } +static inline unsigned long arm_mem_ramoops(unsigned long membase, + unsigned long endmem) +{ + endmem = arm_mem_ttb(membase, endmem); +#ifdef CONFIG_FS_PSTORE_RAMOOPS + endmem -= CONFIG_FS_PSTORE_RAMOOPS_SIZE; + endmem &= ~(SZ_4K - 1); /* Align to 4K */ +#endif + + return endmem; +} + static inline unsigned long arm_mem_barebox_image(unsigned long membase, unsigned long endmem, unsigned long size) { - endmem = arm_mem_ttb(membase, endmem); + endmem = arm_mem_ramoops(membase, endmem); if (IS_ENABLED(CONFIG_RELOCATABLE)) { endmem -= size; |