Browse Source

Merge "feat(intel): add QSPI get devinfo mailbox cmd" into integration

pull/1996/merge
Manish Pandey 4 months ago
committed by TrustedFirmware Code Review
parent
commit
0cdf5199fa
  1. 3
      plat/intel/soc/common/include/socfpga_mailbox.h
  2. 2
      plat/intel/soc/common/include/socfpga_sip_svc.h
  3. 8
      plat/intel/soc/common/soc/socfpga_mailbox.c
  4. 22
      plat/intel/soc/common/socfpga_sip_svc.c

3
plat/intel/soc/common/include/socfpga_mailbox.h

@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2023, Intel Corporation. All rights reserved.
* Copyright (c) 2024, Altera Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -75,6 +76,7 @@
#define MBOX_RSU_STATUS 0x5B
#define MBOX_RSU_UPDATE 0x5C
#define MBOX_HPS_STAGE_NOTIFY 0x5D
#define MBOX_RSU_GET_DEVICE_INFO 0x74
/* FCS Command */
#define MBOX_FCS_GET_PROVISION 0x7B
@ -249,6 +251,7 @@ void intel_smmu_hps_remapper_init(uint64_t *mem);
int mailbox_rsu_get_spt_offset(uint32_t *resp_buf, uint32_t resp_buf_len);
int mailbox_rsu_status(uint32_t *resp_buf, uint32_t resp_buf_len);
int mailbox_rsu_get_device_info(uint32_t *resp_buf, uint32_t resp_buf_len);
int mailbox_rsu_update(uint32_t *flash_offset);
int mailbox_hps_stage_notify(uint32_t execution_stage);
int mailbox_hwmon_readtemp(uint32_t chan, uint32_t *resp_buf);

2
plat/intel/soc/common/include/socfpga_sip_svc.h

@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2023, Intel Corporation. All rights reserved.
* Copyright (c) 2024, Altera Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -64,6 +65,7 @@
#define INTEL_SIP_SMC_RSU_COPY_MAX_RETRY 0xC2000013
#define INTEL_SIP_SMC_RSU_DCMF_STATUS 0xC2000014
#define INTEL_SIP_SMC_RSU_COPY_DCMF_STATUS 0xC2000015
#define INTEL_SIP_SMC_RSU_GET_DEVICE_INFO 0xC2000016
/* Hardware monitor */
#define INTEL_SIP_SMC_HWMON_READTEMP 0xC2000020

8
plat/intel/soc/common/soc/socfpga_mailbox.c

@ -1,5 +1,6 @@
/*
* Copyright (c) 2020-2023, Intel Corporation. All rights reserved.
* Copyright (c) 2024, Altera Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -578,6 +579,13 @@ int mailbox_rsu_status(uint32_t *resp_buf, unsigned int resp_buf_len)
return ret;
}
int mailbox_rsu_get_device_info(uint32_t *resp_buf, unsigned int resp_buf_len)
{
return mailbox_send_cmd(MBOX_JOB_ID, MBOX_RSU_GET_DEVICE_INFO, NULL, 0U,
CMD_CASUAL, resp_buf,
&resp_buf_len);
}
int mailbox_rsu_update(uint32_t *flash_offset)
{
return mailbox_send_cmd(MBOX_JOB_ID, MBOX_RSU_UPDATE,

22
plat/intel/soc/common/socfpga_sip_svc.c

@ -1,5 +1,7 @@
/*
* Copyright (c) 2019-2023, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2019-2023, Intel Corporation. All rights reserved.
* Copyright (c) 2024, Altera Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -507,6 +509,16 @@ static uint32_t intel_rsu_status(uint64_t *respbuf, unsigned int respbuf_sz)
return INTEL_SIP_SMC_STATUS_OK;
}
static uint32_t intel_rsu_get_device_info(uint32_t *respbuf,
unsigned int respbuf_sz)
{
if (mailbox_rsu_get_device_info((uint32_t *)respbuf, respbuf_sz) < 0) {
return INTEL_SIP_SMC_RSU_ERROR;
}
return INTEL_SIP_SMC_STATUS_OK;
}
uint32_t intel_rsu_update(uint64_t update_address)
{
if (update_address > SIZE_MAX) {
@ -878,6 +890,16 @@ uintptr_t sip_smc_handler_v1(uint32_t smc_fid,
status = intel_rsu_copy_dcmf_version(x1, x2);
SMC_RET1(handle, status);
case INTEL_SIP_SMC_RSU_GET_DEVICE_INFO:
status = intel_rsu_get_device_info((uint32_t *)rsu_respbuf,
ARRAY_SIZE(rsu_respbuf));
if (status) {
SMC_RET1(handle, status);
} else {
SMC_RET5(handle, status, rsu_respbuf[0], rsu_respbuf[1],
rsu_respbuf[2], rsu_respbuf[3]);
}
case INTEL_SIP_SMC_RSU_DCMF_STATUS:
SMC_RET2(handle, INTEL_SIP_SMC_STATUS_OK,
((uint64_t)rsu_dcmf_stat[3] << 48) |

Loading…
Cancel
Save