From b1dcc08ea79ca96256a9ae6ef59e5ea4e217ef1d Mon Sep 17 00:00:00 2001 From: Mika Westerberg Date: Wed, 5 May 2010 09:58:33 +0300 Subject: kexec: implement ARM crashdump support Implement support for loading dump capture kernels for ARM architecture. ARM doesn't need any backup memory regions so only elfcore header is allocated from the top of the reserved memory region. Only zImages are supported. The dump capture kernel needs to be loaded to physical address corresponding to the memory region reserved with 'crashkernel=size@start' kernel command line parameter. Signed-off-by: Mika Westerberg Signed-off-by: Simon Horman --- kexec/arch/arm/phys_to_virt.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 kexec/arch/arm/phys_to_virt.c (limited to 'kexec/arch/arm/phys_to_virt.c') diff --git a/kexec/arch/arm/phys_to_virt.c b/kexec/arch/arm/phys_to_virt.c new file mode 100644 index 0000000..bcced52 --- /dev/null +++ b/kexec/arch/arm/phys_to_virt.c @@ -0,0 +1,20 @@ +#include "../../kexec.h" +#include "../../crashdump.h" +#include "crashdump-arm.h" + +/** + * phys_to_virt() - translate physical address to virtual address + * @paddr: physical address to translate + * + * For ARM we have following equation to translate from virtual address to + * physical: + * paddr = vaddr - PAGE_OFFSET + PHYS_OFFSET + * + * See also: + * http://lists.arm.linux.org.uk/lurker/message/20010723.185051.94ce743c.en.html + */ +unsigned long +phys_to_virt(struct crash_elf_info *elf_info, unsigned long paddr) +{ + return paddr + elf_info->page_offset - phys_offset; +} -- cgit