blob: 112b68b50f21ccdead9b8e49727399ba35e3f34c [file] [log] [blame]
Lina Iyer88a8fda2016-04-01 08:23:31 -06001/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#ifndef __SOC_QCOM_TCS_H__
15#define __SOC_QCOM_TCS_H__
16
17#define MAX_RPMH_PAYLOAD 16
18
19struct tcs_cmd {
20 u32 addr; /* slv_id:18:16 | offset:0:15 */
21 u32 data; /* data for resource (or read response) */
22 bool complete; /* wait for completion before sending next */
23};
24
25enum rpmh_state {
26 RPMH_SLEEP_STATE, /* Sleep */
27 RPMH_WAKE_ONLY_STATE, /* Wake only */
28 RPMH_ACTIVE_ONLY_STATE, /* Active only (= AMC) */
Lina Iyer21c17882016-09-22 11:05:51 -060029 RPMH_AWAKE_STATE, /* Use Wake TCS for Wake & Active (AMC = 0) */
Lina Iyer88a8fda2016-04-01 08:23:31 -060030};
31
32struct tcs_mbox_msg {
33 enum rpmh_state state; /* request state */
34 bool is_complete; /* wait for resp from accelerator */
35 bool is_read; /* expecting a response from RPMH */
36 bool is_control; /* private control messages */
37 bool invalidate; /* invalidate sleep/wake commands */
38 u32 num_payload; /* Limited to MAX_RPMH_PAYLOAD in one msg */
39 struct tcs_cmd *payload;/* array of tcs_cmds */
40};
41
42#endif /* __SOC_QCOM_TCS_H__ */