Skip to content

Commit f1c2cd3

Browse files
Hawking Zhangalexdeucher
authored andcommitted
drm/amdgpu: correct ROM_INDEX/DATA offset for VEGA20
The ROMC_INDEX/DATA offset was changed to e4/e5 since from smuio_v11 (vega20/arcturus). Signed-off-by: Hawking Zhang <[email protected]> Tested-by: Candice Li <[email protected]> Reviewed-by: Candice Li <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent d534977 commit f1c2cd3

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@
8989
#define HDP_MEM_POWER_CTRL__RC_MEM_POWER_CTRL_EN_MASK 0x00010000L
9090
#define HDP_MEM_POWER_CTRL__RC_MEM_POWER_LS_EN_MASK 0x00020000L
9191
#define mmHDP_MEM_POWER_CTRL_BASE_IDX 0
92+
93+
/* for Vega20/arcturus regiter offset change */
94+
#define mmROM_INDEX_VG20 0x00e4
95+
#define mmROM_INDEX_VG20_BASE_IDX 0
96+
#define mmROM_DATA_VG20 0x00e5
97+
#define mmROM_DATA_VG20_BASE_IDX 0
98+
9299
/*
93100
* Indirect registers accessor
94101
*/
@@ -309,6 +316,8 @@ static bool soc15_read_bios_from_rom(struct amdgpu_device *adev,
309316
{
310317
u32 *dw_ptr;
311318
u32 i, length_dw;
319+
uint32_t rom_index_offset;
320+
uint32_t rom_data_offset;
312321

313322
if (bios == NULL)
314323
return false;
@@ -321,11 +330,23 @@ static bool soc15_read_bios_from_rom(struct amdgpu_device *adev,
321330
dw_ptr = (u32 *)bios;
322331
length_dw = ALIGN(length_bytes, 4) / 4;
323332

333+
switch (adev->asic_type) {
334+
case CHIP_VEGA20:
335+
case CHIP_ARCTURUS:
336+
rom_index_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_INDEX_VG20);
337+
rom_data_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_DATA_VG20);
338+
break;
339+
default:
340+
rom_index_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_INDEX);
341+
rom_data_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_DATA);
342+
break;
343+
}
344+
324345
/* set rom index to 0 */
325-
WREG32(SOC15_REG_OFFSET(SMUIO, 0, mmROM_INDEX), 0);
346+
WREG32(rom_index_offset, 0);
326347
/* read out the rom data */
327348
for (i = 0; i < length_dw; i++)
328-
dw_ptr[i] = RREG32(SOC15_REG_OFFSET(SMUIO, 0, mmROM_DATA));
349+
dw_ptr[i] = RREG32(rom_data_offset);
329350

330351
return true;
331352
}

0 commit comments

Comments
 (0)