diff options
author | Dale Farnsworth <dale@farnsworth.org> | 2008-12-17 05:09:06 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-12-22 23:13:29 -0500 |
commit | 6f29c3298b18216198631cbee01c349adecb225d (patch) | |
tree | 3ca157092ef9c3092ca67babe401b5f2a80cef19 /arch/powerpc/kernel/machine_kexec_64.c | |
parent | 73753313884e8d063d9bf9d3e36325743ca006ba (diff) |
powerpc/32: Setup OF properties for kdump
Refactor the setting of kdump 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 will be needed for kdump 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_64.c')
-rw-r--r-- | arch/powerpc/kernel/machine_kexec_64.c | 56 |
1 files changed, 4 insertions, 52 deletions
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index a89bce834a51..49e705fcee6d 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c | |||
@@ -303,18 +303,18 @@ static struct property htab_size_prop = { | |||
303 | .value = &htab_size_bytes, | 303 | .value = &htab_size_bytes, |
304 | }; | 304 | }; |
305 | 305 | ||
306 | static void __init export_htab_values(void) | 306 | static int __init export_htab_values(void) |
307 | { | 307 | { |
308 | struct device_node *node; | 308 | struct device_node *node; |
309 | struct property *prop; | 309 | struct property *prop; |
310 | 310 | ||
311 | /* On machines with no htab htab_address is NULL */ | 311 | /* On machines with no htab htab_address is NULL */ |
312 | if (!htab_address) | 312 | if (!htab_address) |
313 | return; | 313 | return -ENODEV; |
314 | 314 | ||
315 | node = of_find_node_by_path("/chosen"); | 315 | node = of_find_node_by_path("/chosen"); |
316 | if (!node) | 316 | if (!node) |
317 | return; | 317 | return -ENODEV; |
318 | 318 | ||
319 | /* remove any stale propertys so ours can be found */ | 319 | /* remove any stale propertys so ours can be found */ |
320 | prop = of_find_property(node, htab_base_prop.name, NULL); | 320 | prop = of_find_property(node, htab_base_prop.name, NULL); |
@@ -329,54 +329,6 @@ static void __init export_htab_values(void) | |||
329 | prom_add_property(node, &htab_size_prop); | 329 | prom_add_property(node, &htab_size_prop); |
330 | 330 | ||
331 | of_node_put(node); | 331 | of_node_put(node); |
332 | } | ||
333 | |||
334 | static struct property crashk_base_prop = { | ||
335 | .name = "linux,crashkernel-base", | ||
336 | .length = sizeof(unsigned long), | ||
337 | .value = &crashk_res.start, | ||
338 | }; | ||
339 | |||
340 | static unsigned long crashk_size; | ||
341 | |||
342 | static struct property crashk_size_prop = { | ||
343 | .name = "linux,crashkernel-size", | ||
344 | .length = sizeof(unsigned long), | ||
345 | .value = &crashk_size, | ||
346 | }; | ||
347 | |||
348 | static void __init export_crashk_values(void) | ||
349 | { | ||
350 | struct device_node *node; | ||
351 | struct property *prop; | ||
352 | |||
353 | node = of_find_node_by_path("/chosen"); | ||
354 | if (!node) | ||
355 | return; | ||
356 | |||
357 | /* There might be existing crash kernel properties, but we can't | ||
358 | * be sure what's in them, so remove them. */ | ||
359 | prop = of_find_property(node, "linux,crashkernel-base", NULL); | ||
360 | if (prop) | ||
361 | prom_remove_property(node, prop); | ||
362 | |||
363 | prop = of_find_property(node, "linux,crashkernel-size", NULL); | ||
364 | if (prop) | ||
365 | prom_remove_property(node, prop); | ||
366 | |||
367 | if (crashk_res.start != 0) { | ||
368 | prom_add_property(node, &crashk_base_prop); | ||
369 | crashk_size = crashk_res.end - crashk_res.start + 1; | ||
370 | prom_add_property(node, &crashk_size_prop); | ||
371 | } | ||
372 | |||
373 | of_node_put(node); | ||
374 | } | ||
375 | |||
376 | static int __init kexec_setup(void) | ||
377 | { | ||
378 | export_htab_values(); | ||
379 | export_crashk_values(); | ||
380 | return 0; | 332 | return 0; |
381 | } | 333 | } |
382 | __initcall(kexec_setup); | 334 | late_initcall(export_htab_values); |