1# Multilevel interrupt configuration
2
3# Copyright (c) 2017 Intel Corporation
4# Copyright (c) 2018 Foundries.io
5# SPDX-License-Identifier: Apache-2.0
6
7config MULTI_LEVEL_INTERRUPTS
8	bool "Multi-level interrupt support"
9	depends on GEN_SW_ISR_TABLE
10	help
11	  Multiple levels of interrupts are normally used to increase the
12	  number of addressable interrupts in a system. For example, if two
13	  levels are used, a second level interrupt aggregator would combine
14	  all interrupts routed to it into one IRQ line in the first level
15	  interrupt controller. If three levels are used, a third level
16	  aggregator combines its input interrupts into one IRQ line at the
17	  second level. The number of interrupt levels is usually determined
18	  by the hardware. (The term "aggregator" here means "interrupt
19	  controller".)
20
21if MULTI_LEVEL_INTERRUPTS
22config 1ST_LEVEL_INTERRUPT_BITS
23	int "Total number of first level interrupt bits"
24	range 1 32
25	default 8
26	help
27	  The number of bits to use of the 32 bit interrupt mask for first
28	  tier interrupts.
29
30config MAX_IRQ_PER_AGGREGATOR
31	int "Max IRQs per interrupt aggregator"
32	default 0
33
34	help
35	  The maximum number of interrupt inputs to any aggregator in the
36	  system.
37
38config 2ND_LEVEL_INTERRUPTS
39	bool "Second-level interrupt support"
40	help
41	  Second level interrupts are used to increase the number of
42	  addressable interrupts in a system.
43
44config 2ND_LVL_ISR_TBL_OFFSET
45	int "Offset in _sw_isr_table for level 2 interrupts"
46	default 0
47	depends on 2ND_LEVEL_INTERRUPTS
48	help
49	  This is the offset in _sw_isr_table, the generated ISR handler table,
50	  where storage for 2nd level interrupt ISRs begins. This is
51	  typically allocated after ISRs for level 1 interrupts.
52
53config NUM_2ND_LEVEL_AGGREGATORS
54	int "Total number of second level interrupt aggregators"
55	range 1 8
56	default 1
57	depends on 2ND_LEVEL_INTERRUPTS
58	help
59	  The number of level 2 interrupt aggregators to support. Each
60	  aggregator can manage at most MAX_IRQ_PER_AGGREGATOR level 2
61	  interrupts.
62
63config 2ND_LEVEL_INTERRUPT_BITS
64	int "Total number of second level interrupt bits"
65	range 0 31
66	default 8
67	help
68	  The number of bits to use of the 32 bit interrupt mask for second
69	  tier interrupts.
70
71prev-level-num = 1
72cur-level-num = 2
73cur-level = 2ND
74aggregator = 0
75rsource "Kconfig.multilevel.aggregator_template"
76aggregator = 1
77rsource "Kconfig.multilevel.aggregator_template"
78aggregator = 2
79rsource "Kconfig.multilevel.aggregator_template"
80aggregator = 3
81rsource "Kconfig.multilevel.aggregator_template"
82aggregator = 4
83rsource "Kconfig.multilevel.aggregator_template"
84aggregator = 5
85rsource "Kconfig.multilevel.aggregator_template"
86aggregator = 6
87rsource "Kconfig.multilevel.aggregator_template"
88aggregator = 7
89rsource "Kconfig.multilevel.aggregator_template"
90
91config 3RD_LEVEL_INTERRUPTS
92	bool "Third-level interrupt support"
93	depends on 2ND_LEVEL_INTERRUPTS
94	help
95	  Third level interrupts are used to increase the number of
96	  addressable interrupts in a system.
97
98config NUM_3RD_LEVEL_AGGREGATORS
99	int "Total number of third level interrupt aggregators"
100	range 1 8
101	default 1
102	depends on 3RD_LEVEL_INTERRUPTS
103	help
104	  The number of level 3 interrupt aggregators to support. Each
105	  aggregator can manage at most MAX_IRQ_PER_AGGREGATOR level 3
106	  interrupts.
107
108config 3RD_LVL_ISR_TBL_OFFSET
109	int "Offset in _sw_isr_table for level 3 interrupts"
110	default 0
111	depends on 3RD_LEVEL_INTERRUPTS
112	help
113	  This is the offset in _sw_isr_table, the generated ISR handler table,
114	  where storage for 3rd level interrupt ISRs begins. This is
115	  typically allocated after ISRs for level 2 interrupts.
116
117config 3RD_LEVEL_INTERRUPT_BITS
118	int "Total number of third level interrupt bits"
119	range 0 30
120	default 8
121	help
122	  The number of bits to use of the 32 bit interrupt mask for third
123	  tier interrupts.
124
125prev-level-num = 2
126cur-level-num = 3
127cur-level = 3RD
128aggregator = 0
129rsource "Kconfig.multilevel.aggregator_template"
130aggregator = 1
131rsource "Kconfig.multilevel.aggregator_template"
132aggregator = 2
133rsource "Kconfig.multilevel.aggregator_template"
134aggregator = 3
135rsource "Kconfig.multilevel.aggregator_template"
136aggregator = 4
137rsource "Kconfig.multilevel.aggregator_template"
138aggregator = 5
139rsource "Kconfig.multilevel.aggregator_template"
140aggregator = 6
141rsource "Kconfig.multilevel.aggregator_template"
142aggregator = 7
143rsource "Kconfig.multilevel.aggregator_template"
144
145endif
146