20 if (config.imbx_base_addr > config.imbx_limit_addr) {
23 if (config.ombx_base_addr > config.ombx_limit_addr) {
28 if ((config.imbx_base_addr <= config.ombx_limit_addr) &&
29 (config.ombx_base_addr <= config.imbx_limit_addr)) {
33 mmio_region_write32(mbx->
base_addr, MBX_INBOUND_BASE_ADDRESS_REG_OFFSET,
34 config.imbx_base_addr);
35 mmio_region_write32(mbx->
base_addr, MBX_INBOUND_LIMIT_ADDRESS_REG_OFFSET,
36 config.imbx_limit_addr);
37 mmio_region_write32(mbx->
base_addr, MBX_OUTBOUND_BASE_ADDRESS_REG_OFFSET,
38 config.ombx_base_addr);
39 mmio_region_write32(mbx->
base_addr, MBX_OUTBOUND_LIMIT_ADDRESS_REG_OFFSET,
40 config.ombx_limit_addr);
42 mmio_region_write32(mbx->
base_addr, MBX_ADDRESS_RANGE_VALID_REG_OFFSET, 1);
49 if (mbx == NULL || config == NULL) {
53 config->imbx_base_addr =
54 mmio_region_read32(mbx->
base_addr, MBX_INBOUND_BASE_ADDRESS_REG_OFFSET);
55 config->imbx_limit_addr =
56 mmio_region_read32(mbx->
base_addr, MBX_INBOUND_LIMIT_ADDRESS_REG_OFFSET);
57 config->ombx_base_addr =
58 mmio_region_read32(mbx->
base_addr, MBX_OUTBOUND_BASE_ADDRESS_REG_OFFSET);
59 config->ombx_limit_addr =
60 mmio_region_read32(mbx->
base_addr, MBX_OUTBOUND_LIMIT_ADDRESS_REG_OFFSET);
65 if (mbx == NULL || is_busy == NULL) {
70 mmio_region_read32(mbx->
base_addr, MBX_STATUS_REG_OFFSET),
71 MBX_STATUS_BUSY_BIT) == 1);
76 uint32_t *doe_intr_addr,
77 uint32_t *doe_intr_data) {
78 if (mbx == NULL || doe_intr_addr == NULL || doe_intr_data == NULL) {
83 mmio_region_read32(mbx->
base_addr, MBX_DOE_INTR_MSG_ADDR_REG_OFFSET);
85 mmio_region_read32(mbx->
base_addr, MBX_DOE_INTR_MSG_DATA_REG_OFFSET);
92 if (mbx == NULL || request == NULL || request->data_dwords == NULL) {
97 mmio_region_read32(mbx->
base_addr, MBX_INBOUND_BASE_ADDRESS_REG_OFFSET);
98 uint32_t imbx_wr_ptr =
99 mmio_region_read32(mbx->
base_addr, MBX_INBOUND_WRITE_PTR_REG_OFFSET);
103 uint32_t read_dwords = 0;
104 while (curr_ptr < imbx_wr_ptr && read_dwords < request->nr_dwords) {
105 request->data_dwords[read_dwords++] = abs_mmio_read32(curr_ptr);
106 curr_ptr +=
sizeof(uint32_t);
110 request->nr_dwords = read_dwords;
114 if (curr_ptr < imbx_wr_ptr) {
125 if (mbx == NULL || response.data_dwords == NULL ||
131 mmio_region_read32(mbx->
base_addr, MBX_OUTBOUND_READ_PTR_REG_OFFSET);
132 for (uint32_t i = 0; i < response.nr_dwords; ++i) {
133 abs_mmio_write32(curr_ptr, response.data_dwords[i]);
134 curr_ptr +=
sizeof(uint32_t);
137 mmio_region_write32(mbx->
base_addr, MBX_OUTBOUND_OBJECT_SIZE_REG_OFFSET,