89
89
#define HDP_MEM_POWER_CTRL__RC_MEM_POWER_CTRL_EN_MASK 0x00010000L
90
90
#define HDP_MEM_POWER_CTRL__RC_MEM_POWER_LS_EN_MASK 0x00020000L
91
91
#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
+
92
99
/*
93
100
* Indirect registers accessor
94
101
*/
@@ -309,6 +316,8 @@ static bool soc15_read_bios_from_rom(struct amdgpu_device *adev,
309
316
{
310
317
u32 * dw_ptr ;
311
318
u32 i , length_dw ;
319
+ uint32_t rom_index_offset ;
320
+ uint32_t rom_data_offset ;
312
321
313
322
if (bios == NULL )
314
323
return false;
@@ -321,11 +330,23 @@ static bool soc15_read_bios_from_rom(struct amdgpu_device *adev,
321
330
dw_ptr = (u32 * )bios ;
322
331
length_dw = ALIGN (length_bytes , 4 ) / 4 ;
323
332
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
+
324
345
/* set rom index to 0 */
325
- WREG32 (SOC15_REG_OFFSET ( SMUIO , 0 , mmROM_INDEX ) , 0 );
346
+ WREG32 (rom_index_offset , 0 );
326
347
/* read out the rom data */
327
348
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 );
329
350
330
351
return true;
331
352
}
0 commit comments