diff options
author | Dale Farnsworth <dale@farnsworth.org> | 2008-12-16 01:22:59 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-12-22 23:13:28 -0500 |
commit | 2e8e4f5b80e101da588af650de0ff6b3c475d6b3 (patch) | |
tree | 5097f654aec290e9835e882e2c2aff1e27d0c980 /arch/powerpc/kernel/machine_kexec.c | |
parent | b906cfa397fdef8decbd36467b1f63c830a0bf2b (diff) |
powerpc: Setup OF properties for ppc32 kexec
Refactor the setting of kexec OF properties, moving the common code
from machine_kexec_64.c to machine_kexec.c where it can be used on
both ppc64 and ppc32. This is needed for kexec to work on ppc32
platforms.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/machine_kexec.c')
-rw-r--r-- | arch/powerpc/kernel/machine_kexec.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index ac2a21f45c75..037ade74a99e 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
@@ -13,8 +13,10 @@ | |||
13 | #include <linux/reboot.h> | 13 | #include <linux/reboot.h> |
14 | #include <linux/threads.h> | 14 | #include <linux/threads.h> |
15 | #include <linux/lmb.h> | 15 | #include <linux/lmb.h> |
16 | #include <linux/of.h> | ||
16 | #include <asm/machdep.h> | 17 | #include <asm/machdep.h> |
17 | #include <asm/prom.h> | 18 | #include <asm/prom.h> |
19 | #include <asm/sections.h> | ||
18 | 20 | ||
19 | void machine_crash_shutdown(struct pt_regs *regs) | 21 | void machine_crash_shutdown(struct pt_regs *regs) |
20 | { | 22 | { |
@@ -118,3 +120,35 @@ int overlaps_crashkernel(unsigned long start, unsigned long size) | |||
118 | { | 120 | { |
119 | return (start + size) > crashk_res.start && start <= crashk_res.end; | 121 | return (start + size) > crashk_res.start && start <= crashk_res.end; |
120 | } | 122 | } |
123 | |||
124 | /* Values we need to export to the second kernel via the device tree. */ | ||
125 | static unsigned long kernel_end; | ||
126 | |||
127 | static struct property kernel_end_prop = { | ||
128 | .name = "linux,kernel-end", | ||
129 | .length = sizeof(unsigned long), | ||
130 | .value = &kernel_end, | ||
131 | }; | ||
132 | |||
133 | static int __init kexec_setup(void) | ||
134 | { | ||
135 | struct device_node *node; | ||
136 | struct property *prop; | ||
137 | |||
138 | node = of_find_node_by_path("/chosen"); | ||
139 | if (!node) | ||
140 | return -ENOENT; | ||
141 | |||
142 | /* remove any stale properties so ours can be found */ | ||
143 | prop = of_find_property(node, kernel_end_prop.name, NULL); | ||
144 | if (prop) | ||
145 | prom_remove_property(node, prop); | ||
146 | |||
147 | /* information needed by userspace when using default_machine_kexec */ | ||
148 | kernel_end = __pa(_end); | ||
149 | prom_add_property(node, &kernel_end_prop); | ||
150 | |||
151 | of_node_put(node); | ||
152 | return 0; | ||
153 | } | ||
154 | late_initcall(kexec_setup); | ||