hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/mips/dec/setup.c
....@@ -6,7 +6,7 @@
66 * for more details.
77 *
88 * Copyright (C) 1998 Harald Koerfgen
9
- * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki
9
+ * Copyright (C) 2000, 2001, 2002, 2003, 2005, 2020 Maciej W. Rozycki
1010 */
1111 #include <linux/console.h>
1212 #include <linux/export.h>
....@@ -15,6 +15,7 @@
1515 #include <linux/ioport.h>
1616 #include <linux/irq.h>
1717 #include <linux/irqnr.h>
18
+#include <linux/memblock.h>
1819 #include <linux/param.h>
1920 #include <linux/percpu-defs.h>
2021 #include <linux/sched.h>
....@@ -22,6 +23,7 @@
2223 #include <linux/types.h>
2324 #include <linux/pm.h>
2425
26
+#include <asm/addrspace.h>
2527 #include <asm/bootinfo.h>
2628 #include <asm/cpu.h>
2729 #include <asm/cpu-features.h>
....@@ -29,7 +31,9 @@
2931 #include <asm/irq.h>
3032 #include <asm/irq_cpu.h>
3133 #include <asm/mipsregs.h>
34
+#include <asm/page.h>
3235 #include <asm/reboot.h>
36
+#include <asm/sections.h>
3337 #include <asm/time.h>
3438 #include <asm/traps.h>
3539 #include <asm/wbflush.h>
....@@ -103,28 +107,8 @@
103107 int cpu_fpu_mask = DEC_CPU_IRQ_MASK(DEC_CPU_INR_FPU);
104108 int *fpu_kstat_irq;
105109
106
-static struct irqaction ioirq = {
107
- .handler = no_action,
108
- .name = "cascade",
109
- .flags = IRQF_NO_THREAD,
110
-};
111
-static struct irqaction fpuirq = {
112
- .handler = no_action,
113
- .name = "fpu",
114
- .flags = IRQF_NO_THREAD,
115
-};
116
-
117
-static struct irqaction busirq = {
118
- .name = "bus error",
119
- .flags = IRQF_NO_THREAD,
120
-};
121
-
122
-static struct irqaction haltirq = {
123
- .handler = dec_intr_halt,
124
- .name = "halt",
125
- .flags = IRQF_NO_THREAD,
126
-};
127
-
110
+static irq_handler_t busirq_handler;
111
+static unsigned int busirq_flags = IRQF_NO_THREAD;
128112
129113 /*
130114 * Bus error (DBE/IBE exceptions and bus interrupts) handling setup.
....@@ -134,21 +118,21 @@
134118 switch (mips_machtype) {
135119 case MACH_DS23100: /* DS2100/DS3100 Pmin/Pmax */
136120 board_be_handler = dec_kn01_be_handler;
137
- busirq.handler = dec_kn01_be_interrupt;
138
- busirq.flags |= IRQF_SHARED;
121
+ busirq_handler = dec_kn01_be_interrupt;
122
+ busirq_flags |= IRQF_SHARED;
139123 dec_kn01_be_init();
140124 break;
141125 case MACH_DS5000_1XX: /* DS5000/1xx 3min */
142126 case MACH_DS5000_XX: /* DS5000/xx Maxine */
143127 board_be_handler = dec_kn02xa_be_handler;
144
- busirq.handler = dec_kn02xa_be_interrupt;
128
+ busirq_handler = dec_kn02xa_be_interrupt;
145129 dec_kn02xa_be_init();
146130 break;
147131 case MACH_DS5000_200: /* DS5000/200 3max */
148132 case MACH_DS5000_2X0: /* DS5000/240 3max+ */
149133 case MACH_DS5900: /* DS5900 bigmax */
150134 board_be_handler = dec_ecc_be_handler;
151
- busirq.handler = dec_ecc_be_interrupt;
135
+ busirq_handler = dec_ecc_be_interrupt;
152136 dec_ecc_be_init();
153137 break;
154138 }
....@@ -166,6 +150,9 @@
166150
167151 ioport_resource.start = ~0UL;
168152 ioport_resource.end = 0UL;
153
+
154
+ /* Stay away from the firmware working memory area for now. */
155
+ memblock_reserve(PHYS_OFFSET, __pa_symbol(&_text) - PHYS_OFFSET);
169156 }
170157
171158 /*
....@@ -759,25 +746,35 @@
759746 dec_interrupt[DEC_IRQ_HALT] = -1;
760747
761748 /* Register board interrupts: FPU and cascade. */
762
- if (dec_interrupt[DEC_IRQ_FPU] >= 0 && cpu_has_fpu) {
749
+ if (IS_ENABLED(CONFIG_MIPS_FP_SUPPORT) &&
750
+ dec_interrupt[DEC_IRQ_FPU] >= 0 && cpu_has_fpu) {
763751 struct irq_desc *desc_fpu;
764752 int irq_fpu;
765753
766754 irq_fpu = dec_interrupt[DEC_IRQ_FPU];
767
- setup_irq(irq_fpu, &fpuirq);
755
+ if (request_irq(irq_fpu, no_action, IRQF_NO_THREAD, "fpu",
756
+ NULL))
757
+ pr_err("Failed to register fpu interrupt\n");
768758 desc_fpu = irq_to_desc(irq_fpu);
769759 fpu_kstat_irq = this_cpu_ptr(desc_fpu->kstat_irqs);
770760 }
771
- if (dec_interrupt[DEC_IRQ_CASCADE] >= 0)
772
- setup_irq(dec_interrupt[DEC_IRQ_CASCADE], &ioirq);
773
-
761
+ if (dec_interrupt[DEC_IRQ_CASCADE] >= 0) {
762
+ if (request_irq(dec_interrupt[DEC_IRQ_CASCADE], no_action,
763
+ IRQF_NO_THREAD, "cascade", NULL))
764
+ pr_err("Failed to register cascade interrupt\n");
765
+ }
774766 /* Register the bus error interrupt. */
775
- if (dec_interrupt[DEC_IRQ_BUS] >= 0 && busirq.handler)
776
- setup_irq(dec_interrupt[DEC_IRQ_BUS], &busirq);
777
-
767
+ if (dec_interrupt[DEC_IRQ_BUS] >= 0 && busirq_handler) {
768
+ if (request_irq(dec_interrupt[DEC_IRQ_BUS], busirq_handler,
769
+ busirq_flags, "bus error", busirq_handler))
770
+ pr_err("Failed to register bus error interrupt\n");
771
+ }
778772 /* Register the HALT interrupt. */
779
- if (dec_interrupt[DEC_IRQ_HALT] >= 0)
780
- setup_irq(dec_interrupt[DEC_IRQ_HALT], &haltirq);
773
+ if (dec_interrupt[DEC_IRQ_HALT] >= 0) {
774
+ if (request_irq(dec_interrupt[DEC_IRQ_HALT], dec_intr_halt,
775
+ IRQF_NO_THREAD, "halt", NULL))
776
+ pr_err("Failed to register halt interrupt\n");
777
+ }
781778 }
782779
783780 asmlinkage unsigned int dec_irq_dispatch(unsigned int irq)