1*3569b6d1SMonk Liu /*
2*3569b6d1SMonk Liu * Copyright 2019 Advanced Micro Devices, Inc.
3*3569b6d1SMonk Liu *
4*3569b6d1SMonk Liu * Permission is hereby granted, free of charge, to any person obtaining a
5*3569b6d1SMonk Liu * copy of this software and associated documentation files (the "Software"),
6*3569b6d1SMonk Liu * to deal in the Software without restriction, including without limitation
7*3569b6d1SMonk Liu * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*3569b6d1SMonk Liu * and/or sell copies of the Software, and to permit persons to whom the
9*3569b6d1SMonk Liu * Software is furnished to do so, subject to the following conditions:
10*3569b6d1SMonk Liu *
11*3569b6d1SMonk Liu * The above copyright notice and this permission notice shall be included in
12*3569b6d1SMonk Liu * all copies or substantial portions of the Software.
13*3569b6d1SMonk Liu *
14*3569b6d1SMonk Liu * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*3569b6d1SMonk Liu * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*3569b6d1SMonk Liu * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17*3569b6d1SMonk Liu * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*3569b6d1SMonk Liu * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*3569b6d1SMonk Liu * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*3569b6d1SMonk Liu * OTHER DEALINGS IN THE SOFTWARE.
21*3569b6d1SMonk Liu *
22*3569b6d1SMonk Liu */
23*3569b6d1SMonk Liu
24*3569b6d1SMonk Liu #ifndef __MMSCH_V2_0_H__
25*3569b6d1SMonk Liu #define __MMSCH_V2_0_H__
26*3569b6d1SMonk Liu
27*3569b6d1SMonk Liu // addressBlock: uvd0_mmsch_dec
28*3569b6d1SMonk Liu // base address: 0x1e000
29*3569b6d1SMonk Liu #define mmMMSCH_UCODE_ADDR 0x0000
30*3569b6d1SMonk Liu #define mmMMSCH_UCODE_ADDR_BASE_IDX 0
31*3569b6d1SMonk Liu #define mmMMSCH_UCODE_DATA 0x0001
32*3569b6d1SMonk Liu #define mmMMSCH_UCODE_DATA_BASE_IDX 0
33*3569b6d1SMonk Liu #define mmMMSCH_SRAM_ADDR 0x0002
34*3569b6d1SMonk Liu #define mmMMSCH_SRAM_ADDR_BASE_IDX 0
35*3569b6d1SMonk Liu #define mmMMSCH_SRAM_DATA 0x0003
36*3569b6d1SMonk Liu #define mmMMSCH_SRAM_DATA_BASE_IDX 0
37*3569b6d1SMonk Liu #define mmMMSCH_VF_SRAM_OFFSET 0x0004
38*3569b6d1SMonk Liu #define mmMMSCH_VF_SRAM_OFFSET_BASE_IDX 0
39*3569b6d1SMonk Liu #define mmMMSCH_DB_SRAM_OFFSET 0x0005
40*3569b6d1SMonk Liu #define mmMMSCH_DB_SRAM_OFFSET_BASE_IDX 0
41*3569b6d1SMonk Liu #define mmMMSCH_CTX_SRAM_OFFSET 0x0006
42*3569b6d1SMonk Liu #define mmMMSCH_CTX_SRAM_OFFSET_BASE_IDX 0
43*3569b6d1SMonk Liu #define mmMMSCH_CTL 0x0007
44*3569b6d1SMonk Liu #define mmMMSCH_CTL_BASE_IDX 0
45*3569b6d1SMonk Liu #define mmMMSCH_INTR 0x0008
46*3569b6d1SMonk Liu #define mmMMSCH_INTR_BASE_IDX 0
47*3569b6d1SMonk Liu #define mmMMSCH_INTR_ACK 0x0009
48*3569b6d1SMonk Liu #define mmMMSCH_INTR_ACK_BASE_IDX 0
49*3569b6d1SMonk Liu #define mmMMSCH_INTR_STATUS 0x000a
50*3569b6d1SMonk Liu #define mmMMSCH_INTR_STATUS_BASE_IDX 0
51*3569b6d1SMonk Liu #define mmMMSCH_VF_VMID 0x000b
52*3569b6d1SMonk Liu #define mmMMSCH_VF_VMID_BASE_IDX 0
53*3569b6d1SMonk Liu #define mmMMSCH_VF_CTX_ADDR_LO 0x000c
54*3569b6d1SMonk Liu #define mmMMSCH_VF_CTX_ADDR_LO_BASE_IDX 0
55*3569b6d1SMonk Liu #define mmMMSCH_VF_CTX_ADDR_HI 0x000d
56*3569b6d1SMonk Liu #define mmMMSCH_VF_CTX_ADDR_HI_BASE_IDX 0
57*3569b6d1SMonk Liu #define mmMMSCH_VF_CTX_SIZE 0x000e
58*3569b6d1SMonk Liu #define mmMMSCH_VF_CTX_SIZE_BASE_IDX 0
59*3569b6d1SMonk Liu #define mmMMSCH_VF_GPCOM_ADDR_LO 0x000f
60*3569b6d1SMonk Liu #define mmMMSCH_VF_GPCOM_ADDR_LO_BASE_IDX 0
61*3569b6d1SMonk Liu #define mmMMSCH_VF_GPCOM_ADDR_HI 0x0010
62*3569b6d1SMonk Liu #define mmMMSCH_VF_GPCOM_ADDR_HI_BASE_IDX 0
63*3569b6d1SMonk Liu #define mmMMSCH_VF_GPCOM_SIZE 0x0011
64*3569b6d1SMonk Liu #define mmMMSCH_VF_GPCOM_SIZE_BASE_IDX 0
65*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_HOST 0x0012
66*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_HOST_BASE_IDX 0
67*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_RESP 0x0013
68*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_RESP_BASE_IDX 0
69*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_0 0x0014
70*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_0_BASE_IDX 0
71*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_0_RESP 0x0015
72*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_0_RESP_BASE_IDX 0
73*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_1 0x0016
74*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_1_BASE_IDX 0
75*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_1_RESP 0x0017
76*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX_1_RESP_BASE_IDX 0
77*3569b6d1SMonk Liu #define mmMMSCH_CNTL 0x001c
78*3569b6d1SMonk Liu #define mmMMSCH_CNTL_BASE_IDX 0
79*3569b6d1SMonk Liu #define mmMMSCH_NONCACHE_OFFSET0 0x001d
80*3569b6d1SMonk Liu #define mmMMSCH_NONCACHE_OFFSET0_BASE_IDX 0
81*3569b6d1SMonk Liu #define mmMMSCH_NONCACHE_SIZE0 0x001e
82*3569b6d1SMonk Liu #define mmMMSCH_NONCACHE_SIZE0_BASE_IDX 0
83*3569b6d1SMonk Liu #define mmMMSCH_NONCACHE_OFFSET1 0x001f
84*3569b6d1SMonk Liu #define mmMMSCH_NONCACHE_OFFSET1_BASE_IDX 0
85*3569b6d1SMonk Liu #define mmMMSCH_NONCACHE_SIZE1 0x0020
86*3569b6d1SMonk Liu #define mmMMSCH_NONCACHE_SIZE1_BASE_IDX 0
87*3569b6d1SMonk Liu #define mmMMSCH_PDEBUG_STATUS 0x0021
88*3569b6d1SMonk Liu #define mmMMSCH_PDEBUG_STATUS_BASE_IDX 0
89*3569b6d1SMonk Liu #define mmMMSCH_PDEBUG_DATA_32UPPERBITS 0x0022
90*3569b6d1SMonk Liu #define mmMMSCH_PDEBUG_DATA_32UPPERBITS_BASE_IDX 0
91*3569b6d1SMonk Liu #define mmMMSCH_PDEBUG_DATA_32LOWERBITS 0x0023
92*3569b6d1SMonk Liu #define mmMMSCH_PDEBUG_DATA_32LOWERBITS_BASE_IDX 0
93*3569b6d1SMonk Liu #define mmMMSCH_PDEBUG_EPC 0x0024
94*3569b6d1SMonk Liu #define mmMMSCH_PDEBUG_EPC_BASE_IDX 0
95*3569b6d1SMonk Liu #define mmMMSCH_PDEBUG_EXCCAUSE 0x0025
96*3569b6d1SMonk Liu #define mmMMSCH_PDEBUG_EXCCAUSE_BASE_IDX 0
97*3569b6d1SMonk Liu #define mmMMSCH_PROC_STATE1 0x0026
98*3569b6d1SMonk Liu #define mmMMSCH_PROC_STATE1_BASE_IDX 0
99*3569b6d1SMonk Liu #define mmMMSCH_LAST_MC_ADDR 0x0027
100*3569b6d1SMonk Liu #define mmMMSCH_LAST_MC_ADDR_BASE_IDX 0
101*3569b6d1SMonk Liu #define mmMMSCH_LAST_MEM_ACCESS_HI 0x0028
102*3569b6d1SMonk Liu #define mmMMSCH_LAST_MEM_ACCESS_HI_BASE_IDX 0
103*3569b6d1SMonk Liu #define mmMMSCH_LAST_MEM_ACCESS_LO 0x0029
104*3569b6d1SMonk Liu #define mmMMSCH_LAST_MEM_ACCESS_LO_BASE_IDX 0
105*3569b6d1SMonk Liu #define mmMMSCH_IOV_ACTIVE_FCN_ID 0x002a
106*3569b6d1SMonk Liu #define mmMMSCH_IOV_ACTIVE_FCN_ID_BASE_IDX 0
107*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_0 0x002b
108*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_0_BASE_IDX 0
109*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_1 0x002c
110*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_1_BASE_IDX 0
111*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_0 0x002d
112*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_0_BASE_IDX 0
113*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_CONTROL_0 0x002e
114*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_CONTROL_0_BASE_IDX 0
115*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_0 0x002f
116*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_0_BASE_IDX 0
117*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_VM_BUSY_STATUS_0 0x0030
118*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_VM_BUSY_STATUS_0_BASE_IDX 0
119*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCNS_0 0x0031
120*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCNS_0_BASE_IDX 0
121*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_0 0x0032
122*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_0_BASE_IDX 0
123*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW6_0 0x0033
124*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW6_0_BASE_IDX 0
125*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW7_0 0x0034
126*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW7_0_BASE_IDX 0
127*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW8_0 0x0035
128*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW8_0_BASE_IDX 0
129*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_1 0x0036
130*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_1_BASE_IDX 0
131*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_CONTROL_1 0x0037
132*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_CONTROL_1_BASE_IDX 0
133*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_1 0x0038
134*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_1_BASE_IDX 0
135*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_VM_BUSY_STATUS_1 0x0039
136*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_VM_BUSY_STATUS_1_BASE_IDX 0
137*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCNS_1 0x003a
138*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCNS_1_BASE_IDX 0
139*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_1 0x003b
140*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_1_BASE_IDX 0
141*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW6_1 0x003c
142*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW6_1_BASE_IDX 0
143*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW7_1 0x003d
144*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW7_1_BASE_IDX 0
145*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW8_1 0x003e
146*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW8_1_BASE_IDX 0
147*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CNTXT 0x003f
148*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CNTXT_BASE_IDX 0
149*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_2 0x0040
150*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_2_BASE_IDX 0
151*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_3 0x0041
152*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_3_BASE_IDX 0
153*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_4 0x0042
154*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_4_BASE_IDX 0
155*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_5 0x0043
156*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_5_BASE_IDX 0
157*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_6 0x0044
158*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_6_BASE_IDX 0
159*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_7 0x0045
160*3569b6d1SMonk Liu #define mmMMSCH_SCRATCH_7_BASE_IDX 0
161*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_HEAD_0 0x0046
162*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_HEAD_0_BASE_IDX 0
163*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_TAIL_0 0x0047
164*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_TAIL_0_BASE_IDX 0
165*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_HEAD_1 0x0048
166*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_HEAD_1_BASE_IDX 0
167*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_TAIL_1 0x0049
168*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_TAIL_1_BASE_IDX 0
169*3569b6d1SMonk Liu #define mmMMSCH_NACK_STATUS 0x004a
170*3569b6d1SMonk Liu #define mmMMSCH_NACK_STATUS_BASE_IDX 0
171*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX0_DATA 0x004b
172*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX0_DATA_BASE_IDX 0
173*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX1_DATA 0x004c
174*3569b6d1SMonk Liu #define mmMMSCH_VF_MAILBOX1_DATA_BASE_IDX 0
175*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_IP_0 0x004d
176*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_IP_0_BASE_IDX 0
177*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_IP_0 0x004e
178*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_IP_0_BASE_IDX 0
179*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_IP_0 0x004f
180*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_IP_0_BASE_IDX 0
181*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_IP_1 0x0050
182*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_IP_1_BASE_IDX 0
183*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_IP_1 0x0051
184*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_IP_1_BASE_IDX 0
185*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_IP_1 0x0052
186*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_IP_1_BASE_IDX 0
187*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CNTXT_IP 0x0053
188*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CNTXT_IP_BASE_IDX 0
189*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_2 0x0054
190*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_2_BASE_IDX 0
191*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_CONTROL_2 0x0055
192*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_CONTROL_2_BASE_IDX 0
193*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_2 0x0056
194*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_2_BASE_IDX 0
195*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_VM_BUSY_STATUS_2 0x0057
196*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_VM_BUSY_STATUS_2_BASE_IDX 0
197*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCNS_2 0x0058
198*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCNS_2_BASE_IDX 0
199*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_2 0x0059
200*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_2_BASE_IDX 0
201*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW6_2 0x005a
202*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW6_2_BASE_IDX 0
203*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW7_2 0x005b
204*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW7_2_BASE_IDX 0
205*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW8_2 0x005c
206*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_DW8_2_BASE_IDX 0
207*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_IP_2 0x005d
208*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_SCH_BLOCK_IP_2_BASE_IDX 0
209*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_IP_2 0x005e
210*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_CMD_STATUS_IP_2_BASE_IDX 0
211*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_IP_2 0x005f
212*3569b6d1SMonk Liu #define mmMMSCH_GPUIOV_ACTIVE_FCN_ID_IP_2_BASE_IDX 0
213*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_HEAD_2 0x0060
214*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_HEAD_2_BASE_IDX 0
215*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_TAIL_2 0x0061
216*3569b6d1SMonk Liu #define mmMMSCH_VFID_FIFO_TAIL_2_BASE_IDX 0
217*3569b6d1SMonk Liu #define mmMMSCH_VM_BUSY_STATUS_0 0x0062
218*3569b6d1SMonk Liu #define mmMMSCH_VM_BUSY_STATUS_0_BASE_IDX 0
219*3569b6d1SMonk Liu #define mmMMSCH_VM_BUSY_STATUS_1 0x0063
220*3569b6d1SMonk Liu #define mmMMSCH_VM_BUSY_STATUS_1_BASE_IDX 0
221*3569b6d1SMonk Liu #define mmMMSCH_VM_BUSY_STATUS_2 0x0064
222*3569b6d1SMonk Liu #define mmMMSCH_VM_BUSY_STATUS_2_BASE_IDX 0
223*3569b6d1SMonk Liu
224*3569b6d1SMonk Liu #define MMSCH_VERSION_MAJOR 2
225*3569b6d1SMonk Liu #define MMSCH_VERSION_MINOR 0
226*3569b6d1SMonk Liu #define MMSCH_VERSION (MMSCH_VERSION_MAJOR << 16 | MMSCH_VERSION_MINOR)
227*3569b6d1SMonk Liu
228*3569b6d1SMonk Liu enum mmsch_v2_0_command_type {
229*3569b6d1SMonk Liu MMSCH_COMMAND__DIRECT_REG_WRITE = 0,
230*3569b6d1SMonk Liu MMSCH_COMMAND__DIRECT_REG_POLLING = 2,
231*3569b6d1SMonk Liu MMSCH_COMMAND__DIRECT_REG_READ_MODIFY_WRITE = 3,
232*3569b6d1SMonk Liu MMSCH_COMMAND__INDIRECT_REG_WRITE = 8,
233*3569b6d1SMonk Liu MMSCH_COMMAND__END = 0xf
234*3569b6d1SMonk Liu };
235*3569b6d1SMonk Liu
236*3569b6d1SMonk Liu struct mmsch_v2_0_init_header {
237*3569b6d1SMonk Liu uint32_t version;
238*3569b6d1SMonk Liu uint32_t header_size;
239*3569b6d1SMonk Liu uint32_t vcn_init_status;
240*3569b6d1SMonk Liu uint32_t vcn_table_offset;
241*3569b6d1SMonk Liu uint32_t vcn_table_size;
242*3569b6d1SMonk Liu };
243*3569b6d1SMonk Liu
244*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_direct_reg_header {
245*3569b6d1SMonk Liu uint32_t reg_offset : 28;
246*3569b6d1SMonk Liu uint32_t command_type : 4;
247*3569b6d1SMonk Liu };
248*3569b6d1SMonk Liu
249*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_indirect_reg_header {
250*3569b6d1SMonk Liu uint32_t reg_offset : 20;
251*3569b6d1SMonk Liu uint32_t reg_idx_space : 8;
252*3569b6d1SMonk Liu uint32_t command_type : 4;
253*3569b6d1SMonk Liu };
254*3569b6d1SMonk Liu
255*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_direct_write {
256*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_direct_reg_header cmd_header;
257*3569b6d1SMonk Liu uint32_t reg_value;
258*3569b6d1SMonk Liu };
259*3569b6d1SMonk Liu
260*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_direct_read_modify_write {
261*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_direct_reg_header cmd_header;
262*3569b6d1SMonk Liu uint32_t write_data;
263*3569b6d1SMonk Liu uint32_t mask_value;
264*3569b6d1SMonk Liu };
265*3569b6d1SMonk Liu
266*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_direct_polling {
267*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_direct_reg_header cmd_header;
268*3569b6d1SMonk Liu uint32_t mask_value;
269*3569b6d1SMonk Liu uint32_t wait_value;
270*3569b6d1SMonk Liu };
271*3569b6d1SMonk Liu
272*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_end {
273*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_direct_reg_header cmd_header;
274*3569b6d1SMonk Liu };
275*3569b6d1SMonk Liu
276*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_indirect_write {
277*3569b6d1SMonk Liu struct mmsch_v2_0_cmd_indirect_reg_header cmd_header;
278*3569b6d1SMonk Liu uint32_t reg_value;
279*3569b6d1SMonk Liu };
280*3569b6d1SMonk Liu
mmsch_v2_0_insert_direct_wt(struct mmsch_v2_0_cmd_direct_write * direct_wt,uint32_t * init_table,uint32_t reg_offset,uint32_t value)281*3569b6d1SMonk Liu static inline void mmsch_v2_0_insert_direct_wt(struct mmsch_v2_0_cmd_direct_write *direct_wt,
282*3569b6d1SMonk Liu uint32_t *init_table,
283*3569b6d1SMonk Liu uint32_t reg_offset,
284*3569b6d1SMonk Liu uint32_t value)
285*3569b6d1SMonk Liu {
286*3569b6d1SMonk Liu direct_wt->cmd_header.reg_offset = reg_offset;
287*3569b6d1SMonk Liu direct_wt->reg_value = value;
288*3569b6d1SMonk Liu memcpy((void *)init_table, direct_wt, sizeof(struct mmsch_v2_0_cmd_direct_write));
289*3569b6d1SMonk Liu }
290*3569b6d1SMonk Liu
mmsch_v2_0_insert_direct_rd_mod_wt(struct mmsch_v2_0_cmd_direct_read_modify_write * direct_rd_mod_wt,uint32_t * init_table,uint32_t reg_offset,uint32_t mask,uint32_t data)291*3569b6d1SMonk Liu static inline void mmsch_v2_0_insert_direct_rd_mod_wt(struct mmsch_v2_0_cmd_direct_read_modify_write *direct_rd_mod_wt,
292*3569b6d1SMonk Liu uint32_t *init_table,
293*3569b6d1SMonk Liu uint32_t reg_offset,
294*3569b6d1SMonk Liu uint32_t mask, uint32_t data)
295*3569b6d1SMonk Liu {
296*3569b6d1SMonk Liu direct_rd_mod_wt->cmd_header.reg_offset = reg_offset;
297*3569b6d1SMonk Liu direct_rd_mod_wt->mask_value = mask;
298*3569b6d1SMonk Liu direct_rd_mod_wt->write_data = data;
299*3569b6d1SMonk Liu memcpy((void *)init_table, direct_rd_mod_wt,
300*3569b6d1SMonk Liu sizeof(struct mmsch_v2_0_cmd_direct_read_modify_write));
301*3569b6d1SMonk Liu }
302*3569b6d1SMonk Liu
mmsch_v2_0_insert_direct_poll(struct mmsch_v2_0_cmd_direct_polling * direct_poll,uint32_t * init_table,uint32_t reg_offset,uint32_t mask,uint32_t wait)303*3569b6d1SMonk Liu static inline void mmsch_v2_0_insert_direct_poll(struct mmsch_v2_0_cmd_direct_polling *direct_poll,
304*3569b6d1SMonk Liu uint32_t *init_table,
305*3569b6d1SMonk Liu uint32_t reg_offset,
306*3569b6d1SMonk Liu uint32_t mask, uint32_t wait)
307*3569b6d1SMonk Liu {
308*3569b6d1SMonk Liu direct_poll->cmd_header.reg_offset = reg_offset;
309*3569b6d1SMonk Liu direct_poll->mask_value = mask;
310*3569b6d1SMonk Liu direct_poll->wait_value = wait;
311*3569b6d1SMonk Liu memcpy((void *)init_table, direct_poll, sizeof(struct mmsch_v2_0_cmd_direct_polling));
312*3569b6d1SMonk Liu }
313*3569b6d1SMonk Liu
314*3569b6d1SMonk Liu #define MMSCH_V2_0_INSERT_DIRECT_RD_MOD_WT(reg, mask, data) { \
315*3569b6d1SMonk Liu mmsch_v2_0_insert_direct_rd_mod_wt(&direct_rd_mod_wt, \
316*3569b6d1SMonk Liu init_table, (reg), \
317*3569b6d1SMonk Liu (mask), (data)); \
318*3569b6d1SMonk Liu init_table += sizeof(struct mmsch_v2_0_cmd_direct_read_modify_write)/4; \
319*3569b6d1SMonk Liu table_size += sizeof(struct mmsch_v2_0_cmd_direct_read_modify_write)/4; \
320*3569b6d1SMonk Liu }
321*3569b6d1SMonk Liu
322*3569b6d1SMonk Liu #define MMSCH_V2_0_INSERT_DIRECT_WT(reg, value) { \
323*3569b6d1SMonk Liu mmsch_v2_0_insert_direct_wt(&direct_wt, \
324*3569b6d1SMonk Liu init_table, (reg), \
325*3569b6d1SMonk Liu (value)); \
326*3569b6d1SMonk Liu init_table += sizeof(struct mmsch_v2_0_cmd_direct_write)/4; \
327*3569b6d1SMonk Liu table_size += sizeof(struct mmsch_v2_0_cmd_direct_write)/4; \
328*3569b6d1SMonk Liu }
329*3569b6d1SMonk Liu
330*3569b6d1SMonk Liu #define MMSCH_V2_0_INSERT_DIRECT_POLL(reg, mask, wait) { \
331*3569b6d1SMonk Liu mmsch_v2_0_insert_direct_poll(&direct_poll, \
332*3569b6d1SMonk Liu init_table, (reg), \
333*3569b6d1SMonk Liu (mask), (wait)); \
334*3569b6d1SMonk Liu init_table += sizeof(struct mmsch_v2_0_cmd_direct_polling)/4; \
335*3569b6d1SMonk Liu table_size += sizeof(struct mmsch_v2_0_cmd_direct_polling)/4; \
336*3569b6d1SMonk Liu }
337*3569b6d1SMonk Liu
338*3569b6d1SMonk Liu #endif
339