Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73346081 authored by Marcin Nowakowski's avatar Marcin Nowakowski Committed by Ralf Baechle
Browse files

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: default avatarMarcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14610/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent d9b5b658
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -49,6 +49,13 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
	return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS));
	return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS));
}
}


int __init early_init_dt_reserve_memory_arch(phys_addr_t base,
					phys_addr_t size, bool nomap)
{
	add_memory_region(base, size, BOOT_MEM_RESERVED);
	return 0;
}

void __init __dt_setup_arch(void *bph)
void __init __dt_setup_arch(void *bph)
{
{
	if (!early_init_dt_scan(bph))
	if (!early_init_dt_scan(bph))
+4 −0
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@
#include <linux/device.h>
#include <linux/device.h>
#include <linux/dma-contiguous.h>
#include <linux/dma-contiguous.h>
#include <linux/decompress/generic.h>
#include <linux/decompress/generic.h>
#include <linux/of_fdt.h>


#include <asm/addrspace.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <asm/bootinfo.h>
@@ -832,6 +833,9 @@ static void __init arch_mem_init(char **cmdline_p)
		print_memory_map();
		print_memory_map();
	}
	}


	early_init_fdt_reserve_self();
	early_init_fdt_scan_reserved_mem();

	bootmem_init();
	bootmem_init();
#ifdef CONFIG_PROC_VMCORE
#ifdef CONFIG_PROC_VMCORE
	if (setup_elfcorehdr && setup_elfcorehdr_size) {
	if (setup_elfcorehdr && setup_elfcorehdr_size) {