]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/machine_kexec_64.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / machine_kexec_64.c
index b438d45a068c6b0dd621b0f51520f9478b729539..704375bda73a928446bb87ba68e492659be093a0 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 
-#include <linux/cpumask.h>
 #include <linux/kexec.h>
 #include <linux/smp.h>
 #include <linux/thread_info.h>
@@ -21,7 +20,6 @@
 #include <asm/machdep.h>
 #include <asm/cacheflush.h>
 #include <asm/paca.h>
-#include <asm/lmb.h>
 #include <asm/mmu.h>
 #include <asm/sections.h>      /* _end */
 #include <asm/prom.h>
@@ -33,8 +31,8 @@ int default_machine_kexec_prepare(struct kimage *image)
        unsigned long begin, end;       /* limits of segment */
        unsigned long low, high;        /* limits of blocked memory range */
        struct device_node *node;
-       unsigned long *basep;
-       unsigned int *sizep;
+       const unsigned long *basep;
+       const unsigned int *sizep;
 
        if (!ppc_md.hpte_clear_all)
                return -ENOENT;
@@ -74,10 +72,8 @@ int default_machine_kexec_prepare(struct kimage *image)
        /* We also should not overwrite the tce tables */
        for (node = of_find_node_by_type(NULL, "pci"); node != NULL;
                        node = of_find_node_by_type(node, "pci")) {
-               basep = (unsigned long *)get_property(node, "linux,tce-base",
-                                                       NULL);
-               sizep = (unsigned int *)get_property(node, "linux,tce-size",
-                                                       NULL);
+               basep = of_get_property(node, "linux,tce-base", NULL);
+               sizep = of_get_property(node, "linux,tce-size", NULL);
                if (basep == NULL || sizep == NULL)
                        continue;
 
@@ -298,19 +294,19 @@ static unsigned long htab_base, kernel_end;
 static struct property htab_base_prop = {
        .name = "linux,htab-base",
        .length = sizeof(unsigned long),
-       .value = (unsigned char *)&htab_base,
+       .value = &htab_base,
 };
 
 static struct property htab_size_prop = {
        .name = "linux,htab-size",
        .length = sizeof(unsigned long),
-       .value = (unsigned char *)&htab_size_bytes,
+       .value = &htab_size_bytes,
 };
 
 static struct property kernel_end_prop = {
        .name = "linux,kernel-end",
        .length = sizeof(unsigned long),
-       .value = (unsigned char *)&kernel_end,
+       .value = &kernel_end,
 };
 
 static void __init export_htab_values(void)
@@ -339,7 +335,7 @@ static void __init export_htab_values(void)
 static struct property crashk_base_prop = {
        .name = "linux,crashkernel-base",
        .length = sizeof(unsigned long),
-       .value = (unsigned char *)&crashk_res.start,
+       .value = &crashk_res.start,
 };
 
 static unsigned long crashk_size;
@@ -347,7 +343,7 @@ static unsigned long crashk_size;
 static struct property crashk_size_prop = {
        .name = "linux,crashkernel-size",
        .length = sizeof(unsigned long),
-       .value = (unsigned char *)&crashk_size,
+       .value = &crashk_size,
 };
 
 static void __init export_crashk_values(void)
@@ -385,58 +381,3 @@ static int __init kexec_setup(void)
        return 0;
 }
 __initcall(kexec_setup);
-
-static int __init early_parse_crashk(char *p)
-{
-       unsigned long size;
-
-       if (!p)
-               return 1;
-
-       size = memparse(p, &p);
-
-       if (*p == '@')
-               crashk_res.start = memparse(p + 1, &p);
-       else
-               crashk_res.start = KDUMP_KERNELBASE;
-
-       crashk_res.end = crashk_res.start + size - 1;
-
-       return 0;
-}
-early_param("crashkernel", early_parse_crashk);
-
-void __init reserve_crashkernel(void)
-{
-       unsigned long size;
-
-       if (crashk_res.start == 0)
-               return;
-
-       /* We might have got these values via the command line or the
-        * device tree, either way sanitise them now. */
-
-       size = crashk_res.end - crashk_res.start + 1;
-
-       if (crashk_res.start != KDUMP_KERNELBASE)
-               printk("Crash kernel location must be 0x%x\n",
-                               KDUMP_KERNELBASE);
-
-       crashk_res.start = KDUMP_KERNELBASE;
-       size = PAGE_ALIGN(size);
-       crashk_res.end = crashk_res.start + size - 1;
-
-       /* Crash kernel trumps memory limit */
-       if (memory_limit && memory_limit <= crashk_res.end) {
-               memory_limit = crashk_res.end + 1;
-               printk("Adjusted memory limit for crashkernel, now 0x%lx\n",
-                               memory_limit);
-       }
-
-       lmb_reserve(crashk_res.start, size);
-}
-
-int overlaps_crashkernel(unsigned long start, unsigned long size)
-{
-       return (start + size) > crashk_res.start && start <= crashk_res.end;
-}