dev-amdgpu: Add PM4PP, VMID, Linux definitions

The PM4 packet processor is handling all non-HSA GPU packets such
as packets for (un)mapping HSA queues. This commit pulls many
Linux structs and defines out into their own files for clarity.
Finally, it implements the VMID related functions in AMDGPU device.

Change-Id: I5f0057209305404df58aff2c4cd07762d1a31690
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53068
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Matthew Poremba
2021-09-21 14:20:33 -05:00
parent e67e02d657
commit 1be246bbe3
16 changed files with 2523 additions and 98 deletions

View File

@@ -48,11 +48,27 @@
namespace gem5
{
/*
/**
* Defines from driver code. Taken from
* https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver/blob/rocm-4.2.0/
* drivers/gpu/drm/amd/include/soc15_ih_clientid.h
*/
enum soc15_ih_clientid
{
SOC15_IH_CLIENTID_RLC = 0x07,
SOC15_IH_CLIENTID_SDMA0 = 0x08,
SOC15_IH_CLIENTID_SDMA1 = 0x09
};
enum ihSourceId
{
TRAP_ID = 224
};
/**
* MSI-style interrupts. Send a "cookie" response to clear interrupts.
* From [1] we know the size of the struct is 8 dwords. Then we can look at
* the register shift offsets in [2] to guess the rest. Or we can also look
* at [3].
* From [1] we know the size of the struct is 8 dwords. Then we can look at the register shift offsets in [2] to guess the rest.
* Or we can also look at [3].
*
* [1] https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver/blob/roc-4.3.x/
* drivers/gpu/drm/amd/amdkfd/kfd_device.c#L316
@@ -83,6 +99,9 @@ typedef struct
uint32_t source_data_dw4;
} AMDGPUInterruptCookie;
/**
* Struct to contain all interrupt handler related registers.
*/
typedef struct
{
uint32_t IH_Cntl;