[PATCH 17/38] MIPS: SGI-IP27: load the kernel at node offset 0x40000
From: Imre Kaloz
Date: Thu Oct 01 2026 - 12:53:45 EST
A Bedrock machine's PROM owns node memory below offset 0x40000. Link
both the mapped and the unmapped kernel there instead of at 0x1c000.
On an Origin 200/2000 the kernel moves up by 144KB, and the 144KB
below it stays reserved and unused.
Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
---
arch/mips/include/asm/mach-ip27/kernel-entry-init.h | 2 +-
arch/mips/include/asm/sn/mapped_kernel.h | 6 +++---
arch/mips/sgi-ip27/Platform | 11 ++++++-----
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/mips/include/asm/mach-ip27/kernel-entry-init.h b/arch/mips/include/asm/mach-ip27/kernel-entry-init.h
index 1bedd3c3bc58..958f4b390df8 100644
--- a/arch/mips/include/asm/mach-ip27/kernel-entry-init.h
+++ b/arch/mips/include/asm/mach-ip27/kernel-entry-init.h
@@ -49,7 +49,7 @@
dli t0, 0xffffffffc0000000
dmtc0 t0, CP0_ENTRYHI
GET_NASID_SHFT t3, t0
- li t0, 0x1c000 # Offset of text into node memory
+ li t0, 0x40000 # Offset of text into node memory
dsllv t1, t1, t3 # Shift text nasid into place
dsllv t2, t2, t3 # Same for data nasid
or t1, t1, t0 # Physical load address of kernel text
diff --git a/arch/mips/include/asm/sn/mapped_kernel.h b/arch/mips/include/asm/sn/mapped_kernel.h
index 3f1049807018..28227718e391 100644
--- a/arch/mips/include/asm/sn/mapped_kernel.h
+++ b/arch/mips/include/asm/sn/mapped_kernel.h
@@ -10,7 +10,7 @@
/*
* Note on how mapped kernels work: the text and data section is
- * compiled at cksseg segment (LOADADDR = 0xc001c000), and the
+ * compiled at cksseg segment (LOADADDR = 0xc0040000), and the
* init/setup/data section gets a 16M virtual address bump in the
* ld.script file (so that tlblo0 and tlblo1 maps the sections).
* The vmlinux.64 section addresses are put in the xkseg range
@@ -18,8 +18,8 @@
* on IRIX to see where the sections go. The Origin loader loads
* the two sections contiguously in physical memory. The loader
* sets the entry point into kernel_entry using a xkphys address,
- * but instead of using 0xa800000001160000, it uses the address
- * 0xa800000000160000, which is where it physically loaded that
+ * but instead of using 0xa800000001184000, it uses the address
+ * 0xa800000000184000, which is where it physically loaded that
* code. So no jumps can be done before we have switched to using
* cksseg addresses.
*/
diff --git a/arch/mips/sgi-ip27/Platform b/arch/mips/sgi-ip27/Platform
index e734ee6abd44..b312bf69bce1 100644
--- a/arch/mips/sgi-ip27/Platform
+++ b/arch/mips/sgi-ip27/Platform
@@ -1,16 +1,17 @@
#
# SGI-IP27 (Origin200/2000)
#
-# Set the load address to >= 0xc000000000300000 if you want to leave space for
-# symmon, 0xc00000000001c000 for production kernels. Note that the value must
-# be 16kb aligned or the handling of the current variable will break.
+# A Bedrock machine's PROM owns node memory below offset 0x40000, so that is
+# where the kernel loads. Set the load address to >= 0xc000000000300000
+# instead if you want to leave space for symmon. Note that the value must be
+# 16kb aligned or the handling of the current variable will break.
#
cflags-$(CONFIG_SGI_IP27) += -I$(srctree)/arch/mips/include/asm/mach-ip27
ifdef CONFIG_MAPPED_KERNEL
-load-$(CONFIG_SGI_IP27) += 0xc00000004001c000
+load-$(CONFIG_SGI_IP27) += 0xc000000040040000
OBJCOPYFLAGS := --change-addresses=0x3fffffff80000000
dataoffset-$(CONFIG_SGI_IP27) += 0x01000000
else
-load-$(CONFIG_SGI_IP27) += 0xa80000000001c000
+load-$(CONFIG_SGI_IP27) += 0xa800000000040000
OBJCOPYFLAGS := --change-addresses=0x57ffffff80000000
endif
--
2.47.3