summaryrefslogtreecommitdiff
path: root/plat/intel
diff options
context:
space:
mode:
authorSieu Mun Tang <sieu.mun.tang@intel.com>2022-12-04 01:43:35 +0800
committerSieu Mun Tang <sieu.mun.tang@intel.com>2022-12-15 12:28:23 +0800
commit76ed32236aa396cb0e15eb049bea03710ca1992d (patch)
tree4095449923c8527ea58b0ce6a5bcb80f38e9b8e1 /plat/intel
parent19e09e27f60b78934a52bc1fb4e126d71e513bb2 (diff)
downloadarm-trusted-firmware-76ed32236aa396cb0e15eb049bea03710ca1992d.tar.gz
fix(intel): add mailbox error return status for FCS_DECRYPTION
Add 2 more mailbox error return status for FCS_DECRYPTION when sending mailbox command to SDM Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com> Change-Id: Ifff4faa397232cc0080f9fca6f6948ac305915c4
Diffstat (limited to 'plat/intel')
-rw-r--r--plat/intel/soc/common/include/socfpga_mailbox.h4
-rw-r--r--plat/intel/soc/common/sip/socfpga_sip_fcs.c5
-rw-r--r--plat/intel/soc/common/socfpga_sip_svc.c5
3 files changed, 12 insertions, 2 deletions
diff --git a/plat/intel/soc/common/include/socfpga_mailbox.h b/plat/intel/soc/common/include/socfpga_mailbox.h
index 3ab6f522e..3abf39dca 100644
--- a/plat/intel/soc/common/include/socfpga_mailbox.h
+++ b/plat/intel/soc/common/include/socfpga_mailbox.h
@@ -129,6 +129,10 @@
#define MBOX_BUSY -5
#define MBOX_TIMEOUT -2047
+/* Key Status */
+#define MBOX_RET_SDOS_DECRYPTION_ERROR_102 -258
+#define MBOX_RET_SDOS_DECRYPTION_ERROR_103 -259
+
/* Reconfig Status Response */
#define RECONFIG_STATUS_STATE 0
#define RECONFIG_STATUS_PIN_STATUS 2
diff --git a/plat/intel/soc/common/sip/socfpga_sip_fcs.c b/plat/intel/soc/common/sip/socfpga_sip_fcs.c
index f18c3e4f7..3b0b37029 100644
--- a/plat/intel/soc/common/sip/socfpga_sip_fcs.c
+++ b/plat/intel/soc/common/sip/socfpga_sip_fcs.c
@@ -411,7 +411,10 @@ int intel_fcs_decryption_ext(uint32_t session_id, uint32_t context_id,
(uint32_t *) &payload, payload_size,
CMD_CASUAL, resp_data, &resp_len);
- if (status < 0) {
+ if (status == MBOX_RET_SDOS_DECRYPTION_ERROR_102 ||
+ status == MBOX_RET_SDOS_DECRYPTION_ERROR_103) {
+ *mbox_error = -status;
+ } else if (status < 0) {
*mbox_error = -status;
return INTEL_SIP_SMC_STATUS_ERROR;
}
diff --git a/plat/intel/soc/common/socfpga_sip_svc.c b/plat/intel/soc/common/socfpga_sip_svc.c
index a20e61c76..79f743f5d 100644
--- a/plat/intel/soc/common/socfpga_sip_svc.c
+++ b/plat/intel/soc/common/socfpga_sip_svc.c
@@ -611,7 +611,10 @@ uint32_t intel_smc_service_completed(uint64_t addr, uint32_t size,
*ret_size = resp_len * MBOX_WORD_BYTE;
flush_dcache_range(addr, *ret_size);
- if (status != MBOX_RET_OK) {
+ if (status == MBOX_RET_SDOS_DECRYPTION_ERROR_102 ||
+ status == MBOX_RET_SDOS_DECRYPTION_ERROR_103) {
+ *mbox_error = -status;
+ } else if (status != MBOX_RET_OK) {
*mbox_error = -status;
return INTEL_SIP_SMC_STATUS_ERROR;
}