diff options
| author | 2011-01-12 14:47:21 +0900 | |
|---|---|---|
| committer | 2011-01-12 14:47:21 +0900 | |
| commit | 53582c4c508a95ece9f7c907edef9911c7eb79eb (patch) | |
| tree | c099e9880f7bf7d60e87dfa6a19cb4e8780ec860 /arch/powerpc/kernel/crash_dump.c | |
| parent | ARM: mach-shmobile: mackerel: Add touchscreen ST1232 support (diff) | |
| parent | ARM: mach-shmobile: sh7372 Enable SDIO IRQs for Mackerel (diff) | |
| download | wireguard-linux-53582c4c508a95ece9f7c907edef9911c7eb79eb.tar.xz wireguard-linux-53582c4c508a95ece9f7c907edef9911c7eb79eb.zip | |
Merge branch 'rmobile/sdio' into rmobile-latest
Diffstat (limited to '')
| -rw-r--r-- | arch/powerpc/kernel/crash_dump.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c index 8e05c16344e4..0a2af50243cb 100644 --- a/arch/powerpc/kernel/crash_dump.c +++ b/arch/powerpc/kernel/crash_dump.c @@ -19,6 +19,7 @@ #include <asm/prom.h> #include <asm/firmware.h> #include <asm/uaccess.h> +#include <asm/rtas.h> #ifdef DEBUG #include <asm/udbg.h> @@ -141,3 +142,35 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, return csize; } + +#ifdef CONFIG_PPC_RTAS +/* + * The crashkernel region will almost always overlap the RTAS region, so + * we have to be careful when shrinking the crashkernel region. + */ +void crash_free_reserved_phys_range(unsigned long begin, unsigned long end) +{ + unsigned long addr; + const u32 *basep, *sizep; + unsigned int rtas_start = 0, rtas_end = 0; + + basep = of_get_property(rtas.dev, "linux,rtas-base", NULL); + sizep = of_get_property(rtas.dev, "rtas-size", NULL); + + if (basep && sizep) { + rtas_start = *basep; + rtas_end = *basep + *sizep; + } + + for (addr = begin; addr < end; addr += PAGE_SIZE) { + /* Does this page overlap with the RTAS region? */ + if (addr <= rtas_end && ((addr + PAGE_SIZE) > rtas_start)) + continue; + + ClearPageReserved(pfn_to_page(addr >> PAGE_SHIFT)); + init_page_count(pfn_to_page(addr >> PAGE_SHIFT)); + free_page((unsigned long)__va(addr)); + totalram_pages++; + } +} +#endif |
