Commit cc947bf9 authored by Luben Tuikov's avatar Luben Tuikov Committed by Alex Deucher

drm/amdgpu: Process any VBIOS RAS EEPROM address

We can now process any RAS EEPROM address from
VBIOS. Generalize so as to compute the top three
bits of the 19-bit EEPROM address, from any byte
returned as the "i2c address" from VBIOS.

Cc: John Clements <john.clements@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Cc: Alex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: default avatarLuben Tuikov <luben.tuikov@amd.com>
Reviewed-by: default avatarAlex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a6a355a2
...@@ -114,21 +114,22 @@ static bool __get_eeprom_i2c_addr_arct(struct amdgpu_device *adev, ...@@ -114,21 +114,22 @@ static bool __get_eeprom_i2c_addr_arct(struct amdgpu_device *adev,
static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev, static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev,
struct amdgpu_ras_eeprom_control *control) struct amdgpu_ras_eeprom_control *control)
{ {
u8 i2c_addr;
if (!control) if (!control)
return false; return false;
control->i2c_address = 0; if (amdgpu_atomfirmware_ras_rom_addr(adev, &i2c_addr)) {
/* The address given by VBIOS is an 8-bit, wire-format
if (amdgpu_atomfirmware_ras_rom_addr(adev, (uint8_t*)&control->i2c_address)) * address, i.e. the most significant byte.
{ *
if (control->i2c_address == 0xA0) * Normalize it to a 19-bit EEPROM address. Remove the
control->i2c_address = 0; * device type identifier and make it a 7-bit address;
else if (control->i2c_address == 0xA8) * then make it a 19-bit EEPROM address. See top of
control->i2c_address = 0x40000; * amdgpu_eeprom.c.
else { */
dev_warn(adev->dev, "RAS EEPROM I2C address not supported"); i2c_addr = (i2c_addr & 0x0F) >> 1;
return false; control->i2c_address = ((u32) i2c_addr) << 16;
}
return true; return true;
} }
......
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