Port and Enable kexec from EpicMTD Kernel.

From 35fd107 Mon Sep 17 00:00:00 2001
From: Mike Kasick <mike@kasick.org>
Date: Fri, 6 Apr 2012 20:42:18 -0400
Subject: [PATCH 1/5] Relocate pmstats to avoid conflict with kexec hardboot
 page.

Relocate pmstats to avoid conflict with kexec hardboot page.

The last page (4 kB) of physical RAM, after the ram_console, is reserved
for pm_debug_scratchpad (pmstats).  This conflicts with that memory's usage
as the hardboot page, already in use in kexec-enabled epicmtd kernels.

Since pmstats uses very little of the whole 4 kB, move the scratchpad
forward to leave 1 kB of memory available for kexec.  Also requires fixing
up pmstats alloc and copy routines to not attempt to read the whole page.
---
 arch/arm/mach-s5pv210/mach-p1.c |    3 ++-
 arch/arm/plat-samsung/pm.c      |   14 +++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)

From e15a4be Mon Sep 17 00:00:00 2001
From: Mike Kasick <mike@kasick.org>
Date: Tue, 18 Oct 2011 21:30:18 -0400
Subject: [PATCH 2/5] Enable kexec syscall and fix support for ARMv7.

Enable kexec syscall and fix support for ARMv7.

Essentially a backport of the relevant functions from Linux 3.1-rc4.  In
particular, it now actually disables cache* and the MMU in preparation for
soft boot.  Without this, relocate_new_kernel() would hang for an unknown
reason.  Although, it's known that there's no safe way to execute that
function with the MMU on as it may overwrite active page tables.

The suggestion to call cpu_reset by its physical address comes from an
earlier kexec support patch by Will Deacon [1].  The arm_machine_restart()
modification is primarily to ensure setup_mm_for_reboot() is called before
cache is disabled, since setting the page table mappings takes a very long
time if done after.

* GB note: cpu_proc_fin already implements cache disabling, but is out of
sync with later Linuxes (i.e., it disables interrupts and flushes as well,
which is done earlier here).  This patch keeps cpu_proc_fin in sync with
EC05 patches and Linux 3.1-rc4.

[1] W. Deacon. [4/6] ARM: reset: add reset functionality for jumping to a
    physical address, Jun. 2011. https://patchwork.kernel.org/patch/852802/
---
 Kernel/arch/arm/configs/victory_8G_defconfig |    3 ++-
 Kernel/arch/arm/kernel/machine_kexec.c       |   13 +++++++++++--
 Kernel/arch/arm/kernel/process.c             |   20 ++++++++++++++------
 Kernel/arch/arm/mm/proc-v7.S                 |   12 ++++++++----
 4 files changed, 35 insertions(+), 13 deletions(-)

From bbed6a1 Mon Sep 17 00:00:00 2001
From: Mike Kasick <mike@kasick.org>
Date: Tue, 18 Oct 2011 21:29:44 -0400
Subject: [PATCH 3/5] Enable caching and buffering for all of physical RAM in the decompressor.

Enable caching and buffering for all of physical RAM in the decompressor.

Old method is to enable caching and buffering only for the 256 MB at the
start of the decompressor image.  This makes a hardboot-kexec'd kernel very
slow to decompress since the decompressor is located far above the kernel
destination.  This patch reduces boot time from 35 to 8 seconds.
---
 Kernel/arch/arm/boot/compressed/head.S             |    6 ++++++
 Kernel/arch/arm/mach-s5pv210/include/mach/memory.h |    3 +++
 2 files changed, 9 insertions(+), 0 deletions(-)

From 7990c59 Mon Sep 17 00:00:00 2001
From: Mike Kasick <mike@kasick.org>
Date: Tue, 18 Oct 2011 21:25:47 -0400
Subject: [PATCH 4/5] Support copying of kernel tagged list (atags) in the decompressor.

Support copying of kernel tagged list (atags) in the decompressor.

This is needed to hardboot kexec a kernel with a new tags list (including a
new kernel command line), since the new atags would otherwise be lost with
the limited kernel memory mapping.  Without this patch, a hardboot-kexec'd
kernel uses the atags provided by the bootloader.
---
 Kernel/arch/arm/boot/compressed/head.S |   41 +++++++++++++++++++++++++++++++-
 Kernel/arch/arm/boot/compressed/misc.c |   23 ++++++++++++++++++
 2 files changed, 63 insertions(+), 1 deletions(-)

From 8a93d5e Mon Sep 17 00:00:00 2001
From: Mike Kasick <mike@kasick.org>
Date: Tue, 18 Oct 2011 21:25:23 -0400
Subject: [PATCH 5/5] Support hard booting to a kexec kernel.

Support hard booting to a kexec kernel.

See KEXEC_HARDBOOT config option help for details.

Change-Id: I14cdc94ae8104d001feffdca8a41d802d200ab6e