static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev,
struct amdgpu_ras_eeprom_control *control)
{
+ uint8_t ras_rom_i2c_slave_addr;
+
if (!control)
return false;
control->i2c_address = 0;
- if (amdgpu_atomfirmware_ras_rom_addr(adev, (uint8_t*)&control->i2c_address))
+ if (amdgpu_atomfirmware_ras_rom_addr(adev, &ras_rom_i2c_slave_addr))
{
- if (control->i2c_address == 0xA0)
+ switch (ras_rom_i2c_slave_addr) {
+ case 0xA0:
control->i2c_address = 0;
- else if (control->i2c_address == 0xA8)
+ return true;
+ case 0xA8:
control->i2c_address = 0x40000;
- else {
- dev_warn(adev->dev, "RAS EEPROM I2C address not supported");
+ return true;
+ default:
+ dev_warn(adev->dev, "RAS EEPROM I2C slave address %02x not supported",
+ ras_rom_i2c_slave_addr);
return false;
}
-
- return true;
}
switch (adev->asic_type) {