Skip to content

Commit bd0efcc

Browse files
singular0770kartben
authored andcommitted
drivers: serial: uart_xlnx_uartlite: set irq flags per device tree
PG142 from AMD specifically says the uartlite IP generates a "rising-edge sensitive interrupt" when interrupts are enabled. When using this IP on a ZynqMP platform with CONFIG_UART_INTERRUPT_DRIVEN enabled, the GIC does not get configured correctly to detect these interrupts. Update driver to heed the flags set by the interrupts property in the device tree. Signed-off-by: Michael Estes <michael.estes@byteserv.io>
1 parent 25dc5fe commit bd0efcc

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

drivers/serial/uart_xlnx_uartlite.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,16 @@ static DEVICE_API(uart, xlnx_uartlite_driver_api) = {
375375
};
376376

377377
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
378-
#define XLNX_UARTLITE_IRQ_INIT(n, i) \
379-
do { \
380-
IRQ_CONNECT(DT_INST_IRQN_BY_IDX(n, i), \
381-
DT_INST_IRQ_BY_IDX(n, i, priority), \
382-
xlnx_uartlite_isr, \
383-
DEVICE_DT_INST_GET(n), 0); \
384-
\
385-
irq_enable(DT_INST_IRQN_BY_IDX(n, i)); \
378+
#define XLNX_UARTLITE_IRQ_INIT(n, i) \
379+
do { \
380+
IRQ_CONNECT(DT_INST_IRQN_BY_IDX(n, i), \
381+
DT_INST_IRQ_BY_IDX(n, i, priority), \
382+
xlnx_uartlite_isr, DEVICE_DT_INST_GET(n), \
383+
COND_CODE_1(DT_INST_IRQ_HAS_CELL_AT_IDX(n, i, flags), \
384+
(DT_INST_IRQ_BY_IDX(n, i, flags)), \
385+
(0))); \
386+
\
387+
irq_enable(DT_INST_IRQN_BY_IDX(n, i)); \
386388
} while (false)
387389
#define XLNX_UARTLITE_CONFIG_FUNC(n) \
388390
static void xlnx_uartlite_config_func_##n(const struct device *dev) \

0 commit comments

Comments
 (0)