* [U-Boot] [PATCH v2] Add generic FPGA reconfig mailbox API for S10
@ 2018-10-05 17:05 chee.hong.ang at intel.com
2018-10-05 17:05 ` [U-Boot] [PATCH v2] arm: socfpga: stratix10: " chee.hong.ang at intel.com
0 siblings, 1 reply; 3+ messages in thread
From: chee.hong.ang at intel.com @ 2018-10-05 17:05 UTC (permalink / raw)
To: u-boot
From: "Ang, Chee Hong" <chee.hong.ang@intel.com>
This patch is v2 for:
https://lists.denx.de/pipermail/u-boot/2018-September/342465.html
Ang, Chee Hong (1):
arm: socfpga: stratix10: Add generic FPGA reconfig mailbox API for S10
arch/arm/mach-socfpga/include/mach/mailbox_s10.h | 3 +-
arch/arm/mach-socfpga/mailbox_s10.c | 48 ++++++++++++++++++++++++
2 files changed, 50 insertions(+), 1 deletion(-)
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] arm: socfpga: stratix10: Add generic FPGA reconfig mailbox API for S10
2018-10-05 17:05 [U-Boot] [PATCH v2] Add generic FPGA reconfig mailbox API for S10 chee.hong.ang at intel.com
@ 2018-10-05 17:05 ` chee.hong.ang at intel.com
2018-10-05 21:21 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: chee.hong.ang at intel.com @ 2018-10-05 17:05 UTC (permalink / raw)
To: u-boot
From: "Ang, Chee Hong" <chee.hong.ang@intel.com>
Add a generic mailbox API for FPGA reconfig status which can be
called by others. This new function accepts 2 different mailbox
commands: CONFIG_STATUS or RECONFIG_STATUS.
Signed-off-by: Ang, Chee Hong <chee.hong.ang@intel.com>
---
arch/arm/mach-socfpga/include/mach/mailbox_s10.h | 3 +-
arch/arm/mach-socfpga/mailbox_s10.c | 48 ++++++++++++++++++++++++
2 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-socfpga/include/mach/mailbox_s10.h b/arch/arm/mach-socfpga/include/mach/mailbox_s10.h
index 81a609d..660df35 100644
--- a/arch/arm/mach-socfpga/include/mach/mailbox_s10.h
+++ b/arch/arm/mach-socfpga/include/mach/mailbox_s10.h
@@ -140,5 +140,6 @@ int mbox_qspi_open(void);
#endif
int mbox_reset_cold(void);
-
+int mbox_get_fpga_config_status(u32 cmd);
+int mbox_get_fpga_config_status_psci(u32 cmd);
#endif /* _MAILBOX_S10_H_ */
diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c
index 0d906c3..3c33223 100644
--- a/arch/arm/mach-socfpga/mailbox_s10.c
+++ b/arch/arm/mach-socfpga/mailbox_s10.c
@@ -342,6 +342,54 @@ int mbox_reset_cold(void)
return 0;
}
+/* Accepted commands: CONFIG_STATUS or RECONFIG_STATUS */
+static __always_inline int mbox_get_fpga_config_status_common(u32 cmd)
+{
+ u32 reconfig_status_resp_len;
+ u32 reconfig_status_resp[RECONFIG_STATUS_RESPONSE_LEN];
+ int ret;
+
+ reconfig_status_resp_len = RECONFIG_STATUS_RESPONSE_LEN;
+ ret = mbox_send_cmd_common(MBOX_ID_UBOOT, cmd,
+ MBOX_CMD_DIRECT, 0, NULL, 0,
+ &reconfig_status_resp_len,
+ reconfig_status_resp);
+
+ if (ret)
+ return ret;
+
+ /* Check for any error */
+ ret = reconfig_status_resp[RECONFIG_STATUS_STATE];
+ if (ret && ret != MBOX_CFGSTAT_STATE_CONFIG)
+ return ret;
+
+ /* Make sure nStatus is not 0 */
+ ret = reconfig_status_resp[RECONFIG_STATUS_PIN_STATUS];
+ if (!(ret & RCF_PIN_STATUS_NSTATUS))
+ return MBOX_CFGSTAT_STATE_ERROR_HARDWARE;
+
+ ret = reconfig_status_resp[RECONFIG_STATUS_SOFTFUNC_STATUS];
+ if (ret & RCF_SOFTFUNC_STATUS_SEU_ERROR)
+ return MBOX_CFGSTAT_STATE_ERROR_HARDWARE;
+
+ if ((ret & RCF_SOFTFUNC_STATUS_CONF_DONE) &&
+ (ret & RCF_SOFTFUNC_STATUS_INIT_DONE) &&
+ !reconfig_status_resp[RECONFIG_STATUS_STATE])
+ return 0; /* configuration success */
+
+ return MBOX_CFGSTAT_STATE_CONFIG;
+}
+
+int mbox_get_fpga_config_status(u32 cmd)
+{
+ return mbox_get_fpga_config_status_common(cmd);
+}
+
+int __secure mbox_get_fpga_config_status_psci(u32 cmd)
+{
+ return mbox_get_fpga_config_status_common(cmd);
+}
+
int mbox_send_cmd(u8 id, u32 cmd, u8 is_indirect, u32 len, u32 *arg,
u8 urgent, u32 *resp_buf_len, u32 *resp_buf)
{
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] arm: socfpga: stratix10: Add generic FPGA reconfig mailbox API for S10
2018-10-05 17:05 ` [U-Boot] [PATCH v2] arm: socfpga: stratix10: " chee.hong.ang at intel.com
@ 2018-10-05 21:21 ` Marek Vasut
0 siblings, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2018-10-05 21:21 UTC (permalink / raw)
To: u-boot
On 10/05/2018 07:05 PM, chee.hong.ang at intel.com wrote:
> From: "Ang, Chee Hong" <chee.hong.ang@intel.com>
>
> Add a generic mailbox API for FPGA reconfig status which can be
> called by others. This new function accepts 2 different mailbox
> commands: CONFIG_STATUS or RECONFIG_STATUS.
>
> Signed-off-by: Ang, Chee Hong <chee.hong.ang@intel.com>
Applied, thanks
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-05 21:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-05 17:05 [U-Boot] [PATCH v2] Add generic FPGA reconfig mailbox API for S10 chee.hong.ang at intel.com
2018-10-05 17:05 ` [U-Boot] [PATCH v2] arm: socfpga: stratix10: " chee.hong.ang at intel.com
2018-10-05 21:21 ` Marek Vasut
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.