From 7ffdac000a5944292c0cbc0f4d4c0fc7d5e8aac3 Mon Sep 17 00:00:00 2001 From: Martin Velay Date: Mon, 12 Oct 2026 15:53:25 +0200 Subject: [PATCH] [vendor] Keep unstrobed bytes on mailbox threshold writes Backport pulp-platform/axi@11603194 (in v0.39.10) as a vendor patch. A write to WIRQT or RIRQT with some write strobes low cleared the unstrobed bytes instead of leaving them unchanged, which AXI requires (IHI 0022 H.c A3.4.4). The vendored revision stays at v0.39.9. Signed-off-by: Martin Velay --- ...ep_unstrobed_mailbox_threshold_bytes.patch | 32 +++++++++++++++++++ hw/vendor/pulp_axi/src/axi_lite_mailbox.sv | 4 +-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 hw/vendor/patches/pulp_axi/0008_Keep_unstrobed_mailbox_threshold_bytes.patch diff --git a/hw/vendor/patches/pulp_axi/0008_Keep_unstrobed_mailbox_threshold_bytes.patch b/hw/vendor/patches/pulp_axi/0008_Keep_unstrobed_mailbox_threshold_bytes.patch new file mode 100644 index 000000000..f385f65e0 --- /dev/null +++ b/hw/vendor/patches/pulp_axi/0008_Keep_unstrobed_mailbox_threshold_bytes.patch @@ -0,0 +1,32 @@ +From 1160319407d0d5bdc490b6c3ecc0973055b488cd Mon Sep 17 00:00:00 2001 +From: Adam Taback +Date: Wed, 11 Feb 2026 11:25:56 -0500 +Subject: [PATCH] Fixed axi_lite_mailbox wstrb axi violation + +Backport of pulp-platform/axi@11603194 (pulp-platform/axi#412, in v0.39.10). +--- + src/axi_lite_mailbox.sv | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/axi_lite_mailbox.sv b/src/axi_lite_mailbox.sv +index 73adeca..8c410d8 100644 +--- a/src/axi_lite_mailbox.sv ++++ b/src/axi_lite_mailbox.sv +@@ -443,7 +443,7 @@ module axi_lite_mailbox_slave #( + // ERROR: read only + WIRQT: begin + for (int unsigned i = 0; i < AxiDataWidth/8; i++) begin +- wirqt_d[i*8+:8] = slv_req_i.w.strb[i] ? slv_req_i.w.data[i*8+:8] : 8'b0000_0000; ++ wirqt_d[i*8+:8] = slv_req_i.w.strb[i] ? slv_req_i.w.data[i*8+:8] : wirqt_d[i*8+:8]; + end + if (wirqt_d >= data_t'(MailboxDepth)) begin + // the `-1` is to have the interrupt fireing when the FIFO is comletely full +@@ -454,7 +454,7 @@ module axi_lite_mailbox_slave #( + end + RIRQT: begin + for (int unsigned i = 0; i < AxiDataWidth/8; i++) begin +- rirqt_d[i*8+:8] = slv_req_i.w.strb[i] ? slv_req_i.w.data[i*8+:8] : 8'b0000_0000; ++ rirqt_d[i*8+:8] = slv_req_i.w.strb[i] ? slv_req_i.w.data[i*8+:8] : rirqt_d[i*8+:8]; + end + if (rirqt_d >= data_t'(MailboxDepth)) begin + // Threshold to maximal value, minus two to prevent overflow in usage diff --git a/hw/vendor/pulp_axi/src/axi_lite_mailbox.sv b/hw/vendor/pulp_axi/src/axi_lite_mailbox.sv index 73adeca38..8c410d83d 100644 --- a/hw/vendor/pulp_axi/src/axi_lite_mailbox.sv +++ b/hw/vendor/pulp_axi/src/axi_lite_mailbox.sv @@ -443,7 +443,7 @@ module axi_lite_mailbox_slave #( // ERROR: read only WIRQT: begin for (int unsigned i = 0; i < AxiDataWidth/8; i++) begin - wirqt_d[i*8+:8] = slv_req_i.w.strb[i] ? slv_req_i.w.data[i*8+:8] : 8'b0000_0000; + wirqt_d[i*8+:8] = slv_req_i.w.strb[i] ? slv_req_i.w.data[i*8+:8] : wirqt_d[i*8+:8]; end if (wirqt_d >= data_t'(MailboxDepth)) begin // the `-1` is to have the interrupt fireing when the FIFO is comletely full @@ -454,7 +454,7 @@ module axi_lite_mailbox_slave #( end RIRQT: begin for (int unsigned i = 0; i < AxiDataWidth/8; i++) begin - rirqt_d[i*8+:8] = slv_req_i.w.strb[i] ? slv_req_i.w.data[i*8+:8] : 8'b0000_0000; + rirqt_d[i*8+:8] = slv_req_i.w.strb[i] ? slv_req_i.w.data[i*8+:8] : rirqt_d[i*8+:8]; end if (rirqt_d >= data_t'(MailboxDepth)) begin // Threshold to maximal value, minus two to prevent overflow in usage