1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
3 * Copyright 2014-2022 Advanced Micro Devices, Inc.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
25 #ifndef KFD_PM4_HEADERS_H_
26 #define KFD_PM4_HEADERS_H_
28 #ifndef PM4_MES_HEADER_DEFINED
29 #define PM4_MES_HEADER_DEFINED
30 union PM4_MES_TYPE_3_HEADER {
36 /* number of DWORDs - 1 in the information body */
38 /* packet identifier. It should be 3 for type 3 packets */
43 #endif /* PM4_MES_HEADER_DEFINED */
46 /*--------------------MES_MAP_PROCESS-------------------- */
48 #ifndef PM4_MES_MAP_PROCESS_DEFINED
49 #define PM4_MES_MAP_PROCESS_DEFINED
51 struct pm4_map_process {
53 union PM4_MES_TYPE_3_HEADER header; /* header */
61 uint32_t diq_enable:1;
62 uint32_t process_quantum:7;
69 uint32_t page_table_base:28;
75 uint32_t sh_mem_bases;
76 uint32_t sh_mem_ape1_base;
77 uint32_t sh_mem_ape1_limit;
78 uint32_t sh_mem_config;
89 uint32_t num_queues:10;
97 #ifndef PM4_MES_MAP_PROCESS_DEFINED_KV_SCRATCH
98 #define PM4_MES_MAP_PROCESS_DEFINED_KV_SCRATCH
100 struct pm4_map_process_scratch_kv {
102 union PM4_MES_TYPE_3_HEADER header; /* header */
109 uint32_t reserved1:8;
110 uint32_t diq_enable:1;
111 uint32_t process_quantum:7;
118 uint32_t page_table_base:28;
119 uint32_t reserved2:4;
125 uint32_t sh_mem_bases;
126 uint32_t sh_mem_config;
127 uint32_t sh_mem_ape1_base;
128 uint32_t sh_mem_ape1_limit;
129 uint32_t sh_hidden_private_base_vmid;
132 uint32_t gds_addr_lo;
133 uint32_t gds_addr_hi;
138 uint32_t reserved6:2;
140 uint32_t reserved7:4;
142 uint32_t num_queues:10;
147 uint32_t completion_signal_lo32;
148 uint32_t completion_signal_hi32;
153 CACHE_FLUSH_AND_INV_TS_EVENT = 0x00000014
156 #endif /* KFD_PM4_HEADERS_H_ */