[PATCH 4/4] arm: socfpga: mailbox_s10: handle error 0x8f explicitly

Michael Tretter m.tretter at pengutronix.de
Wed Mar 11 04:06:42 PDT 2026


The 0x8f is a command specific error code that indicates that the SDM
denied the HPS direct access to the QSPI. This is a valid SDM
configuration, but prevents barebox from using the QSPI flash, which may
or may not be a problem.

This configuration may also happen accidentally when using Quartus 25.3
to add a FSBL to a board SDM configuration created by Quartus 24.3.

Print a specific error message for this situation to help the developer.

Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
---
 arch/arm/mach-socfpga/mailbox_s10.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c
index ff2f261014b2..4199c4fb913a 100644
--- a/arch/arm/mach-socfpga/mailbox_s10.c
+++ b/arch/arm/mach-socfpga/mailbox_s10.c
@@ -319,7 +319,13 @@ int socfpga_mailbox_s10_qspi_open(void)
 	/* HPS will directly control the QSPI controller, no longer mailbox */
 	ret = mbox_send_cmd(MBOX_ID_BAREBOX, MBOX_QSPI_DIRECT, MBOX_CMD_DIRECT,
 			    0, NULL, 0, &resp_buf_len, resp_buf);
-	if (ret) {
+	switch (ret) {
+	case MBOX_RESP_STATOK:
+		break;
+	case 0x8f:
+		pr_err("QSPI: SDM denied direct QSPI access\n");
+		goto error;
+	default:
 		pr_err("QSPI: QSPI_DIRECT failed: 0x%x\n", ret);
 		goto error;
 	}

-- 
2.47.3




More information about the barebox mailing list