Skip to content

Commit a36424c

Browse files
baileyshdcrowell77
authored andcommitted
HTMGT: Push2 BringUp changes needed to get HTMGT to work.
Thermal Control CMD data enhancments. AVS Bus Data enhancments. OCC checkpoint fix. Change-Id: Iaefe4a2a7cfd8408aefeafe818245524be84c253 RTC:170737 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38370 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
1 parent 1fa7778 commit a36424c

File tree

9 files changed

+85
-42
lines changed

9 files changed

+85
-42
lines changed

src/include/usr/isteps/istep21list.H

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2012,2016 */
8+
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
99
/* [+] Google Inc. */
1010
/* [+] International Business Machines Corp. */
1111
/* */
@@ -124,6 +124,9 @@ const DepModInfo g_istep21Dependancies = {
124124
DEP_LIB(libruntime.so),
125125
DEP_LIB(libp9_cpuWkup.so),
126126
DEP_LIB(libpm.so),
127+
#ifdef CONFIG_HTMGT
128+
DEP_LIB(libhtmgt.so),
129+
#endif
127130
NULL
128131
}
129132
};

src/usr/htmgt/htmgt.C

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ namespace HTMGT
6565
}
6666
TMGT_INF("processOccStartStatus(Start Success=%c, failedOcc=0x%08X)",
6767
i_startCompleted?'y':'n', l_huid);
68+
6869
if (false == int_flags_set(FLAG_HOLD_OCCS_IN_RESET))
6970
{
7071
if (i_startCompleted)
@@ -207,6 +208,9 @@ namespace HTMGT
207208
else
208209
{
209210
// retry worked - commit original error as informational
211+
TMGT_INF("processOccStartStatus: OCC failed to go active "
212+
"with 0x%04X, but recovery was successful",
213+
l_err->reasonCode());
210214
l_err->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL);
211215
ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
212216
}

