From d9ca6d86e9a96e966a111ff1edd421c095b14ffa Mon Sep 17 00:00:00 2001 From: Mantravadi Karthik Date: Thu, 20 May 2021 22:49:26 +0530 Subject: tegra: safety-ivc: Add support for HB CMD Why? L2SS expects a heartbeat ping every 40ms. CCPLEX is expected to write the Boot status in the IVC channel for the first time and the consective pings will be just to send Alive check. How? Create a new callback API for the HB command which fills the bit fields for the HB data and sends it over the cmd-resp IVC channel. * Added mutex lock support for l1ss_cmd_resp_send_frame for syncronizing the ivc writes. * Waiting for empty interrupts hogs the system. Time critical features such as HB fail while waiting for empty interrupts. Hence, removing the HSP SM empty isr support. Bug 200700400 Change-Id: I7f124c9f7336df9d387536aa3f2dda80d9234db8 Signed-off-by: Mantravadi Karthik Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2519655 Tested-by: mobile promotions Reviewed-by: mobile promotions --- include/linux/tegra-safety-ivc.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/linux/tegra-safety-ivc.h b/include/linux/tegra-safety-ivc.h index 9c43f271b..fce08c62c 100644 --- a/include/linux/tegra-safety-ivc.h +++ b/include/linux/tegra-safety-ivc.h @@ -22,6 +22,8 @@ #define SAFETY_CONF(id, value) ((SAFETY_CONF_ ## id << 24) | (value)) #define SAFETY_CONF_GET_ID(value) (((value) >> 24) & 0x7f) #define SAFETY_CONF_GET_VALUE(value) ((value) & 0xffffff) +#define TEGRA_SAFETY_SM_CMDRESP_CH 0 +#define TEGRA_SAFETY_IVC_READ_TIMEOUT (2 * HZ) enum { SAFETY_CONF_IVC_READY = 1, @@ -49,6 +51,10 @@ struct tegra_safety_ivc { } cmd; struct tegra_safety_ivc_chan *ivc_chan[MAX_SAFETY_CHANNELS]; atomic_t ivc_ready; + struct work_struct work; + struct workqueue_struct *wq; + struct mutex rlock; + struct mutex wlock; struct l1ss_data *ldata; }; -- cgit v1.2.2