diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 22 | 
1 files changed, 17 insertions, 5 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c index b12808c0c331..06a62a8a992e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c @@ -404,6 +404,22 @@ static int amdgpu_ras_eeprom_correct_header_tag(  	return res;  } +static void amdgpu_ras_set_eeprom_table_version(struct amdgpu_ras_eeprom_control *control) +{ +	struct amdgpu_device *adev = to_amdgpu_device(control); +	struct amdgpu_ras_eeprom_table_header *hdr = &control->tbl_hdr; + +	switch (amdgpu_ip_version(adev, UMC_HWIP, 0)) { +	case IP_VERSION(8, 10, 0): +	case IP_VERSION(12, 0, 0): +		hdr->version = RAS_TABLE_VER_V2_1; +		return; +	default: +		hdr->version = RAS_TABLE_VER_V1; +		return; +	} +} +  /**   * amdgpu_ras_eeprom_reset_table -- Reset the RAS EEPROM table   * @control: pointer to control structure @@ -423,11 +439,7 @@ int amdgpu_ras_eeprom_reset_table(struct amdgpu_ras_eeprom_control *control)  	mutex_lock(&control->ras_tbl_mutex);  	hdr->header = RAS_TABLE_HDR_VAL; -	if (adev->umc.ras && -	    adev->umc.ras->set_eeprom_table_version) -		adev->umc.ras->set_eeprom_table_version(hdr); -	else -		hdr->version = RAS_TABLE_VER_V1; +	amdgpu_ras_set_eeprom_table_version(control);  	if (hdr->version == RAS_TABLE_VER_V2_1) {  		hdr->first_rec_offset = RAS_RECORD_START_V2_1; | 
