Commit 5c606836 authored by Lijo Lazar's avatar Lijo Lazar Committed by Alex Deucher

drm/amdgpu: Use SDMA instance table for aqua vanjaram

For aqua vanjaram, add mapping for logical to physical
instances.

v2:
	Register accesses on bare metal should be based on physical
instance. Use GET_INST() to get physical instance.
Signed-off-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: default avatarLe Ma <Le.Ma@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent cf24f6a0
......@@ -59,6 +59,7 @@ static int8_t aqua_vanjaram_logical_to_dev_inst(struct amdgpu_device *adev,
switch (block) {
case GC_HWIP:
case SDMA0_HWIP:
dev_inst = adev->ip_map.dev_inst[block][inst];
break;
default:
......@@ -73,7 +74,7 @@ static int8_t aqua_vanjaram_logical_to_dev_inst(struct amdgpu_device *adev,
void aqua_vanjaram_ip_map_init(struct amdgpu_device *adev)
{
int xcc_mask;
int xcc_mask, sdma_mask;
int l, i;
/* Map GC instances */
......@@ -87,5 +88,15 @@ void aqua_vanjaram_ip_map_init(struct amdgpu_device *adev)
for (; l < HWIP_MAX_INSTANCE; l++)
adev->ip_map.dev_inst[GC_HWIP][l] = -1;
l = 0;
sdma_mask = adev->sdma.sdma_mask;
while (sdma_mask) {
i = ffs(sdma_mask) - 1;
adev->ip_map.dev_inst[SDMA0_HWIP][l++] = i;
sdma_mask &= ~(1 << i);
}
for (; l < HWIP_MAX_INSTANCE; l++)
adev->ip_map.dev_inst[SDMA0_HWIP][l] = -1;
adev->ip_map.logical_to_dev_inst = aqua_vanjaram_logical_to_dev_inst;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment