Browse Source

Merge "fix(spmd): perform G0 interrupt acknowledge and deactivation" into integration

pull/2000/head
Olivier Deprez 1 year ago
committed by TrustedFirmware Code Review
parent
commit
80c2c3742b
  1. 3
      plat/arm/board/tc/tc_bl31_setup.c
  2. 12
      services/std_svc/spmd/spmd_main.c

3
plat/arm/board/tc/tc_bl31_setup.c

@ -122,12 +122,9 @@ int plat_spmd_handle_group0_interrupt(uint32_t intid)
{ {
/* Trusted Watchdog timer is the only source of Group0 interrupt now. */ /* Trusted Watchdog timer is the only source of Group0 interrupt now. */
if (intid == SBSA_SECURE_WDOG_INTID) { if (intid == SBSA_SECURE_WDOG_INTID) {
INFO("Watchdog restarted\n");
/* Refresh the timer. */ /* Refresh the timer. */
plat_arm_secure_wdt_refresh(); plat_arm_secure_wdt_refresh();
/* Deactivate the corresponding interrupt. */
plat_ic_end_of_interrupt(intid);
return 0; return 0;
} }

12
services/std_svc/spmd/spmd_main.c

@ -273,13 +273,16 @@ static uint64_t spmd_group0_interrupt_handler_nwd(uint32_t id,
assert(plat_ic_get_pending_interrupt_type() == INTR_TYPE_EL3); assert(plat_ic_get_pending_interrupt_type() == INTR_TYPE_EL3);
intid = plat_ic_get_pending_interrupt_id(); intid = plat_ic_acknowledge_interrupt();
if (plat_spmd_handle_group0_interrupt(intid) < 0) { if (plat_spmd_handle_group0_interrupt(intid) < 0) {
ERROR("Group0 interrupt %u not handled\n", intid); ERROR("Group0 interrupt %u not handled\n", intid);
panic(); panic();
} }
/* Deactivate the corresponding Group0 interrupt. */
plat_ic_end_of_interrupt(intid);
return 0U; return 0U;
} }
#endif #endif
@ -300,7 +303,7 @@ static uint64_t spmd_handle_group0_intr_swd(void *handle)
assert(plat_ic_get_pending_interrupt_type() == INTR_TYPE_EL3); assert(plat_ic_get_pending_interrupt_type() == INTR_TYPE_EL3);
intid = plat_ic_get_pending_interrupt_id(); intid = plat_ic_acknowledge_interrupt();
/* /*
* TODO: Currently due to a limitation in SPMD implementation, the * TODO: Currently due to a limitation in SPMD implementation, the
@ -313,6 +316,9 @@ static uint64_t spmd_handle_group0_intr_swd(void *handle)
panic(); panic();
} }
/* Deactivate the corresponding Group0 interrupt. */
plat_ic_end_of_interrupt(intid);
/* Return success. */ /* Return success. */
SMC_RET8(handle, FFA_SUCCESS_SMC32, FFA_PARAM_MBZ, FFA_PARAM_MBZ, SMC_RET8(handle, FFA_SUCCESS_SMC32, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
@ -1187,7 +1193,7 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
if (secure_origin) { if (secure_origin) {
return spmd_handle_group0_intr_swd(handle); return spmd_handle_group0_intr_swd(handle);
} else { } else {
return spmd_ffa_error_return(handle, FFA_ERROR_DENIED); return spmd_ffa_error_return(handle, FFA_ERROR_NOT_SUPPORTED);
} }
default: default:
WARN("SPM: Unsupported call 0x%08x\n", smc_fid); WARN("SPM: Unsupported call 0x%08x\n", smc_fid);

Loading…
Cancel
Save