revert(plat/xilinx): add timeout while waiting for IPI Ack

This reverts commit 4d9b9b2352.

Timeout in IPI ack was added for functional safety reason.
Functional safety is not criteria for ATF. However, this
creates issues for APIs that take long or non-deterministic
duration like FPGA load. So revert this patch for now to fix
FPGA loading issue. Need to add support for non-blocking API
for FPGA loading with callback when API completes.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I940e798f1e2f7d0dfca1da5caaf8b94036d440c6
This commit is contained in:
Venkatesh Yadav Abbarapu 2021-08-04 21:33:15 -06:00
parent 87311b4c16
commit 62f9134de0
4 changed files with 6 additions and 23 deletions

View File

@ -63,7 +63,7 @@ void ipi_mb_release(uint32_t local, uint32_t remote);
int ipi_mb_enquire_status(uint32_t local, uint32_t remote);
/* Trigger notification on the IPI mailbox */
int ipi_mb_notify(uint32_t local, uint32_t remote, uint32_t is_blocking);
void ipi_mb_notify(uint32_t local, uint32_t remote, uint32_t is_blocking);
/* Ack IPI mailbox notification */
void ipi_mb_ack(uint32_t local, uint32_t remote);

View File

@ -13,7 +13,6 @@
#include <common/debug.h>
#include <common/runtime_svc.h>
#include <drivers/delay_timer.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
@ -39,9 +38,6 @@
/* IPI register bit mask */
#define IPI_BIT_MASK(I) (ipi_table[(I)].ipi_bit_mask)
/* IPI Timeout */
#define TIMEOUT_COUNT_US U(0x4000)
/* IPI configuration table */
const static struct ipi_config *ipi_table;
@ -160,30 +156,21 @@ int ipi_mb_enquire_status(uint32_t local, uint32_t remote)
* @remote - remote IPI ID
* @is_blocking - if to trigger the notification in blocking mode or not.
*
* return - 0 - Success or Error incase of timeout
* It sets the remote bit in the IPI agent trigger register.
*
*/
int ipi_mb_notify(uint32_t local, uint32_t remote, uint32_t is_blocking)
void ipi_mb_notify(uint32_t local, uint32_t remote, uint32_t is_blocking)
{
uint32_t status;
const unsigned int timeout_count = TIMEOUT_COUNT_US;
uint64_t timeout;
mmio_write_32(IPI_REG_BASE(local) + IPI_TRIG_OFFSET,
IPI_BIT_MASK(remote));
if (is_blocking) {
timeout = timeout_init_us(timeout_count);
do {
status = mmio_read_32(IPI_REG_BASE(local) +
IPI_OBR_OFFSET);
if (timeout_elapsed(timeout)) {
return -ETIMEDOUT;
}
} while (status & IPI_BIT_MASK(remote));
}
return 0;
}
/* ipi_mb_ack() - Ack IPI mailbox notification from the other end

View File

@ -107,8 +107,8 @@ uint64_t ipi_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2,
uint32_t is_blocking;
is_blocking = (x3 & IPI_SMC_NOTIFY_BLOCK_MASK) ? 1 : 0;
ret = ipi_mb_notify(ipi_local_id, ipi_remote_id, is_blocking);
SMC_RET1(handle, ret);
ipi_mb_notify(ipi_local_id, ipi_remote_id, is_blocking);
SMC_RET1(handle, 0);
}
case IPI_MAILBOX_ACK:
{

View File

@ -55,7 +55,6 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc,
uint32_t payload[PAYLOAD_ARG_CNT],
uint32_t is_blocking)
{
int status;
unsigned int offset = 0;
uintptr_t buffer_base = proc->ipi->buffer_base +
IPI_BUFFER_TARGET_REMOTE_OFFSET +
@ -71,13 +70,10 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc,
}
/* Generate IPI to remote processor */
status = ipi_mb_notify(proc->ipi->local_ipi_id, proc->ipi->remote_ipi_id,
ipi_mb_notify(proc->ipi->local_ipi_id, proc->ipi->remote_ipi_id,
is_blocking);
if (status == 0) {
return PM_RET_SUCCESS;
}
return PM_RET_ERROR_TIMEOUT;
return PM_RET_SUCCESS;
}
/**