Skip to content

Commit 793fa8c

Browse files
huangruialexdeucher
authored andcommitted
drm/amdgpu: cleanup sriov function for psp v12
PSP v12 won't have SRIOV function. Signed-off-by: Huang Rui <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 4a89b76 commit 793fa8c

File tree

1 file changed

+17
-35
lines changed

1 file changed

+17
-35
lines changed

drivers/gpu/drm/amd/amdgpu/psp_v12_0.c

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -147,41 +147,23 @@ static int psp_v12_0_ring_create(struct psp_context *psp,
147147
struct psp_ring *ring = &psp->km_ring;
148148
struct amdgpu_device *adev = psp->adev;
149149

150-
if (amdgpu_sriov_vf(psp->adev)) {
151-
/* Write low address of the ring to C2PMSG_102 */
152-
psp_ring_reg = lower_32_bits(ring->ring_mem_mc_addr);
153-
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_102, psp_ring_reg);
154-
/* Write high address of the ring to C2PMSG_103 */
155-
psp_ring_reg = upper_32_bits(ring->ring_mem_mc_addr);
156-
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_103, psp_ring_reg);
157-
158-
/* Write the ring initialization command to C2PMSG_101 */
159-
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_101,
160-
GFX_CTRL_CMD_ID_INIT_GPCOM_RING);
161-
162-
/* Wait for response flag (bit 31) in C2PMSG_101 */
163-
ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_101),
164-
0x80000000, 0x8000FFFF, false);
165-
166-
} else {
167-
/* Write low address of the ring to C2PMSG_69 */
168-
psp_ring_reg = lower_32_bits(ring->ring_mem_mc_addr);
169-
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_69, psp_ring_reg);
170-
/* Write high address of the ring to C2PMSG_70 */
171-
psp_ring_reg = upper_32_bits(ring->ring_mem_mc_addr);
172-
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_70, psp_ring_reg);
173-
/* Write size of ring to C2PMSG_71 */
174-
psp_ring_reg = ring->ring_size;
175-
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_71, psp_ring_reg);
176-
/* Write the ring initialization command to C2PMSG_64 */
177-
psp_ring_reg = ring_type;
178-
psp_ring_reg = psp_ring_reg << 16;
179-
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_64, psp_ring_reg);
180-
181-
/* Wait for response flag (bit 31) in C2PMSG_64 */
182-
ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_64),
183-
0x80000000, 0x8000FFFF, false);
184-
}
150+
/* Write low address of the ring to C2PMSG_69 */
151+
psp_ring_reg = lower_32_bits(ring->ring_mem_mc_addr);
152+
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_69, psp_ring_reg);
153+
/* Write high address of the ring to C2PMSG_70 */
154+
psp_ring_reg = upper_32_bits(ring->ring_mem_mc_addr);
155+
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_70, psp_ring_reg);
156+
/* Write size of ring to C2PMSG_71 */
157+
psp_ring_reg = ring->ring_size;
158+
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_71, psp_ring_reg);
159+
/* Write the ring initialization command to C2PMSG_64 */
160+
psp_ring_reg = ring_type;
161+
psp_ring_reg = psp_ring_reg << 16;
162+
WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_64, psp_ring_reg);
163+
164+
/* Wait for response flag (bit 31) in C2PMSG_64 */
165+
ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_64),
166+
0x80000000, 0x8000FFFF, false);
185167

186168
return ret;
187169
}

0 commit comments

Comments
 (0)