summaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-06-16 14:52:03 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-06-20 08:30:22 +0200
commit22d7d604f13968fdaeadda73e81e930e933d7e10 (patch)
tree2d3d27db4c718c56aeef84a44d9768f137a0d869 /arch/arm/include
parentb0e1847f134e7ec90f41623a8cbe6ce2f941ddde (diff)
downloadbarebox-22d7d604f13968fdaeadda73e81e930e933d7e10.tar.gz
barebox-22d7d604f13968fdaeadda73e81e930e933d7e10.tar.xz
ARM: start: Fix arm_mem_barebox_image for !CONFIG_RELOCATABLE
Fixes: 65071bd arm: Clarify memory layout calculation arm_mem_barebox_image() shall return the beginning of the barebox image (and thus the end of the malloc region). For relocatable images we can return a suitable location, but for non relocatable images we do not have a choice: We must return TEXT_BASE. If TEXT_BASE happens to be outside the memory region between membase and endmem we can return the base of the ramoops area. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Markus Pargmann <mpa@pengutronix.de>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/barebox-arm.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 8e7b45c33d..0acdfa3dbc 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -143,9 +143,13 @@ static inline unsigned long arm_mem_barebox_image(unsigned long membase,
if (IS_ENABLED(CONFIG_RELOCATABLE)) {
endmem -= size;
endmem &= ~(SZ_1M - 1);
+ return endmem;
+ } else {
+ if (TEXT_BASE >= membase && TEXT_BASE < endmem)
+ return TEXT_BASE;
+ else
+ return endmem;
}
-
- return endmem;
}
#define ENTRY_FUNCTION(name, arg0, arg1, arg2) \