Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20069
b: refs/heads/master
c: b68239e
h: refs/heads/master
i:
  20067: 15e5fb0
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Feb 7, 2006
1 parent e50940a commit 8fd2829
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4fd884a037c791a39f2f03da719e251af176a97
refs/heads/master: b68239ee746760bd99a68692f4c97a28f08a5d01
27 changes: 27 additions & 0 deletions trunk/arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1922,3 +1922,30 @@ int prom_update_property(struct device_node *np,

return 0;
}

#ifdef CONFIG_KEXEC
/* We may have allocated the flat device tree inside the crash kernel region
* in prom_init. If so we need to move it out into regular memory. */
void kdump_move_device_tree(void)
{
unsigned long start, end;
struct boot_param_header *new;

start = __pa((unsigned long)initial_boot_params);
end = start + initial_boot_params->totalsize;

if (end < crashk_res.start || start > crashk_res.end)
return;

new = (struct boot_param_header*)
__va(lmb_alloc(initial_boot_params->totalsize, PAGE_SIZE));

memcpy(new, initial_boot_params, initial_boot_params->totalsize);

initial_boot_params = new;

DBG("Flat device tree blob moved to %p\n", initial_boot_params);

/* XXX should we unreserve the old DT? */
}
#endif /* CONFIG_KEXEC */
3 changes: 3 additions & 0 deletions trunk/arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@ void __init setup_system(void)
{
DBG(" -> setup_system()\n");

#ifdef CONFIG_KEXEC
kdump_move_device_tree();
#endif
/*
* Unflatten the device-tree passed by prom_init or kexec
*/
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-powerpc/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,7 @@ extern int of_address_to_resource(struct device_node *dev, int index,
extern int of_pci_address_to_resource(struct device_node *dev, int bar,
struct resource *r);

extern void kdump_move_device_tree(void);

#endif /* __KERNEL__ */
#endif /* _POWERPC_PROM_H */

0 comments on commit 8fd2829

Please sign in to comment.