Skip to content

Commit cd06c3d

Browse files
committed
Fix the OCC to OPAL Pstate Table vdd and vcs vids
Values of the Vdd and Vcs VIDS where copied in the wrong order to the Sapphire table in the HOMER image. This commit fixes the bug, and writes the correct Vdd and Vcs values for corresponding Pstate entries. Change-Id: I7a6a65a2a94564e2a2973366a22bd660a950f603 CQ: SW336150 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21461 Reviewed-by: William A. Bryan <wilbryan@us.ibm.com> Tested-by: FSP CI Jenkins Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: Wael El-Essawy <welessa@us.ibm.com>
1 parent bc4b54a commit cd06c3d

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

src/occ/occbuildname.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) =
3434

3535
#else
3636

37-
volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_151116a\0" /*</BuildName>*/ ;
37+
volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_160229a\0" /*</BuildName>*/ ;
3838

3939
#endif

src/occ/proc/proc_pstate.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -980,16 +980,20 @@ void populate_pstate_to_sapphire_tbl()
980980

981981
l_gpst_ptr = gpsm_gpst();
982982
const int8_t l_pmax = (int8_t) l_gpst_ptr->pmin + l_gpst_ptr->entries - 1;
983-
G_sapphire_table.config.valid = 0x01; // default 0x01
984-
G_sapphire_table.config.version = 0x02; // default 0x02
983+
G_sapphire_table.config.valid = 0x01; // default 0x01
984+
G_sapphire_table.config.version = 0x02; // default 0x02
985985
G_sapphire_table.config.throttle = NO_THROTTLE; // default 0x00
986-
G_sapphire_table.config.pmin = gpst_pmin(&G_global_pstate_table)+1; //Per David Du, we must use pmin+1 to avoid gpsa hang
987-
G_sapphire_table.config.pnominal = (int8_t)proc_freq2pstate(G_sysConfigData.sys_mode_freq.table[OCC_MODE_NOMINAL]);
986+
//Per David Du, we must use pmin+1 to avoid gpsa hang
987+
G_sapphire_table.config.pmin = gpst_pmin(&G_global_pstate_table)+1;
988+
G_sapphire_table.config.pnominal =
989+
(int8_t)proc_freq2pstate(G_sysConfigData.sys_mode_freq.table[OCC_MODE_NOMINAL]);
988990
G_sapphire_table.config.turbo = (int8_t) proc_freq2pstate(l_turboFreq);
989991
G_sapphire_table.config.ultraTurbo = (int8_t) proc_freq2pstate(l_ultraturboFreq);
990992

991993
int8_t l_tempPmax = gpst_pmax(&G_global_pstate_table);
992994
const uint16_t l_entries = l_tempPmax - G_sapphire_table.config.pmin + 1;
995+
996+
// index to the last entry in the pstates table: pmax
993997
const uint8_t l_idx = l_gpst_ptr->entries-1;
994998

995999
for (i = 0; i < l_entries; i++)
@@ -998,17 +1002,22 @@ void populate_pstate_to_sapphire_tbl()
9981002
G_sapphire_table.data[i].flag = 0; // default 0x00
9991003
if (i < l_gpst_ptr->entries)
10001004
{
1001-
G_sapphire_table.data[i].evid_vdd = l_gpst_ptr->pstate[i].fields.evid_vdd;
1002-
G_sapphire_table.data[i].evid_vcs = l_gpst_ptr->pstate[i].fields.evid_vcs;
1005+
// The Pstate entries are passed from tmgt ordered from lowest
1006+
// pstate enery level (pmin) to highest pstate level (pmax = 0)
1007+
G_sapphire_table.data[i].evid_vdd =
1008+
l_gpst_ptr->pstate[l_idx - i].fields.evid_vdd;
1009+
G_sapphire_table.data[i].evid_vcs =
1010+
l_gpst_ptr->pstate[l_idx - i].fields.evid_vcs;
10031011
}
10041012
else
10051013
{
10061014
// leave the VDD & VCS Vids the same as the "Pstate Table Pmin"
1007-
G_sapphire_table.data[i].evid_vdd = l_gpst_ptr->pstate[l_idx].fields.evid_vdd;
1008-
G_sapphire_table.data[i].evid_vcs = l_gpst_ptr->pstate[l_idx].fields.evid_vcs;
1015+
G_sapphire_table.data[i].evid_vdd = l_gpst_ptr->pstate[0].fields.evid_vdd;
1016+
G_sapphire_table.data[i].evid_vcs = l_gpst_ptr->pstate[0].fields.evid_vcs;
10091017
}
10101018
// extrapolate the frequency
1011-
G_sapphire_table.data[i].freq_khz = l_gpst_ptr->pstate0_frequency_khz + (G_sapphire_table.data[i].pstate * l_gpst_ptr->frequency_step_khz);
1019+
G_sapphire_table.data[i].freq_khz = l_gpst_ptr->pstate0_frequency_khz +
1020+
(G_sapphire_table.data[i].pstate * l_gpst_ptr->frequency_step_khz);
10121021
}
10131022

10141023
uint8_t l_core = 0;

0 commit comments

Comments
 (0)