aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2013-09-05 14:54:00 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-09-05 14:54:00 -0400
commit356948f042c59d94dc6700455263b7739f09e6b0 (patch)
treedc4acdea069607d581596670d83bf576636bde59
parent4d854194f3e60d56d68e82a934d5613c42c1273b (diff)
parentc2882b7fab9251309dc10c980b17e486f848502f (diff)
Merge branch '3.11-fixes' into mips-for-linux-next
-rw-r--r--arch/mips/dec/time.c5
-rw-r--r--arch/mips/kernel/csrc-ioasic.c6
-rw-r--r--arch/mips/kernel/relocate_kernel.S6
-rw-r--r--arch/mips/kernel/setup.c99
-rw-r--r--arch/mips/mm/init.c1
5 files changed, 61 insertions, 56 deletions
diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c
index ea57f39e6736..56ebc7f2bede 100644
--- a/arch/mips/dec/time.c
+++ b/arch/mips/dec/time.c
@@ -126,12 +126,13 @@ int rtc_mips_set_mmss(unsigned long nowtime)
126void __init plat_time_init(void) 126void __init plat_time_init(void)
127{ 127{
128 u32 start, end; 128 u32 start, end;
129 int i = HZ / 10; 129 int i = HZ / 8;
130 130
131 /* Set up the rate of periodic DS1287 interrupts. */ 131 /* Set up the rate of periodic DS1287 interrupts. */
132 ds1287_set_base_clock(HZ); 132 ds1287_set_base_clock(HZ);
133 133
134 if (cpu_has_counter) { 134 if (cpu_has_counter) {
135 ds1287_timer_state();
135 while (!ds1287_timer_state()) 136 while (!ds1287_timer_state())
136 ; 137 ;
137 138
@@ -143,7 +144,7 @@ void __init plat_time_init(void)
143 144
144 end = read_c0_count(); 145 end = read_c0_count();
145 146
146 mips_hpt_frequency = (end - start) * 10; 147 mips_hpt_frequency = (end - start) * 8;
147 printk(KERN_INFO "MIPS counter frequency %dHz\n", 148 printk(KERN_INFO "MIPS counter frequency %dHz\n",
148 mips_hpt_frequency); 149 mips_hpt_frequency);
149 } else if (IOASIC) 150 } else if (IOASIC)
diff --git a/arch/mips/kernel/csrc-ioasic.c b/arch/mips/kernel/csrc-ioasic.c
index 0654bff9b69c..87e88feb4a25 100644
--- a/arch/mips/kernel/csrc-ioasic.c
+++ b/arch/mips/kernel/csrc-ioasic.c
@@ -41,9 +41,9 @@ void __init dec_ioasic_clocksource_init(void)
41{ 41{
42 unsigned int freq; 42 unsigned int freq;
43 u32 start, end; 43 u32 start, end;
44 int i = HZ / 10; 44 int i = HZ / 8;
45
46 45
46 ds1287_timer_state();
47 while (!ds1287_timer_state()) 47 while (!ds1287_timer_state())
48 ; 48 ;
49 49
@@ -55,7 +55,7 @@ void __init dec_ioasic_clocksource_init(void)
55 55
56 end = dec_ioasic_hpt_read(&clocksource_dec); 56 end = dec_ioasic_hpt_read(&clocksource_dec);
57 57
58 freq = (end - start) * 10; 58 freq = (end - start) * 8;
59 printk(KERN_INFO "I/O ASIC clock frequency %dHz\n", freq); 59 printk(KERN_INFO "I/O ASIC clock frequency %dHz\n", freq);
60 60
61 clocksource_dec.rating = 200 + freq / 10000000; 61 clocksource_dec.rating = 200 + freq / 10000000;
diff --git a/arch/mips/kernel/relocate_kernel.S b/arch/mips/kernel/relocate_kernel.S
index 43d2d78d3287..74bab9ddd0e1 100644
--- a/arch/mips/kernel/relocate_kernel.S
+++ b/arch/mips/kernel/relocate_kernel.S
@@ -26,6 +26,12 @@ process_entry:
26 PTR_L s2, (s0) 26 PTR_L s2, (s0)
27 PTR_ADD s0, s0, SZREG 27 PTR_ADD s0, s0, SZREG
28 28
29 /*
30 * In case of a kdump/crash kernel, the indirection page is not
31 * populated as the kernel is directly copied to a reserved location
32 */
33 beqz s2, done
34
29 /* destination page */ 35 /* destination page */
30 and s3, s2, 0x1 36 and s3, s2, 0x1
31 beq s3, zero, 1f 37 beq s3, zero, 1f
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index c7f90519e58c..c538d6e01b7b 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -552,6 +552,52 @@ static void __init arch_mem_addpart(phys_t mem, phys_t end, int type)
552 add_memory_region(mem, size, type); 552 add_memory_region(mem, size, type);
553} 553}
554 554
555#ifdef CONFIG_KEXEC
556static inline unsigned long long get_total_mem(void)
557{
558 unsigned long long total;
559
560 total = max_pfn - min_low_pfn;
561 return total << PAGE_SHIFT;
562}
563
564static void __init mips_parse_crashkernel(void)
565{
566 unsigned long long total_mem;
567 unsigned long long crash_size, crash_base;
568 int ret;
569
570 total_mem = get_total_mem();
571 ret = parse_crashkernel(boot_command_line, total_mem,
572 &crash_size, &crash_base);
573 if (ret != 0 || crash_size <= 0)
574 return;
575
576 crashk_res.start = crash_base;
577 crashk_res.end = crash_base + crash_size - 1;
578}
579
580static void __init request_crashkernel(struct resource *res)
581{
582 int ret;
583
584 ret = request_resource(res, &crashk_res);
585 if (!ret)
586 pr_info("Reserving %ldMB of memory at %ldMB for crashkernel\n",
587 (unsigned long)((crashk_res.end -
588 crashk_res.start + 1) >> 20),
589 (unsigned long)(crashk_res.start >> 20));
590}
591#else /* !defined(CONFIG_KEXEC) */
592static void __init mips_parse_crashkernel(void)
593{
594}
595
596static void __init request_crashkernel(struct resource *res)
597{
598}
599#endif /* !defined(CONFIG_KEXEC) */
600
555static void __init arch_mem_init(char **cmdline_p) 601static void __init arch_mem_init(char **cmdline_p)
556{ 602{
557 extern void plat_mem_setup(void); 603 extern void plat_mem_setup(void);
@@ -608,6 +654,8 @@ static void __init arch_mem_init(char **cmdline_p)
608 BOOTMEM_DEFAULT); 654 BOOTMEM_DEFAULT);
609 } 655 }
610#endif 656#endif
657
658 mips_parse_crashkernel();
611#ifdef CONFIG_KEXEC 659#ifdef CONFIG_KEXEC
612 if (crashk_res.start != crashk_res.end) 660 if (crashk_res.start != crashk_res.end)
613 reserve_bootmem(crashk_res.start, 661 reserve_bootmem(crashk_res.start,
@@ -620,52 +668,6 @@ static void __init arch_mem_init(char **cmdline_p)
620 paging_init(); 668 paging_init();
621} 669}
622 670
623#ifdef CONFIG_KEXEC
624static inline unsigned long long get_total_mem(void)
625{
626 unsigned long long total;
627
628 total = max_pfn - min_low_pfn;
629 return total << PAGE_SHIFT;
630}
631
632static void __init mips_parse_crashkernel(void)
633{
634 unsigned long long total_mem;
635 unsigned long long crash_size, crash_base;
636 int ret;
637
638 total_mem = get_total_mem();
639 ret = parse_crashkernel(boot_command_line, total_mem,
640 &crash_size, &crash_base);
641 if (ret != 0 || crash_size <= 0)
642 return;
643
644 crashk_res.start = crash_base;
645 crashk_res.end = crash_base + crash_size - 1;
646}
647
648static void __init request_crashkernel(struct resource *res)
649{
650 int ret;
651
652 ret = request_resource(res, &crashk_res);
653 if (!ret)
654 pr_info("Reserving %ldMB of memory at %ldMB for crashkernel\n",
655 (unsigned long)((crashk_res.end -
656 crashk_res.start + 1) >> 20),
657 (unsigned long)(crashk_res.start >> 20));
658}
659#else /* !defined(CONFIG_KEXEC) */
660static void __init mips_parse_crashkernel(void)
661{
662}
663
664static void __init request_crashkernel(struct resource *res)
665{
666}
667#endif /* !defined(CONFIG_KEXEC) */
668
669static void __init resource_init(void) 671static void __init resource_init(void)
670{ 672{
671 int i; 673 int i;
@@ -678,11 +680,6 @@ static void __init resource_init(void)
678 data_resource.start = __pa_symbol(&_etext); 680 data_resource.start = __pa_symbol(&_etext);
679 data_resource.end = __pa_symbol(&_edata) - 1; 681 data_resource.end = __pa_symbol(&_edata) - 1;
680 682
681 /*
682 * Request address space for all standard RAM.
683 */
684 mips_parse_crashkernel();
685
686 for (i = 0; i < boot_mem_map.nr_map; i++) { 683 for (i = 0; i < boot_mem_map.nr_map; i++) {
687 struct resource *res; 684 struct resource *res;
688 unsigned long start, end; 685 unsigned long start, end;
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 4e73f10a7519..e205ef598e97 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -254,6 +254,7 @@ void copy_from_user_page(struct vm_area_struct *vma,
254 SetPageDcacheDirty(page); 254 SetPageDcacheDirty(page);
255 } 255 }
256} 256}
257EXPORT_SYMBOL_GPL(copy_from_user_page);
257 258
258void __init fixrange_init(unsigned long start, unsigned long end, 259void __init fixrange_init(unsigned long start, unsigned long end,
259 pgd_t *pgd_base) 260 pgd_t *pgd_base)