Skip to content

Commit bd848d1

Browse files
Thomas Bogendoerferpaulburton
authored andcommitted
MIPS: init: Prevent adding memory before PHYS_OFFSET
On some SGI machines (IP28 and IP30) a small region of memory is mirrored to pyhsical address 0 for exception vectors while rest of the memory is reachable at a higher physical address. ARC PROM marks this region as reserved, but with commit a94e4f2 ("MIPS: init: Drop boot_mem_map") this chunk is used, when searching for start of ram, which breaks at least IP28 and IP30 machines. To fix this add_region_memory() checks for start address < PHYS_OFFSET and ignores these chunks. Fixes: a94e4f2 ("MIPS: init: Drop boot_mem_map") Signed-off-by: Thomas Bogendoerfer <[email protected]> Signed-off-by: Paul Burton <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: James Hogan <[email protected]> Cc: [email protected] Cc: [email protected]
1 parent 66b416e commit bd848d1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/mips/kernel/setup.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ void __init add_memory_region(phys_addr_t start, phys_addr_t size, long type)
108108
return;
109109
}
110110

111+
if (start < PHYS_OFFSET)
112+
return;
113+
111114
memblock_add(start, size);
112115
/* Reserve any memory except the ordinary RAM ranges. */
113116
switch (type) {

0 commit comments

Comments
 (0)