diff options
| -rw-r--r-- | arch/sh/include/asm/io_generic.h | 1 | ||||
| -rw-r--r-- | arch/sh/include/asm/kexec.h | 8 | ||||
| -rw-r--r-- | arch/sh/include/asm/machvec.h | 2 | ||||
| -rw-r--r-- | arch/sh/include/asm/mmzone.h | 3 | ||||
| -rw-r--r-- | arch/sh/include/asm/page.h | 2 | ||||
| -rw-r--r-- | arch/sh/include/asm/setup.h | 1 | ||||
| -rw-r--r-- | arch/sh/kernel/machine_kexec.c | 59 | ||||
| -rw-r--r-- | arch/sh/kernel/machvec.c | 1 | ||||
| -rw-r--r-- | arch/sh/kernel/setup.c | 228 | ||||
| -rw-r--r-- | arch/sh/mm/init.c | 173 | ||||
| -rw-r--r-- | arch/sh/mm/pmb.c | 2 |
11 files changed, 271 insertions, 209 deletions
diff --git a/arch/sh/include/asm/io_generic.h b/arch/sh/include/asm/io_generic.h index 1e5d375f55dc..491df93cbf8e 100644 --- a/arch/sh/include/asm/io_generic.h +++ b/arch/sh/include/asm/io_generic.h | |||
| @@ -38,5 +38,6 @@ void IO_CONCAT(__IO_PREFIX,iounmap)(void *addr); | |||
| 38 | 38 | ||
| 39 | void __iomem *IO_CONCAT(__IO_PREFIX,ioport_map)(unsigned long addr, unsigned int size); | 39 | void __iomem *IO_CONCAT(__IO_PREFIX,ioport_map)(unsigned long addr, unsigned int size); |
| 40 | void IO_CONCAT(__IO_PREFIX,ioport_unmap)(void __iomem *addr); | 40 | void IO_CONCAT(__IO_PREFIX,ioport_unmap)(void __iomem *addr); |
| 41 | void IO_CONCAT(__IO_PREFIX,mem_init)(void); | ||
| 41 | 42 | ||
| 42 | #undef __IO_PREFIX | 43 | #undef __IO_PREFIX |
diff --git a/arch/sh/include/asm/kexec.h b/arch/sh/include/asm/kexec.h index 765a5e1660fc..ad6ef8a275ee 100644 --- a/arch/sh/include/asm/kexec.h +++ b/arch/sh/include/asm/kexec.h | |||
| @@ -26,6 +26,10 @@ | |||
| 26 | /* The native architecture */ | 26 | /* The native architecture */ |
| 27 | #define KEXEC_ARCH KEXEC_ARCH_SH | 27 | #define KEXEC_ARCH KEXEC_ARCH_SH |
| 28 | 28 | ||
| 29 | #ifdef CONFIG_KEXEC | ||
| 30 | /* arch/sh/kernel/machine_kexec.c */ | ||
| 31 | void reserve_crashkernel(void); | ||
| 32 | |||
| 29 | static inline void crash_setup_regs(struct pt_regs *newregs, | 33 | static inline void crash_setup_regs(struct pt_regs *newregs, |
| 30 | struct pt_regs *oldregs) | 34 | struct pt_regs *oldregs) |
| 31 | { | 35 | { |
| @@ -59,4 +63,8 @@ static inline void crash_setup_regs(struct pt_regs *newregs, | |||
| 59 | newregs->pc = (unsigned long)current_text_addr(); | 63 | newregs->pc = (unsigned long)current_text_addr(); |
| 60 | } | 64 | } |
| 61 | } | 65 | } |
| 66 | #else | ||
| 67 | static inline void reserve_crashkernel(void) { } | ||
| 68 | #endif /* CONFIG_KEXEC */ | ||
| 69 | |||
| 62 | #endif /* __ASM_SH_KEXEC_H */ | 70 | #endif /* __ASM_SH_KEXEC_H */ |
diff --git a/arch/sh/include/asm/machvec.h b/arch/sh/include/asm/machvec.h index 9c30955630ff..bc0218cb72e1 100644 --- a/arch/sh/include/asm/machvec.h +++ b/arch/sh/include/asm/machvec.h | |||
| @@ -49,6 +49,8 @@ struct sh_machine_vector { | |||
| 49 | 49 | ||
| 50 | int (*mv_clk_init)(void); | 50 | int (*mv_clk_init)(void); |
| 51 | int (*mv_mode_pins)(void); | 51 | int (*mv_mode_pins)(void); |
| 52 | |||
| 53 | void (*mv_mem_init)(void); | ||
| 52 | }; | 54 | }; |
| 53 | 55 | ||
| 54 | extern struct sh_machine_vector sh_mv; | 56 | extern struct sh_machine_vector sh_mv; |
diff --git a/arch/sh/include/asm/mmzone.h b/arch/sh/include/asm/mmzone.h index 7f5363b29ba0..8887baff5eff 100644 --- a/arch/sh/include/asm/mmzone.h +++ b/arch/sh/include/asm/mmzone.h | |||
| @@ -42,9 +42,10 @@ setup_bootmem_node(int nid, unsigned long start, unsigned long end) | |||
| 42 | void __init plat_mem_setup(void); | 42 | void __init plat_mem_setup(void); |
| 43 | 43 | ||
| 44 | /* arch/sh/kernel/setup.c */ | 44 | /* arch/sh/kernel/setup.c */ |
| 45 | void __init setup_bootmem_allocator(unsigned long start_pfn); | ||
| 46 | void __init __add_active_range(unsigned int nid, unsigned long start_pfn, | 45 | void __init __add_active_range(unsigned int nid, unsigned long start_pfn, |
| 47 | unsigned long end_pfn); | 46 | unsigned long end_pfn); |
| 47 | /* arch/sh/mm/init.c */ | ||
| 48 | void __init allocate_pgdat(unsigned int nid); | ||
| 48 | 49 | ||
| 49 | #endif /* __KERNEL__ */ | 50 | #endif /* __KERNEL__ */ |
| 50 | #endif /* __ASM_SH_MMZONE_H */ | 51 | #endif /* __ASM_SH_MMZONE_H */ |
diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h index 0152c040f6c3..fb703d120d09 100644 --- a/arch/sh/include/asm/page.h +++ b/arch/sh/include/asm/page.h | |||
| @@ -49,7 +49,7 @@ | |||
| 49 | 49 | ||
| 50 | extern unsigned long shm_align_mask; | 50 | extern unsigned long shm_align_mask; |
| 51 | extern unsigned long max_low_pfn, min_low_pfn; | 51 | extern unsigned long max_low_pfn, min_low_pfn; |
| 52 | extern unsigned long memory_start, memory_end; | 52 | extern unsigned long memory_start, memory_end, memory_limit; |
| 53 | 53 | ||
| 54 | static inline unsigned long | 54 | static inline unsigned long |
| 55 | pages_do_alias(unsigned long addr1, unsigned long addr2) | 55 | pages_do_alias(unsigned long addr1, unsigned long addr2) |
diff --git a/arch/sh/include/asm/setup.h b/arch/sh/include/asm/setup.h index 4758325bb24a..01fa17a3d759 100644 --- a/arch/sh/include/asm/setup.h +++ b/arch/sh/include/asm/setup.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #define COMMAND_LINE ((char *) (PARAM+0x100)) | 19 | #define COMMAND_LINE ((char *) (PARAM+0x100)) |
| 20 | 20 | ||
| 21 | void sh_mv_setup(void); | 21 | void sh_mv_setup(void); |
| 22 | void check_for_initrd(void); | ||
| 22 | 23 | ||
| 23 | #endif /* __KERNEL__ */ | 24 | #endif /* __KERNEL__ */ |
| 24 | 25 | ||
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index 0e90c7f9564f..5a559e666eb3 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | * This source code is licensed under the GNU General Public License, | 8 | * This source code is licensed under the GNU General Public License, |
| 9 | * Version 2. See the file COPYING for more details. | 9 | * Version 2. See the file COPYING for more details. |
| 10 | */ | 10 | */ |
| 11 | |||
| 12 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
| 13 | #include <linux/kexec.h> | 12 | #include <linux/kexec.h> |
| 14 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
| @@ -16,6 +15,7 @@ | |||
| 16 | #include <linux/numa.h> | 15 | #include <linux/numa.h> |
| 17 | #include <linux/ftrace.h> | 16 | #include <linux/ftrace.h> |
| 18 | #include <linux/suspend.h> | 17 | #include <linux/suspend.h> |
| 18 | #include <linux/lmb.h> | ||
| 19 | #include <asm/pgtable.h> | 19 | #include <asm/pgtable.h> |
| 20 | #include <asm/pgalloc.h> | 20 | #include <asm/pgalloc.h> |
| 21 | #include <asm/mmu_context.h> | 21 | #include <asm/mmu_context.h> |
| @@ -151,3 +151,60 @@ void arch_crash_save_vmcoreinfo(void) | |||
| 151 | VMCOREINFO_CONFIG(X2TLB); | 151 | VMCOREINFO_CONFIG(X2TLB); |
| 152 | #endif | 152 | #endif |
| 153 | } | 153 | } |
| 154 | |||
| 155 | void __init reserve_crashkernel(void) | ||
| 156 | { | ||
| 157 | unsigned long long crash_size, crash_base; | ||
| 158 | int ret; | ||
| 159 | |||
| 160 | /* this is necessary because of lmb_phys_mem_size() */ | ||
| 161 | lmb_analyze(); | ||
| 162 | |||
| 163 | ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(), | ||
| 164 | &crash_size, &crash_base); | ||
| 165 | if (ret == 0 && crash_size > 0) { | ||
| 166 | crashk_res.start = crash_base; | ||
| 167 | crashk_res.end = crash_base + crash_size - 1; | ||
| 168 | } | ||
| 169 | |||
| 170 | if (crashk_res.end == crashk_res.start) | ||
| 171 | goto disable; | ||
| 172 | |||
| 173 | crash_size = PAGE_ALIGN(crashk_res.end - crashk_res.start + 1); | ||
| 174 | if (!crashk_res.start) { | ||
| 175 | unsigned long max = lmb_end_of_DRAM() - memory_limit; | ||
| 176 | crashk_res.start = __lmb_alloc_base(crash_size, PAGE_SIZE, max); | ||
| 177 | if (!crashk_res.start) { | ||
| 178 | pr_err("crashkernel allocation failed\n"); | ||
| 179 | goto disable; | ||
| 180 | } | ||
| 181 | } else { | ||
| 182 | ret = lmb_reserve(crashk_res.start, crash_size); | ||
| 183 | if (unlikely(ret < 0)) { | ||
| 184 | pr_err("crashkernel reservation failed - " | ||
| 185 | "memory is in use\n"); | ||
| 186 | goto disable; | ||
| 187 | } | ||
| 188 | } | ||
| 189 | |||
| 190 | crashk_res.end = crashk_res.start + crash_size - 1; | ||
| 191 | |||
| 192 | /* | ||
| 193 | * Crash kernel trumps memory limit | ||
| 194 | */ | ||
| 195 | if ((lmb_end_of_DRAM() - memory_limit) <= crashk_res.end) { | ||
| 196 | memory_limit = 0; | ||
| 197 | pr_info("Disabled memory limit for crashkernel\n"); | ||
| 198 | } | ||
| 199 | |||
| 200 | pr_info("Reserving %ldMB of memory at 0x%08lx " | ||
| 201 | "for crashkernel (System RAM: %ldMB)\n", | ||
| 202 | (unsigned long)(crash_size >> 20), | ||
| 203 | (unsigned long)(crashk_res.start), | ||
| 204 | (unsigned long)(lmb_phys_mem_size() >> 20)); | ||
| 205 | |||
| 206 | return; | ||
| 207 | |||
| 208 | disable: | ||
| 209 | crashk_res.start = crashk_res.end = 0; | ||
| 210 | } | ||
diff --git a/arch/sh/kernel/machvec.c b/arch/sh/kernel/machvec.c index 1652340ba3f2..85cfaf916fdc 100644 --- a/arch/sh/kernel/machvec.c +++ b/arch/sh/kernel/machvec.c | |||
| @@ -131,6 +131,7 @@ void __init sh_mv_setup(void) | |||
| 131 | mv_set(ioport_unmap); | 131 | mv_set(ioport_unmap); |
| 132 | mv_set(irq_demux); | 132 | mv_set(irq_demux); |
| 133 | mv_set(mode_pins); | 133 | mv_set(mode_pins); |
