[PATCH 2/2] arm: socfpga: mailbox_s10: add wrapper for CONFIG_STATUS
Michael Tretter
m.tretter at pengutronix.de
Mon Sep 28 05:45:58 PDT 2026
The CONFIG_STATUS command allows barebox to request the current
bitstream configuration from the SDM firmware. This includes potential
errors, the boot configuration and the Quartus Version that was used to
create the image and the SDM firmware.
Add a wrapper to have a more convenient interface to the SDM firmware.
Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
---
arch/arm/mach-socfpga/mailbox_s10.c | 21 +++++++++++++++++++++
include/mach/socfpga/mailbox_s10.h | 11 +++++++++++
2 files changed, 32 insertions(+)
diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c
index a3e208a2aa17..1cf92813b5a7 100644
--- a/arch/arm/mach-socfpga/mailbox_s10.c
+++ b/arch/arm/mach-socfpga/mailbox_s10.c
@@ -369,6 +369,27 @@ int mbox_rsu_get_spt(struct rsu_spt_offset *rsu_spt_offset)
return 0;
}
+int mbox_config_status(struct config_status *config_status)
+{
+ int ret;
+ u32 *resp_buf = (u32 *)config_status;
+ u32 resp_buf_len = sizeof(*config_status)/sizeof(*resp_buf);
+
+ ret = mbox_send_cmd(MBOX_ID_BAREBOX,
+ MBOX_CONFIG_STATUS,
+ MBOX_CMD_DIRECT,
+ 0, NULL, 0, &resp_buf_len, resp_buf);
+ switch (ret) {
+ case MBOX_RESP_STATOK:
+ break;
+ default:
+ pr_err("MBOX_CONFIG_STATUS failed: %d\n", ret);
+ return ret;
+ }
+
+ return 0;
+}
+
int mbox_rsu_status(struct rsu_status_info *status_info)
{
int ret;
diff --git a/include/mach/socfpga/mailbox_s10.h b/include/mach/socfpga/mailbox_s10.h
index b006fb18ff09..bc0fd97ff0fc 100644
--- a/include/mach/socfpga/mailbox_s10.h
+++ b/include/mach/socfpga/mailbox_s10.h
@@ -190,6 +190,17 @@ int socfpga_mailbox_s10_qspi_close(void);
int socfpga_mailbox_s10_qspi_open(unsigned long *master_ref_clk);
int socfpga_mailbox_s10_qspi_get_device_info(u32 *resp_buf, u32 resp_buf_len);
+struct config_status {
+ u32 state;
+ u32 version;
+ u32 pin_status;
+ u32 soft_function_status;
+ u32 error_location;
+ u32 error_details;
+};
+
+int mbox_config_status(struct config_status *config_status);
+
struct rsu_spt_offset {
u32 spt0_hi;
u32 spt0_lo;
--
2.47.3
More information about the barebox
mailing list