Received: from mail.onstor.com ([66.201.51.107]) by onstor-exch02.onstor.net with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 28 Jan 2007 10:13:00 -0800
Received: from ftp.linux-mips.org ([194.74.144.162]) by mail.onstor.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 28 Jan 2007 10:13:00 -0800
Received: from localhost.localdomain ([127.0.0.1]:36019 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP
	id S20038317AbXA1SLq (ORCPT <rfc822;dan.stein@onstor.com> + 1 other);
	Sun, 28 Jan 2007 18:11:46 +0000
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 28 Jan 2007 18:11:23 +0000 (GMT)
Received: from nevyn.them.org ([66.93.172.17]:48873 "EHLO nevyn.them.org")
	by ftp.linux-mips.org with ESMTP id S20038287AbXA1SLT (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 28 Jan 2007 18:11:19 +0000
Received: from drow by nevyn.them.org with local (Exim 4.63)
	(envelope-from <drow@nevyn.them.org>)
	id 1HBERj-0004xA-CW; Sun, 28 Jan 2007 13:08:07 -0500
Date:	Sun, 28 Jan 2007 13:08:07 -0500
From:	Daniel Jacobowitz <dan@debian.org>
To:	linux-mips@linux-mips.org
Cc:	Franck Bui-Huu <vagabon.xyz@gmail.com>, ralf@linux-mips.org
Subject: RFC: Sentosa boot fix
Message-ID: <20070128180807.GA18890@nevyn.them.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.13 (2006-08-11)
X-archive-position: 13836
X-ecartis-version: Ecartis v1.0.0
Sender:	linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dan@debian.org
Precedence: bulk
X-list:	linux-mips
Return-Path: linux-mips-bounce@linux-mips.org
X-OriginalArrivalTime: 28 Jan 2007 18:13:00.0261 (UTC) FILETIME=[F1B8F150:01C74307]

From: Daniel Jacobowitz <dan@codesourcery.com>

Always support CKSEG0 for 64-bit kernels.

This prevents an early exception when used without a ramdisk.

Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>

---

Here's a crude patch that lets my Sentosa boot using GIT HEAD.
The problem is __pa_symbol(&_end); the kernel is linked at
0xffffffff80xxxxxx, so subtracting a PAGE_OFFSET of 0xa800000000000000
does not do anything useful to this address at all.

This may be the wrong fix, but if so, I don't understand what's going
on.  What does CKSEG0 have to do with !CONFIG_BUILD_ELF64?

diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 2f9e1a9..81dc8a6 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -132,7 +132,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 /* to align the pointer to the (next) page boundary */
 #define PAGE_ALIGN(addr)	(((addr) + PAGE_SIZE - 1) & PAGE_MASK)
 
-#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
+#if defined(CONFIG_64BIT)
 #define __pa_page_offset(x)	((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0)
 #else
 #define __pa_page_offset(x)	PAGE_OFFSET

-- 
Daniel Jacobowitz
CodeSourcery

