fix(intel): add FPGA isolation trigger when reconfiguration

This change is to add in new Mailbox CMD to SDM for MPFE isolation.

Change-Id: I52c84dc227e1c8edbded63c699ded63e431d9af2
Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com>
This commit is contained in:
Sieu Mun Tang 2024-11-09 00:30:33 +08:00
parent 42e906205e
commit 6ce576c63d
3 changed files with 32 additions and 0 deletions

View file

@ -48,6 +48,7 @@
#define MBOX_CMD_GET_IDCODE 0x10
#define MBOX_CMD_GET_USERCODE 0x13
#define MBOX_CMD_GET_CHIPID 0x12
#define MBOX_CMD_FPGA_CONFIG_COMP 0x45
#define MBOX_CMD_REBOOT_HPS 0x47
/* Reconfiguration Commands */
@ -260,4 +261,6 @@ int mailbox_hwmon_readvolt(uint32_t chan, uint32_t *resp_buf);
int mailbox_seu_err_status(uint32_t *resp_buf, uint32_t resp_buf_len);
int mailbox_safe_inject_seu_err(uint32_t *arg, unsigned int len);
int mailbox_send_fpga_config_comp(void);
#endif /* SOCFPGA_MBOX_H */

View file

@ -622,6 +622,22 @@ int mailbox_init(void)
return MBOX_RET_OK;
}
int mailbox_send_fpga_config_comp(void)
{
int ret;
ret = mailbox_send_cmd(MBOX_JOB_ID, MBOX_CMD_FPGA_CONFIG_COMP, NULL, 0U,
CMD_CASUAL, NULL, NULL);
if (ret != 0) {
INFO("SOCFPGA: FPGA configuration complete response, Return Code: 0x%x\n",
MBOX_RESP_ERR(-ret));
return MBOX_RET_ERROR;
}
return MBOX_RET_OK;
}
int intel_mailbox_get_config_status(uint32_t cmd, bool init_done)
{
int status;

View file

@ -222,6 +222,19 @@ static int intel_fpga_config_start(uint32_t flag)
unsigned int size = 0;
unsigned int resp_len = ARRAY_SIZE(response);
#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
/*
* To trigger isolation
* FPGA configuration complete signal should be de-asserted
*/
INFO("SOCFPGA: Request SDM to trigger isolation\n");
status = mailbox_send_fpga_config_comp();
if (status < 0) {
INFO("SOCFPGA: Isolation for FPGA configuration complete is not executed\n");
}
#endif
request_type = RECONFIGURATION;
if (!CONFIG_TEST_FLAG(flag, PARTIAL_CONFIG)) {