Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Use early_init_fdt_reserve_self to protect DTB location

early_init_fdt_reserve_self is used to tell the boot memory allocator
that a memory is occupied by the DTB, so add it in the MIPS init code to
ensure information about the DTB is added to the boot memory array.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14610/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Marcin Nowakowski and committed by
Ralf Baechle
73346081 d9b5b658

+11
+7
arch/mips/kernel/prom.c
··· 49 49 return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)); 50 50 } 51 51 52 + int __init early_init_dt_reserve_memory_arch(phys_addr_t base, 53 + phys_addr_t size, bool nomap) 54 + { 55 + add_memory_region(base, size, BOOT_MEM_RESERVED); 56 + return 0; 57 + } 58 + 52 59 void __init __dt_setup_arch(void *bph) 53 60 { 54 61 if (!early_init_dt_scan(bph))
+4
arch/mips/kernel/setup.c
··· 27 27 #include <linux/device.h> 28 28 #include <linux/dma-contiguous.h> 29 29 #include <linux/decompress/generic.h> 30 + #include <linux/of_fdt.h> 30 31 31 32 #include <asm/addrspace.h> 32 33 #include <asm/bootinfo.h> ··· 832 831 pr_info("User-defined physical RAM map:\n"); 833 832 print_memory_map(); 834 833 } 834 + 835 + early_init_fdt_reserve_self(); 836 + early_init_fdt_scan_reserved_mem(); 835 837 836 838 bootmem_init(); 837 839 #ifdef CONFIG_PROC_VMCORE