xref: /openbmc/linux/arch/powerpc/include/asm/ipic.h (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
12874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2b8b572e1SStephen Rothwell /*
3b8b572e1SStephen Rothwell  * IPIC external definitions and structure.
4b8b572e1SStephen Rothwell  *
5b8b572e1SStephen Rothwell  * Maintainer: Kumar Gala <galak@kernel.crashing.org>
6b8b572e1SStephen Rothwell  *
7b8b572e1SStephen Rothwell  * Copyright 2005 Freescale Semiconductor, Inc
8b8b572e1SStephen Rothwell  */
9b8b572e1SStephen Rothwell #ifdef __KERNEL__
10b8b572e1SStephen Rothwell #ifndef __ASM_IPIC_H__
11b8b572e1SStephen Rothwell #define __ASM_IPIC_H__
12b8b572e1SStephen Rothwell 
13b8b572e1SStephen Rothwell #include <linux/irq.h>
14b8b572e1SStephen Rothwell 
15b8b572e1SStephen Rothwell /* Flags when we init the IPIC */
16b8b572e1SStephen Rothwell #define IPIC_SPREADMODE_GRP_A	0x00000001
17b8b572e1SStephen Rothwell #define IPIC_SPREADMODE_GRP_B	0x00000002
18b8b572e1SStephen Rothwell #define IPIC_SPREADMODE_GRP_C	0x00000004
19b8b572e1SStephen Rothwell #define IPIC_SPREADMODE_GRP_D	0x00000008
20b8b572e1SStephen Rothwell #define IPIC_SPREADMODE_MIX_A	0x00000010
21b8b572e1SStephen Rothwell #define IPIC_SPREADMODE_MIX_B	0x00000020
22b8b572e1SStephen Rothwell #define IPIC_DISABLE_MCP_OUT	0x00000040
23b8b572e1SStephen Rothwell #define IPIC_IRQ0_MCP		0x00000080
24b8b572e1SStephen Rothwell 
25b8b572e1SStephen Rothwell /* IPIC registers offsets */
26b8b572e1SStephen Rothwell #define IPIC_SICFR	0x00	/* System Global Interrupt Configuration Register */
27b8b572e1SStephen Rothwell #define IPIC_SIVCR	0x04	/* System Global Interrupt Vector Register */
28b8b572e1SStephen Rothwell #define IPIC_SIPNR_H	0x08	/* System Internal Interrupt Pending Register (HIGH) */
29b8b572e1SStephen Rothwell #define IPIC_SIPNR_L	0x0C	/* System Internal Interrupt Pending Register (LOW) */
30b8b572e1SStephen Rothwell #define IPIC_SIPRR_A	0x10	/* System Internal Interrupt group A Priority Register */
31b8b572e1SStephen Rothwell #define IPIC_SIPRR_B	0x14	/* System Internal Interrupt group B Priority Register */
32b8b572e1SStephen Rothwell #define IPIC_SIPRR_C	0x18	/* System Internal Interrupt group C Priority Register */
33b8b572e1SStephen Rothwell #define IPIC_SIPRR_D	0x1C	/* System Internal Interrupt group D Priority Register */
34b8b572e1SStephen Rothwell #define IPIC_SIMSR_H	0x20	/* System Internal Interrupt Mask Register (HIGH) */
35b8b572e1SStephen Rothwell #define IPIC_SIMSR_L	0x24	/* System Internal Interrupt Mask Register (LOW) */
36b8b572e1SStephen Rothwell #define IPIC_SICNR	0x28	/* System Internal Interrupt Control Register */
37b8b572e1SStephen Rothwell #define IPIC_SEPNR	0x2C	/* System External Interrupt Pending Register */
38b8b572e1SStephen Rothwell #define IPIC_SMPRR_A	0x30	/* System Mixed Interrupt group A Priority Register */
39b8b572e1SStephen Rothwell #define IPIC_SMPRR_B	0x34	/* System Mixed Interrupt group B Priority Register */
40b8b572e1SStephen Rothwell #define IPIC_SEMSR	0x38	/* System External Interrupt Mask Register */
41b8b572e1SStephen Rothwell #define IPIC_SECNR	0x3C	/* System External Interrupt Control Register */
42b8b572e1SStephen Rothwell #define IPIC_SERSR	0x40	/* System Error Status Register */
43b8b572e1SStephen Rothwell #define IPIC_SERMR	0x44	/* System Error Mask Register */
44b8b572e1SStephen Rothwell #define IPIC_SERCR	0x48	/* System Error Control Register */
45b8b572e1SStephen Rothwell #define IPIC_SIFCR_H	0x50	/* System Internal Interrupt Force Register (HIGH) */
46b8b572e1SStephen Rothwell #define IPIC_SIFCR_L	0x54	/* System Internal Interrupt Force Register (LOW) */
47b8b572e1SStephen Rothwell #define IPIC_SEFCR	0x58	/* System External Interrupt Force Register */
48b8b572e1SStephen Rothwell #define IPIC_SERFR	0x5C	/* System Error Force Register */
49b8b572e1SStephen Rothwell #define IPIC_SCVCR	0x60	/* System Critical Interrupt Vector Register */
50b8b572e1SStephen Rothwell #define IPIC_SMVCR	0x64	/* System Management Interrupt Vector Register */
51b8b572e1SStephen Rothwell 
52b8b572e1SStephen Rothwell enum ipic_prio_grp {
53b8b572e1SStephen Rothwell 	IPIC_INT_GRP_A = IPIC_SIPRR_A,
54b8b572e1SStephen Rothwell 	IPIC_INT_GRP_D = IPIC_SIPRR_D,
55b8b572e1SStephen Rothwell 	IPIC_MIX_GRP_A = IPIC_SMPRR_A,
56b8b572e1SStephen Rothwell 	IPIC_MIX_GRP_B = IPIC_SMPRR_B,
57b8b572e1SStephen Rothwell };
58b8b572e1SStephen Rothwell 
59b8b572e1SStephen Rothwell enum ipic_mcp_irq {
60b8b572e1SStephen Rothwell 	IPIC_MCP_IRQ0 = 0,
61b8b572e1SStephen Rothwell 	IPIC_MCP_WDT  = 1,
62b8b572e1SStephen Rothwell 	IPIC_MCP_SBA  = 2,
63b8b572e1SStephen Rothwell 	IPIC_MCP_PCI1 = 5,
64b8b572e1SStephen Rothwell 	IPIC_MCP_PCI2 = 6,
65b8b572e1SStephen Rothwell 	IPIC_MCP_MU   = 7,
66b8b572e1SStephen Rothwell };
67b8b572e1SStephen Rothwell 
68*6c552983SNick Child void __init ipic_set_default_priority(void);
69b8b572e1SStephen Rothwell extern u32 ipic_get_mcp_status(void);
70b8b572e1SStephen Rothwell extern void ipic_clear_mcp_status(u32 mask);
71b8b572e1SStephen Rothwell 
72b8b572e1SStephen Rothwell extern struct ipic * ipic_init(struct device_node *node, unsigned int flags);
73b8b572e1SStephen Rothwell extern unsigned int ipic_get_irq(void);
74b8b572e1SStephen Rothwell 
75b8b572e1SStephen Rothwell #endif /* __ASM_IPIC_H__ */
76b8b572e1SStephen Rothwell #endif /* __KERNEL__ */
77