Path: blob/master/drivers/gpu/drm/amd/amdkfd/kfd_pm4_headers.h
26516 views
/* SPDX-License-Identifier: GPL-2.0 OR MIT */1/*2* Copyright 2014-2022 Advanced Micro Devices, Inc.3*4* Permission is hereby granted, free of charge, to any person obtaining a5* copy of this software and associated documentation files (the "Software"),6* to deal in the Software without restriction, including without limitation7* the rights to use, copy, modify, merge, publish, distribute, sublicense,8* and/or sell copies of the Software, and to permit persons to whom the9* Software is furnished to do so, subject to the following conditions:10*11* The above copyright notice and this permission notice shall be included in12* all copies or substantial portions of the Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR18* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,19* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR20* OTHER DEALINGS IN THE SOFTWARE.21*22*/2324#ifndef KFD_PM4_HEADERS_H_25#define KFD_PM4_HEADERS_H_2627#ifndef PM4_MES_HEADER_DEFINED28#define PM4_MES_HEADER_DEFINED29union PM4_MES_TYPE_3_HEADER {30struct {31/* reserved */32uint32_t reserved1:8;33/* IT opcode */34uint32_t opcode:8;35/* number of DWORDs - 1 in the information body */36uint32_t count:14;37/* packet identifier. It should be 3 for type 3 packets */38uint32_t type:2;39};40uint32_t u32all;41};42#endif /* PM4_MES_HEADER_DEFINED */434445/*--------------------MES_MAP_PROCESS-------------------- */4647#ifndef PM4_MES_MAP_PROCESS_DEFINED48#define PM4_MES_MAP_PROCESS_DEFINED4950struct pm4_map_process {51union {52union PM4_MES_TYPE_3_HEADER header; /* header */53uint32_t ordinal1;54};5556union {57struct {58uint32_t pasid:16;59uint32_t reserved1:8;60uint32_t diq_enable:1;61uint32_t process_quantum:7;62} bitfields2;63uint32_t ordinal2;64};6566union {67struct {68uint32_t page_table_base:28;69uint32_t reserved3:4;70} bitfields3;71uint32_t ordinal3;72};7374uint32_t sh_mem_bases;75uint32_t sh_mem_ape1_base;76uint32_t sh_mem_ape1_limit;77uint32_t sh_mem_config;78uint32_t gds_addr_lo;79uint32_t gds_addr_hi;8081union {82struct {83uint32_t num_gws:6;84uint32_t reserved4:2;85uint32_t num_oac:4;86uint32_t reserved5:4;87uint32_t gds_size:6;88uint32_t num_queues:10;89} bitfields10;90uint32_t ordinal10;91};9293};94#endif9596#ifndef PM4_MES_MAP_PROCESS_DEFINED_KV_SCRATCH97#define PM4_MES_MAP_PROCESS_DEFINED_KV_SCRATCH9899struct pm4_map_process_scratch_kv {100union {101union PM4_MES_TYPE_3_HEADER header; /* header */102uint32_t ordinal1;103};104105union {106struct {107uint32_t pasid:16;108uint32_t reserved1:8;109uint32_t diq_enable:1;110uint32_t process_quantum:7;111} bitfields2;112uint32_t ordinal2;113};114115union {116struct {117uint32_t page_table_base:28;118uint32_t reserved2:4;119} bitfields3;120uint32_t ordinal3;121};122123uint32_t reserved3;124uint32_t sh_mem_bases;125uint32_t sh_mem_config;126uint32_t sh_mem_ape1_base;127uint32_t sh_mem_ape1_limit;128uint32_t sh_hidden_private_base_vmid;129uint32_t reserved4;130uint32_t reserved5;131uint32_t gds_addr_lo;132uint32_t gds_addr_hi;133134union {135struct {136uint32_t num_gws:6;137uint32_t reserved6:2;138uint32_t num_oac:4;139uint32_t reserved7:4;140uint32_t gds_size:6;141uint32_t num_queues:10;142} bitfields14;143uint32_t ordinal14;144};145146uint32_t completion_signal_lo32;147uint32_t completion_signal_hi32;148};149#endif150151enum {152CACHE_FLUSH_AND_INV_TS_EVENT = 0x00000014153};154155#endif /* KFD_PM4_HEADERS_H_ */156157158