summaryrefslogtreecommitdiff
path: root/arch/riscv/mm
diff options
context:
space:
mode:
authorNick Kossifidis <mick@ics.forth.gr>2020-10-12 17:24:10 +0300
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-11-09 11:54:30 -0800
commit00ab027a3b82dbad0a698fef1e359ebcab4c205b (patch)
tree2d61ebaf1931f734fb8fc903464dcf5949d73614 /arch/riscv/mm
parent3650b228f83adda7e5ee532e2b90429c03f7b9ec (diff)
RISC-V: Add kernel image sections to the resource tree
This patch (previously part of my kexec/kdump series) populates /proc/iomem with the various sections of the kernel image. We need this for kexec-tools to be able to prepare the crashkernel image for kdump to work. Since resource tree initialization is not related to memory initialization I added the code to kernel/setup.c and removed the original code (derived from the arm64 tree) from mm/init.c. Signed-off-by: Nick Kossifidis <mick@ics.forth.gr> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/mm')
-rw-r--r--arch/riscv/mm/init.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index ea933b789a88..e3c1fc4d5d03 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -625,39 +625,12 @@ void mark_rodata_ro(void)
}
#endif
-static void __init resource_init(void)
-{
- struct memblock_region *region;
-
- for_each_mem_region(region) {
- struct resource *res;
-
- res = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
- if (!res)
- panic("%s: Failed to allocate %zu bytes\n", __func__,
- sizeof(struct resource));
-
- if (memblock_is_nomap(region)) {
- res->name = "reserved";
- res->flags = IORESOURCE_MEM;
- } else {
- res->name = "System RAM";
- res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
- }
- res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
- res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
-
- request_resource(&iomem_resource, res);
- }
-}
-
void __init paging_init(void)
{
setup_vm_final();
sparse_init();
setup_zero_page();
zone_sizes_init();
- resource_init();
}
#ifdef CONFIG_SPARSEMEM_VMEMMAP