Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2)  * IRQ vector handles
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * License.  See the file "COPYING" in the main directory of this archive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  * for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  * Copyright (C) 1995, 1996, 1997, 2003 by Ralf Baechle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/pci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <asm/i8259.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <asm/irq_cpu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <asm/irq_gt641xx.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <asm/gt64120.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) asmlinkage void plat_irq_dispatch(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 	unsigned pending = read_c0_status() & read_c0_cause() & ST0_IM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 	int irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	if (pending & CAUSEF_IP2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 		gt641xx_irq_dispatch();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	else if (pending & CAUSEF_IP6) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 		irq = i8259_irq();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 		if (irq < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 			spurious_interrupt();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 		else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 			do_IRQ(irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	} else if (pending & CAUSEF_IP3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 		do_IRQ(MIPS_CPU_IRQ_BASE + 3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	else if (pending & CAUSEF_IP4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 		do_IRQ(MIPS_CPU_IRQ_BASE + 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 	else if (pending & CAUSEF_IP5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 		do_IRQ(MIPS_CPU_IRQ_BASE + 5);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 	else if (pending & CAUSEF_IP7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 		do_IRQ(MIPS_CPU_IRQ_BASE + 7);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 		spurious_interrupt();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) void __init arch_init_irq(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 	mips_cpu_irq_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 	gt641xx_irq_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	init_i8259_irqs();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 	if (request_irq(GT641XX_CASCADE_IRQ, no_action, IRQF_NO_THREAD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 			"cascade", NULL)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 		pr_err("Failed to request irq %d (cascade)\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 		       GT641XX_CASCADE_IRQ);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 	if (request_irq(I8259_CASCADE_IRQ, no_action, IRQF_NO_THREAD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 			"cascade", NULL)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 		pr_err("Failed to request irq %d (cascade)\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 		       I8259_CASCADE_IRQ);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) }