Re: IP32 prom crashes due to __pa() funkiness

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

 



On 3/19/07, Kumba <kumba@xxxxxxxxxx> wrote:

Most of this is because IP22 (Indy/Idigo2 R4xx) and IP32 (O2 R5xxx), while
supporting 64bit kernels (same for cobalt, since it's a mips4-level CPU), we had
to "trick" them into accepting 64bit code.  IP32 at one point ran 32bit kernels
only, but it was later converted to supporting only 64bit kernels, hence the
hackery involved.  We describe it as wrapping 64bit code into a 32bit object,
because their proms will only recognize 32bit objects (specifically, IP22 will
only boot 32bit objects; crash on 64bit; IP32 will take both, but likes 32bit
better).

So really, CONFIG_BUILD_ELF64 was probably part of this "magic" to stuff 64bit
code into a candy-coated 32bit wrapper for the Indy (And later the O2) to suck
down w/o complaint.  Hence, __pa() probably needs to replicate this support, or
we all need to brainstorm a proper way to get these systems to boot.


I'm really not confident with all your tricks you described. Maybe a
config that I believed to be uninsteresting and useless should be
supported still.

Can you try the attached patch with a plain linux-mips kernel ? This
patch restore CPHYSADDR() for 64 bits kernels _only_. I guess it's ok
because we won't need to support mapped kernels on 64 bits machines...

Could others give their opinions ?

> I'm sorry but my IPxx background is 0 ;)

Time to buy an O2 :)


As soon as it will work with a plain linux-mips without hackery ;)
--
              Franck
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index d3fbd83..6461154 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -149,12 +149,12 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 /*
  * __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)
+#ifdef CONFIG_64BIT
+#define __pa(x)		((unsigned long)(x) < CKSEG0 ? XPHYSADDR((unsigned long)(x))\
+						     : CPHYSADDR((unsigned long)(x)))
 #else
-#define __pa_page_offset(x)	PAGE_OFFSET
+#define __pa(x)		((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)
 #endif
-#define __pa(x)		((unsigned long)(x) - __pa_page_offset(x) + PHYS_OFFSET)
 #define __va(x)		((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
 #define __pa_symbol(x)	__pa(RELOC_HIDE((unsigned long)(x),0))
 

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

  Powered by Linux