summaryrefslogtreecommitdiffstats
path: root/drivers/soc/qcom/rpmh-internal.h
diff options
context:
space:
mode:
authorLina Iyer <ilina@codeaurora.org>2018-06-20 18:57:02 +0530
committerAndy Gross <andy.gross@linaro.org>2018-07-21 13:32:49 -0500
commitfa460e453a83af0054dc3d3d210a6617db333a20 (patch)
treec489e03393e120ec205c9170966abfb1816e8a6a /drivers/soc/qcom/rpmh-internal.h
parentc1038456b02b86cc4445441a8d33c5aca0ac103e (diff)
downloadlinux-fa460e453a83af0054dc3d3d210a6617db333a20.tar.bz2
drivers: qcom: rpmh-rsc: write sleep/wake requests to TCS
Sleep and wake requests are sent when the application processor subsystem of the SoC is entering deep sleep states like in suspend. These requests help lower the system power requirements when the resources are not in use. Sleep and wake requests are written to the TCS slots but are not triggered at the time of writing. The TCS are triggered by the firmware after the last of the CPUs has executed its WFI. Since these requests may come in different batches of requests, it is the job of this controller driver to find and arrange the requests into the available TCSes. Signed-off-by: Lina Iyer <ilina@codeaurora.org> Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org> Reviewed-by: Evan Green <evgreen@chromium.org> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'drivers/soc/qcom/rpmh-internal.h')
-rw-r--r--drivers/soc/qcom/rpmh-internal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/soc/qcom/rpmh-internal.h b/drivers/soc/qcom/rpmh-internal.h
index 1e687f719301..af4da1cb6558 100644
--- a/drivers/soc/qcom/rpmh-internal.h
+++ b/drivers/soc/qcom/rpmh-internal.h
@@ -14,6 +14,7 @@
#define MAX_CMDS_PER_TCS 16
#define MAX_TCS_PER_TYPE 3
#define MAX_TCS_NR (MAX_TCS_PER_TYPE * TCS_TYPE_NR)
+#define MAX_TCS_SLOTS (MAX_CMDS_PER_TCS * MAX_TCS_PER_TYPE)
struct rsc_drv;
@@ -29,6 +30,8 @@ struct rsc_drv;
* @ncpt: number of commands in each TCS
* @lock: lock for synchronizing this TCS writes
* @req: requests that are sent from the TCS
+ * @cmd_cache: flattened cache of cmds in sleep/wake TCS
+ * @slots: indicates which of @cmd_addr are occupied
*/
struct tcs_group {
struct rsc_drv *drv;
@@ -39,6 +42,8 @@ struct tcs_group {
int ncpt;
spinlock_t lock;
const struct tcs_request *req[MAX_TCS_PER_TYPE];
+ u32 *cmd_cache;
+ DECLARE_BITMAP(slots, MAX_TCS_SLOTS);
};
/**
@@ -92,6 +97,9 @@ struct rsc_drv {
};
int rpmh_rsc_send_data(struct rsc_drv *drv, const struct tcs_request *msg);
+int rpmh_rsc_write_ctrl_data(struct rsc_drv *drv,
+ const struct tcs_request *msg);
+int rpmh_rsc_invalidate(struct rsc_drv *drv);
void rpmh_tx_done(const struct tcs_request *msg, int r);