Fix incorrect AVSBus disable commands

Rework CPU regulator data structures for additional
clarity on configuration.
parent 5ededa77
Pipeline #234 passed with stage
in 18 seconds
......@@ -108,7 +108,11 @@ typedef struct
uint8_t *i2c_master;
uint32_t i2c_frequency;
uint8_t vdd_regulator_addr;
uint8_t vdd_regulator_page;
uint8_t vcs_regulator_addr;
uint8_t vcs_regulator_page;
uint8_t vdn_regulator_addr;
uint8_t vdn_regulator_page;
uint8_t vdd_smbus_addr;
uint8_t vdn_smbus_addr;
} cpu_info_t;
......@@ -118,7 +122,11 @@ static const cpu_info_t g_cpu_info[] = {
.i2c_master = (uint8_t *)I2CMASTER1_BASE,
.i2c_frequency = 100000,
.vdd_regulator_addr = 0x70,
.vdd_regulator_page = 0x00,
.vcs_regulator_addr = 0x70,
.vcs_regulator_page = 0x01,
.vdn_regulator_addr = 0x73,
.vdn_regulator_page = 0x00,
.vdd_smbus_addr = 0x28,
.vdn_smbus_addr = 0x2b,
......@@ -129,7 +137,11 @@ static const cpu_info_t g_cpu_info[] = {
.i2c_master = (uint8_t *)I2CMASTER2_BASE,
.i2c_frequency = 100000,
.vdd_regulator_addr = 0x70,
.vdd_regulator_page = 0x00,
.vcs_regulator_addr = 0x70,
.vcs_regulator_page = 0x01,
.vdn_regulator_addr = 0x73,
.vdn_regulator_page = 0x00,
.vdd_smbus_addr = 0x28,
.vdn_smbus_addr = 0x2b,
},
......@@ -1465,7 +1477,7 @@ static int apply_avsbus_workarounds(const cpu_info_t *cpu_info, int cpu_count)
static int enable_avsbus_pmbus_cpu(const cpu_info_t *cpu)
{
printf("\tVDD %d: Placing device in AVSBus voltage command mode\n", cpu->index);
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdd_regulator_addr, 0x00, 0x00))
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdd_regulator_addr, 0x00, cpu->vdd_regulator_page))
{
return -1;
}
......@@ -1475,17 +1487,17 @@ static int enable_avsbus_pmbus_cpu(const cpu_info_t *cpu)
}
printf("\tVCS %d: Placing device in AVSBus voltage command mode\n", cpu->index);
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdd_regulator_addr, 0x00, 0x01))
if (i2c_write_register_byte(cpu->i2c_master, cpu->vcs_regulator_addr, 0x00, cpu->vcs_regulator_page))
{
return -1;
}
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdd_regulator_addr, 0x01, 0xb0))
if (i2c_write_register_byte(cpu->i2c_master, cpu->vcs_regulator_addr, 0x01, 0xb0))
{
return -1;
}
printf("\tVDN %d: Placing device in AVSBus voltage command mode\n", cpu->index);
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdn_regulator_addr, 0x00, 0x00))
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdn_regulator_addr, 0x00, cpu->vdn_regulator_page))
{
return -1;
}
......@@ -1516,31 +1528,31 @@ static int enable_avsbus_pmbus(const cpu_info_t *cpu_info, int cpu_count)
static int disable_avsbus_pmbus_cpu(const cpu_info_t *cpu)
{
printf("\tVDD %d: Placing device in immediate off mode\n", cpu->index);
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdd_regulator_addr, 0x00, 0x00))
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdd_regulator_addr, 0x00, cpu->vdd_regulator_page))
{
return -1;
}
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdd_regulator_addr, 0x01, 0xb0))
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdd_regulator_addr, 0x01, 0x80))
{
return -1;
}
printf("\tVCS %d: Placing device in immediate off mode\n", cpu->index);
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdd_regulator_addr, 0x00, 0x01))
if (i2c_write_register_byte(cpu->i2c_master, cpu->vcs_regulator_addr, 0x00, cpu->vcs_regulator_page))
{
return -1;
}
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdd_regulator_addr, 0x01, 0xb0))
if (i2c_write_register_byte(cpu->i2c_master, cpu->vcs_regulator_addr, 0x01, 0x80))
{
return -1;
}
printf("\tVDN %d: Placing device in immediate off mode\n", cpu->index);
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdn_regulator_addr, 0x00, 0x00))
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdn_regulator_addr, 0x00, cpu->vdn_regulator_page))
{
return -1;
}
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdn_regulator_addr, 0x01, 0xb0))
if (i2c_write_register_byte(cpu->i2c_master, cpu->vdn_regulator_addr, 0x01, 0x80))
{
return -1;
}
......
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