2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Carsten Langgaard, carstenl@mips.com
7 * Copyright (C) 2000, 2001, 2004 MIPS Technologies, Inc.
8 * Copyright (C) 2001 Ralf Baechle
9 * Copyright (C) 2013 Imagination Technologies Ltd.
11 * Routines for generic manipulation of the interrupts found on the MIPS
12 * Malta board. The interrupt controller is located in the South Bridge
13 * a PIIX4 device with two internal 82C95 interrupt controllers.
15 #include <linux/init.h>
16 #include <linux/irq.h>
17 #include <linux/sched.h>
18 #include <linux/smp.h>
19 #include <linux/interrupt.h>
21 #include <linux/kernel_stat.h>
22 #include <linux/kernel.h>
23 #include <linux/random.h>
25 #include <asm/traps.h>
26 #include <asm/i8259.h>
27 #include <asm/irq_cpu.h>
28 #include <asm/irq_regs.h>
29 #include <asm/mips-cm.h>
30 #include <asm/mips-boards/malta.h>
31 #include <asm/mips-boards/maltaint.h>
32 #include <asm/gt64120.h>
33 #include <asm/mips-boards/generic.h>
34 #include <asm/mips-boards/msc01_pci.h>
35 #include <asm/msc01_ic.h>
37 #include <asm/setup.h>
40 static unsigned long _msc01_biu_base;
41 static unsigned int ipi_map[NR_CPUS];
43 static DEFINE_RAW_SPINLOCK(mips_irq_lock);
45 #ifdef CONFIG_MIPS_GIC_IPI
46 DECLARE_BITMAP(ipi_ints, GIC_NUM_INTRS);
49 static inline int mips_pcibios_iack(void)
54 * Determine highest priority pending interrupt by performing
55 * a PCI Interrupt Acknowledge cycle.
57 switch (mips_revision_sconid) {
58 case MIPS_REVISION_SCON_SOCIT:
59 case MIPS_REVISION_SCON_ROCIT:
60 case MIPS_REVISION_SCON_SOCITSC:
61 case MIPS_REVISION_SCON_SOCITSCP:
62 MSC_READ(MSC01_PCI_IACK, irq);
65 case MIPS_REVISION_SCON_GT64120:
66 irq = GT_READ(GT_PCI0_IACK_OFS);
69 case MIPS_REVISION_SCON_BONITO:
70 /* The following will generate a PCI IACK cycle on the
71 * Bonito controller. It's a little bit kludgy, but it
72 * was the easiest way to implement it in hardware at
75 BONITO_PCIMAP_CFG = 0x20000;
77 /* Flush Bonito register block */
78 (void) BONITO_PCIMAP_CFG;
81 irq = __raw_readl((u32 *)_pcictrl_bonito_pcicfg);
84 BONITO_PCIMAP_CFG = 0;
87 pr_emerg("Unknown system controller.\n");
93 static inline int get_int(void)
97 raw_spin_lock_irqsave(&mips_irq_lock, flags);
99 irq = mips_pcibios_iack();
102 * The only way we can decide if an interrupt is spurious
103 * is by checking the 8259 registers. This needs a spinlock
104 * on an SMP system, so leave it up to the generic code...
107 raw_spin_unlock_irqrestore(&mips_irq_lock, flags);
112 static void malta_hw0_irqdispatch(void)
118 /* interrupt has already been cleared */
122 do_IRQ(MALTA_INT_BASE + irq);
124 #ifdef CONFIG_MIPS_VPE_APSP_API_MT
130 static void malta_ipi_irqdispatch(void)
132 #ifdef CONFIG_MIPS_GIC_IPI
134 DECLARE_BITMAP(pending, GIC_NUM_INTRS);
136 gic_get_int_mask(pending, ipi_ints);
138 irq = find_first_bit(pending, GIC_NUM_INTRS);
140 while (irq < GIC_NUM_INTRS) {
141 do_IRQ(MIPS_GIC_IRQ_BASE + irq);
143 irq = find_next_bit(pending, GIC_NUM_INTRS, irq + 1);
146 if (gic_compare_int())
147 do_IRQ(MIPS_GIC_IRQ_BASE);
150 static void corehi_irqdispatch(void)
152 unsigned int intedge, intsteer, pcicmd, pcibadaddr;
153 unsigned int pcimstat, intisr, inten, intpol;
154 unsigned int intrcause, datalo, datahi;
155 struct pt_regs *regs = get_irq_regs();
157 pr_emerg("CoreHI interrupt, shouldn't happen, we die here!\n");
158 pr_emerg("epc : %08lx\nStatus: %08lx\n"
159 "Cause : %08lx\nbadVaddr : %08lx\n",
160 regs->cp0_epc, regs->cp0_status,
161 regs->cp0_cause, regs->cp0_badvaddr);
163 /* Read all the registers and then print them as there is a
164 problem with interspersed printk's upsetting the Bonito controller.
165 Do it for the others too.
168 switch (mips_revision_sconid) {
169 case MIPS_REVISION_SCON_SOCIT:
170 case MIPS_REVISION_SCON_ROCIT:
171 case MIPS_REVISION_SCON_SOCITSC:
172 case MIPS_REVISION_SCON_SOCITSCP:
175 case MIPS_REVISION_SCON_GT64120:
176 intrcause = GT_READ(GT_INTRCAUSE_OFS);
177 datalo = GT_READ(GT_CPUERR_ADDRLO_OFS);
178 datahi = GT_READ(GT_CPUERR_ADDRHI_OFS);
179 pr_emerg("GT_INTRCAUSE = %08x\n", intrcause);
180 pr_emerg("GT_CPUERR_ADDR = %02x%08x\n",
183 case MIPS_REVISION_SCON_BONITO:
184 pcibadaddr = BONITO_PCIBADADDR;
185 pcimstat = BONITO_PCIMSTAT;
186 intisr = BONITO_INTISR;
187 inten = BONITO_INTEN;
188 intpol = BONITO_INTPOL;
189 intedge = BONITO_INTEDGE;
190 intsteer = BONITO_INTSTEER;
191 pcicmd = BONITO_PCICMD;
192 pr_emerg("BONITO_INTISR = %08x\n", intisr);
193 pr_emerg("BONITO_INTEN = %08x\n", inten);
194 pr_emerg("BONITO_INTPOL = %08x\n", intpol);
195 pr_emerg("BONITO_INTEDGE = %08x\n", intedge);
196 pr_emerg("BONITO_INTSTEER = %08x\n", intsteer);
197 pr_emerg("BONITO_PCICMD = %08x\n", pcicmd);
198 pr_emerg("BONITO_PCIBADADDR = %08x\n", pcibadaddr);
199 pr_emerg("BONITO_PCIMSTAT = %08x\n", pcimstat);
203 die("CoreHi interrupt", regs);
206 static inline int clz(unsigned long x)
220 * Version of ffs that only looks at bits 12..15.
222 static inline unsigned int irq_ffs(unsigned int pending)
224 #if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
225 return -clz(pending) + 31 - CAUSEB_IP;
230 t0 = pending & 0xf000;
234 pending = pending << t0;
236 t0 = pending & 0xc000;
240 pending = pending << t0;
242 t0 = pending & 0x8000;
246 /* pending = pending << t0; */
253 * IRQs on the Malta board look basically (barring software IRQs which we
254 * don't use at all and all external interrupt sources are combined together
255 * on hardware interrupt 0 (MIPS IRQ 2)) like:
259 * 0 Software (ignored)
260 * 1 Software (ignored)
261 * 2 Combined hardware interrupt (hw0)
262 * 3 Hardware (ignored)
263 * 4 Hardware (ignored)
264 * 5 Hardware (ignored)
265 * 6 Hardware (ignored)
266 * 7 R4k timer (what we use)
268 * We handle the IRQ according to _our_ priority which is:
270 * Highest ---- R4k Timer
271 * Lowest ---- Combined hardware interrupt
273 * then we just return, if multiple IRQs are pending then we will just take
274 * another exception, big deal.
277 asmlinkage void plat_irq_dispatch(void)
279 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
282 if (unlikely(!pending)) {
283 spurious_interrupt();
287 irq = irq_ffs(pending);
289 if (irq == MIPSCPU_INT_I8259A)
290 malta_hw0_irqdispatch();
291 else if (gic_present && ((1 << irq) & ipi_map[smp_processor_id()]))
292 malta_ipi_irqdispatch();
294 do_IRQ(MIPS_CPU_IRQ_BASE + irq);
297 #ifdef CONFIG_MIPS_MT_SMP
299 #define MIPS_CPU_IPI_RESCHED_IRQ 0 /* SW int 0 for resched */
300 #define C_RESCHED C_SW0
301 #define MIPS_CPU_IPI_CALL_IRQ 1 /* SW int 1 for resched */
303 static int cpu_ipi_resched_irq, cpu_ipi_call_irq;
305 static void ipi_resched_dispatch(void)
307 do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_RESCHED_IRQ);
310 static void ipi_call_dispatch(void)
312 do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ);
315 #endif /* CONFIG_MIPS_MT_SMP */
317 #ifdef CONFIG_MIPS_GIC_IPI
319 #define GIC_MIPS_CPU_IPI_RESCHED_IRQ 3
320 #define GIC_MIPS_CPU_IPI_CALL_IRQ 4
322 static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
324 #ifdef CONFIG_MIPS_VPE_APSP_API_CMP
334 static irqreturn_t ipi_call_interrupt(int irq, void *dev_id)
336 smp_call_function_interrupt();
341 static struct irqaction irq_resched = {
342 .handler = ipi_resched_interrupt,
343 .flags = IRQF_PERCPU,
344 .name = "IPI_resched"
347 static struct irqaction irq_call = {
348 .handler = ipi_call_interrupt,
349 .flags = IRQF_PERCPU,
352 #endif /* CONFIG_MIPS_GIC_IPI */
354 static int gic_resched_int_base;
355 static int gic_call_int_base;
356 #define GIC_RESCHED_INT(cpu) (gic_resched_int_base+(cpu))
357 #define GIC_CALL_INT(cpu) (gic_call_int_base+(cpu))
359 unsigned int plat_ipi_call_int_xlate(unsigned int cpu)
361 return GIC_CALL_INT(cpu);
364 unsigned int plat_ipi_resched_int_xlate(unsigned int cpu)
366 return GIC_RESCHED_INT(cpu);
369 static struct irqaction i8259irq = {
370 .handler = no_action,
371 .name = "XT-PIC cascade",
372 .flags = IRQF_NO_THREAD,
375 static struct irqaction corehi_irqaction = {
376 .handler = no_action,
378 .flags = IRQF_NO_THREAD,
381 static msc_irqmap_t msc_irqmap[] __initdata = {
382 {MSC01C_INT_TMR, MSC01_IRQ_EDGE, 0},
383 {MSC01C_INT_PCI, MSC01_IRQ_LEVEL, 0},
385 static int msc_nr_irqs __initdata = ARRAY_SIZE(msc_irqmap);
387 static msc_irqmap_t msc_eicirqmap[] __initdata = {
388 {MSC01E_INT_SW0, MSC01_IRQ_LEVEL, 0},
389 {MSC01E_INT_SW1, MSC01_IRQ_LEVEL, 0},
390 {MSC01E_INT_I8259A, MSC01_IRQ_LEVEL, 0},
391 {MSC01E_INT_SMI, MSC01_IRQ_LEVEL, 0},
392 {MSC01E_INT_COREHI, MSC01_IRQ_LEVEL, 0},
393 {MSC01E_INT_CORELO, MSC01_IRQ_LEVEL, 0},
394 {MSC01E_INT_TMR, MSC01_IRQ_EDGE, 0},
395 {MSC01E_INT_PCI, MSC01_IRQ_LEVEL, 0},
396 {MSC01E_INT_PERFCTR, MSC01_IRQ_LEVEL, 0},
397 {MSC01E_INT_CPUCTR, MSC01_IRQ_LEVEL, 0}
400 static int msc_nr_eicirqs __initdata = ARRAY_SIZE(msc_eicirqmap);
403 * This GIC specific tabular array defines the association between External
404 * Interrupts and CPUs/Core Interrupts. The nature of the External
405 * Interrupts is also defined here - polarity/trigger.
408 #define GIC_CPU_NMI GIC_MAP_TO_NMI_MSK
411 static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {
415 { 0, GIC_CPU_INT0, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
416 { 0, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
417 { 0, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
418 { 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
419 { 0, GIC_CPU_INT4, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
420 { 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
421 { 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
424 { 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
425 { 0, GIC_CPU_NMI, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
426 { 0, GIC_CPU_NMI, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
428 /* The remainder of this table is initialised by fill_ipi_map */
432 #ifdef CONFIG_MIPS_GIC_IPI
433 static void __init fill_ipi_map1(int baseintr, int cpu, int cpupin)
435 int intr = baseintr + cpu;
436 gic_intr_map[intr].cpunum = cpu;
437 gic_intr_map[intr].pin = cpupin;
438 gic_intr_map[intr].polarity = GIC_POL_POS;
439 gic_intr_map[intr].trigtype = GIC_TRIG_EDGE;
440 gic_intr_map[intr].flags = 0;
441 ipi_map[cpu] |= (1 << (cpupin + 2));
442 bitmap_set(ipi_ints, intr, 1);
445 static void __init fill_ipi_map(void)
449 for (cpu = 0; cpu < nr_cpu_ids; cpu++) {
450 fill_ipi_map1(gic_resched_int_base, cpu, GIC_CPU_INT1);
451 fill_ipi_map1(gic_call_int_base, cpu, GIC_CPU_INT2);
456 void __init arch_init_ipiirq(int irq, struct irqaction *action)
458 setup_irq(irq, action);
459 irq_set_handler(irq, handle_percpu_irq);
462 void __init arch_init_irq(void)
469 if (mips_cm_present()) {
470 write_gcr_gic_base(GIC_BASE_ADDR | CM_GCR_GIC_BASE_GICEN_MSK);
473 if (mips_revision_sconid == MIPS_REVISION_SCON_ROCIT) {
474 _msc01_biu_base = (unsigned long)
475 ioremap_nocache(MSC01_BIU_REG_BASE,
476 MSC01_BIU_ADDRSPACE_SZ);
477 gic_present = (REG(_msc01_biu_base, MSC01_SC_CFG) &
478 MSC01_SC_CFG_GICPRES_MSK) >>
479 MSC01_SC_CFG_GICPRES_SHF;
483 pr_debug("GIC present\n");
485 switch (mips_revision_sconid) {
486 case MIPS_REVISION_SCON_SOCIT:
487 case MIPS_REVISION_SCON_ROCIT:
489 init_msc_irqs(MIPS_MSC01_IC_REG_BASE,
490 MSC01E_INT_BASE, msc_eicirqmap,
493 init_msc_irqs(MIPS_MSC01_IC_REG_BASE,
494 MSC01C_INT_BASE, msc_irqmap,
498 case MIPS_REVISION_SCON_SOCITSC:
499 case MIPS_REVISION_SCON_SOCITSCP:
501 init_msc_irqs(MIPS_SOCITSC_IC_REG_BASE,
502 MSC01E_INT_BASE, msc_eicirqmap,
505 init_msc_irqs(MIPS_SOCITSC_IC_REG_BASE,
506 MSC01C_INT_BASE, msc_irqmap,
511 set_vi_handler(MSC01E_INT_I8259A, malta_hw0_irqdispatch);
512 set_vi_handler(MSC01E_INT_COREHI, corehi_irqdispatch);
513 setup_irq(MSC01E_INT_BASE+MSC01E_INT_I8259A, &i8259irq);
514 setup_irq(MSC01E_INT_BASE+MSC01E_INT_COREHI, &corehi_irqaction);
515 } else if (cpu_has_vint) {
516 set_vi_handler(MIPSCPU_INT_I8259A, malta_hw0_irqdispatch);
517 set_vi_handler(MIPSCPU_INT_COREHI, corehi_irqdispatch);
518 setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq);
519 setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI,
522 setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq);
523 setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI,
530 #if defined(CONFIG_MIPS_GIC_IPI)
531 gic_call_int_base = GIC_NUM_INTRS -
532 (NR_CPUS - nr_cpu_ids) * 2 - nr_cpu_ids;
533 gic_resched_int_base = gic_call_int_base - nr_cpu_ids;
536 gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map,
537 ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE);
538 if (!mips_cm_present()) {
540 i = REG(_msc01_biu_base, MSC01_SC_CFG);
541 REG(_msc01_biu_base, MSC01_SC_CFG) =
542 (i | (0x1 << MSC01_SC_CFG_GICENA_SHF));
543 pr_debug("GIC Enabled\n");
545 #if defined(CONFIG_MIPS_GIC_IPI)
546 /* set up ipi interrupts */
548 set_vi_handler(MIPSCPU_INT_IPI0, malta_ipi_irqdispatch);
549 set_vi_handler(MIPSCPU_INT_IPI1, malta_ipi_irqdispatch);
551 /* Argh.. this really needs sorting out.. */
552 pr_info("CPU%d: status register was %08x\n",
553 smp_processor_id(), read_c0_status());
554 write_c0_status(read_c0_status() | STATUSF_IP3 | STATUSF_IP4);
555 pr_info("CPU%d: status register now %08x\n",
556 smp_processor_id(), read_c0_status());
557 write_c0_status(0x1100dc00);
558 pr_info("CPU%d: status register frc %08x\n",
559 smp_processor_id(), read_c0_status());
560 for (i = 0; i < nr_cpu_ids; i++) {
561 arch_init_ipiirq(MIPS_GIC_IRQ_BASE +
562 GIC_RESCHED_INT(i), &irq_resched);
563 arch_init_ipiirq(MIPS_GIC_IRQ_BASE +
564 GIC_CALL_INT(i), &irq_call);
568 #if defined(CONFIG_MIPS_MT_SMP)
569 /* set up ipi interrupts */
571 set_vi_handler (MSC01E_INT_SW0, ipi_resched_dispatch);
572 set_vi_handler (MSC01E_INT_SW1, ipi_call_dispatch);
573 cpu_ipi_resched_irq = MSC01E_INT_SW0;
574 cpu_ipi_call_irq = MSC01E_INT_SW1;
577 set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ,
578 ipi_resched_dispatch);
579 set_vi_handler (MIPS_CPU_IPI_CALL_IRQ,
582 cpu_ipi_resched_irq = MIPS_CPU_IRQ_BASE +
583 MIPS_CPU_IPI_RESCHED_IRQ;
584 cpu_ipi_call_irq = MIPS_CPU_IRQ_BASE +
585 MIPS_CPU_IPI_CALL_IRQ;
587 arch_init_ipiirq(cpu_ipi_resched_irq, &irq_resched);
588 arch_init_ipiirq(cpu_ipi_call_irq, &irq_call);
593 void malta_be_init(void)
595 /* Could change CM error mask register. */
599 static char *tr[8] = {
600 "mem", "gcr", "gic", "mmio",
601 "0x04", "0x05", "0x06", "0x07"
604 static char *mcmd[32] = {
606 [0x01] = "Legacy Write",
607 [0x02] = "Legacy Read",
613 [0x08] = "Coherent Read Own",
614 [0x09] = "Coherent Read Share",
615 [0x0a] = "Coherent Read Discard",
616 [0x0b] = "Coherent Ready Share Always",
617 [0x0c] = "Coherent Upgrade",
618 [0x0d] = "Coherent Writeback",
621 [0x10] = "Coherent Copyback",
622 [0x11] = "Coherent Copyback Invalidate",
623 [0x12] = "Coherent Invalidate",
624 [0x13] = "Coherent Write Invalidate",
625 [0x14] = "Coherent Completion Sync",
639 static char *core[8] = {
640 "Invalid/OK", "Invalid/Data",
641 "Shared/OK", "Shared/Data",
642 "Modified/OK", "Modified/Data",
643 "Exclusive/OK", "Exclusive/Data"
646 static char *causes[32] = {
647 "None", "GC_WR_ERR", "GC_RD_ERR", "COH_WR_ERR",
648 "COH_RD_ERR", "MMIO_WR_ERR", "MMIO_RD_ERR", "0x07",
649 "0x08", "0x09", "0x0a", "0x0b",
650 "0x0c", "0x0d", "0x0e", "0x0f",
651 "0x10", "0x11", "0x12", "0x13",
652 "0x14", "0x15", "0x16", "INTVN_WR_ERR",
653 "INTVN_RD_ERR", "0x19", "0x1a", "0x1b",
654 "0x1c", "0x1d", "0x1e", "0x1f"
657 int malta_be_handler(struct pt_regs *regs, int is_fixup)
659 /* This duplicates the handling in do_be which seems wrong */
660 int retval = is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL;
662 if (mips_cm_present()) {
663 unsigned long cm_error = read_gcr_error_cause();
664 unsigned long cm_addr = read_gcr_error_addr();
665 unsigned long cm_other = read_gcr_error_mult();
666 unsigned long cause, ocause;
669 cause = cm_error & CM_GCR_ERROR_CAUSE_ERRTYPE_MSK;
671 cause >>= CM_GCR_ERROR_CAUSE_ERRTYPE_SHF;
673 unsigned long cca_bits = (cm_error >> 15) & 7;
674 unsigned long tr_bits = (cm_error >> 12) & 7;
675 unsigned long cmd_bits = (cm_error >> 7) & 0x1f;
676 unsigned long stag_bits = (cm_error >> 3) & 15;
677 unsigned long sport_bits = (cm_error >> 0) & 7;
679 snprintf(buf, sizeof(buf),
680 "CCA=%lu TR=%s MCmd=%s STag=%lu "
682 cca_bits, tr[tr_bits], mcmd[cmd_bits],
683 stag_bits, sport_bits);
685 /* glob state & sresp together */
686 unsigned long c3_bits = (cm_error >> 18) & 7;
687 unsigned long c2_bits = (cm_error >> 15) & 7;
688 unsigned long c1_bits = (cm_error >> 12) & 7;
689 unsigned long c0_bits = (cm_error >> 9) & 7;
690 unsigned long sc_bit = (cm_error >> 8) & 1;
691 unsigned long cmd_bits = (cm_error >> 3) & 0x1f;
692 unsigned long sport_bits = (cm_error >> 0) & 7;
693 snprintf(buf, sizeof(buf),
694 "C3=%s C2=%s C1=%s C0=%s SC=%s "
695 "MCmd=%s SPort=%lu\n",
696 core[c3_bits], core[c2_bits],
697 core[c1_bits], core[c0_bits],
698 sc_bit ? "True" : "False",
699 mcmd[cmd_bits], sport_bits);
702 ocause = (cm_other & CM_GCR_ERROR_MULT_ERR2ND_MSK) >>
703 CM_GCR_ERROR_MULT_ERR2ND_SHF;
705 pr_err("CM_ERROR=%08lx %s <%s>\n", cm_error,
707 pr_err("CM_ADDR =%08lx\n", cm_addr);
708 pr_err("CM_OTHER=%08lx %s\n", cm_other, causes[ocause]);
710 /* reprime cause register */
711 write_gcr_error_cause(0);
718 void gic_enable_interrupt(int irq_vec)
720 GIC_SET_INTR_MASK(irq_vec);
723 void gic_disable_interrupt(int irq_vec)
725 GIC_CLR_INTR_MASK(irq_vec);
728 void gic_irq_ack(struct irq_data *d)
730 int irq = (d->irq - gic_irq_base);
732 GIC_CLR_INTR_MASK(irq);
734 if (gic_irq_flags[irq] & GIC_TRIG_EDGE)
735 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), irq);
738 void gic_finish_irq(struct irq_data *d)
740 /* Enable interrupts. */
741 GIC_SET_INTR_MASK(d->irq - gic_irq_base);
744 void __init gic_platform_init(int irqs, struct irq_chip *irq_controller)
748 for (i = gic_irq_base; i < (gic_irq_base + irqs); i++)
749 irq_set_chip(i, irq_controller);