aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2015-10-06 23:48:20 -0400
committerScott Wood <scottwood@freescale.com>2015-10-27 19:13:29 -0400
commitffda09a9941c18d9f08d1176d55588d505f62912 (patch)
tree0d351c61ced2de8d1af8d2959201d90e41adcbe8
parent567cf94dc7801f6602a73b55f04cb096a3c351fb (diff)
powerpc/booke: Only use VIRT_PHYS_OFFSET on booke32
The way VIRT_PHYS_OFFSET is not correct on book3e-64, because it does not account for CONFIG_RELOCATABLE other than via the 32-bit-only virt_phys_offset. book3e-64 can (and if the comment about a GCC miscompilation is still relevant, should) use the normal ppc64 __va/__pa. At this point, only booke-32 will use VIRT_PHYS_OFFSET, so given the issues with its calculation, restrict its definition to booke-32. Signed-off-by: Scott Wood <scottwood@freescale.com>
-rw-r--r--arch/powerpc/include/asm/page.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 96534b4e5a64..3140c19c448c 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -108,12 +108,13 @@ extern long long virt_phys_offset;
108#endif 108#endif
109 109
110/* See Description below for VIRT_PHYS_OFFSET */ 110/* See Description below for VIRT_PHYS_OFFSET */
111#ifdef CONFIG_RELOCATABLE_PPC32 111#if defined(CONFIG_PPC32) && defined(CONFIG_BOOKE)
112#ifdef CONFIG_RELOCATABLE
112#define VIRT_PHYS_OFFSET virt_phys_offset 113#define VIRT_PHYS_OFFSET virt_phys_offset
113#else 114#else
114#define VIRT_PHYS_OFFSET (KERNELBASE - PHYSICAL_START) 115#define VIRT_PHYS_OFFSET (KERNELBASE - PHYSICAL_START)
115#endif 116#endif
116 117#endif
117 118
118#ifdef CONFIG_PPC64 119#ifdef CONFIG_PPC64
119#define MEMORY_START 0UL 120#define MEMORY_START 0UL
@@ -206,7 +207,7 @@ extern long long virt_phys_offset;
206 * On non-Book-E PPC64 PAGE_OFFSET and MEMORY_START are constants so use 207 * On non-Book-E PPC64 PAGE_OFFSET and MEMORY_START are constants so use
207 * the other definitions for __va & __pa. 208 * the other definitions for __va & __pa.
208 */ 209 */
209#ifdef CONFIG_BOOKE 210#if defined(CONFIG_PPC32) && defined(CONFIG_BOOKE)
210#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET)) 211#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
211#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET) 212#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)
212#else 213#else