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
21config 1ST_LEVEL_INTERRUPT_BITS
22	int "Total number of first level interrupt bits"
23	range 1 32
24	default 8
25	help
26	  The number of bits to use of the 32 bit interrupt mask for first
27	  tier interrupts.
28
29config MAX_IRQ_PER_AGGREGATOR
30	int "Max IRQs per interrupt aggregator"
31	default 0
32	depends on MULTI_LEVEL_INTERRUPTS
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	depends on MULTI_LEVEL_INTERRUPTS
41	help
42	  Second level interrupts are used to increase the number of
43	  addressable interrupts in a system.
44
45config 2ND_LVL_ISR_TBL_OFFSET
46	int "Offset in _sw_isr_table for level 2 interrupts"
47	default 0
48	depends on 2ND_LEVEL_INTERRUPTS
49	help
50	  This is the offset in _sw_isr_table, the generated ISR handler table,
51	  where storage for 2nd level interrupt ISRs begins. This is
52	  typically allocated after ISRs for level 1 interrupts.
53
54config NUM_2ND_LEVEL_AGGREGATORS
55	int "Total number of second level interrupt aggregators"
56	range 1 8
57	default 1
58	depends on 2ND_LEVEL_INTERRUPTS
59	help
60	  The number of level 2 interrupt aggregators to support. Each
61	  aggregator can manage at most MAX_IRQ_PER_AGGREGATOR level 2
62	  interrupts.
63
64config 2ND_LEVEL_INTERRUPT_BITS
65	int "Total number of second level interrupt bits"
66	range 0 31
67	default 8
68	help
69	  The number of bits to use of the 32 bit interrupt mask for second
70	  tier interrupts.
71
72prev-level-num = 1
73cur-level-num = 2
74cur-level = 2ND
75aggregator = 0
76rsource "Kconfig.multilevel.aggregator_template"
77aggregator = 1
78rsource "Kconfig.multilevel.aggregator_template"
79aggregator = 2
80rsource "Kconfig.multilevel.aggregator_template"
81aggregator = 3
82rsource "Kconfig.multilevel.aggregator_template"
83aggregator = 4
84rsource "Kconfig.multilevel.aggregator_template"
85aggregator = 5
86rsource "Kconfig.multilevel.aggregator_template"
87aggregator = 6
88rsource "Kconfig.multilevel.aggregator_template"
89aggregator = 7
90rsource "Kconfig.multilevel.aggregator_template"
91
92config 3RD_LEVEL_INTERRUPTS
93	bool "Third-level interrupt support"
94	depends on 2ND_LEVEL_INTERRUPTS
95	help
96	  Third level interrupts are used to increase the number of
97	  addressable interrupts in a system.
98
99config NUM_3RD_LEVEL_AGGREGATORS
100	int "Total number of third level interrupt aggregators"
101	range 1 8
102	default 1
103	depends on 3RD_LEVEL_INTERRUPTS
104	help
105	  The number of level 3 interrupt aggregators to support. Each
106	  aggregator can manage at most MAX_IRQ_PER_AGGREGATOR level 3
107	  interrupts.
108
109config 3RD_LVL_ISR_TBL_OFFSET
110	int "Offset in _sw_isr_table for level 3 interrupts"
111	default 0
112	depends on 3RD_LEVEL_INTERRUPTS
113	help
114	  This is the offset in _sw_isr_table, the generated ISR handler table,
115	  where storage for 3rd level interrupt ISRs begins. This is
116	  typically allocated after ISRs for level 2 interrupts.
117
118config 3RD_LEVEL_INTERRUPT_BITS
119	int "Total number of third level interrupt bits"
120	range 0 30
121	default 8
122	help
123	  The number of bits to use of the 32 bit interrupt mask for third
124	  tier interrupts.
125
126prev-level-num = 2
127cur-level-num = 3
128cur-level = 3RD
129aggregator = 0
130rsource "Kconfig.multilevel.aggregator_template"
131aggregator = 1
132rsource "Kconfig.multilevel.aggregator_template"
133aggregator = 2
134rsource "Kconfig.multilevel.aggregator_template"
135aggregator = 3
136rsource "Kconfig.multilevel.aggregator_template"
137aggregator = 4
138rsource "Kconfig.multilevel.aggregator_template"
139aggregator = 5
140rsource "Kconfig.multilevel.aggregator_template"
141aggregator = 6
142rsource "Kconfig.multilevel.aggregator_template"
143aggregator = 7
144rsource "Kconfig.multilevel.aggregator_template"
145