12#include "dt/dt_uart.h"
46 [kDtUartRegBlockCore] = 0x40000000,
57 [kDtUartPeriphIoRx] = {
62 .outsel_or_dt_pad = 0,
65 [kDtUartPeriphIoTx] = {
69 .periph_input_or_direct_pad = 0,
78 [kDtUartRegBlockCore] = 0x40010000,
89 [kDtUartPeriphIoRx] = {
94 .outsel_or_dt_pad = 0,
97 [kDtUartPeriphIoTx] = {
101 .periph_input_or_direct_pad = 0,
110 [kDtUartRegBlockCore] = 0x40020000,
121 [kDtUartPeriphIoRx] = {
126 .outsel_or_dt_pad = 0,
129 [kDtUartPeriphIoTx] = {
133 .periph_input_or_direct_pad = 0,
142 [kDtUartRegBlockCore] = 0x40030000,
153 [kDtUartPeriphIoRx] = {
158 .outsel_or_dt_pad = 0,
161 [kDtUartPeriphIoTx] = {
165 .periph_input_or_direct_pad = 0,
178#define TRY_GET_DT(dt, default) ({ if ((dt) < (dt_uart_t)0 || (dt) >= kDtUartCount) return (default); &uart_desc[dt]; })
196 return TRY_GET_DT(dt, 0xdeadbeef)->base_addr[reg_block];
203 if (first_irq == kDtPlicIrqIdNone) {
204 return kDtPlicIrqIdNone;
214 if (first_irq == kDtPlicIrqIdNone) {
227 return (
dt_alert_id_t)((uint32_t)uart_desc[dt].first_alert + (uint32_t)alert);
234 if (alert < uart_desc[dt].first_alert || alert >= uart_desc[dt].first_alert + (
dt_alert_id_t)count) {
245 return TRY_GET_DT(dt, kDtPeriphIoConstantHighZ)->periph_io[sig];