Skip to content

Commit

Permalink
[ot] hw/opentitan: update UART interrupts
Browse files Browse the repository at this point in the history
`TX_EMPTY` has changed to `TX_DONE` which indicates the buffer is empty
and there's no ongoing transmission. Added the interrupt to the module
but not integrated it yet.
  • Loading branch information
jwnrt committed Dec 9, 2024
1 parent 797fc90 commit de9f090
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hw/opentitan/ot_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@
REG32(INTR_STATE, 0x00u)
SHARED_FIELD(INTR_TX_WATERMARK, 0u, 1u)
SHARED_FIELD(INTR_RX_WATERMARK, 1u, 1u)
SHARED_FIELD(INTR_TX_EMPTY, 2u, 1u)
SHARED_FIELD(INTR_TX_DONE, 2u, 1u)
SHARED_FIELD(INTR_RX_OVERFLOW, 3u, 1u)
SHARED_FIELD(INTR_RX_FRAME_ERR, 4u, 1u)
SHARED_FIELD(INTR_RX_BREAK_ERR, 5u, 1u)
SHARED_FIELD(INTR_RX_TIMEOUT, 6u, 1u)
SHARED_FIELD(INTR_RX_PARITY_ERR, 7u, 1u)
SHARED_FIELD(INTR_TX_EMPTY, 8u, 1u)
REG32(INTR_ENABLE, 0x04u)
REG32(INTR_TEST, 0x08u)
REG32(ALERT_TEST, 0x0cu)
Expand Down Expand Up @@ -97,9 +98,9 @@ REG32(TIMEOUT_CTRL, 0x30u)
/* clang-format on */

#define INTR_MASK \
(INTR_TX_WATERMARK_MASK | INTR_RX_WATERMARK_MASK | INTR_TX_EMPTY_MASK | \
(INTR_TX_WATERMARK_MASK | INTR_RX_WATERMARK_MASK | INTR_TX_DONE_MASK | \
INTR_RX_OVERFLOW_MASK | INTR_RX_FRAME_ERR_MASK | INTR_RX_BREAK_ERR_MASK | \
INTR_RX_TIMEOUT_MASK | INTR_RX_PARITY_ERR_MASK)
INTR_RX_TIMEOUT_MASK | INTR_RX_PARITY_ERR_MASK | INTR_TX_EMPTY_MASK)

#define CTRL_MASK \
(R_CTRL_TX_MASK | R_CTRL_RX_MASK | R_CTRL_NF_MASK | R_CTRL_SLPBK_MASK | \
Expand All @@ -112,7 +113,7 @@ REG32(TIMEOUT_CTRL, 0x30u)
#define OT_UART_NCO_BITS 16u
#define OT_UART_TX_FIFO_SIZE 128u
#define OT_UART_RX_FIFO_SIZE 128u
#define OT_UART_IRQ_NUM 8u
#define OT_UART_IRQ_NUM 9u

#define R32_OFF(_r_) ((_r_) / sizeof(uint32_t))

Expand Down

0 comments on commit de9f090

Please sign in to comment.