aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of.h
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2021-02-21 09:49:22 -0800
committerRob Herring <robh@kernel.org>2021-03-08 12:06:29 -0700
commitb30be4dc733e5067b56def359b0823f1e54ded8c (patch)
tree0442c9d623d1227b980846493dc41d22c7bd9291 /include/linux/of.h
parentx86: Use ELF fields defined in 'struct kimage' (diff)
downloadlinux-dev-b30be4dc733e5067b56def359b0823f1e54ded8c.tar.xz
linux-dev-b30be4dc733e5067b56def359b0823f1e54ded8c.zip
of: Add a common kexec FDT setup function
Both arm64 and powerpc do essentially the same FDT /chosen setup for kexec. The differences are either omissions that arm64 should have or additional properties that will be ignored. The setup code can be combined and shared by both powerpc and arm64. The differences relative to the arm64 version: - If /chosen doesn't exist, it will be created (should never happen). - Any old dtb and initrd reserved memory will be released. - The new initrd and elfcorehdr are marked reserved. - "linux,booted-from-kexec" is set. The differences relative to the powerpc version: - "kaslr-seed" and "rng-seed" may be set. - "linux,elfcorehdr" is set. - Any existing "linux,usable-memory-range" is removed. Combine the code for setting up the /chosen node in the FDT and updating the memory reservation for kexec, for powerpc and arm64, in of_kexec_alloc_and_setup_fdt() and move it to "drivers/of/kexec.c". Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com> Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210221174930.27324-6-nramas@linux.microsoft.com
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index 4b27c9a27df3..d66c915df910 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -560,6 +560,11 @@ int of_map_id(struct device_node *np, u32 id,
phys_addr_t of_dma_get_max_cpu_address(struct device_node *np);
+struct kimage;
+void *of_kexec_alloc_and_setup_fdt(const struct kimage *image,
+ unsigned long initrd_load_addr,
+ unsigned long initrd_len,
+ const char *cmdline, size_t extra_fdt_size);
#else /* CONFIG_OF */
static inline void of_core_init(void)