mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 17:44:19 +00:00

Very rarely, during cpuidle operations the following error is seen: "PM MSG Trigger Timeout". This is caused by slow handling of message interrutps in the PM FW running on CM3 (under heavy PM operation load). This is not a real issue, so we extend the timeout to avoid the error prints. Change-Id: I92fd6f2ff1ddf208b216c123880ded28a00b6e0e Signed-off-by: Igal Liberman <igall@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/59670 Reviewed-by: Kostya Porotchkin <kostap@marvell.com> Tested-by: iSoC Platform CI <ykjenk@marvell.com>
84 lines
2.1 KiB
C
84 lines
2.1 KiB
C
/*
|
|
* Copyright (C) 2018 Marvell International Ltd.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
* https://spdx.org/licenses
|
|
*/
|
|
|
|
#include <debug.h>
|
|
#include <mmio.h>
|
|
#include <psci.h>
|
|
#include <string.h>
|
|
|
|
#include <mss_pm_ipc.h>
|
|
|
|
/*
|
|
* SISR is 32 bit interrupt register representing 32 interrupts
|
|
*
|
|
* +======+=============+=============+
|
|
* + Bits + 31 + 30 - 00 +
|
|
* +======+=============+=============+
|
|
* + Desc + MSS Msg Int + Reserved +
|
|
* +======+=============+=============+
|
|
*/
|
|
#define MSS_SISR (MVEBU_REGS_BASE + 0x5800D0)
|
|
#define MSS_SISTR (MVEBU_REGS_BASE + 0x5800D8)
|
|
|
|
#define MSS_MSG_INT_MASK (0x80000000)
|
|
#define MSS_TIMER_BASE (MVEBU_REGS_BASE_MASK + 0x580110)
|
|
#define MSS_TRIGGER_TIMEOUT (2000)
|
|
|
|
/*****************************************************************************
|
|
* mss_pm_ipc_msg_send
|
|
*
|
|
* DESCRIPTION: create and transmit IPC message
|
|
*****************************************************************************
|
|
*/
|
|
int mss_pm_ipc_msg_send(unsigned int channel_id, unsigned int msg_id,
|
|
const psci_power_state_t *target_state)
|
|
{
|
|
/* Transmit IPC message */
|
|
#ifndef DISABLE_CLUSTER_LEVEL
|
|
mv_pm_ipc_msg_tx(channel_id, msg_id,
|
|
(unsigned int)target_state->pwr_domain_state[
|
|
MPIDR_AFFLVL1]);
|
|
#else
|
|
mv_pm_ipc_msg_tx(channel_id, msg_id, 0);
|
|
#endif
|
|
|
|
return 0;
|
|
}
|
|
|
|
/*****************************************************************************
|
|
* mss_pm_ipc_msg_trigger
|
|
*
|
|
* DESCRIPTION: Trigger IPC message interrupt to MSS
|
|
*****************************************************************************
|
|
*/
|
|
int mss_pm_ipc_msg_trigger(void)
|
|
{
|
|
unsigned int timeout;
|
|
unsigned int t_end;
|
|
unsigned int t_start = mmio_read_32(MSS_TIMER_BASE);
|
|
|
|
mmio_write_32(MSS_SISR, MSS_MSG_INT_MASK);
|
|
|
|
do {
|
|
/* wait while SCP process incoming interrupt */
|
|
if (mmio_read_32(MSS_SISTR) != MSS_MSG_INT_MASK)
|
|
break;
|
|
|
|
/* check timeout */
|
|
t_end = mmio_read_32(MSS_TIMER_BASE);
|
|
|
|
timeout = ((t_start > t_end) ?
|
|
(t_start - t_end) : (t_end - t_start));
|
|
if (timeout > MSS_TRIGGER_TIMEOUT) {
|
|
ERROR("PM MSG Trigger Timeout\n");
|
|
break;
|
|
}
|
|
|
|
} while (1);
|
|
|
|
return 0;
|
|
}
|