Re: IP32 prom crashes due to __pa() funkiness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kumba wrote:
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@xxxxxxxx>

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

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

kind regards

peter

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?


--Kumba

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


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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux