Skip to content

Commit 46a828e

Browse files
jimmyzhekartben
authored andcommitted
drivers: interrupt_controller: intc_clic: add CLIC parameters
Add support for CLIC hardware parameters based on the hardware implementation. 1. CLIC_PARAMETER_INTCTLBITS Specifies the number of modifiable bit in interrupt control register. 2. CLIC_PARAMETER_MNLBITS Specifies the number of bits are assigned to interrupt level in the interrupt control bits. Signed-off-by: Jimmy Zheng <[email protected]>
1 parent ed97af9 commit 46a828e

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

drivers/interrupt_controller/Kconfig.clic

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@ config CLIC_SMCLICCONFIG_EXT
4343
Enables the SMCLICCONFIG extension, allowing configuration of CLIC
4444
parameters such as the number of interrupt level bits.
4545

46+
config CLIC_PARAMETER_INTCTLBITS
47+
int "The number of modifiable bits in the clicintctl registers"
48+
range 0 8
49+
default 8
50+
help
51+
This option specifies the number of modifiable bits in the clicintctl
52+
registers.
53+
54+
config CLIC_PARAMETER_MNLBITS
55+
int "The number of bits in CLICINTCTLBITS to encode the interrupt level"
56+
range 0 CLIC_PARAMETER_INTCTLBITS
57+
default 0
58+
help
59+
This option specifies the number of bits in CLICINTCTLBITS assigned to
60+
encode the interrupt level at machine mode.
61+
4662
config LEGACY_CLIC
4763
bool "Use the legacy clic specification"
4864
depends on RISCV_HAS_CLIC

drivers/interrupt_controller/intc_clic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ static int clic_init(const struct device *dev)
245245

246246
#define CLIC_INTC_DATA_INIT(n) \
247247
static struct clic_data clic_data_##n = { \
248-
.nlbits = 0, \
249-
.intctlbits = 8, \
248+
.nlbits = CONFIG_CLIC_PARAMETER_MNLBITS, \
249+
.intctlbits = CONFIG_CLIC_PARAMETER_INTCTLBITS, \
250250
};
251251
#define CLIC_INTC_CONFIG_INIT(n) \
252252
const static struct clic_config clic_config_##n = { \

0 commit comments

Comments
 (0)