diff options
Diffstat (limited to 'arch/mips/kernel')
| -rw-r--r-- | arch/mips/kernel/cpu-probe.c | 12 | ||||
| -rw-r--r-- | arch/mips/kernel/csrc-ioasic.c | 6 | ||||
| -rw-r--r-- | arch/mips/kernel/idle.c | 1 | ||||
| -rw-r--r-- | arch/mips/kernel/mcount.S | 2 | ||||
| -rw-r--r-- | arch/mips/kernel/relocate_kernel.S | 6 | ||||
| -rw-r--r-- | arch/mips/kernel/setup.c | 99 | ||||
| -rw-r--r-- | arch/mips/kernel/time.c | 10 | ||||
| -rw-r--r-- | arch/mips/kernel/vmlinux.lds.S | 1 |
8 files changed, 81 insertions, 56 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 4c6167a17875..37663c7862a5 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
| @@ -852,10 +852,17 @@ platform: | |||
| 852 | case PRID_IMP_CAVIUM_CN63XX: | 852 | case PRID_IMP_CAVIUM_CN63XX: |
| 853 | case PRID_IMP_CAVIUM_CN66XX: | 853 | case PRID_IMP_CAVIUM_CN66XX: |
| 854 | case PRID_IMP_CAVIUM_CN68XX: | 854 | case PRID_IMP_CAVIUM_CN68XX: |
| 855 | case PRID_IMP_CAVIUM_CNF71XX: | ||
| 855 | c->cputype = CPU_CAVIUM_OCTEON2; | 856 | c->cputype = CPU_CAVIUM_OCTEON2; |
| 856 | __cpu_name[cpu] = "Cavium Octeon II"; | 857 | __cpu_name[cpu] = "Cavium Octeon II"; |
| 857 | set_elf_platform(cpu, "octeon2"); | 858 | set_elf_platform(cpu, "octeon2"); |
| 858 | break; | 859 | break; |
| 860 | case PRID_IMP_CAVIUM_CN70XX: | ||
| 861 | case PRID_IMP_CAVIUM_CN78XX: | ||
| 862 | c->cputype = CPU_CAVIUM_OCTEON3; | ||
| 863 | __cpu_name[cpu] = "Cavium Octeon III"; | ||
| 864 | set_elf_platform(cpu, "octeon3"); | ||
| 865 | break; | ||
| 859 | default: | 866 | default: |
| 860 | printk(KERN_INFO "Unknown Octeon chip!\n"); | 867 | printk(KERN_INFO "Unknown Octeon chip!\n"); |
| 861 | c->cputype = CPU_UNKNOWN; | 868 | c->cputype = CPU_UNKNOWN; |
| @@ -899,6 +906,11 @@ static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu) | |||
| 899 | MIPS_CPU_LLSC); | 906 | MIPS_CPU_LLSC); |
| 900 | 907 | ||
| 901 | switch (c->processor_id & 0xff00) { | 908 | switch (c->processor_id & 0xff00) { |
| 909 | case PRID_IMP_NETLOGIC_XLP2XX: | ||
| 910 | c->cputype = CPU_XLP; | ||
| 911 | __cpu_name[cpu] = "Broadcom XLPII"; | ||
| 912 | break; | ||
| 913 | |||
| 902 | case PRID_IMP_NETLOGIC_XLP8XX: | 914 | case PRID_IMP_NETLOGIC_XLP8XX: |
| 903 | case PRID_IMP_NETLOGIC_XLP3XX: | 915 | case PRID_IMP_NETLOGIC_XLP3XX: |
| 904 | c->cputype = CPU_XLP; | 916 | c->cputype = CPU_XLP; |
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/idle.c b/arch/mips/kernel/idle.c index 0c655deeea4a..42f8875d2444 100644 --- a/arch/mips/kernel/idle.c +++ b/arch/mips/kernel/idle.c | |||
| @@ -166,6 +166,7 @@ void __init check_wait(void) | |||
| 166 | case CPU_CAVIUM_OCTEON: | 166 | case CPU_CAVIUM_OCTEON: |
| 167 | case CPU_CAVIUM_OCTEON_PLUS: | 167 | case CPU_CAVIUM_OCTEON_PLUS: |
| 168 | case CPU_CAVIUM_OCTEON2: | 168 | case CPU_CAVIUM_OCTEON2: |
| 169 | case CPU_CAVIUM_OCTEON3: | ||
| 169 | case CPU_JZRISC: | 170 | case CPU_JZRISC: |
| 170 | case CPU_LOONGSON1: | 171 | case CPU_LOONGSON1: |
| 171 | case CPU_XLR: | 172 | case CPU_XLR: |
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S index a03e93c4a946..539b6294b613 100644 --- a/arch/mips/kernel/mcount.S +++ b/arch/mips/kernel/mcount.S | |||
| @@ -83,7 +83,7 @@ _mcount: | |||
| 83 | PTR_S MCOUNT_RA_ADDRESS_REG, PT_R12(sp) | 83 | PTR_S MCOUNT_RA_ADDRESS_REG, PT_R12(sp) |
| 84 | #endif | 84 | #endif |
| 85 | 85 | ||
| 86 | move a0, ra /* arg1: self return address */ | 86 | PTR_SUBU a0, ra, 8 /* arg1: self address */ |
| 87 | .globl ftrace_call | 87 | .globl ftrace_call |
| 88 | ftrace_call: | 88 | ftrace_call: |
| 89 | nop /* a placeholder for the call to a real tracing function */ | 89 | nop /* a placeholder for the call to a real tracing function */ |
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 | ||
| 556 | static 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 | |||
| 564 | static 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 | |||
| 580 | static 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) */ | ||
| 592 | static void __init mips_parse_crashkernel(void) | ||
| 593 | { | ||
| 594 | } | ||
| 595 | |||
| 596 | static void __init request_crashkernel(struct resource *res) | ||
| 597 | { | ||
| 598 | } | ||
| 599 | #endif /* !defined(CONFIG_KEXEC) */ | ||
| 600 | |||
| 555 | static void __init arch_mem_init(char **cmdline_p) | 601 | static 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 | ||
| 624 | static 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 | |||
| 632 | static 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 | |||
| 648 | static 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) */ | ||
| 660 | static void __init mips_parse_crashkernel(void) | ||
| 661 | { | ||
| 662 | } | ||
| 663 | |||
| 664 | static void __init request_crashkernel(struct resource *res) | ||
| 665 | { | ||
| 666 | } | ||
| 667 | #endif /* !defined(CONFIG_KEXEC) */ | ||
| 668 | |||
| 669 | static void __init resource_init(void) | 671 | static 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/kernel/time.c b/arch/mips/kernel/time.c index 9d686bf97b0e..364d26ae4215 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c | |||
| @@ -121,6 +121,14 @@ void __init time_init(void) | |||
| 121 | { | 121 | { |
| 122 | plat_time_init(); | 122 | plat_time_init(); |
| 123 | 123 | ||
| 124 | if (!mips_clockevent_init() || !cpu_has_mfc0_count_bug()) | 124 | /* |
| 125 | * The use of the R4k timer as a clock event takes precedence; | ||
| 126 | * if reading the Count register might interfere with the timer | ||
| 127 | * interrupt, then we don't use the timer as a clock source. | ||
| 128 | * We may still use the timer as a clock source though if the | ||
| 129 | * timer interrupt isn't reliable; the interference doesn't | ||
| 130 | * matter then, because we don't use the interrupt. | ||
| 131 | */ | ||
| 132 | if (mips_clockevent_init() != 0 || !cpu_has_mfc0_count_bug()) | ||
| 125 | init_mips_clocksource(); | 133 | init_mips_clocksource(); |
| 126 | } | 134 | } |
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 05826d20a792..3b46f7ce9ca7 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S | |||
| @@ -179,5 +179,6 @@ SECTIONS | |||
| 179 | *(.options) | 179 | *(.options) |
| 180 | *(.pdr) | 180 | *(.pdr) |
| 181 | *(.reginfo) | 181 | *(.reginfo) |
| 182 | *(.eh_frame) | ||
| 182 | } | 183 | } |
| 183 | } | 184 | } |
