[Top] [All Lists]

Re: Building 64 bit kernel on Cobalt

Subject: Re: Building 64 bit kernel on Cobalt
From: Kumba <>
Date: Fri, 23 Mar 2007 09:47:32 -0400
Cc: Franck Bui-Huu <>, Atsushi Nemoto <>
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <>
User-agent: Thunderbird 2.0b2 (Windows/20070116)
Franck Bui-Huu wrote:

Yes it is !

After writing this I just realised that I was confused by what you said earlier:

   You are using CONFIG_BUILD_ELF64=y and CKSEG0 load address.
   This combination does not work.  Please refer these threads:

This combo should theoritically work but currently does not. Unlike
the following one

   CONFIG_BUILD_ELF64=n and XKPHYS load address.

which definitely don't work. And I mixed the second case with the first one...

no other comment ;)

Cobalt's, being just like IP32, should work fine, provided that the __pa_page_offset() macro gets set properly. The thing isn't whether or not CKSEG0 works or doesn't work (IMHO, it works just fine), it's just making sure that macro gets set properly, and sanely.

These three systems (IP22, IP32, & Cobalt) are the kinds of systems that are gonna violate whatever rule that says CONFIG_BUILD_ELF64 && CKSEG0 is invalid. This is the nature of MIPS, especially on the SGI platform. They're also the most common types of machines end user/hobbyists are gonna get, so these machines need to work. If it was some obscure mips board only available for large sums of <insert currency>, then I figure things would be different.

Can someone review this patch for sanity? It achieves my desire and lets IP32 boot using the way I've been told (BUILD_ELF64 + -msym32 + vmlinux.32). Likely, it'll also do the same for Cobalt and IP22 64bit kernels (good luck getting those to work right anyways).


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
diff -Naurp mipslinux/arch/mips/Kconfig mipslinux.ckseg0-a/arch/mips/Kconfig
--- mipslinux/arch/mips/Kconfig 2007-03-17 21:12:06.000000000 -0400
+++ mipslinux.ckseg0-a/arch/mips/Kconfig        2007-03-20 01:38:42.000000000 
@@ -1659,6 +1659,11 @@ config SB1_PASS_2_1_WORKAROUNDS
        depends on CPU_SB1 && CPU_SB1_PASS_2
        default y
+       bool
+       depends on BUILD_ELF64 && (SGI_IP22 || (SGI_IP32 && (CPU_R5000 || 
+       default y
 config 64BIT_PHYS_ADDR
        bool "Support for 64-bit physical address space"
        depends on (CPU_R4X00 || CPU_R5000 || CPU_RM7000 || CPU_RM9000 || 
CPU_R10000 || CPU_SB1 || CPU_MIPS32 || CPU_MIPS64) && 32BIT
diff -Naurp mipslinux/include/asm-mips/page.h 
--- mipslinux/include/asm-mips/page.h   2007-03-17 21:12:31.000000000 -0400
+++ mipslinux.ckseg0-a/include/asm-mips/page.h  2007-03-20 01:37:31.000000000 
@@ -149,7 +149,7 @@ typedef struct { unsigned long pgprot; }
  * __pa()/__va() should be used only during mem init.
-#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
+#if defined(CONFIG_64BIT) && (!defined(CONFIG_BUILD_ELF64) || 
 #define __pa_page_offset(x)    ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : 
 #define __pa_page_offset(x)    PAGE_OFFSET
<Prev in Thread] Current Thread [Next in Thread>