diff options
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/mips/kernel/cpu-bugs64.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 10 | ||||
-rw-r--r-- | arch/mips/kernel/csrc-r4k.c | 7 | ||||
-rw-r--r-- | arch/mips/kernel/head.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/traps.c | 38 |
6 files changed, 43 insertions, 19 deletions
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile index ffa08362de17..9e78e1a4ca17 100644 --- a/arch/mips/kernel/Makefile +++ b/arch/mips/kernel/Makefile | |||
@@ -76,7 +76,6 @@ obj-$(CONFIG_PROC_FS) += proc.o | |||
76 | obj-$(CONFIG_64BIT) += cpu-bugs64.o | 76 | obj-$(CONFIG_64BIT) += cpu-bugs64.o |
77 | 77 | ||
78 | obj-$(CONFIG_I8253) += i8253.o | 78 | obj-$(CONFIG_I8253) += i8253.o |
79 | obj-$(CONFIG_PCSPEAKER) += pcspeaker.o | ||
80 | 79 | ||
81 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | 80 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o |
82 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 81 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c index 417bb3e336ac..a1b48af0992f 100644 --- a/arch/mips/kernel/cpu-bugs64.c +++ b/arch/mips/kernel/cpu-bugs64.c | |||
@@ -167,7 +167,7 @@ static inline void check_mult_sh(void) | |||
167 | panic(bug64hit, !R4000_WAR ? r4kwar : nowar); | 167 | panic(bug64hit, !R4000_WAR ? r4kwar : nowar); |
168 | } | 168 | } |
169 | 169 | ||
170 | static volatile int daddi_ov __initdata = 0; | 170 | static volatile int daddi_ov __cpuinitdata = 0; |
171 | 171 | ||
172 | asmlinkage void __init do_daddi_ov(struct pt_regs *regs) | 172 | asmlinkage void __init do_daddi_ov(struct pt_regs *regs) |
173 | { | 173 | { |
@@ -239,7 +239,7 @@ static inline void check_daddi(void) | |||
239 | panic(bug64hit, !DADDI_WAR ? daddiwar : nowar); | 239 | panic(bug64hit, !DADDI_WAR ? daddiwar : nowar); |
240 | } | 240 | } |
241 | 241 | ||
242 | int daddiu_bug __initdata = -1; | 242 | int daddiu_bug __cpuinitdata = -1; |
243 | 243 | ||
244 | static inline void check_daddiu(void) | 244 | static inline void check_daddiu(void) |
245 | { | 245 | { |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 5861a432a52f..89c3304cb93c 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -550,7 +550,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c) | |||
550 | } | 550 | } |
551 | } | 551 | } |
552 | 552 | ||
553 | static char unknown_isa[] __initdata = KERN_ERR \ | 553 | static char unknown_isa[] __cpuinitdata = KERN_ERR \ |
554 | "Unsupported ISA type, c0.config0: %d."; | 554 | "Unsupported ISA type, c0.config0: %d."; |
555 | 555 | ||
556 | static inline unsigned int decode_config0(struct cpuinfo_mips *c) | 556 | static inline unsigned int decode_config0(struct cpuinfo_mips *c) |
@@ -656,7 +656,7 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c) | |||
656 | return config3 & MIPS_CONF_M; | 656 | return config3 & MIPS_CONF_M; |
657 | } | 657 | } |
658 | 658 | ||
659 | static void __init decode_configs(struct cpuinfo_mips *c) | 659 | static void __cpuinit decode_configs(struct cpuinfo_mips *c) |
660 | { | 660 | { |
661 | /* MIPS32 or MIPS64 compliant CPU. */ | 661 | /* MIPS32 or MIPS64 compliant CPU. */ |
662 | c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER | | 662 | c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER | |
@@ -814,7 +814,7 @@ const char *__cpu_name[NR_CPUS]; | |||
814 | /* | 814 | /* |
815 | * Name a CPU | 815 | * Name a CPU |
816 | */ | 816 | */ |
817 | static __init const char *cpu_to_name(struct cpuinfo_mips *c) | 817 | static __cpuinit const char *cpu_to_name(struct cpuinfo_mips *c) |
818 | { | 818 | { |
819 | const char *name = NULL; | 819 | const char *name = NULL; |
820 | 820 | ||
@@ -896,7 +896,7 @@ static __init const char *cpu_to_name(struct cpuinfo_mips *c) | |||
896 | return name; | 896 | return name; |
897 | } | 897 | } |
898 | 898 | ||
899 | __init void cpu_probe(void) | 899 | __cpuinit void cpu_probe(void) |
900 | { | 900 | { |
901 | struct cpuinfo_mips *c = ¤t_cpu_data; | 901 | struct cpuinfo_mips *c = ¤t_cpu_data; |
902 | unsigned int cpu = smp_processor_id(); | 902 | unsigned int cpu = smp_processor_id(); |
@@ -959,7 +959,7 @@ __init void cpu_probe(void) | |||
959 | c->srsets = 1; | 959 | c->srsets = 1; |
960 | } | 960 | } |
961 | 961 | ||
962 | __init void cpu_report(void) | 962 | __cpuinit void cpu_report(void) |
963 | { | 963 | { |
964 | struct cpuinfo_mips *c = ¤t_cpu_data; | 964 | struct cpuinfo_mips *c = ¤t_cpu_data; |
965 | 965 | ||
diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c index 0e2b5cd81f67..86e026f067bc 100644 --- a/arch/mips/kernel/csrc-r4k.c +++ b/arch/mips/kernel/csrc-r4k.c | |||
@@ -22,12 +22,17 @@ static struct clocksource clocksource_mips = { | |||
22 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 22 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
23 | }; | 23 | }; |
24 | 24 | ||
25 | void __init init_mips_clocksource(void) | 25 | int __init init_mips_clocksource(void) |
26 | { | 26 | { |
27 | if (!cpu_has_counter || !mips_hpt_frequency) | ||
28 | return -ENXIO; | ||
29 | |||
27 | /* Calclate a somewhat reasonable rating value */ | 30 | /* Calclate a somewhat reasonable rating value */ |
28 | clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; | 31 | clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; |
29 | 32 | ||
30 | clocksource_set_clock(&clocksource_mips, mips_hpt_frequency); | 33 | clocksource_set_clock(&clocksource_mips, mips_hpt_frequency); |
31 | 34 | ||
32 | clocksource_register(&clocksource_mips); | 35 | clocksource_register(&clocksource_mips); |
36 | |||
37 | return 0; | ||
33 | } | 38 | } |
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index a24fb7900901..361364501d34 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S | |||
@@ -195,7 +195,7 @@ NESTED(kernel_entry, 16, sp) # kernel entry point | |||
195 | j start_kernel | 195 | j start_kernel |
196 | END(kernel_entry) | 196 | END(kernel_entry) |
197 | 197 | ||
198 | __INIT | 198 | __CPUINIT |
199 | 199 | ||
200 | #ifdef CONFIG_SMP | 200 | #ifdef CONFIG_SMP |
201 | /* | 201 | /* |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index fcae66752972..984c0d0a7b4d 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -534,8 +534,7 @@ static int simulate_llsc(struct pt_regs *regs, unsigned int opcode) | |||
534 | 534 | ||
535 | /* | 535 | /* |
536 | * Simulate trapping 'rdhwr' instructions to provide user accessible | 536 | * Simulate trapping 'rdhwr' instructions to provide user accessible |
537 | * registers not implemented in hardware. The only current use of this | 537 | * registers not implemented in hardware. |
538 | * is the thread area pointer. | ||
539 | */ | 538 | */ |
540 | static int simulate_rdhwr(struct pt_regs *regs, unsigned int opcode) | 539 | static int simulate_rdhwr(struct pt_regs *regs, unsigned int opcode) |
541 | { | 540 | { |
@@ -545,11 +544,31 @@ static int simulate_rdhwr(struct pt_regs *regs, unsigned int opcode) | |||
545 | int rd = (opcode & RD) >> 11; | 544 | int rd = (opcode & RD) >> 11; |
546 | int rt = (opcode & RT) >> 16; | 545 | int rt = (opcode & RT) >> 16; |
547 | switch (rd) { | 546 | switch (rd) { |
548 | case 29: | 547 | case 0: /* CPU number */ |
549 | regs->regs[rt] = ti->tp_value; | 548 | regs->regs[rt] = smp_processor_id(); |
550 | return 0; | 549 | return 0; |
550 | case 1: /* SYNCI length */ | ||
551 | regs->regs[rt] = min(current_cpu_data.dcache.linesz, | ||
552 | current_cpu_data.icache.linesz); | ||
553 | return 0; | ||
554 | case 2: /* Read count register */ | ||
555 | regs->regs[rt] = read_c0_count(); | ||
556 | return 0; | ||
557 | case 3: /* Count register resolution */ | ||
558 | switch (current_cpu_data.cputype) { | ||
559 | case CPU_20KC: | ||
560 | case CPU_25KF: | ||
561 | regs->regs[rt] = 1; | ||
562 | break; | ||
551 | default: | 563 | default: |
552 | return -1; | 564 | regs->regs[rt] = 2; |
565 | } | ||
566 | return 0; | ||
567 | case 29: | ||
568 | regs->regs[rt] = ti->tp_value; | ||
569 | return 0; | ||
570 | default: | ||
571 | return -1; | ||
553 | } | 572 | } |
554 | } | 573 | } |
555 | 574 | ||
@@ -1287,7 +1306,7 @@ int cp0_compare_irq; | |||
1287 | int cp0_perfcount_irq; | 1306 | int cp0_perfcount_irq; |
1288 | EXPORT_SYMBOL_GPL(cp0_perfcount_irq); | 1307 | EXPORT_SYMBOL_GPL(cp0_perfcount_irq); |
1289 | 1308 | ||
1290 | void __init per_cpu_trap_init(void) | 1309 | void __cpuinit per_cpu_trap_init(void) |
1291 | { | 1310 | { |
1292 | unsigned int cpu = smp_processor_id(); | 1311 | unsigned int cpu = smp_processor_id(); |
1293 | unsigned int status_set = ST0_CU0; | 1312 | unsigned int status_set = ST0_CU0; |
@@ -1404,11 +1423,12 @@ void __init set_handler(unsigned long offset, void *addr, unsigned long size) | |||
1404 | flush_icache_range(ebase + offset, ebase + offset + size); | 1423 | flush_icache_range(ebase + offset, ebase + offset + size); |
1405 | } | 1424 | } |
1406 | 1425 | ||
1407 | static char panic_null_cerr[] __initdata = | 1426 | static char panic_null_cerr[] __cpuinitdata = |
1408 | "Trying to set NULL cache error exception handler"; | 1427 | "Trying to set NULL cache error exception handler"; |
1409 | 1428 | ||
1410 | /* Install uncached CPU exception handler */ | 1429 | /* Install uncached CPU exception handler */ |
1411 | void __init set_uncached_handler(unsigned long offset, void *addr, unsigned long size) | 1430 | void __cpuinit set_uncached_handler(unsigned long offset, void *addr, |
1431 | unsigned long size) | ||
1412 | { | 1432 | { |
1413 | #ifdef CONFIG_32BIT | 1433 | #ifdef CONFIG_32BIT |
1414 | unsigned long uncached_ebase = KSEG1ADDR(ebase); | 1434 | unsigned long uncached_ebase = KSEG1ADDR(ebase); |