[Top] [All Lists]

Re: IP32 prom crashes due to __pa() funkiness

Subject: Re: IP32 prom crashes due to __pa() funkiness
From: Kumba <>
Date: Sun, 18 Mar 2007 17:37:28 -0400
Cc: Franck Bui-Huu <>, Linux MIPS List <>
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <Pine.LNX.4.58.0703181006450.396@Indigo2.Peter> <>
User-agent: Thunderbird 2.0b2 (Windows/20070116)
Kumba wrote:
peter fuerst wrote:


Did you try to use PHYS_OFFSET > 0 ?  __pa() ist still (as of
d3fbd83ff545e49e2a0a5ca0f00dda4eedaf8be7) defined as (casts omitted):

#define __pa(x) (x - (x < CKSEG0 ? PAGE_OFFSET:CKSEG0) + PHYS_OFFSET)

This gives __pa(CKSEG0) == PHYS_OFFSET, which will never work for
PHYS_OFFSET > 0. A quick fix (assuming this was the cause for failure)
could be:

--- d3fbd83ff545e49e2a0a5ca0f00dda4eedaf8be7/include/asm-mips/page.h Sat Mar 10 08:43:17 2007
+++ quickfix/include/asm-mips/page.h    Sun Mar 18 10:24:34 2007
@@ -150,7 +150,7 @@ typedef struct { unsigned long pgprot; }
  * __pa()/__va() should be used only during mem init.
 #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
-#define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0) +#define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0+PHYS_OFFSET)
 #define __pa_page_offset(x)    PAGE_OFFSET

Signed-off-by: peter fuerst <>


Of course, "#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)" is also needed.

kind regards


Hmm, I can't find where PHYS_OFFSET is defined for mips. A grep shows it mostly existing for the arm arch. Is there an alternative macro available, or is this something that needs porting over?


Ah, duh. PHYS_OFFSET was introduced post-2.6.20, so I won't be able to leverage this w/o backporting.


Gentoo/MIPS Team Lead

"Such is oft the course of deeds that move the wheels of the world: small hands do them because they must, while the eyes of the great are elsewhere." --Elrond

<Prev in Thread] Current Thread [Next in Thread>