linux-mips
[Top] [All Lists]

Re: IP32 prom crashes due to __pa() funkiness

To: post@pfrst.de
Subject: Re: IP32 prom crashes due to __pa() funkiness
From: Kumba <kumba@gentoo.org>
Date: Sun, 18 Mar 2007 18:44:48 -0400
Cc: Franck Bui-Huu <vagabon.xyz@gmail.com>, Linux MIPS List <linux-mips@linux-mips.org>
In-reply-to: <Pine.LNX.4.58.0703181006450.396@Indigo2.Peter>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <45D8B070.7070405@gentoo.org> <cda58cb80703010139y3e5bbb8eqa4d25b75ba658a22@mail.gmail.com> <45FC3923.2080207@gentoo.org> <Pine.LNX.4.58.0703181006450.396@Indigo2.Peter>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0b2 (Windows/20070116)
peter fuerst wrote:

Hi!

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)
 #else
 #define __pa_page_offset(x)    PAGE_OFFSET
 #endif


Signed-off-by: peter fuerst <post@pfrst.de>

========================================================================

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

kind regards

peter


Backported the patches that bring in PHYS_OFFSET and tried both with and without Frank's patches to remove CONFIG_BUILD_ELF64 from the Makefile, plus this change, and still no go. W/o CONFIG_BUILD_ELF64, both the vmlinux and vmlinux.32 targets just silently hang. With CONFIG_BUILD_ELF64 in the Makefile, the same Prom crash.


--Kumba

--
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>