1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
6 #ifndef __SOC_QCOM_TCS_H__
7 #define __SOC_QCOM_TCS_H__
9 #define MAX_RPMH_PAYLOAD 16
12 * rpmh_state: state for the request
14 * RPMH_SLEEP_STATE: State of the resource when the processor subsystem
15 * is powered down. There is no client using the
17 * RPMH_WAKE_ONLY_STATE: Resume resource state to the value previously
18 * requested before the processor was powered down.
19 * RPMH_ACTIVE_ONLY_STATE: Active or AMC mode requests. Resource state
20 * is aggregated immediately.
25 RPMH_ACTIVE_ONLY_STATE
,
29 * struct tcs_cmd: an individual request to RPMH.
31 * @addr: the address of the resource slv_id:18:16 | offset:0:15
32 * @data: the resource state request
33 * @wait: wait for this request to be complete before sending the next
42 * struct tcs_request: A set of tcs_cmds sent together in a TCS
44 * @state: state for the request.
45 * @wait_for_compl: wait until we get a response from the h/w accelerator
46 * @num_cmds: the number of @cmds in this request
47 * @cmds: an array of tcs_cmds
50 enum rpmh_state state
;
56 #define BCM_TCS_CMD_COMMIT_SHFT 30
57 #define BCM_TCS_CMD_COMMIT_MASK 0x40000000
58 #define BCM_TCS_CMD_VALID_SHFT 29
59 #define BCM_TCS_CMD_VALID_MASK 0x20000000
60 #define BCM_TCS_CMD_VOTE_X_SHFT 14
61 #define BCM_TCS_CMD_VOTE_MASK 0x3fff
62 #define BCM_TCS_CMD_VOTE_Y_SHFT 0
63 #define BCM_TCS_CMD_VOTE_Y_MASK 0xfffc000
65 /* Construct a Bus Clock Manager (BCM) specific TCS command */
66 #define BCM_TCS_CMD(commit, valid, vote_x, vote_y) \
67 (((commit) << BCM_TCS_CMD_COMMIT_SHFT) | \
68 ((valid) << BCM_TCS_CMD_VALID_SHFT) | \
69 ((cpu_to_le32(vote_x) & \
70 BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_X_SHFT) | \
71 ((cpu_to_le32(vote_y) & \
72 BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_Y_SHFT))
74 #endif /* __SOC_QCOM_TCS_H__ */