xref: /OK3568_Linux_fs/kernel/arch/c6x/include/asm/irq.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  *  Port on Texas Instruments TMS320C6x architecture
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  *  Copyright (C) 2004, 2006, 2009, 2010, 2011 Texas Instruments Incorporated
6*4882a593Smuzhiyun  *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  *  Large parts taken directly from powerpc.
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun #ifndef _ASM_C6X_IRQ_H
11*4882a593Smuzhiyun #define _ASM_C6X_IRQ_H
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #include <linux/irqdomain.h>
14*4882a593Smuzhiyun #include <linux/threads.h>
15*4882a593Smuzhiyun #include <linux/list.h>
16*4882a593Smuzhiyun #include <linux/radix-tree.h>
17*4882a593Smuzhiyun #include <asm/percpu.h>
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun #define irq_canonicalize(irq)  (irq)
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun /*
22*4882a593Smuzhiyun  * The C64X+ core has 16 IRQ vectors. One each is used by Reset and NMI. Two
23*4882a593Smuzhiyun  * are reserved. The remaining 12 vectors are used to route SoC interrupts.
24*4882a593Smuzhiyun  * These interrupt vectors are prioritized with IRQ 4 having the highest
25*4882a593Smuzhiyun  * priority and IRQ 15 having the lowest.
26*4882a593Smuzhiyun  *
27*4882a593Smuzhiyun  * The C64x+ megamodule provides a PIC which combines SoC IRQ sources into a
28*4882a593Smuzhiyun  * single core IRQ vector. There are four combined sources, each of which
29*4882a593Smuzhiyun  * feed into one of the 12 general interrupt vectors. The remaining 8 vectors
30*4882a593Smuzhiyun  * can each route a single SoC interrupt directly.
31*4882a593Smuzhiyun  */
32*4882a593Smuzhiyun #define NR_PRIORITY_IRQS 16
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun /* Total number of virq in the platform */
35*4882a593Smuzhiyun #define NR_IRQS		256
36*4882a593Smuzhiyun 
37*4882a593Smuzhiyun /* This number is used when no interrupt has been assigned */
38*4882a593Smuzhiyun #define NO_IRQ		0
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun extern void __init init_pic_c64xplus(void);
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun extern void init_IRQ(void);
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun struct pt_regs;
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun extern asmlinkage void c6x_do_IRQ(unsigned int prio, struct pt_regs *regs);
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun extern unsigned long irq_err_count;
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun #endif /* _ASM_C6X_IRQ_H */
51