1ca750681SFelix Kuehling /*
2ca750681SFelix Kuehling  * Copyright 2016-2018 Advanced Micro Devices, Inc.
3ca750681SFelix Kuehling  *
4ca750681SFelix Kuehling  * Permission is hereby granted, free of charge, to any person obtaining a
5ca750681SFelix Kuehling  * copy of this software and associated documentation files (the "Software"),
6ca750681SFelix Kuehling  * to deal in the Software without restriction, including without limitation
7ca750681SFelix Kuehling  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8ca750681SFelix Kuehling  * and/or sell copies of the Software, and to permit persons to whom the
9ca750681SFelix Kuehling  * Software is furnished to do so, subject to the following conditions:
10ca750681SFelix Kuehling  *
11ca750681SFelix Kuehling  * The above copyright notice and this permission notice shall be included in
12ca750681SFelix Kuehling  * all copies or substantial portions of the Software.
13ca750681SFelix Kuehling  *
14ca750681SFelix Kuehling  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15ca750681SFelix Kuehling  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16ca750681SFelix Kuehling  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17ca750681SFelix Kuehling  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18ca750681SFelix Kuehling  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19ca750681SFelix Kuehling  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20ca750681SFelix Kuehling  * OTHER DEALINGS IN THE SOFTWARE.
21ca750681SFelix Kuehling  */
22ca750681SFelix Kuehling 
23ca750681SFelix Kuehling #ifndef HSA_SOC15_INT_H_INCLUDED
24ca750681SFelix Kuehling #define HSA_SOC15_INT_H_INCLUDED
25ca750681SFelix Kuehling 
26ca750681SFelix Kuehling #include "soc15_ih_clientid.h"
27ca750681SFelix Kuehling 
28ca750681SFelix Kuehling #define SOC15_INTSRC_CP_END_OF_PIPE	181
29ca750681SFelix Kuehling #define SOC15_INTSRC_CP_BAD_OPCODE	183
30ca750681SFelix Kuehling #define SOC15_INTSRC_SQ_INTERRUPT_MSG	239
31ca750681SFelix Kuehling #define SOC15_INTSRC_VMC_FAULT		0
32ca750681SFelix Kuehling #define SOC15_INTSRC_SDMA_TRAP		224
334a1d4b6dSHawking Zhang #define SOC15_INTSRC_SDMA_ECC		220
34cc009e61SMukul Joshi #define SOC21_INTSRC_SDMA_TRAP		49
35cc009e61SMukul Joshi #define SOC21_INTSRC_SDMA_ECC		62
36ca750681SFelix Kuehling 
37ca750681SFelix Kuehling #define SOC15_CLIENT_ID_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[0]) & 0xff)
38ca750681SFelix Kuehling #define SOC15_SOURCE_ID_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[0]) >> 8 & 0xff)
39ca750681SFelix Kuehling #define SOC15_RING_ID_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[0]) >> 16 & 0xff)
40ca750681SFelix Kuehling #define SOC15_VMID_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[0]) >> 24 & 0xf)
41ca750681SFelix Kuehling #define SOC15_VMID_TYPE_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[0]) >> 31 & 0x1)
42ca750681SFelix Kuehling #define SOC15_PASID_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[3]) & 0xffff)
43*d4300362SMukul Joshi #define SOC15_NODEID_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[3]) >> 16 & 0xff)
44ca750681SFelix Kuehling #define SOC15_CONTEXT_ID0_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[4]))
45ca750681SFelix Kuehling #define SOC15_CONTEXT_ID1_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[5]))
46ca750681SFelix Kuehling #define SOC15_CONTEXT_ID2_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[6]))
47ca750681SFelix Kuehling #define SOC15_CONTEXT_ID3_FROM_IH_ENTRY(entry) (le32_to_cpu(entry[7]))
48ca750681SFelix Kuehling 
49ca750681SFelix Kuehling #endif
50ca750681SFelix Kuehling 
51