[PATCH 12/38] MIPS: SGI-IP27: reserve the bottom 64MB of node 0 on Bedrock hubs
From: Imre Kaloz
Date: Thu Oct 01 2026 - 12:27:06 EST
On Bedrock hubs, reserve the first 64MB of physical memory, the bottom
of node 0, and place node 0's node data above it. node_getfirstfree()
covers only the kernel image, so the area needs a reservation of its
own.
Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
---
arch/mips/sgi-ip27/ip27-memory.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index 0204dc8bb1bb..98184dfcd8c5 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -17,6 +17,7 @@
#include <linux/mmzone.h>
#include <linux/export.h>
#include <linux/nodemask.h>
+#include <linux/sizes.h>
#include <linux/swap.h>
#include <linux/pfn.h>
#include <linux/highmem.h>
@@ -36,6 +37,9 @@
/* A Bedrock node's memory comes in 1GB banks. */
#define BEDROCK_SLOT_SHIFT 30
+/* Reserved at the bottom of node 0, which starts at physical 0. */
+#define BEDROCK_RSVD_SIZE SZ_64M
+
static unsigned int __init slot_shift(void)
{
return system_is_ip35 ? BEDROCK_SLOT_SHIFT : SLOT_SHIFT;
@@ -370,6 +374,10 @@ static void __init node_mem_init(nasid_t node)
get_pfn_range_for_nid(node, &start_pfn, &end_pfn);
+ /* Keep the node data above the reserved area. */
+ if (system_is_ip35 && node == 0)
+ slot_freepfn = max(slot_freepfn, PFN_UP(BEDROCK_RSVD_SIZE));
+
/*
* Allocate the node data structures on the node first.
*/
@@ -410,6 +418,10 @@ void __init prom_meminit(void)
mlreset();
szmem();
+
+ if (system_is_ip35)
+ memblock_reserve(0, BEDROCK_RSVD_SIZE);
+
max_low_pfn = PHYS_PFN(memblock_end_of_DRAM());
for (node = 0; node < MAX_NUMNODES; node++) {
--
2.47.3