diff options
author | Rob Herring <robh@kernel.org> | 2021-02-21 09:49:22 -0800 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2021-03-08 12:06:29 -0700 |
commit | b30be4dc733e5067b56def359b0823f1e54ded8c (patch) | |
tree | 0442c9d623d1227b980846493dc41d22c7bd9291 /drivers/of/Makefile | |
parent | 179350f00e0663cea76af83b843078eebe1bfbf4 (diff) |
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 'drivers/of/Makefile')
-rw-r--r-- | drivers/of/Makefile | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/of/Makefile b/drivers/of/Makefile index 6e1e5212f058..c13b982084a3 100644 --- a/drivers/of/Makefile +++ b/drivers/of/Makefile @@ -14,4 +14,10 @@ obj-$(CONFIG_OF_RESOLVE) += resolver.o obj-$(CONFIG_OF_OVERLAY) += overlay.o obj-$(CONFIG_OF_NUMA) += of_numa.o +ifdef CONFIG_KEXEC_FILE +ifdef CONFIG_OF_FLATTREE +obj-y += kexec.o +endif +endif + obj-$(CONFIG_OF_UNITTEST) += unittest-data/ |