src/usr/htmgt/htmgt_cfgdata.C

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,11 @@ void getThermalControlMessageData(uint8_t* o_data,
794794
if ( ! l_sys->tryGetAttr //if attr does not exists.
795795
<ATTR_OPEN_POWER_PROC_WEIGHT>(l_proc_weight))
796796
{
797-
l_proc_weight = 10; //Default 1.0 weight.
797+
l_proc_weight = OCC_PROC_QUAD_DEFAULT_WEIGHT;
798+
}
799+
if(l_proc_weight == 0x0)
800+
{
801+
l_proc_weight = OCC_PROC_QUAD_DEFAULT_WEIGHT;
798802
}
799803
o_data[index++] = l_proc_weight;
800804

@@ -804,7 +808,11 @@ void getThermalControlMessageData(uint8_t* o_data,
804808
if ( ! l_sys->tryGetAttr //if attr does not exists.
805809
<ATTR_OPEN_POWER_QUAD_WEIGHT>(l_quad_weight))
806810
{
807-
l_quad_weight = 10; //Default 1.0 weight.
811+
l_quad_weight = OCC_PROC_QUAD_DEFAULT_WEIGHT;
812+
}
813+
if(l_quad_weight == 0x0)
814+
{
815+
l_quad_weight = OCC_PROC_QUAD_DEFAULT_WEIGHT;
808816
}
809817
o_data[index++] = l_quad_weight;
810818

@@ -819,11 +827,20 @@ void getThermalControlMessageData(uint8_t* o_data,
819827

820828
// Processor
821829
o_data[index++] = CFGDATA_FRU_TYPE_PROC;
822-
o_data[index++] = l_sys->getAttr<ATTR_OPEN_POWER_PROC_DVFS_TEMP_DEG_C>();
823-
o_data[index++] = l_sys->getAttr<ATTR_OPEN_POWER_PROC_ERROR_TEMP_DEG_C>();
824-
o_data[index++] = 0xFF; //PM_DVFS not defined.
825-
o_data[index++] = 0xFF; //PM_ERROR not defined.
826-
o_data[index++] = l_sys->getAttr<ATTR_OPEN_POWER_PROC_READ_TIMEOUT_SEC>();
830+
uint8_t l_DVFS_temp =l_sys->getAttr<ATTR_OPEN_POWER_PROC_DVFS_TEMP_DEG_C>();
831+
uint8_t l_ERR_temp =l_sys->getAttr<ATTR_OPEN_POWER_PROC_ERROR_TEMP_DEG_C>();
832+
uint8_t l_timeout = l_sys->getAttr<ATTR_OPEN_POWER_PROC_READ_TIMEOUT_SEC>();
833+
if(l_DVFS_temp == 0x0)
834+
{
835+
l_DVFS_temp = OCC_PROC_DEFAULT_DVFS_TEMP;
836+
l_ERR_temp = OCC_PROC_DEFAULT_ERR_TEMP;
837+
l_timeout = OCC_PROC_DEFAULT_TIMEOUT;
838+
}
839+
o_data[index++] = l_DVFS_temp;
840+
o_data[index++] = l_ERR_temp;
841+
o_data[index++] = OCC_NOT_DEFINED; //PM_DVFS
842+
o_data[index++] = OCC_NOT_DEFINED; //PM_ERROR
843+
o_data[index++] = l_timeout;
827844
l_numSets++;
828845

829846
// If Nimbus, skip non-existent Centaurs
@@ -835,21 +852,29 @@ void getThermalControlMessageData(uint8_t* o_data,
835852
l_sys->getAttr<ATTR_OPEN_POWER_MEMCTRL_THROTTLE_TEMP_DEG_C>();
836853
o_data[index++] =
837854
l_sys->getAttr<ATTR_OPEN_POWER_MEMCTRL_ERROR_TEMP_DEG_C>();
838-
o_data[index++] = 0xFF; //PM_DVFS not defined.
839-
o_data[index++] = 0xFF; //PM_ERROR not defined.
855+
o_data[index++] = OCC_NOT_DEFINED; //PM_DVFS
856+
o_data[index++] = OCC_NOT_DEFINED; //PM_ERROR
840857
o_data[index++] =
841858
l_sys->getAttr<ATTR_OPEN_POWER_MEMCTRL_READ_TIMEOUT_SEC>();
842859
l_numSets++;
843860
}
844861

845862
// Dimm
846863
o_data[index++] = CFGDATA_FRU_TYPE_DIMM;
847-
o_data[index++] =
848-
l_sys->getAttr<ATTR_OPEN_POWER_DIMM_THROTTLE_TEMP_DEG_C>();
849-
o_data[index++] = l_sys->getAttr<ATTR_OPEN_POWER_DIMM_ERROR_TEMP_DEG_C>();
850-
o_data[index++] = 0xFF; //PM_DVFS not defined.
851-
o_data[index++] = 0xFF; //PM_ERROR not defined.
852-
o_data[index++] = l_sys->getAttr<ATTR_OPEN_POWER_DIMM_READ_TIMEOUT_SEC>();
864+
l_DVFS_temp =l_sys->getAttr<ATTR_OPEN_POWER_DIMM_THROTTLE_TEMP_DEG_C>();
865+
l_ERR_temp =l_sys->getAttr<ATTR_OPEN_POWER_DIMM_ERROR_TEMP_DEG_C>();
866+
l_timeout = l_sys->getAttr<ATTR_OPEN_POWER_DIMM_READ_TIMEOUT_SEC>();
867+
if(l_DVFS_temp == 0x0)
868+
{
869+
l_DVFS_temp = OCC_DIMM_DEFAULT_DVFS_TEMP;
870+
l_ERR_temp = OCC_DIMM_DEFAULT_ERR_TEMP;
871+
l_timeout = OCC_DIMM_DEFAULT_TIMEOUT;
872+
}
873+
o_data[index++] = l_DVFS_temp;
874+
o_data[index++] = l_ERR_temp;
875+
o_data[index++] = OCC_NOT_DEFINED; //PM_DVFS
876+
o_data[index++] = OCC_NOT_DEFINED; //PM_ERROR
877+
o_data[index++] = l_timeout;
853878
l_numSets++;
854879

855880
o_data[l_numSetsOffset] = l_numSets;
@@ -874,11 +899,14 @@ void getAVSBusConfigMessageData( const TargetHandle_t i_occ,
874899
// Populate the data
875900
o_data[index++] = OCC_CFGDATA_AVSBUS_CONFIG;
876901
o_data[index++] = OCC_CFGDATA_AVSBUS_CONFIG_VERSION;
877-
o_data[index++] = l_proc->getAttr<ATTR_VDD_AVSBUS_BUSNUM>();
878-
o_data[index++] = l_proc->getAttr<ATTR_VDD_AVSBUS_RAIL>();
879-
o_data[index++] = l_proc->getAttr<ATTR_VDN_AVSBUS_BUSNUM>();
880-
o_data[index++] = l_proc->getAttr<ATTR_VDN_AVSBUS_RAIL>();
881-
902+
o_data[index++] = l_proc->getAttr<ATTR_VDD_AVSBUS_BUSNUM>();//Vdd Bus
903+
o_data[index++] = l_proc->getAttr<ATTR_VDD_AVSBUS_RAIL>(); //Vdd Rail Sel
904+
o_data[index++] = 0xFF; //reserved
905+
o_data[index++] = 0xFF; //reserved
906+
o_data[index++] = l_proc->getAttr<ATTR_VDN_AVSBUS_BUSNUM>();//Vdn Bus
907+
o_data[index++] = l_proc->getAttr<ATTR_VDN_AVSBUS_RAIL>(); //Vdn Rail sel
908+
o_data[index++] = 0xFF; //reserved
909+
o_data[index++] = 0xFF; //reserved
882910
o_size = index;
883911
}
884912

src/usr/htmgt/htmgt_cfgdata.H

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131

3232
namespace HTMGT
3333
{
34+
const uint8_t OCC_PROC_QUAD_DEFAULT_WEIGHT = 10; //Default 1.0 weight.
35+
const uint8_t OCC_PROC_DEFAULT_DVFS_TEMP = 0x55;//default from DEF file PM
36+
const uint8_t OCC_PROC_DEFAULT_ERR_TEMP = 0x5F;
37+
const uint8_t OCC_PROC_DEFAULT_TIMEOUT = 0x05;
38+
const uint8_t OCC_DIMM_DEFAULT_DVFS_TEMP = 0x45;//default from DEF file PM
39+
const uint8_t OCC_DIMM_DEFAULT_ERR_TEMP = 0x56;
40+
const uint8_t OCC_DIMM_DEFAULT_TIMEOUT = 0x1E;
41+
const uint8_t OCC_NOT_DEFINED = 0xFF;
3442

3543
/** OCC configuration data message formats */
3644
enum occCfgDataFormat

src/usr/htmgt/htmgt_occ.C

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#include <occ/occ.H>
4242
#include <occ/occ_common.H>
4343
#include <errl/errludlogregister.H>
44-
#include <buffer.H>
44+
#include <fapi2.H>
4545

4646
#include <isteps/pm/pm_common_ext.H>
4747

@@ -1016,24 +1016,25 @@ namespace HTMGT
10161016
{
10171017
nanosleep(0, NS_BETWEEN_READ);
10181018

1019+
TARGETING::ConstTargetHandle_t procTarget =
1020+
TARGETING::getParentChip(occ->getTarget() );
1021+
10191022
// Read SRAM response buffer to check for OCC checkpoint
10201023
errlHndl_t l_err = nullptr;
1021-
const uint16_t l_length = 8;
1022-
1023-
fapi2::buffer<uint64_t> l_buffer;
1024-
l_err = HBOCC::readSRAM(occ->getTarget(),
1024+
const uint16_t l_length = 8; //Note: number of bytes
1025+
uint8_t l_sram_data[l_length] = { 0x0 };
1026+
l_err = HBOCC::readSRAM(procTarget,
10251027
OCC_RSP_SRAM_ADDR,
1026-
l_buffer.pointer(),
1028+
(uint64_t*)(&(l_sram_data)),
10271029
l_length);
10281030

10291031
if (nullptr == l_err)
10301032
{
10311033
// Pull status from response (byte 2)
1032-
uint8_t status = 0;
1033-
l_buffer.extractToRight<16, 8>(status);
1034+
uint8_t status = l_sram_data[2];
1035+
10341036
// Pull checkpoint from response (byte 6-7)
1035-
uint16_t checkpoint = 0;
1036-
l_buffer.extractToRight<48,16>(checkpoint);
1037+
uint16_t checkpoint= l_sram_data[6]<<8 | l_sram_data[7];
10371038

10381039
if (checkpoint != lastCheckpoint)
10391040
{
@@ -1051,14 +1052,12 @@ namespace HTMGT
10511052
occReady = true;
10521053
break;
10531054
}
1054-
if( ( ( checkpoint & OCC_INIT_FAILURE ) ==
1055-
OCC_INIT_FAILURE ) ||
1056-
( status != OCC_RC_OCC_INIT_CHECKPOINT ) )
1055+
if( ((checkpoint & OCC_INIT_FAILURE ) ==
1056+
OCC_INIT_FAILURE ) ||
1057+
( status == OCC_RC_INIT_FAILURE ) )
10571058
{
1058-
1059-
TMGT_ERR("_waitForOccCheckpoint: Final checkpoint "
1060-
"not reached byt OCC%d stopped "
1061-
"(0x%02X, 0x%04X)",
1059+
TMGT_ERR("_waitForOccCheckpoint: OCC%d failed "
1060+
"during initialization (0x%02X, 0x%04X)",
10621061
occ->getInstance(),
10631062
status,
10641063
checkpoint );

src/usr/htmgt/htmgt_occ.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2014,2016 */
8+
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */

src/usr/htmgt/htmgt_poll.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2014,2016 */
8+
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */

src/usr/htmgt/htmgt_poll.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2014,2016 */
8+
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -59,7 +59,7 @@ namespace HTMGT
5959
uint8_t errorId;
6060
uint32_t errorAddress;
6161
uint16_t errorLength;
62-
uint16_t reserved2;
62+
uint16_t reserved[2];
6363
uint8_t codeLevel[16];
6464
uint8_t sensor[6];
6565
uint8_t numBlocks;

src/usr/isteps/istep21/call_host_runtime_setup.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <initservice/initserviceif.H>
3333
#include <initservice/istepdispatcherif.H>
3434
#include <vfs/vfs.H>
35+
#include <htmgt/htmgt.H>
3536
#include <runtime/runtime.H>
3637
#include <devtree/devtreeif.H>
3738
#include <runtime/customize_attrs_for_payload.H>

0 commit comments

Comments
 (0)