Skip to content

Commit 649a6e9

Browse files
committed
soc: arm: cypress: Fix psoc6 irq priority
PSoC-6 have different priority bit masks for cortex-m0+ and cortex-m4. M0: 0-3 (2 bits of NVIC prio, no prio reserved by the kernel) M4: 0-6 (3 bits of NVIC prio, one level reserved by the kernel) The current macro that gets priority level value from devicetree apply same value from cortex-m4 on cortex-m0+. This add missing indirection to get from intmux node the correct cortex-m0+ priority level value. Signed-off-by: Gerson Fernando Budke <[email protected]>
1 parent a56c425 commit 649a6e9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

soc/arm/cypress/common/cypress_psoc6_dt.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@
6565
IF_ENABLED(DT_INST_NODE_HAS_PROP(n, interrupt_parent),\
6666
(CY_PSOC6_IRQ_CONFIG(n, isr)))
6767
#define CY_PSOC6_NVIC_MUX_IRQN(n) DT_IRQN(DT_INST_PHANDLE_BY_IDX(n,\
68-
interrupt_parent, 0))
68+
interrupt_parent, 0))
69+
70+
#define CY_PSOC6_NVIC_MUX_IRQ_PRIO(n) DT_IRQ(DT_INST_PHANDLE_BY_IDX(n,\
71+
interrupt_parent, 0), priority)
6972
/*
7073
* DT_INST_PROP_BY_IDX should be used get interrupt and configure, instead
7174
* DT_INST_IRQN. The DT_INST_IRQN return IRQ number with level translation,
@@ -86,13 +89,14 @@
8689
*/
8790
#define CY_PSOC6_DT_INST_NVIC_INSTALL(n, isr) CY_PSOC6_IRQ_CONFIG(n, isr)
8891
#define CY_PSOC6_NVIC_MUX_IRQN(n) DT_INST_IRQN(n)
92+
#define CY_PSOC6_NVIC_MUX_IRQ_PRIO(n) DT_INST_IRQ(n, priority)
8993
#define CY_PSOC6_NVIC_MUX_MAP(n)
9094
#endif
9195

9296
#define CY_PSOC6_IRQ_CONFIG(n, isr) \
9397
do { \
9498
IRQ_CONNECT(CY_PSOC6_NVIC_MUX_IRQN(n), \
95-
DT_INST_IRQ(n, priority), \
99+
CY_PSOC6_NVIC_MUX_IRQ_PRIO(n),\
96100
isr, DEVICE_DT_INST_GET(n), 0);\
97101
CY_PSOC6_NVIC_MUX_MAP(n); \
98102
irq_enable(CY_PSOC6_NVIC_MUX_IRQN(n)); \

0 commit comments

Comments
 (0)