12#include "hw/top/dt/dt_uart.h"
48 [kDtUartRegBlockCore] = 0x40000000,
63 [kDtUartPeriphIoRx] = {
68 .outsel_or_dt_pad = 0,
71 [kDtUartPeriphIoTx] = {
75 .periph_input_or_direct_pad = 0,
84 [kDtUartRegBlockCore] = 0x40010000,
99 [kDtUartPeriphIoRx] = {
104 .outsel_or_dt_pad = 0,
107 [kDtUartPeriphIoTx] = {
111 .periph_input_or_direct_pad = 0,
120 [kDtUartRegBlockCore] = 0x40020000,
135 [kDtUartPeriphIoRx] = {
140 .outsel_or_dt_pad = 0,
143 [kDtUartPeriphIoTx] = {
147 .periph_input_or_direct_pad = 0,
156 [kDtUartRegBlockCore] = 0x40030000,
171 [kDtUartPeriphIoRx] = {
176 .outsel_or_dt_pad = 0,
179 [kDtUartPeriphIoTx] = {
183 .periph_input_or_direct_pad = 0,
196#define TRY_GET_DT(dt, default) ({ if ((dt) < (dt_uart_t)0 || (dt) >= kDtUartCount) return (default); &uart_desc[dt]; })
214 return TRY_GET_DT(dt, 0xdeadbeef)->reg_addr[reg_block];
221 return TRY_GET_DT(dt, 0xdeadbeef)->mem_addr[mem];
235 if (first_irq == kDtPlicIrqIdNone) {
236 return kDtPlicIrqIdNone;
246 if (first_irq == kDtPlicIrqIdNone) {
259 return (
dt_alert_id_t)((uint32_t)uart_desc[dt].first_alert + (uint32_t)alert);
266 if (alert < uart_desc[dt].first_alert || alert >= uart_desc[dt].first_alert + (
dt_alert_id_t)count) {
277 return TRY_GET_DT(dt, kDtPeriphIoConstantHighZ)->periph_io[sig];