1*b843c749SSergey Zigachev /*
2*b843c749SSergey Zigachev  * Copyright 2014 Advanced Micro Devices, Inc.
3*b843c749SSergey Zigachev  *
4*b843c749SSergey Zigachev  * Permission is hereby granted, free of charge, to any person obtaining a
5*b843c749SSergey Zigachev  * copy of this software and associated documentation files (the "Software"),
6*b843c749SSergey Zigachev  * to deal in the Software without restriction, including without limitation
7*b843c749SSergey Zigachev  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*b843c749SSergey Zigachev  * and/or sell copies of the Software, and to permit persons to whom the
9*b843c749SSergey Zigachev  * Software is furnished to do so, subject to the following conditions:
10*b843c749SSergey Zigachev  *
11*b843c749SSergey Zigachev  * The above copyright notice and this permission notice shall be included in
12*b843c749SSergey Zigachev  * all copies or substantial portions of the Software.
13*b843c749SSergey Zigachev  *
14*b843c749SSergey Zigachev  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*b843c749SSergey Zigachev  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*b843c749SSergey Zigachev  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17*b843c749SSergey Zigachev  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*b843c749SSergey Zigachev  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*b843c749SSergey Zigachev  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*b843c749SSergey Zigachev  * OTHER DEALINGS IN THE SOFTWARE.
21*b843c749SSergey Zigachev  *
22*b843c749SSergey Zigachev  */
23*b843c749SSergey Zigachev 
24*b843c749SSergey Zigachev #ifndef SMU_UCODE_XFER_VI_H
25*b843c749SSergey Zigachev #define SMU_UCODE_XFER_VI_H
26*b843c749SSergey Zigachev 
27*b843c749SSergey Zigachev #define SMU_DRAMData_TOC_VERSION  1
28*b843c749SSergey Zigachev #define MAX_IH_REGISTER_COUNT     65535
29*b843c749SSergey Zigachev #define SMU_DIGEST_SIZE_BYTES     20
30*b843c749SSergey Zigachev #define SMU_FB_SIZE_BYTES         1048576
31*b843c749SSergey Zigachev #define SMU_MAX_ENTRIES           12
32*b843c749SSergey Zigachev 
33*b843c749SSergey Zigachev #define UCODE_ID_SMU              0
34*b843c749SSergey Zigachev #define UCODE_ID_SDMA0            1
35*b843c749SSergey Zigachev #define UCODE_ID_SDMA1            2
36*b843c749SSergey Zigachev #define UCODE_ID_CP_CE            3
37*b843c749SSergey Zigachev #define UCODE_ID_CP_PFP           4
38*b843c749SSergey Zigachev #define UCODE_ID_CP_ME            5
39*b843c749SSergey Zigachev #define UCODE_ID_CP_MEC           6
40*b843c749SSergey Zigachev #define UCODE_ID_CP_MEC_JT1       7
41*b843c749SSergey Zigachev #define UCODE_ID_CP_MEC_JT2       8
42*b843c749SSergey Zigachev #define UCODE_ID_GMCON_RENG       9
43*b843c749SSergey Zigachev #define UCODE_ID_RLC_G            10
44*b843c749SSergey Zigachev #define UCODE_ID_IH_REG_RESTORE   11
45*b843c749SSergey Zigachev #define UCODE_ID_VBIOS            12
46*b843c749SSergey Zigachev #define UCODE_ID_MISC_METADATA    13
47*b843c749SSergey Zigachev #define UCODE_ID_SMU_SK		      14
48*b843c749SSergey Zigachev #define UCODE_ID_RLC_SCRATCH      32
49*b843c749SSergey Zigachev #define UCODE_ID_RLC_SRM_ARAM     33
50*b843c749SSergey Zigachev #define UCODE_ID_RLC_SRM_DRAM     34
51*b843c749SSergey Zigachev #define UCODE_ID_MEC_STORAGE      35
52*b843c749SSergey Zigachev #define UCODE_ID_VBIOS_PARAMETERS 36
53*b843c749SSergey Zigachev #define UCODE_META_DATA           0xFF
54*b843c749SSergey Zigachev 
55*b843c749SSergey Zigachev #define UCODE_ID_SMU_MASK             0x00000001
56*b843c749SSergey Zigachev #define UCODE_ID_SDMA0_MASK           0x00000002
57*b843c749SSergey Zigachev #define UCODE_ID_SDMA1_MASK           0x00000004
58*b843c749SSergey Zigachev #define UCODE_ID_CP_CE_MASK           0x00000008
59*b843c749SSergey Zigachev #define UCODE_ID_CP_PFP_MASK          0x00000010
60*b843c749SSergey Zigachev #define UCODE_ID_CP_ME_MASK           0x00000020
61*b843c749SSergey Zigachev #define UCODE_ID_CP_MEC_MASK          0x00000040
62*b843c749SSergey Zigachev #define UCODE_ID_CP_MEC_JT1_MASK      0x00000080
63*b843c749SSergey Zigachev #define UCODE_ID_CP_MEC_JT2_MASK      0x00000100
64*b843c749SSergey Zigachev #define UCODE_ID_GMCON_RENG_MASK      0x00000200
65*b843c749SSergey Zigachev #define UCODE_ID_RLC_G_MASK           0x00000400
66*b843c749SSergey Zigachev #define UCODE_ID_IH_REG_RESTORE_MASK  0x00000800
67*b843c749SSergey Zigachev #define UCODE_ID_VBIOS_MASK           0x00001000
68*b843c749SSergey Zigachev 
69*b843c749SSergey Zigachev #define UCODE_FLAG_UNHALT_MASK   0x1
70*b843c749SSergey Zigachev 
71*b843c749SSergey Zigachev struct SMU_Entry {
72*b843c749SSergey Zigachev #ifndef __BIG_ENDIAN
73*b843c749SSergey Zigachev 	uint16_t id;
74*b843c749SSergey Zigachev 	uint16_t version;
75*b843c749SSergey Zigachev 	uint32_t image_addr_high;
76*b843c749SSergey Zigachev 	uint32_t image_addr_low;
77*b843c749SSergey Zigachev 	uint32_t meta_data_addr_high;
78*b843c749SSergey Zigachev 	uint32_t meta_data_addr_low;
79*b843c749SSergey Zigachev 	uint32_t data_size_byte;
80*b843c749SSergey Zigachev 	uint16_t flags;
81*b843c749SSergey Zigachev 	uint16_t num_register_entries;
82*b843c749SSergey Zigachev #else
83*b843c749SSergey Zigachev 	uint16_t version;
84*b843c749SSergey Zigachev 	uint16_t id;
85*b843c749SSergey Zigachev 	uint32_t image_addr_high;
86*b843c749SSergey Zigachev 	uint32_t image_addr_low;
87*b843c749SSergey Zigachev 	uint32_t meta_data_addr_high;
88*b843c749SSergey Zigachev 	uint32_t meta_data_addr_low;
89*b843c749SSergey Zigachev 	uint32_t data_size_byte;
90*b843c749SSergey Zigachev 	uint16_t num_register_entries;
91*b843c749SSergey Zigachev 	uint16_t flags;
92*b843c749SSergey Zigachev #endif
93*b843c749SSergey Zigachev };
94*b843c749SSergey Zigachev 
95*b843c749SSergey Zigachev struct SMU_DRAMData_TOC {
96*b843c749SSergey Zigachev 	uint32_t structure_version;
97*b843c749SSergey Zigachev 	uint32_t num_entries;
98*b843c749SSergey Zigachev 	struct SMU_Entry entry[SMU_MAX_ENTRIES];
99*b843c749SSergey Zigachev };
100*b843c749SSergey Zigachev 
101*b843c749SSergey Zigachev #endif
102