1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2017 The Linux Foundation. All rights reserved. */
7 struct a6xx_hfi_queue_table_header {
9 u32 size; /* Size of the queue table in dwords */
10 u32 qhdr0_offset; /* Offset of the first queue header */
11 u32 qhdr_size; /* Size of the queue headers */
12 u32 num_queues; /* Number of total queues */
13 u32 active_queues; /* Number of active queues */
16 struct a6xx_hfi_queue_header {
31 struct a6xx_hfi_queue {
32 struct a6xx_hfi_queue_header *header;
38 * Tracking for the start index of the last N messages in the
39 * queue, for the benefit of devcore dump / crashdec (since
40 * parsing in the reverse direction to decode the last N
41 * messages is difficult to do and would rely on heuristics
42 * which are not guaranteed to be correct)
44 #define HFI_HISTORY_SZ 8
45 s32 history[HFI_HISTORY_SZ];
49 /* This is the outgoing queue to the GMU */
50 #define HFI_COMMAND_QUEUE 0
52 /* THis is the incoming response queue from the GMU */
53 #define HFI_RESPONSE_QUEUE 1
55 #define HFI_HEADER_ID(msg) ((msg) & 0xff)
56 #define HFI_HEADER_SIZE(msg) (((msg) >> 8) & 0xff)
57 #define HFI_HEADER_SEQNUM(msg) (((msg) >> 20) & 0xfff)
59 /* FIXME: Do we need this or can we use ARRAY_SIZE? */
60 #define HFI_RESPONSE_PAYLOAD_SIZE 16
62 /* HFI message types */
66 #define HFI_MSG_ACK_V1 2
68 #define HFI_F2H_MSG_ACK 126
70 struct a6xx_hfi_msg_response {
74 u32 payload[HFI_RESPONSE_PAYLOAD_SIZE];
77 #define HFI_F2H_MSG_ERROR 100
79 struct a6xx_hfi_msg_error {
85 #define HFI_H2F_MSG_INIT 0
87 struct a6xx_hfi_msg_gmu_init_cmd {
95 #define HFI_H2F_MSG_FW_VERSION 1
97 struct a6xx_hfi_msg_fw_version {
99 u32 supported_version;
102 #define HFI_H2F_MSG_PERF_TABLE 4
109 struct perf_gx_level {
115 struct a6xx_hfi_msg_perf_table_v1 {
120 struct perf_level gx_votes[16];
121 struct perf_level cx_votes[4];
124 struct a6xx_hfi_msg_perf_table {
129 struct perf_gx_level gx_votes[16];
130 struct perf_level cx_votes[4];
133 #define HFI_H2F_MSG_BW_TABLE 3
135 struct a6xx_hfi_msg_bw_table {
140 u32 cnoc_wait_bitmask;
141 u32 ddr_wait_bitmask;
142 u32 cnoc_cmds_addrs[6];
143 u32 cnoc_cmds_data[2][6];
144 u32 ddr_cmds_addrs[8];
145 u32 ddr_cmds_data[16][8];
148 #define HFI_H2F_MSG_TEST 5
150 struct a6xx_hfi_msg_test {
154 #define HFI_H2F_MSG_START 10
156 struct a6xx_hfi_msg_start {
160 #define HFI_H2F_MSG_CORE_FW_START 14
162 struct a6xx_hfi_msg_core_fw_start {
167 #define HFI_H2F_MSG_GX_BW_PERF_VOTE 30
169 struct a6xx_hfi_gx_bw_perf_vote_cmd {
176 #define HFI_H2F_MSG_PREPARE_SLUMBER 33
178 struct a6xx_hfi_prep_slumber_cmd {