aboutsummaryrefslogtreecommitdiff
path: root/include/soc/qcom/tcs.h
blob: 4022701ddf727b00b5406a852618fee19ad2f5db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#ifndef __SOC_QCOM_TCS_H__
#define __SOC_QCOM_TCS_H__

#define MAX_RPMH_PAYLOAD	16

struct tcs_cmd {
	u32 addr;		/* slv_id:18:16 | offset:0:15 */
	u32 data;		/* data for resource (or read response) */
	bool complete;		/* wait for completion before sending next */
};

enum rpmh_state {
	RPMH_SLEEP_STATE,	/* Sleep */
	RPMH_WAKE_ONLY_STATE,	/* Wake only */
	RPMH_ACTIVE_ONLY_STATE,	/* Active only (= AMC) */
	RPMH_AWAKE_STATE,	/* Use Wake TCS for Wake & Active (AMC = 0) */
};

struct tcs_mbox_msg {
	enum rpmh_state state;	/* request state */
	bool is_complete;	/* wait for resp from accelerator */
	bool is_read;		/* expecting a response from RPMH */
	bool is_control;	/* private control messages */
	bool invalidate;	/* invalidate sleep/wake commands */
	u32 num_payload;	/* Limited to MAX_RPMH_PAYLOAD in one msg */
	struct tcs_cmd *payload;/* array of tcs_cmds */
};

#endif /* __SOC_QCOM_TCS_H__ */