ARM: kexec: backup the machine id reported by boot loader
PATCH 1/1 ARM: kexec: backup the machine id reported by boot loader
Starting a non-devicetree kernel via kexec from a devicetree kernel, fails since the machine id as received from the bootloader has been overwritten.
Signed-off-by Andreas Fenkart <[email protected]>
--- arch/arm/include/asm/setup.h | 1 + arch/arm/kernel/machine_kexec.c | 4 ++-- arch/arm/kernel/setup.c | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-)
arch/arm/include/asm/setup.h +1 -0
@@ -16,6 +16,7 @@#include <uapi/asm/setup.h> +extern unsigned int __machine_arch_type_bootloader;#define __tag __used __attribute__((__section__(".taglist.init")))#define __tagtable (tag, fn) \
arch/arm/kernel/machine_kexec.c +2 -2
@@ -15,7 +15,7 @@#include <asm/mmu_context.h> #include <asm/cacheflush.h> #include <asm/fncpy.h> -#include <asm/mach-types.h> +#include <asm/setup.h> #include <asm/smp_plat.h> #include <asm/system_misc.h>
@@ -168,7 +168,7 @@ void machine_kexec(struct kimage *image)set_kernel_text_rw (); kexec_start_address = image->start; kexec_indirection_page = page_list; - kexec_mach_type = machine_arch_type; + kexec_mach_type = __machine_arch_type_bootloader; kexec_boot_atags = dt_mem ?: image->start -KEXEC_ARM_ZIMAGE_OFFSET +KEXEC_ARM_ATAGS_OFFSET ;
arch/arm/kernel/setup.c +5 -0
@@ -83,6 +83,8 @@ extern void setup_dma_zone(const struct machine_desc *desc);unsigned int processor_id;EXPORT_SYMBOL (processor_id); +unsigned int __machine_arch_type_bootloader__read_mostly ; +EXPORT_SYMBOL (__machine_arch_type_bootloader);unsigned int __machine_arch_type__read_mostly ;EXPORT_SYMBOL (__machine_arch_type);unsigned int cacheid__read_mostly ;
@@ -914,6 +916,9 @@ void __init setup_arch(char **cmdline_p) {const struct machine_desc *mdesc; +/* save machine type as received by the boot loader */ + __machine_arch_type_bootloader = __machine_arch_type; +setup_processor (); mdesc =setup_machine_fdt (__atags_pointer);if (!mdesc)
Signature · 1 line
2.6.1