ARM: P2V: eliminate head.S use of PHYS_OFFSET for !XIP_KERNEL
commit72a20e22f49e2dad3180c23980a9df1c63faab0a
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 4 Jan 2011 19:04:00 +0000 (4 19:04 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 17 Feb 2011 23:27:30 +0000 (17 23:27 +0000)
tree97edaa9db248ecc7e9a6a66c1ef5a054412af5c2
parentb75c178afaa975896e894bb2b6951dc4cd43c977
ARM: P2V: eliminate head.S use of PHYS_OFFSET for !XIP_KERNEL

head.S makes use of PHYS_OFFSET.  When it becomes a variable, the
assembler won't understand this.  Compute PHYS_OFFSET by the following
method.  This code is linked at its virtual address, but run at before
the MMU is enabled, so at his physical address.

1: .long .
.long PAGE_OFFSET

adr r0, 1b @ r0 = physical ','
ldmia r0, {r1, r2} @ r1 = virtual '.', r2 = PAGE_OFFSET
sub r1, r0, r1 @ r1 = physical-virtual
add r2, r2, r1 @ r2 = PAGE_OFFSET + physical-virtual
@    := PHYS_OFFSET.

Switch XIP users of PHYS_OFFSET to use PLAT_PHYS_OFFSET - we can't
use this method for XIP kernels as the code doesn't execute in RAM.

Tested-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/head.S