During early boot mem init, some configs can't use __pa() to convert virtual into physical addresses. This patch make __pa() uses CPHYSADDR() for these configs only, others don't need this hack. This will allow to not use anymore CPHYSADDR() in generic code. Signed-off-by: Franck Bui-Huu <fbuihuu@xxxxxxxxx> --- include/asm-mips/page.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 32e5625..b4851ac 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h @@ -131,7 +131,11 @@ #endif /* !__ASSEMBLY__ */ /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) -#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) +#if defined(CONFIG_64BITS) && !defined(CONFIG_BUILD_ELF64) +#define __pa(x) CPHYSADDR(x) +#else +#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET) +#endif #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) -- 1.4.2.3