summaryrefslogtreecommitdiff
path: root/arch/arm/include/asm
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-03-18 09:07:08 -0500
committerJustin Waters <justin.waters@timesys.com>2010-12-13 16:09:20 -0500
commit80f75b69316dc1e1df18b321708e7912681660cc (patch)
tree13b15f67b197e710c94d9b9acea22e817eaa6d53 /arch/arm/include/asm
parentc4190676011b49ca8610fd8c4ab5398c4b33faa6 (diff)
Allow PHYS_OFFSET to be runtime determined
This bases on work done earlier by Lennert Buytenhek and Mark A. Greer. Compared to their approach zreladdr isn't guessed based on the pc register but the bootloader is expected to pass PHYS_OFFSET in r3. If that value doesn't look right (e.g. isn't aligned) it is guessed based on the value of sp. This should work for CONFIG_ZBOOT_ROM, too. To use it for your machine removing the definition of PHYS_OFFSET from <mach/memory.h> and selecting CONFIG_RUNTIME_PHYS_OFFSET should be enough. Cc: Lennert Buytenhek <buytenh@wantstofly.org> Cc: Steve Chen <schen@mvista.com> Cc: Mark A. Greer <mgreer@mvista.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r--arch/arm/include/asm/memory.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 4312ee5e3d0b..05a7a3f22f26 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -24,6 +24,11 @@
*/
#define UL(x) _AC(x, UL)
+#if defined(CONFIG_RUNTIME_PHYS_OFFSET) && !defined(__ASSEMBLY__)
+extern unsigned long phys_offset;
+#define PHYS_OFFSET phys_offset
+#endif
+
#ifdef CONFIG_MMU
/*