diff options
31 files changed, 157 insertions, 144 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 2c7d6c240b73..2f2ce0c28bc0 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
| @@ -361,10 +361,10 @@ config QEMU | |||
| 361 | select PCSPEAKER | 361 | select PCSPEAKER |
| 362 | select SWAP_IO_SPACE | 362 | select SWAP_IO_SPACE |
| 363 | select SYS_HAS_CPU_MIPS32_R1 | 363 | select SYS_HAS_CPU_MIPS32_R1 |
| 364 | select SYS_HAS_EARLY_PRINTK | ||
| 364 | select SYS_SUPPORTS_32BIT_KERNEL | 365 | select SYS_SUPPORTS_32BIT_KERNEL |
| 365 | select SYS_SUPPORTS_BIG_ENDIAN | 366 | select SYS_SUPPORTS_BIG_ENDIAN |
| 366 | select SYS_SUPPORTS_LITTLE_ENDIAN | 367 | select SYS_SUPPORTS_LITTLE_ENDIAN |
| 367 | select ARCH_SPARSEMEM_ENABLE | ||
| 368 | select GENERIC_HARDIRQS_NO__DO_IRQ | 368 | select GENERIC_HARDIRQS_NO__DO_IRQ |
| 369 | select NR_CPUS_DEFAULT_1 | 369 | select NR_CPUS_DEFAULT_1 |
| 370 | select SYS_SUPPORTS_SMP | 370 | select SYS_SUPPORTS_SMP |
| @@ -1409,7 +1409,6 @@ config MIPS_MT_SMP | |||
| 1409 | depends on SYS_SUPPORTS_MULTITHREADING | 1409 | depends on SYS_SUPPORTS_MULTITHREADING |
| 1410 | select CPU_MIPSR2_IRQ_VI | 1410 | select CPU_MIPSR2_IRQ_VI |
| 1411 | select CPU_MIPSR2_IRQ_EI | 1411 | select CPU_MIPSR2_IRQ_EI |
| 1412 | select CPU_MIPSR2_SRS | ||
| 1413 | select MIPS_MT | 1412 | select MIPS_MT |
| 1414 | select NR_CPUS_DEFAULT_2 | 1413 | select NR_CPUS_DEFAULT_2 |
| 1415 | select SMP | 1414 | select SMP |
| @@ -1426,7 +1425,6 @@ config MIPS_MT_SMTC | |||
| 1426 | select GENERIC_CLOCKEVENTS_BROADCAST | 1425 | select GENERIC_CLOCKEVENTS_BROADCAST |
| 1427 | select CPU_MIPSR2_IRQ_VI | 1426 | select CPU_MIPSR2_IRQ_VI |
| 1428 | select CPU_MIPSR2_IRQ_EI | 1427 | select CPU_MIPSR2_IRQ_EI |
| 1429 | select CPU_MIPSR2_SRS | ||
| 1430 | select MIPS_MT | 1428 | select MIPS_MT |
| 1431 | select NR_CPUS_DEFAULT_8 | 1429 | select NR_CPUS_DEFAULT_8 |
| 1432 | select SMP | 1430 | select SMP |
| @@ -1453,7 +1451,6 @@ config MIPS_VPE_LOADER | |||
| 1453 | depends on SYS_SUPPORTS_MULTITHREADING | 1451 | depends on SYS_SUPPORTS_MULTITHREADING |
| 1454 | select CPU_MIPSR2_IRQ_VI | 1452 | select CPU_MIPSR2_IRQ_VI |
| 1455 | select CPU_MIPSR2_IRQ_EI | 1453 | select CPU_MIPSR2_IRQ_EI |
| 1456 | select CPU_MIPSR2_SRS | ||
| 1457 | select MIPS_MT | 1454 | select MIPS_MT |
| 1458 | help | 1455 | help |
| 1459 | Includes a loader for loading an elf relocatable object | 1456 | Includes a loader for loading an elf relocatable object |
| @@ -1582,12 +1579,6 @@ config CPU_MIPSR2_IRQ_VI | |||
| 1582 | config CPU_MIPSR2_IRQ_EI | 1579 | config CPU_MIPSR2_IRQ_EI |
| 1583 | bool | 1580 | bool |
| 1584 | 1581 | ||
| 1585 | # | ||
| 1586 | # Shadow registers are an R2 feature | ||
| 1587 | # | ||
| 1588 | config CPU_MIPSR2_SRS | ||
| 1589 | bool | ||
| 1590 | |||
| 1591 | config CPU_HAS_SYNC | 1582 | config CPU_HAS_SYNC |
| 1592 | bool | 1583 | bool |
| 1593 | depends on !CPU_R3000 | 1584 | depends on !CPU_R3000 |
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 23c17755eca0..a1f8d8b96b03 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
| @@ -44,7 +44,7 @@ endif | |||
| 44 | 44 | ||
| 45 | ifneq ($(SUBARCH),$(ARCH)) | 45 | ifneq ($(SUBARCH),$(ARCH)) |
| 46 | ifeq ($(CROSS_COMPILE),) | 46 | ifeq ($(CROSS_COMPILE),) |
| 47 | CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux- $(tool-archpref)-gnu-linux- $(tool-archpref)-unknown-gnu-linux-) | 47 | CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux- $(tool-archpref)-linux-gnu- $(tool-archpref)-unknown-linux-gnu-) |
| 48 | endif | 48 | endif |
| 49 | endif | 49 | endif |
| 50 | 50 | ||
diff --git a/arch/mips/kernel/cevt-bcm1480.c b/arch/mips/kernel/cevt-bcm1480.c index 21e6d63eb4d1..0a57f86945f1 100644 --- a/arch/mips/kernel/cevt-bcm1480.c +++ b/arch/mips/kernel/cevt-bcm1480.c | |||
| @@ -75,6 +75,7 @@ static int sibyte_next_event(unsigned long delta, struct clock_event_device *cd) | |||
| 75 | cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)); | 75 | cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)); |
| 76 | init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)); | 76 | init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)); |
| 77 | 77 | ||
| 78 | __raw_writeq(0, cfg); | ||
| 78 | __raw_writeq(delta - 1, init); | 79 | __raw_writeq(delta - 1, init); |
| 79 | __raw_writeq(M_SCD_TIMER_ENABLE, cfg); | 80 | __raw_writeq(M_SCD_TIMER_ENABLE, cfg); |
| 80 | 81 | ||
| @@ -122,7 +123,7 @@ void __cpuinit sb1480_clockevent_init(void) | |||
| 122 | CLOCK_EVT_FEAT_ONESHOT; | 123 | CLOCK_EVT_FEAT_ONESHOT; |
| 123 | clockevent_set_clock(cd, V_SCD_TIMER_FREQ); | 124 | clockevent_set_clock(cd, V_SCD_TIMER_FREQ); |
| 124 | cd->max_delta_ns = clockevent_delta2ns(0x7fffff, cd); | 125 | cd->max_delta_ns = clockevent_delta2ns(0x7fffff, cd); |
| 125 | cd->min_delta_ns = clockevent_delta2ns(1, cd); | 126 | cd->min_delta_ns = clockevent_delta2ns(2, cd); |
| 126 | cd->rating = 200; | 127 | cd->rating = 200; |
| 127 | cd->irq = irq; | 128 | cd->irq = irq; |
| 128 | cd->cpumask = cpumask_of_cpu(cpu); | 129 | cd->cpumask = cpumask_of_cpu(cpu); |
| @@ -143,7 +144,10 @@ void __cpuinit sb1480_clockevent_init(void) | |||
| 143 | 144 | ||
| 144 | action->handler = sibyte_counter_handler; | 145 | action->handler = sibyte_counter_handler; |
| 145 | action->flags = IRQF_DISABLED | IRQF_PERCPU; | 146 | action->flags = IRQF_DISABLED | IRQF_PERCPU; |
| 147 | action->mask = cpumask_of_cpu(cpu); | ||
| 146 | action->name = name; | 148 | action->name = name; |
| 147 | action->dev_id = cd; | 149 | action->dev_id = cd; |
| 150 | |||
| 151 | irq_set_affinity(irq, cpumask_of_cpu(cpu)); | ||
| 148 | setup_irq(irq, action); | 152 | setup_irq(irq, action); |
| 149 | } | 153 | } |
diff --git a/arch/mips/kernel/cevt-sb1250.c b/arch/mips/kernel/cevt-sb1250.c index e2029d0fc39b..63ac3ad462bc 100644 --- a/arch/mips/kernel/cevt-sb1250.c +++ b/arch/mips/kernel/cevt-sb1250.c | |||
| @@ -73,6 +73,7 @@ static int sibyte_next_event(unsigned long delta, struct clock_event_device *cd) | |||
| 73 | cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)); | 73 | cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)); |
| 74 | init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)); | 74 | init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)); |
| 75 | 75 | ||
| 76 | __raw_writeq(0, cfg); | ||
| 76 | __raw_writeq(delta - 1, init); | 77 | __raw_writeq(delta - 1, init); |
| 77 | __raw_writeq(M_SCD_TIMER_ENABLE, cfg); | 78 | __raw_writeq(M_SCD_TIMER_ENABLE, cfg); |
| 78 | 79 | ||
| @@ -121,7 +122,7 @@ void __cpuinit sb1250_clockevent_init(void) | |||
| 121 | CLOCK_EVT_FEAT_ONESHOT; | 122 | CLOCK_EVT_FEAT_ONESHOT; |
| 122 | clockevent_set_clock(cd, V_SCD_TIMER_FREQ); | 123 | clockevent_set_clock(cd, V_SCD_TIMER_FREQ); |
| 123 | cd->max_delta_ns = clockevent_delta2ns(0x7fffff, cd); | 124 | cd->max_delta_ns = clockevent_delta2ns(0x7fffff, cd); |
| 124 | cd->min_delta_ns = clockevent_delta2ns(1, cd); | 125 | cd->min_delta_ns = clockevent_delta2ns(2, cd); |
| 125 | cd->rating = 200; | 126 | cd->rating = 200; |
| 126 | cd->irq = irq; | 127 | cd->irq = irq; |
| 127 | cd->cpumask = cpumask_of_cpu(cpu); | 128 | cd->cpumask = cpumask_of_cpu(cpu); |
| @@ -142,7 +143,10 @@ void __cpuinit sb1250_clockevent_init(void) | |||
| 142 | 143 | ||
| 143 | action->handler = sibyte_counter_handler; | 144 | action->handler = sibyte_counter_handler; |
| 144 | action->flags = IRQF_DISABLED | IRQF_PERCPU; | 145 | action->flags = IRQF_DISABLED | IRQF_PERCPU; |
| 146 | action->mask = cpumask_of_cpu(cpu); | ||
| 145 | action->name = name; | 147 | action->name = name; |
| 146 | action->dev_id = cd; | 148 | action->dev_id = cd; |
| 149 | |||
| 150 | irq_set_affinity(irq, cpumask_of_cpu(cpu)); | ||
| 147 | setup_irq(irq, action); | 151 | setup_irq(irq, action); |
| 148 | } | 152 | } |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index c8c47a2d1972..5c2794391bf5 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
| @@ -943,6 +943,11 @@ __init void cpu_probe(void) | |||
| 943 | } | 943 | } |
| 944 | 944 | ||
| 945 | __cpu_name[cpu] = cpu_to_name(c); | 945 | __cpu_name[cpu] = cpu_to_name(c); |
| 946 | |||
| 947 | if (cpu_has_mips_r2) | ||
| 948 | c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1; | ||
| 949 | else | ||
| 950 | c->srsets = 1; | ||
| 946 | } | 951 | } |
| 947 | 952 | ||
| 948 | __init void cpu_report(void) | 953 | __init void cpu_report(void) |
diff --git a/arch/mips/kernel/csrc-sb1250.c b/arch/mips/kernel/csrc-sb1250.c index ebb16e668877..92212bbb8e45 100644 --- a/arch/mips/kernel/csrc-sb1250.c +++ b/arch/mips/kernel/csrc-sb1250.c | |||
| @@ -43,7 +43,7 @@ static cycle_t sb1250_hpt_read(void) | |||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | struct clocksource bcm1250_clocksource = { | 45 | struct clocksource bcm1250_clocksource = { |
| 46 | .name = "MIPS", | 46 | .name = "bcm1250-counter-3", |
| 47 | .rating = 200, | 47 | .rating = 200, |
| 48 | .read = sb1250_hpt_read, | 48 | .read = sb1250_hpt_read, |
| 49 | .mask = CLOCKSOURCE_MASK(23), | 49 | .mask = CLOCKSOURCE_MASK(23), |
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index c0f19d638b98..e76a76bf0b3d 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S | |||
| @@ -146,7 +146,7 @@ NESTED(handle_int, PT_SIZE, sp) | |||
| 146 | and k0, ST0_IEP | 146 | and k0, ST0_IEP |
| 147 | bnez k0, 1f | 147 | bnez k0, 1f |
| 148 | 148 | ||
| 149 | mfc0 k0, EP0_EPC | 149 | mfc0 k0, CP0_EPC |
| 150 | .set noreorder | 150 | .set noreorder |
| 151 | j k0 | 151 | j k0 |
| 152 | rfe | 152 | rfe |
diff --git a/arch/mips/kernel/irq-rm7000.c b/arch/mips/kernel/irq-rm7000.c index 250732883488..971adf6ef4f4 100644 --- a/arch/mips/kernel/irq-rm7000.c +++ b/arch/mips/kernel/irq-rm7000.c | |||
| @@ -44,5 +44,5 @@ void __init rm7k_cpu_irq_init(void) | |||
| 44 | 44 | ||
| 45 | for (i = base; i < base + 4; i++) | 45 | for (i = base; i < base + 4; i++) |
| 46 | set_irq_chip_and_handler(i, &rm7k_irq_controller, | 46 | set_irq_chip_and_handler(i, &rm7k_irq_controller, |
| 47 | handle_level_irq); | 47 | handle_percpu_irq); |
| 48 | } | 48 | } |
diff --git a/arch/mips/kernel/irq-rm9000.c b/arch/mips/kernel/irq-rm9000.c index ae83d2df6f31..7b04583bd800 100644 --- a/arch/mips/kernel/irq-rm9000.c +++ b/arch/mips/kernel/irq-rm9000.c | |||
| @@ -104,5 +104,5 @@ void __init rm9k_cpu_irq_init(void) | |||
| 104 | 104 | ||
| 105 | rm9000_perfcount_irq = base + 1; | 105 | rm9000_perfcount_irq = base + 1; |
| 106 | set_irq_chip_and_handler(rm9000_perfcount_irq, &rm9k_perfcounter_irq, | 106 | set_irq_chip_and_handler(rm9000_perfcount_irq, &rm9k_perfcounter_irq, |
| 107 | handle_level_irq); | 107 | handle_percpu_irq); |
| 108 | } | 108 | } |
diff --git a/arch/mips/kernel/irq_cpu.c b/arch/mips/kernel/irq_cpu.c index 7b66e03b5899..0ee2567b780d 100644 --- a/arch/mips/kernel/irq_cpu.c +++ b/arch/mips/kernel/irq_cpu.c | |||
| @@ -116,5 +116,5 @@ void __init mips_cpu_irq_init(void) | |||
| 116 | 116 | ||
| 117 | for (i = irq_base + 2; i < irq_base + 8; i++) | 117 | for (i = irq_base + 2; i < irq_base + 8; i++) |
| 118 | set_irq_chip_and_handler(i, &mips_cpu_irq_controller, | 118 | set_irq_chip_and_handler(i, &mips_cpu_irq_controller, |
| 119 | handle_level_irq); | 119 | handle_percpu_irq); |
| 120 | } | 120 | } |
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index efd2d1314123..6e6e947cce1e 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c | |||
| @@ -60,6 +60,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
| 60 | cpu_has_dsp ? " dsp" : "", | 60 | cpu_has_dsp ? " dsp" : "", |
| 61 | cpu_has_mipsmt ? " mt" : "" | 61 | cpu_has_mipsmt ? " mt" : "" |
| 62 | ); | 62 | ); |
| 63 | seq_printf(m, "shadow register sets\t: %d\n", | ||
| 64 | cpu_data[n].srsets); | ||
| 63 | 65 | ||
| 64 | sprintf(fmt, "VCE%%c exceptions\t\t: %s\n", | 66 | sprintf(fmt, "VCE%%c exceptions\t\t: %s\n", |
| 65 | cpu_has_vce ? "%u" : "not available"); | 67 | cpu_has_vce ? "%u" : "not available"); |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 118be24224f2..01993ec3368b 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
| @@ -293,7 +293,7 @@ EXPORT(sysn32_call_table) | |||
| 293 | PTR sys_ni_syscall /* 6170, was get_kernel_syms */ | 293 | PTR sys_ni_syscall /* 6170, was get_kernel_syms */ |
| 294 | PTR sys_ni_syscall /* was query_module */ | 294 | PTR sys_ni_syscall /* was query_module */ |
| 295 | PTR sys_quotactl | 295 | PTR sys_quotactl |
| 296 | PTR sys_nfsservctl | 296 | PTR compat_sys_nfsservctl |
| 297 | PTR sys_ni_syscall /* res. for getpmsg */ | 297 | PTR sys_ni_syscall /* res. for getpmsg */ |
| 298 | PTR sys_ni_syscall /* 6175 for putpmsg */ | 298 | PTR sys_ni_syscall /* 6175 for putpmsg */ |
| 299 | PTR sys_ni_syscall /* res. for afs_syscall */ | 299 | PTR sys_ni_syscall /* res. for afs_syscall */ |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index fa500787152d..23e73d0650a3 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
| @@ -1100,59 +1100,6 @@ void *set_except_vector(int n, void *addr) | |||
| 1100 | return (void *)old_handler; | 1100 | return (void *)old_handler; |
| 1101 | } | 1101 | } |
| 1102 | 1102 | ||
| 1103 | #ifdef CONFIG_CPU_MIPSR2_SRS | ||
| 1104 | /* | ||
| 1105 | * MIPSR2 shadow register set allocation | ||
| 1106 | * FIXME: SMP... | ||
| 1107 | */ | ||
| 1108 | |||
| 1109 | static struct shadow_registers { | ||
| 1110 | /* | ||
| 1111 | * Number of shadow register sets supported | ||
| 1112 | */ | ||
| 1113 | unsigned long sr_supported; | ||
| 1114 | /* | ||
| 1115 | * Bitmap of allocated shadow registers | ||
| 1116 | */ | ||
| 1117 | unsigned long sr_allocated; | ||
| 1118 | } shadow_registers; | ||
| 1119 | |||
| 1120 | static void mips_srs_init(void) | ||
| 1121 | { | ||
| 1122 | shadow_registers.sr_supported = ((read_c0_srsctl() >> 26) & 0x0f) + 1; | ||
| 1123 | printk(KERN_INFO "%ld MIPSR2 register sets available\n", | ||
| 1124 | shadow_registers.sr_supported); | ||
| 1125 | shadow_registers.sr_allocated = 1; /* Set 0 used by kernel */ | ||
| 1126 | } | ||
| 1127 | |||
| 1128 | int mips_srs_max(void) | ||
| 1129 | { | ||
| 1130 | return shadow_registers.sr_supported; | ||
| 1131 | } | ||
| 1132 | |||
| 1133 | int mips_srs_alloc(void) | ||
| 1134 | { | ||
| 1135 | struct shadow_registers *sr = &shadow_registers; | ||
| 1136 | int set; | ||
| 1137 | |||
| 1138 | again: | ||
| 1139 | set = find_first_zero_bit(&sr->sr_allocated, sr->sr_supported); | ||
| 1140 | if (set >= sr->sr_supported) | ||
| 1141 | return -1; | ||
| 1142 | |||
| 1143 | if (test_and_set_bit(set, &sr->sr_allocated)) | ||
| 1144 | goto again; | ||
| 1145 | |||
| 1146 | return set; | ||
| 1147 | } | ||
| 1148 | |||
| 1149 | void mips_srs_free(int set) | ||
| 1150 | { | ||
| 1151 | struct shadow_registers *sr = &shadow_registers; | ||
| 1152 | |||
| 1153 | clear_bit(set, &sr->sr_allocated); | ||
| 1154 | } | ||
| 1155 | |||
| 1156 | static asmlinkage void do_default_vi(void) | 1103 | static asmlinkage void do_default_vi(void) |
| 1157 | { | 1104 | { |
| 1158 | show_regs(get_irq_regs()); | 1105 | show_regs(get_irq_regs()); |
| @@ -1163,6 +1110,7 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) | |||
| 1163 | { | 1110 | { |
| 1164 | unsigned long handler; | 1111 | unsigned long handler; |
| 1165 | unsigned long old_handler = vi_handlers[n]; | 1112 | unsigned long old_handler = vi_handlers[n]; |
| 1113 | int srssets = current_cpu_data.srsets; | ||
| 1166 | u32 *w; | 1114 | u32 *w; |
| 1167 | unsigned char *b; | 1115 | unsigned char *b; |
| 1168 | 1116 | ||
| @@ -1178,7 +1126,7 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) | |||
| 1178 | 1126 | ||
| 1179 | b = (unsigned char *)(ebase + 0x200 + n*VECTORSPACING); | 1127 | b = (unsigned char *)(ebase + 0x200 + n*VECTORSPACING); |
| 1180 | 1128 | ||
| 1181 | if (srs >= mips_srs_max()) | 1129 | if (srs >= srssets) |
| 1182 | panic("Shadow register set %d not supported", srs); | 1130 | panic("Shadow register set %d not supported", srs); |
| 1183 | 1131 | ||
| 1184 | if (cpu_has_veic) { | 1132 | if (cpu_has_veic) { |
| @@ -1186,7 +1134,7 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) | |||
| 1186 | board_bind_eic_interrupt(n, srs); | 1134 | board_bind_eic_interrupt(n, srs); |
| 1187 | } else if (cpu_has_vint) { | 1135 | } else if (cpu_has_vint) { |
| 1188 | /* SRSMap is only defined if shadow sets are implemented */ | 1136 | /* SRSMap is only defined if shadow sets are implemented */ |
| 1189 | if (mips_srs_max() > 1) | 1137 | if (srssets > 1) |
| 1190 | change_c0_srsmap(0xf << n*4, srs << n*4); | 1138 | change_c0_srsmap(0xf << n*4, srs << n*4); |
| 1191 | } | 1139 | } |
| 1192 | 1140 | ||
| @@ -1253,14 +1201,6 @@ void *set_vi_handler(int n, vi_handler_t addr) | |||
| 1253 | return set_vi_srs_handler(n, addr, 0); | 1201 | return set_vi_srs_handler(n, addr, 0); |
| 1254 | } | 1202 | } |
| 1255 | 1203 | ||
| 1256 | #else | ||
| 1257 | |||
| 1258 | static inline void mips_srs_init(void) | ||
| 1259 | { | ||
| 1260 | } | ||
| 1261 | |||
| 1262 | #endif /* CONFIG_CPU_MIPSR2_SRS */ | ||
| 1263 | |||
| 1264 | /* | 1204 | /* |
| 1265 | * This is used by native signal handling | 1205 | * This is used by native signal handling |
| 1266 | */ | 1206 | */ |
| @@ -1503,8 +1443,6 @@ void __init trap_init(void) | |||
| 1503 | else | 1443 | else |
| 1504 | ebase = CAC_BASE; | 1444 | ebase = CAC_BASE; |
| 1505 | 1445 | ||
| 1506 | mips_srs_init(); | ||
| 1507 | |||
| 1508 | per_cpu_trap_init(); | 1446 | per_cpu_trap_init(); |
| 1509 | 1447 | ||
| 1510 | /* | 1448 | /* |
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 436a64ff3989..38bd33fa2a23 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
| @@ -1003,6 +1003,7 @@ static void cleanup_tc(struct tc *tc) | |||
| 1003 | write_tc_c0_tcstatus(tmp); | 1003 | write_tc_c0_tcstatus(tmp); |
| 1004 | 1004 | ||
| 1005 | write_tc_c0_tchalt(TCHALT_H); | 1005 | write_tc_c0_tchalt(TCHALT_H); |
| 1006 | mips_ihb(); | ||
| 1006 | 1007 | ||
| 1007 | /* bind it to anything other than VPE1 */ | 1008 | /* bind it to anything other than VPE1 */ |
| 1008 | // write_tc_c0_tcbind(read_tc_c0_tcbind() & ~TCBIND_CURVPE); // | TCBIND_CURVPE | 1009 | // write_tc_c0_tcbind(read_tc_c0_tcbind() & ~TCBIND_CURVPE); // | TCBIND_CURVPE |
| @@ -1235,9 +1236,12 @@ int vpe_free(vpe_handle vpe) | |||
| 1235 | settc(t->index); | 1236 | settc(t->index); |
| 1236 | write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() & ~VPECONF0_VPA); | 1237 | write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() & ~VPECONF0_VPA); |
| 1237 | 1238 | ||
| 1238 | /* mark the TC unallocated and halt'ed */ | 1239 | /* halt the TC */ |
| 1239 | write_tc_c0_tcstatus(read_tc_c0_tcstatus() & ~TCSTATUS_A); | ||
| 1240 | write_tc_c0_tchalt(TCHALT_H); | 1240 | write_tc_c0_tchalt(TCHALT_H); |
| 1241 | mips_ihb(); | ||
| 1242 | |||
| 1243 | /* mark the TC unallocated */ | ||
| 1244 | write_tc_c0_tcstatus(read_tc_c0_tcstatus() & ~TCSTATUS_A); | ||
| 1241 | 1245 | ||
| 1242 | v->state = VPE_STATE_UNUSED; | 1246 | v->state = VPE_STATE_UNUSED; |
| 1243 | 1247 | ||
| @@ -1533,14 +1537,16 @@ static int __init vpe_module_init(void) | |||
| 1533 | t->pvpe = get_vpe(0); /* set the parent vpe */ | 1537 | t->pvpe = get_vpe(0); /* set the parent vpe */ |
| 1534 | } | 1538 | } |
| 1535 | 1539 | ||
| 1540 | /* halt the TC */ | ||
| 1541 | write_tc_c0_tchalt(TCHALT_H); | ||
| 1542 | mips_ihb(); | ||
| 1543 | |||
| 1536 | tmp = read_tc_c0_tcstatus(); | 1544 | tmp = read_tc_c0_tcstatus(); |
| 1537 | 1545 | ||
| 1538 | /* mark not activated and not dynamically allocatable */ | 1546 | /* mark not activated and not dynamically allocatable */ |
| 1539 | tmp &= ~(TCSTATUS_A | TCSTATUS_DA); | 1547 | tmp &= ~(TCSTATUS_A | TCSTATUS_DA); |
| 1540 | tmp |= TCSTATUS_IXMT; /* interrupt exempt */ | 1548 | tmp |= TCSTATUS_IXMT; /* interrupt exempt */ |
| 1541 | write_tc_c0_tcstatus(tmp); | 1549 | write_tc_c0_tcstatus(tmp); |
| 1542 | |||
| 1543 | write_tc_c0_tchalt(TCHALT_H); | ||
| 1544 | } | 1550 | } |
| 1545 | } | 1551 | } |
| 1546 | 1552 | ||
diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c index ba9692be3564..cfeab669782f 100644 --- a/arch/mips/lasat/interrupt.c +++ b/arch/mips/lasat/interrupt.c | |||
| @@ -19,17 +19,14 @@ | |||
| 19 | * Lasat boards. | 19 | * Lasat boards. |
| 20 | */ | 20 | */ |
| 21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 22 | #include <linux/irq.h> | ||
| 23 | #include <linux/sched.h> | ||
| 24 | #include <linux/slab.h> | ||
| 25 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
| 26 | #include <linux/kernel_stat.h> | 23 | #include <linux/irq.h> |
| 27 | 24 | ||
| 28 | #include <asm/bootinfo.h> | 25 | #include <asm/bootinfo.h> |
| 29 | #include <asm/irq_cpu.h> | 26 | #include <asm/irq_cpu.h> |
| 30 | #include <asm/lasat/lasatint.h> | 27 | #include <asm/lasat/lasatint.h> |
| 31 | #include <asm/time.h> | 28 | |
| 32 | #include <asm/gdb-stub.h> | 29 | #include <irq.h> |
| 33 | 30 | ||
| 34 | static volatile int *lasat_int_status; | 31 | static volatile int *lasat_int_status; |
| 35 | static volatile int *lasat_int_mask; | 32 | static volatile int *lasat_int_mask; |
| @@ -97,12 +94,18 @@ asmlinkage void plat_irq_dispatch(void) | |||
| 97 | 94 | ||
| 98 | /* if int_status == 0, then the interrupt has already been cleared */ | 95 | /* if int_status == 0, then the interrupt has already been cleared */ |
| 99 | if (int_status) { | 96 | if (int_status) { |
| 100 | irq = LASATINT_BASE + ls1bit32(int_status); | 97 | irq = LASAT_IRQ_BASE + ls1bit32(int_status); |
| 101 | 98 | ||
| 102 | do_IRQ(irq); | 99 | do_IRQ(irq); |
| 103 | } | 100 | } |
| 104 | } | 101 | } |
| 105 | 102 | ||
| 103 | static struct irqaction cascade = { | ||
| 104 | .handler = no_action, | ||
| 105 | .mask = CPU_MASK_NONE, | ||
| 106 | .name = "cascade", | ||
| 107 | }; | ||
| 108 | |||
| 106 | void __init arch_init_irq(void) | 109 | void __init arch_init_irq(void) |
| 107 | { | 110 | { |
| 108 | int i; | 111 | int i; |
| @@ -127,6 +130,9 @@ void __init arch_init_irq(void) | |||
| 127 | } | 130 | } |
| 128 | 131 | ||
| 129 | mips_cpu_irq_init(); | 132 | mips_cpu_irq_init(); |
| 130 | for (i = LASATINT_BASE; i <= LASATINT_END; i++) | 133 | |
| 134 | for (i = LASAT_IRQ_BASE; i <= LASAT_IRQ_END; i++) | ||
| 131 | set_irq_chip_and_handler(i, &lasat_irq_type, handle_level_irq); | 135 | set_irq_chip_and_handler(i, &lasat_irq_type, handle_level_irq); |
| 136 | |||
| 137 | setup_irq(LASAT_CASCADE_IRQ, &cascade); | ||
| 132 | } | 138 | } |
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 6806d58211b2..9355f1c9325f 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Ralf Baechle (ralf@gnu.org) | 7 | * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Ralf Baechle (ralf@gnu.org) |
| 8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | 8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. |
| 9 | */ | 9 | */ |
| 10 | #include <linux/hardirq.h> | ||
| 10 | #include <linux/init.h> | 11 | #include <linux/init.h> |
| 11 | #include <linux/highmem.h> | 12 | #include <linux/highmem.h> |
| 12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| @@ -507,7 +508,11 @@ static inline void local_r4k_flush_data_cache_page(void * addr) | |||
| 507 | 508 | ||
| 508 | static void r4k_flush_data_cache_page(unsigned long addr) | 509 | static void r4k_flush_data_cache_page(unsigned long addr) |
| 509 | { | 510 | { |
| 510 | r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, 1, 1); | 511 | if (in_atomic()) |
| 512 | local_r4k_flush_data_cache_page((void *)addr); | ||
| 513 | else | ||
| 514 | r4k_on_each_cpu(local_r4k_flush_data_cache_page, (void *) addr, | ||
| 515 | 1, 1); | ||
| 511 | } | 516 | } |
| 512 | 517 | ||
| 513 | struct flush_icache_range_args { | 518 | struct flush_icache_range_args { |
diff --git a/arch/mips/mm/cerr-sb1.c b/arch/mips/mm/cerr-sb1.c index e7f539e3284b..1bd1f18ac23c 100644 --- a/arch/mips/mm/cerr-sb1.c +++ b/arch/mips/mm/cerr-sb1.c | |||
| @@ -154,7 +154,7 @@ static void check_bus_watcher(void) | |||
| 154 | if (status & ~(1UL << 31)) { | 154 | if (status & ~(1UL << 31)) { |
| 155 | l2_err = csr_in32(IOADDR(A_BUS_L2_ERRORS)); | 155 | l2_err = csr_in32(IOADDR(A_BUS_L2_ERRORS)); |
| 156 | #ifdef DUMP_L2_ECC_TAG_ON_ERROR | 156 | #ifdef DUMP_L2_ECC_TAG_ON_ERROR |
| 157 | l2_tag = in64(IO_SPACE_BASE | A_L2_ECC_TAG); | 157 | l2_tag = in64(IOADDR(A_L2_ECC_TAG)); |
| 158 | #endif | 158 | #endif |
| 159 | memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS)); | 159 | memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS)); |
| 160 | printk("Bus watcher error counters: %08x %08x\n", l2_err, memio_err); | 160 | printk("Bus watcher error counters: %08x %08x\n", l2_err, memio_err); |
| @@ -183,9 +183,9 @@ asmlinkage void sb1_cache_error(void) | |||
| 183 | #ifdef CONFIG_SIBYTE_BW_TRACE | 183 | #ifdef CONFIG_SIBYTE_BW_TRACE |
| 184 | /* Freeze the trace buffer now */ | 184 | /* Freeze the trace buffer now */ |
| 185 | #if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80) | 185 | #if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80) |
| 186 | csr_out32(M_BCM1480_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG); | 186 | csr_out32(M_BCM1480_SCD_TRACE_CFG_FREEZE, IOADDR(A_SCD_TRACE_CFG)); |
| 187 | #else | 187 | #else |
| 188 | csr_out32(M_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG); | 188 | csr_out32(M_SCD_TRACE_CFG_FREEZE, IOADDR(A_SCD_TRACE_CFG)); |
| 189 | #endif | 189 | #endif |
| 190 | printk("Trace buffer frozen\n"); | 190 | printk("Trace buffer frozen\n"); |
| 191 | #endif | 191 | #endif |
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 110ee7656b41..ec3b9e9f30f4 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
| @@ -426,7 +426,7 @@ void __init mem_init(void) | |||
| 426 | 426 | ||
| 427 | #ifdef CONFIG_HIGHMEM | 427 | #ifdef CONFIG_HIGHMEM |
| 428 | for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) { | 428 | for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) { |
| 429 | struct page *page = mem_map + tmp; | 429 | struct page *page = pfn_to_page(tmp); |
| 430 | 430 | ||
| 431 | if (!page_is_ram(tmp)) { | 431 | if (!page_is_ram(tmp)) { |
| 432 | SetPageReserved(page); | 432 | SetPageReserved(page); |
diff --git a/arch/mips/pci/fixup-sni.c b/arch/mips/pci/fixup-sni.c index a45bedd17233..5c8a79bb2661 100644 --- a/arch/mips/pci/fixup-sni.c +++ b/arch/mips/pci/fixup-sni.c | |||
| @@ -113,6 +113,16 @@ static char irq_tab_pcit[13][5] __initdata = { | |||
| 113 | { 0, INTA, INTB, INTC, INTD }, /* Slot 5 */ | 113 | { 0, INTA, INTB, INTC, INTD }, /* Slot 5 */ |
| 114 | }; | 114 | }; |
| 115 | 115 | ||
| 116 | static char irq_tab_pcit_cplus[13][5] __initdata = { | ||
| 117 | /* INTA INTB INTC INTD */ | ||
| 118 | { 0, 0, 0, 0, 0 }, /* HOST bridge */ | ||
| 119 | { 0, INTB, INTC, INTD, INTA }, /* PCI Slot 9 */ | ||
| 120 | { 0, 0, 0, 0, 0 }, /* PCI-EISA */ | ||
| 121 | { 0, 0, 0, 0, 0 }, /* Unused */ | ||
| 122 | { 0, INTA, INTB, INTC, INTD }, /* PCI-PCI bridge */ | ||
| 123 | { 0, INTB, INTC, INTD, INTA }, /* fixup */ | ||
| 124 | }; | ||
| 125 | |||
| 116 | static inline int is_rm300_revd(void) | 126 | static inline int is_rm300_revd(void) |
| 117 | { | 127 | { |
| 118 | unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR; | 128 | unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR; |
| @@ -123,8 +133,19 @@ static inline int is_rm300_revd(void) | |||
| 123 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 133 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
| 124 | { | 134 | { |
| 125 | switch (sni_brd_type) { | 135 | switch (sni_brd_type) { |
| 126 | case SNI_BRD_PCI_TOWER: | ||
| 127 | case SNI_BRD_PCI_TOWER_CPLUS: | 136 | case SNI_BRD_PCI_TOWER_CPLUS: |
| 137 | if (slot == 4) { | ||
| 138 | /* | ||
| 139 | * SNI messed up interrupt wiring for onboard | ||
| 140 | * PCI bus 1; we need to fix this up here | ||
| 141 | */ | ||
| 142 | while (dev && dev->bus->number != 1) | ||
| 143 | dev = dev->bus->self; | ||
| 144 | if (dev && dev->devfn >= PCI_DEVFN(4, 0)) | ||
| 145 | slot = 5; | ||
| 146 | } | ||
| 147 | return irq_tab_pcit_cplus[slot][pin]; | ||
| 148 | case SNI_BRD_PCI_TOWER: | ||
| 128 | return irq_tab_pcit[slot][pin]; | 149 | return irq_tab_pcit[slot][pin]; |
| 129 | 150 | ||
| 130 | case SNI_BRD_PCI_MTOWER: | 151 | case SNI_BRD_PCI_MTOWER: |
diff --git a/arch/mips/pci/pci-lasat.c b/arch/mips/pci/pci-lasat.c index 174f314933b5..e70ae3236e0b 100644 --- a/arch/mips/pci/pci-lasat.c +++ b/arch/mips/pci/pci-lasat.c | |||
| @@ -5,12 +5,14 @@ | |||
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2000, 2001, 04 Keith M Wesolowski | 6 | * Copyright (C) 2000, 2001, 04 Keith M Wesolowski |
| 7 | */ | 7 | */ |
| 8 | #include <linux/kernel.h> | ||
| 9 | #include <linux/init.h> | 8 | #include <linux/init.h> |
| 9 | #include <linux/kernel.h> | ||
| 10 | #include <linux/pci.h> | 10 | #include <linux/pci.h> |
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | |||
| 12 | #include <asm/bootinfo.h> | 13 | #include <asm/bootinfo.h> |
| 13 | #include <asm/lasat/lasatint.h> | 14 | |
| 15 | #include <irq.h> | ||
| 14 | 16 | ||
| 15 | extern struct pci_ops nile4_pci_ops; | 17 | extern struct pci_ops nile4_pci_ops; |
| 16 | extern struct pci_ops gt64xxx_pci0_ops; | 18 | extern struct pci_ops gt64xxx_pci0_ops; |
| @@ -55,15 +57,15 @@ static int __init lasat_pci_setup(void) | |||
| 55 | 57 | ||
| 56 | arch_initcall(lasat_pci_setup); | 58 | arch_initcall(lasat_pci_setup); |
| 57 | 59 | ||
| 58 | #define LASATINT_ETH1 (LASATINT_BASE + 0) | 60 | #define LASAT_IRQ_ETH1 (LASAT_IRQ_BASE + 0) |
| 59 | #define LASATINT_ETH0 (LASATINT_BASE + 1) | 61 | #define LASAT_IRQ_ETH0 (LASAT_IRQ_BASE + 1) |
| 60 | #define LASATINT_HDC (LASATINT_BASE + 2) | 62 | #define LASAT_IRQ_HDC (LASAT_IRQ_BASE + 2) |
| 61 | #define LASATINT_COMP (LASATINT_BASE + 3) | 63 | #define LASAT_IRQ_COMP (LASAT_IRQ_BASE + 3) |
| 62 | #define LASATINT_HDLC (LASATINT_BASE + 4) | 64 | #define LASAT_IRQ_HDLC (LASAT_IRQ_BASE + 4) |
| 63 | #define LASATINT_PCIA (LASATINT_BASE + 5) | 65 | #define LASAT_IRQ_PCIA (LASAT_IRQ_BASE + 5) |
| 64 | #define LASATINT_PCIB (LASATINT_BASE + 6) | 66 | #define LASAT_IRQ_PCIB (LASAT_IRQ_BASE + 6) |
| 65 | #define LASATINT_PCIC (LASATINT_BASE + 7) | 67 | #define LASAT_IRQ_PCIC (LASAT_IRQ_BASE + 7) |
| 66 | #define LASATINT_PCID (LASATINT_BASE + 8) | 68 | #define LASAT_IRQ_PCID (LASAT_IRQ_BASE + 8) |
| 67 | 69 | ||
| 68 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 70 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
| 69 | { | 71 | { |
| @@ -71,13 +73,13 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |||
| 71 | case 1: | 73 | case 1: |
| 72 | case 2: | 74 | case 2: |
| 73 | case 3: | 75 | case 3: |
| 74 | return LASATINT_PCIA + (((slot-1) + (pin-1)) % 4); | 76 | return LASAT_IRQ_PCIA + (((slot-1) + (pin-1)) % 4); |
| 75 | case 4: | 77 | case 4: |
| 76 | return LASATINT_ETH1; /* Ethernet 1 (LAN 2) */ | 78 | return LASAT_IRQ_ETH1; /* Ethernet 1 (LAN 2) */ |
| 77 | case 5: | 79 | case 5: |
| 78 | return LASATINT_ETH0; /* Ethernet 0 (LAN 1) */ | 80 | return LASAT_IRQ_ETH0; /* Ethernet 0 (LAN 1) */ |
| 79 | case 6: | 81 | case 6: |
| 80 | return LASATINT_HDC; /* IDE controller */ | 82 | return LASAT_IRQ_HDC; /* IDE controller */ |
| 81 | default: | 83 | default: |
| 82 | return 0xff; /* Illegal */ | 84 | return 0xff; /* Illegal */ |
| 83 | } | 85 | } |
diff --git a/arch/mips/pci/pci-vr41xx.c b/arch/mips/pci/pci-vr41xx.c index 240df9e33813..33c4f683d067 100644 --- a/arch/mips/pci/pci-vr41xx.c +++ b/arch/mips/pci/pci-vr41xx.c | |||
| @@ -154,6 +154,7 @@ static int __init vr41xx_pciu_init(void) | |||
| 154 | pciu_write(PCICLKSELREG, QUARTER_VTCLOCK); | 154 | pciu_write(PCICLKSELREG, QUARTER_VTCLOCK); |
| 155 | else { | 155 | else { |
| 156 | printk(KERN_ERR "PCI Clock is over 33MHz.\n"); | 156 | printk(KERN_ERR "PCI Clock is over 33MHz.\n"); |
| 157 | iounmap(pciu_base); | ||
| 157 | return -EINVAL; | 158 | return -EINVAL; |
| 158 | } | 159 | } |
| 159 | 160 | ||
diff --git a/arch/mips/qemu/Makefile b/arch/mips/qemu/Makefile index cec24c117f6e..2ba4ef34b4a7 100644 --- a/arch/mips/qemu/Makefile +++ b/arch/mips/qemu/Makefile | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | obj-y = q-firmware.o q-irq.o q-mem.o q-setup.o q-reset.o | 5 | obj-y = q-firmware.o q-irq.o q-mem.o q-setup.o q-reset.o |
| 6 | 6 | ||
| 7 | obj-$(CONFIG_SMP) += q-smp.o | 7 | obj-$(CONFIG_EARLY_PRINTK) += q-console.o |
| 8 | obj-$(CONFIG_SMP) += q-smp.o | ||
| 8 | 9 | ||
| 9 | EXTRA_CFLAGS += -Werror | 10 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/qemu/q-console.c b/arch/mips/qemu/q-console.c new file mode 100644 index 000000000000..81101ae5017a --- /dev/null +++ b/arch/mips/qemu/q-console.c | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #include <linux/console.h> | ||
| 2 | #include <linux/init.h> | ||
| 3 | #include <linux/serial_reg.h> | ||
| 4 | #include <asm/io.h> | ||
| 5 | |||
| 6 | #define PORT(offset) (0x3f8 + (offset)) | ||
| 7 | |||
| 8 | static inline unsigned int serial_in(int offset) | ||
| 9 | { | ||
| 10 | return inb(PORT(offset)); | ||
| 11 | } | ||
| 12 | |||
| 13 | static inline void serial_out(int offset, int value) | ||
| 14 | { | ||
| 15 | outb(value, PORT(offset)); | ||
| 16 | } | ||
| 17 | |||
| 18 | int prom_putchar(char c) | ||
| 19 | { | ||
| 20 | while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0) | ||
| 21 | ; | ||
| 22 | |||
| 23 | serial_out(UART_TX, c); | ||
| 24 | |||
| 25 | return 1; | ||
| 26 | } | ||
diff --git a/arch/mips/qemu/q-firmware.c b/arch/mips/qemu/q-firmware.c index c2239b417587..3ed43f416cd1 100644 --- a/arch/mips/qemu/q-firmware.c +++ b/arch/mips/qemu/q-firmware.c | |||
| @@ -2,6 +2,9 @@ | |||
| 2 | #include <linux/string.h> | 2 | #include <linux/string.h> |
| 3 | #include <asm/addrspace.h> | 3 | #include <asm/addrspace.h> |
| 4 | #include <asm/bootinfo.h> | 4 | #include <asm/bootinfo.h> |
| 5 | #include <asm/io.h> | ||
| 6 | |||
| 7 | #define QEMU_PORT_BASE 0xb4000000 | ||
| 5 | 8 | ||
| 6 | void __init prom_init(void) | 9 | void __init prom_init(void) |
| 7 | { | 10 | { |
| @@ -15,4 +18,7 @@ void __init prom_init(void) | |||
| 15 | } else { | 18 | } else { |
| 16 | add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM); | 19 | add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM); |
| 17 | } | 20 | } |
| 21 | |||
| 22 | |||
| 23 | set_io_port_base(QEMU_PORT_BASE); | ||
| 18 | } | 24 | } |
diff --git a/arch/mips/qemu/q-setup.c b/arch/mips/qemu/q-setup.c index 23d34c1917c0..969cedc8d8b9 100644 --- a/arch/mips/qemu/q-setup.c +++ b/arch/mips/qemu/q-setup.c | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | extern void qemu_reboot_setup(void); | 7 | extern void qemu_reboot_setup(void); |
| 8 | 8 | ||
| 9 | #define QEMU_PORT_BASE 0xb4000000 | ||
| 10 | |||
| 11 | const char *get_system_type(void) | 9 | const char *get_system_type(void) |
| 12 | { | 10 | { |
| 13 | return "Qemu"; | 11 | return "Qemu"; |
| @@ -20,6 +18,5 @@ void __init plat_time_init(void) | |||
| 20 | 18 | ||
| 21 | void __init plat_mem_setup(void) | 19 | void __init plat_mem_setup(void) |
| 22 | { | 20 | { |
| 23 | set_io_port_base(QEMU_PORT_BASE); | ||
| 24 | qemu_reboot_setup(); | 21 | qemu_reboot_setup(); |
| 25 | } | 22 | } |
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c index e28d626255a3..db372a0f106d 100644 --- a/arch/mips/sibyte/bcm1480/irq.c +++ b/arch/mips/sibyte/bcm1480/irq.c | |||
| @@ -370,11 +370,11 @@ void __init arch_init_irq(void) | |||
| 370 | #endif | 370 | #endif |
| 371 | /* Setup uart 1 settings, mapper */ | 371 | /* Setup uart 1 settings, mapper */ |
| 372 | /* QQQ FIXME */ | 372 | /* QQQ FIXME */ |
| 373 | __raw_writeq(M_DUART_IMR_BRK, IO_SPACE_BASE + A_DUART_IMRREG(kgdb_port)); | 373 | __raw_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port))); |
| 374 | 374 | ||
| 375 | __raw_writeq(IMR_IP6_VAL, | 375 | __raw_writeq(IMR_IP6_VAL, |
| 376 | IO_SPACE_BASE + A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) + | 376 | IOADDR(A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) + |
| 377 | (kgdb_irq<<3)); | 377 | (kgdb_irq << 3))); |
| 378 | bcm1480_unmask_irq(0, kgdb_irq); | 378 | bcm1480_unmask_irq(0, kgdb_irq); |
| 379 | 379 | ||
| 380 | #ifdef CONFIG_GDB_CONSOLE | 380 | #ifdef CONFIG_GDB_CONSOLE |
| @@ -412,18 +412,6 @@ static void bcm1480_kgdb_interrupt(void) | |||
| 412 | 412 | ||
| 413 | extern void bcm1480_mailbox_interrupt(void); | 413 | extern void bcm1480_mailbox_interrupt(void); |
| 414 | 414 | ||
| 415 | static inline void dispatch_ip4(void) | ||
| 416 | { | ||
| 417 | int cpu = smp_processor_id(); | ||
| 418 | int irq = K_BCM1480_INT_TIMER_0 + cpu; | ||
| 419 | |||
| 420 | /* Reset the timer */ | ||
| 421 | __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS, | ||
| 422 | IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); | ||
| 423 | |||
| 424 | do_IRQ(irq); | ||
| 425 | } | ||
| 426 | |||
| 427 | static inline void dispatch_ip2(void) | 415 | static inline void dispatch_ip2(void) |
| 428 | { | 416 | { |
| 429 | unsigned long long mask_h, mask_l; | 417 | unsigned long long mask_h, mask_l; |
| @@ -451,6 +439,7 @@ static inline void dispatch_ip2(void) | |||
| 451 | 439 | ||
| 452 | asmlinkage void plat_irq_dispatch(void) | 440 | asmlinkage void plat_irq_dispatch(void) |
| 453 | { | 441 | { |
| 442 | unsigned int cpu = smp_processor_id(); | ||
| 454 | unsigned int pending; | 443 | unsigned int pending; |
| 455 | 444 | ||
| 456 | #ifdef CONFIG_SIBYTE_BCM1480_PROF | 445 | #ifdef CONFIG_SIBYTE_BCM1480_PROF |
| @@ -467,7 +456,7 @@ asmlinkage void plat_irq_dispatch(void) | |||
| 467 | #endif | 456 | #endif |
| 468 | 457 | ||
| 469 | if (pending & CAUSEF_IP4) | 458 | if (pending & CAUSEF_IP4) |
| 470 | dispatch_ip4(); | 459 | do_IRQ(K_BCM1480_INT_TIMER_0 + cpu); |
| 471 | #ifdef CONFIG_SMP | 460 | #ifdef CONFIG_SMP |
| 472 | else if (pending & CAUSEF_IP3) | 461 | else if (pending & CAUSEF_IP3) |
| 473 | bcm1480_mailbox_interrupt(); | 462 | bcm1480_mailbox_interrupt(); |
diff --git a/arch/mips/sni/pcimt.c b/arch/mips/sni/pcimt.c index 4df070f2ff5d..834650f371e0 100644 --- a/arch/mips/sni/pcimt.c +++ b/arch/mips/sni/pcimt.c | |||
| @@ -244,7 +244,7 @@ static void pcimt_hwint1(void) | |||
| 244 | if (pend & IT_EISA) { | 244 | if (pend & IT_EISA) { |
| 245 | int irq; | 245 | int irq; |
| 246 | /* | 246 | /* |
| 247 | * Note: ASIC PCI's builtin interrupt achknowledge feature is | 247 | * Note: ASIC PCI's builtin interrupt acknowledge feature is |
| 248 | * broken. Using it may result in loss of some or all i8259 | 248 | * broken. Using it may result in loss of some or all i8259 |
| 249 | * interrupts, so don't use PCIMT_INT_ACKNOWLEDGE ... | 249 | * interrupts, so don't use PCIMT_INT_ACKNOWLEDGE ... |
| 250 | */ | 250 | */ |
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h index 94f1c8172360..ed5c02c6afbb 100644 --- a/include/asm-mips/cpu-info.h +++ b/include/asm-mips/cpu-info.h | |||
| @@ -54,6 +54,7 @@ struct cpuinfo_mips { | |||
| 54 | struct cache_desc dcache; /* Primary D or combined I/D cache */ | 54 | struct cache_desc dcache; /* Primary D or combined I/D cache */ |
| 55 | struct cache_desc scache; /* Secondary cache */ | 55 | struct cache_desc scache; /* Secondary cache */ |
| 56 | struct cache_desc tcache; /* Tertiary/split secondary cache */ | 56 | struct cache_desc tcache; /* Tertiary/split secondary cache */ |
| 57 | int srsets; /* Shadow register sets */ | ||
| 57 | #if defined(CONFIG_MIPS_MT_SMTC) | 58 | #if defined(CONFIG_MIPS_MT_SMTC) |
| 58 | /* | 59 | /* |
| 59 | * In the MIPS MT "SMTC" model, each TC is considered | 60 | * In the MIPS MT "SMTC" model, each TC is considered |
diff --git a/include/asm-mips/lasat/lasatint.h b/include/asm-mips/lasat/lasatint.h index 581dc45685a2..e0d2458b43d0 100644 --- a/include/asm-mips/lasat/lasatint.h +++ b/include/asm-mips/lasat/lasatint.h | |||
| @@ -1,11 +1,6 @@ | |||
| 1 | #ifndef __ASM_LASAT_LASATINT_H | 1 | #ifndef __ASM_LASAT_LASATINT_H |
| 2 | #define __ASM_LASAT_LASATINT_H | 2 | #define __ASM_LASAT_LASATINT_H |
| 3 | 3 | ||
| 4 | #include <linux/irq.h> | ||
| 5 | |||
| 6 | #define LASATINT_BASE MIPS_CPU_IRQ_BASE | ||
| 7 | #define LASATINT_END (LASATINT_BASE + 16) | ||
| 8 | |||
| 9 | /* lasat 100 */ | 4 | /* lasat 100 */ |
| 10 | #define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000)) | 5 | #define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000)) |
| 11 | #define LASAT_INT_MASK_REG_100 (KSEG1ADDR(0x1c890000)) | 6 | #define LASAT_INT_MASK_REG_100 (KSEG1ADDR(0x1c890000)) |
diff --git a/include/asm-mips/mach-lasat/irq.h b/include/asm-mips/mach-lasat/irq.h new file mode 100644 index 000000000000..da75f89f3723 --- /dev/null +++ b/include/asm-mips/mach-lasat/irq.h | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #ifndef _ASM_MACH_LASAT_IRQ_H | ||
| 2 | #define _ASM_MACH_LASAT_IRQ_H | ||
| 3 | |||
| 4 | #define LASAT_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 0) | ||
| 5 | |||
| 6 | #define LASAT_IRQ_BASE 8 | ||
| 7 | #define LASAT_IRQ_END 23 | ||
| 8 | |||
| 9 | #define NR_IRQS 24 | ||
| 10 | |||
| 11 | #include_next <irq.h> | ||
| 12 | |||
| 13 | #endif /* _ASM_MACH_LASAT_IRQ_H */ | ||
diff --git a/include/asm-mips/timex.h b/include/asm-mips/timex.h index 5816ad1569d6..6529704aa73a 100644 --- a/include/asm-mips/timex.h +++ b/include/asm-mips/timex.h | |||
| @@ -35,7 +35,7 @@ typedef unsigned int cycles_t; | |||
| 35 | 35 | ||
| 36 | static inline cycles_t get_cycles(void) | 36 | static inline cycles_t get_cycles(void) |
| 37 | { | 37 | { |
| 38 | return read_c0_count(); | 38 | return 0; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | #endif /* __KERNEL__ */ | 41 | #endif /* __KERNEL__ */ |
