summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2012-11-12 13:28:11 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-12-03 17:05:17 -0600
commit081bc55d54bffba5f1bb660d7757e5a13a6ea771 (patch)
tree765249a9dacb584cbfa8b74e2a3764f8b493f952 /src
parent0bbc1fcf5d4b8a5301820f709b86a9ac292dacee (diff)
downloadblackbird-hostboot-081bc55d54bffba5f1bb660d7757e5a13a6ea771.tar.gz
blackbird-hostboot-081bc55d54bffba5f1bb660d7757e5a13a6ea771.zip
Add NAME and ECMD_STRING to HostServices attributes
These additions came about as a result of the HostServices code review meetings. Change-Id: I1d76b931a158ba724bdf0ee9835a1ecbb7b10100 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2310 Tested-by: Jenkins Server Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com> Reviewed-by: Terry J. Opie <opiet@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/usr/hwpf/hwp/start_payload/start_payload.C4
-rw-r--r--src/usr/runtime/common/hsvc_attribute_structs.H5
-rw-r--r--src/usr/runtime/populate_attributes.C53
-rw-r--r--src/usr/runtime/test/runtimeattrstest.H19
4 files changed, 58 insertions, 23 deletions
diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C
index d7bd14adb..aa9c89e96 100644
--- a/src/usr/hwpf/hwp/start_payload/start_payload.C
+++ b/src/usr/hwpf/hwp/start_payload/start_payload.C
@@ -107,7 +107,7 @@ errlHndl_t notifyFsp ( bool i_istepModeFlag,
void* call_host_runtime_setup( void *io_pArgs )
{
- TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"call_host_runtime_setup entry" );
errlHndl_t l_err = NULL;
@@ -314,7 +314,7 @@ errlHndl_t callShutdown ( void )
// do the shutdown.
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "call_host_start_payload finished, shutdown = 0x%x.",
+ "callShutdown finished, shutdown = 0x%x.",
status );
INITSERVICE::doShutdown( status,
payloadBase,
diff --git a/src/usr/runtime/common/hsvc_attribute_structs.H b/src/usr/runtime/common/hsvc_attribute_structs.H
index 19f12ddcd..4493b07d5 100644
--- a/src/usr/runtime/common/hsvc_attribute_structs.H
+++ b/src/usr/runtime/common/hsvc_attribute_structs.H
@@ -73,5 +73,6 @@ struct hsvc_node_data_t
// Custom Attribute IDs
// Note: Standard fapi::AttributeId are only 32-bits so we can use the top
// 32-bits of the 64-bit value for our own numbers
-static const uint64_t HSVC_HUID = 0xFF000001FFFFFFFF;
-static const uint64_t HSVC_PHYS_PATH = 0xFF000002FFFFFFFF;
+static const uint64_t HSVC_HUID = 0xFF000001FFFFFFFF;
+static const uint64_t HSVC_PHYS_PATH = 0xFF000002FFFFFFFF;
+static const uint64_t HSVC_ECMD_STRING = 0xFF000003FFFFFFFF;
diff --git a/src/usr/runtime/populate_attributes.C b/src/usr/runtime/populate_attributes.C
index cba9612bc..7562b2d26 100644
--- a/src/usr/runtime/populate_attributes.C
+++ b/src/usr/runtime/populate_attributes.C
@@ -54,7 +54,7 @@ TRAC_INIT(&g_trac_runtime, "RUNTIME", 4096);
_failed_attribute = fapi::__fid; \
break; \
} \
- TRACFCOMP( g_trac_runtime, "> %d: 0x%x=%X @ %p", *_num_attr, fapi::__fid, result_##__fid, _output_ptr ); \
+ TRACDCOMP( g_trac_runtime, "> %d: 0x%x=%X @ %p", *_num_attr, fapi::__fid, result_##__fid, _output_ptr ); \
_cur_header = &(_all_headers[(*_num_attr)]); \
_cur_header->id = fapi::__fid; \
_cur_header->sizeBytes = sizeof(fapi::__fid##_Type); \
@@ -74,7 +74,7 @@ TRAC_INIT(&g_trac_runtime, "RUNTIME", 4096);
_failed_attribute = fapi::__fid; \
break; \
} \
- TRACFCOMP( g_trac_runtime, "> %d: 0x%x=%X @ %p", *_num_attr, fapi::__fid, result_##__fid, _output_ptr ); \
+ TRACDCOMP( g_trac_runtime, "> %d: 0x%x=%X @ %p", *_num_attr, fapi::__fid, result_##__fid, _output_ptr ); \
_cur_header = &(_all_headers[(*_num_attr)]); \
_cur_header->id = fapi::__fid; \
_cur_header->sizeBytes = sizeof(fapi::__fid##_Type); \
@@ -88,7 +88,7 @@ TRAC_INIT(&g_trac_runtime, "RUNTIME", 4096);
*/
#define ADD_HUID(__targ) \
_huid_temp = TARGETING::get_huid(__targ); \
- TRACFCOMP( g_trac_runtime, "> HUID=%.8X @ %p", _huid_temp, _output_ptr ); \
+ TRACDCOMP( g_trac_runtime, "> HUID=%.8X @ %p", _huid_temp, _output_ptr ); \
_cur_header = &(_all_headers[(*_num_attr)]); \
_cur_header->id = HSVC_HUID; \
_cur_header->sizeBytes = sizeof(uint32_t); \
@@ -112,6 +112,21 @@ TRAC_INIT(&g_trac_runtime, "RUNTIME", 4096);
(*_num_attr)++; }
/**
+ * @brief Read the PHYS_PATH attribute from targeting and stick it into mainstore
+ */
+#define ADD_ECMD_STRING() \
+ { const char* estring = _target->toEcmdString(); \
+ _cur_header = &(_all_headers[(*_num_attr)]); \
+ _cur_header->id = HSVC_ECMD_STRING; \
+ _cur_header->sizeBytes = fapi::MAX_ECMD_STRING_LEN; \
+ _cur_header->offset = (_output_ptr - _beginning); \
+ memcpy( _output_ptr, estring, _cur_header->sizeBytes ); \
+ _output_ptr += _cur_header->sizeBytes; \
+ (*_num_attr)++; }
+
+//void Target::toString(char (&o_ecmdString)[MAX_ECMD_STRING_LEN]) const
+
+/**
* @brief Insert a terminator into the attribute list
*/
#define EMPTY_ATTRIBUTE \
@@ -150,7 +165,7 @@ struct node_data_t
MAX_PROCS_RSV = 16, //leave space for double
MAX_EX_PER_PROC = 16,
MAX_EX_RSV = MAX_PROCS_RSV*MAX_EX_PER_PROC,
- NUM_PROC_ATTRIBUTES = 100,
+ NUM_PROC_ATTRIBUTES = 125,
NUM_EX_ATTRIBUTES = 10,
MAX_ATTRIBUTES = MAX_PROCS_RSV*NUM_PROC_ATTRIBUTES +
MAX_PROCS_RSV*MAX_EX_PER_PROC*NUM_EX_ATTRIBUTES
@@ -186,7 +201,7 @@ errlHndl_t populate_system_attributes( void )
int _rc = 0; //result from FAPI_ATTR_GET
do {
- TRACFCOMP( g_trac_runtime, "-SYSTEM-" );
+ TRACDCOMP( g_trac_runtime, "-SYSTEM-" );
// allocate memory and fill it with some junk data
// @fixme RTC:49509 - remove mm_linear_map and put in real HDAT.
@@ -231,6 +246,11 @@ errlHndl_t populate_system_attributes( void )
// Add an empty attribute header to signal the end
EMPTY_ATTRIBUTE;
+ TRACFCOMP( g_trac_runtime, "populate_system_attributes> numAttr=%d", sys_data->hsvc.numAttr );
+
+ // Make sure we don't overrun our space
+ assert( *_num_attr < system_data_t::MAX_ATTRIBUTES );
+
TRACFCOMP( g_trac_runtime, "Run: system_cmp0.memory_ln4->image.save attributes.sys.bin 0x%X %d", sys_data, sizeof(system_data_t) );
//@todo - Walk through attribute headers to look for duplicates?
@@ -270,7 +290,7 @@ errlHndl_t populate_node_attributes( uint64_t i_nodeNum )
int _rc = 0; //result from FAPI_ATTR_GET
do {
- TRACFCOMP( g_trac_runtime, "-NODE-" );
+ TRACDCOMP( g_trac_runtime, "-NODE-" );
// allocate memory and fill it with some junk data
node_data_t* node_data =
@@ -318,7 +338,7 @@ errlHndl_t populate_node_attributes( uint64_t i_nodeNum )
uint64_t chip_id =
all_procs[p]->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>();
uint32_t procid = (node_id << 3) | (chip_id); //NNNCCC
- TRACFCOMP( g_trac_runtime, "PROC:%d (%.8X)", procid, TARGETING::get_huid(all_procs[p]) );
+ TRACDCOMP( g_trac_runtime, "PROC:%d (%.8X)", procid, TARGETING::get_huid(all_procs[p]) );
// Fill in the metadata
node_data->procs[p].procid = procid;
@@ -336,13 +356,20 @@ errlHndl_t populate_node_attributes( uint64_t i_nodeNum )
// Fill up the attributes
ADD_HUID( (all_procs[p]) ); // for debug
ADD_PHYS_PATH( (all_procs[p]) );
- HSVC_LOAD_ATTR_P( ATTR_EC );
+ ADD_ECMD_STRING();
+ HSVC_LOAD_ATTR_P( ATTR_EC );
+ HSVC_LOAD_ATTR_P( ATTR_NAME );
+
// Use a generated file for the list of attributes to load
#include "common/hsvc_procdata.C"
// Add an empty attribute header to signal the end
EMPTY_ATTRIBUTE;
+ TRACFCOMP( g_trac_runtime, "populate_node_attributes> PROC:%d (%.8X) : numAttr=%d", procid, TARGETING::get_huid(all_procs[p]), node_data->procs[p].numAttr );
+
+ // Make sure we don't overrun our space
+ assert( *_num_attr < node_data_t::NUM_PROC_ATTRIBUTES );
// Loop around all of the EX chiplets for this proc
TARGETING::TargetHandleList all_ex;
@@ -352,7 +379,7 @@ errlHndl_t populate_node_attributes( uint64_t i_nodeNum )
{
uint32_t chiplet =
all_ex[e]->getAttr<TARGETING::ATTR_CHIP_UNIT>();
- TRACFCOMP( g_trac_runtime, "EX:p%d c%d(%.8X)", procid, chiplet, get_huid(all_ex[e]) );
+ TRACDCOMP( g_trac_runtime, "EX:p%d c%d(%.8X)", procid, chiplet, get_huid(all_ex[e]) );
// Fill in the metadata
(node_data->hsvc.numTargets)++;
@@ -380,12 +407,18 @@ errlHndl_t populate_node_attributes( uint64_t i_nodeNum )
// Fill up the attributes
ADD_HUID( (all_ex[e]) ); // for debug
ADD_PHYS_PATH( (all_ex[e]) );
+ ADD_ECMD_STRING();
// Use a generated file for the list of attributes to load
#include "common/hsvc_exdata.C"
// Add an empty attribute header to signal the end
EMPTY_ATTRIBUTE;
+ TRACFCOMP( g_trac_runtime, "populate_node_attributes> EX:p%d c%d(%.8X) : numAttr=%d", procid, chiplet, get_huid(all_ex[e]), node_data->ex[next_ex].numAttr );
+
+ // Make sure we don't overrun our space
+ assert( *_num_attr < node_data_t::NUM_EX_ATTRIBUTES );
+
next_ex++;
}
@@ -436,6 +469,8 @@ errlHndl_t populate_attributes( void )
errlHndl_t errhdl = NULL;
do {
+ TRACFCOMP( g_trac_runtime, "Running populate_attributes" );
+
//@todo : Remove this before RTC:49137 is merged, fix with RTC:49509
// Skip this in VPO
if( TARGETING::is_vpo() )
diff --git a/src/usr/runtime/test/runtimeattrstest.H b/src/usr/runtime/test/runtimeattrstest.H
index bdf7b430e..435c6bee6 100644
--- a/src/usr/runtime/test/runtimeattrstest.H
+++ b/src/usr/runtime/test/runtimeattrstest.H
@@ -143,7 +143,7 @@ class RuntimeTest: public CxxTest::TestSuite
if( attr != sysdata->numAttr )
{
TRACFCOMP( g_trac_runtime, "numAttr=%d, found attr=%d", sysdata->numAttr, attr );
- TS_FAIL("Number of attributes found doesn't match expected value");
+ TS_FAIL("testVerifySystemAttributes> Number of attributes found doesn't match expected value");
}
TRACFCOMP( g_trac_runtime, "testVerifySystemAttributes> finish" );
@@ -223,7 +223,7 @@ class RuntimeTest: public CxxTest::TestSuite
if( headers[attr].sizeBytes !=
sizeof(fapi::ATTR_CHIP_ID_Type) )
{
- TRACFCOMP( g_trac_runtime, "size=%.16X", headers[attr].sizeBytes );
+ TRACFCOMP( g_trac_runtime, "procid=%d: size=%.16X", curproc->procid, headers[attr].sizeBytes );
TS_FAIL("Size of fapi::ATTR_CHIP_ID data is wrong");
}
else
@@ -233,7 +233,7 @@ class RuntimeTest: public CxxTest::TestSuite
(beginning+headers[attr].offset);
if( *tmp1_act != tmp1 )
{
- TRACFCOMP( g_trac_runtime, "Expected=%X, Actual=%X", tmp1, *tmp1_act );
+ TRACFCOMP( g_trac_runtime, "procid=%d: Expected=%X, Actual=%X", curproc->procid, tmp1, *tmp1_act );
TS_FAIL("fapi::ATTR_CHIP_ID data is wrong");
}
}
@@ -253,7 +253,7 @@ class RuntimeTest: public CxxTest::TestSuite
(beginning+headers[attr].offset);
if( *tmp2_act != tmp2 )
{
- TRACFCOMP( g_trac_runtime, "Expected=%X, Actual=%X", tmp2, *tmp2_act );
+ TRACFCOMP( g_trac_runtime, "procid=%d: Expected=%X, Actual=%X", curproc->procid, tmp2, *tmp2_act );
TS_FAIL("fapi::ATTR_PM_PVSAFE_PSTATE data is wrong");
}
}
@@ -262,13 +262,12 @@ class RuntimeTest: public CxxTest::TestSuite
}
if( attr != curproc->numAttr )
{
- TRACFCOMP( g_trac_runtime, "numAttr=%d, found attr=%d", curproc->numAttr, attr );
- TS_FAIL("Number of attributes found doesn't match expected value");
+ TRACFCOMP( g_trac_runtime, "procid=%d: numAttr=%d, found attr=%d", curproc->procid, curproc->numAttr, attr );
+ TS_FAIL("testVerifyNodeAttributes> Number of attributes found doesn't match expected value");
}
delete proc;
curproc++;
- TRACFCOMP( g_trac_runtime, "curproc=%p", curproc );
}
@@ -333,7 +332,7 @@ class RuntimeTest: public CxxTest::TestSuite
(beginning+headers[attr].offset);
if( *tmp1_act != tmp1 )
{
- TRACFCOMP( g_trac_runtime, "Expected=%X, Actual=%X", tmp1, *tmp1_act );
+ TRACFCOMP( g_trac_runtime, "procid=%d: Expected=%X, Actual=%X", curproc->procid, tmp1, *tmp1_act );
TS_FAIL("fapi::ATTR_CHIP_UNIT_POS data is wrong");
}
}
@@ -353,7 +352,7 @@ class RuntimeTest: public CxxTest::TestSuite
(beginning+headers[attr].offset);
if( *tmp2_act != tmp2 )
{
- TRACFCOMP( g_trac_runtime, "Expected=%X, Actual=%X", tmp2, *tmp2_act );
+ TRACFCOMP( g_trac_runtime, "procid=%d: Expected=%X, Actual=%X", curproc->procid, tmp2, *tmp2_act );
TS_FAIL("fapi::ATTR_FUNCTIONAL data is wrong");
}
}
@@ -362,7 +361,7 @@ class RuntimeTest: public CxxTest::TestSuite
}
if( attr != curex->numAttr )
{
- TRACFCOMP( g_trac_runtime, "numAttr=%d, found attr=%d", curex->numAttr, attr );
+ TRACFCOMP( g_trac_runtime, "procid=%d: numAttr=%d, found attr=%d", curproc->procid, curex->numAttr, attr );
TS_FAIL("Number of attributes found doesn't match expected value");
}
OpenPOWER on IntegriCloud