summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2014-12-09 09:45:14 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-01-22 17:28:34 -0600
commit3443aa895cfc6ad9acaed6f26622ce540f96e30d (patch)
tree3566d1b79d548b3ef52a71c2d7c921ba79010010
parent32c1363b48266e3c10a37345225d35f06c863073 (diff)
downloadblackbird-hostboot-3443aa895cfc6ad9acaed6f26622ce540f96e30d.tar.gz
blackbird-hostboot-3443aa895cfc6ad9acaed6f26622ce540f96e30d.zip
Data streaming from a hw procedure - simple solution to console
Change-Id: Icbf4b70acbe3909211294be9f0faed338763fc55 RTC: 34190 CMVC-Prereq: 949573 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14799 Tested-by: Jenkins Server Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatTrace.H26
-rw-r--r--src/include/usr/trace/trace.H8
-rw-r--r--src/usr/hwpf/hwp/system_attributes.xml20
-rw-r--r--src/usr/hwpf/plat/fapiPlatUtil.C4
-rw-r--r--src/usr/hwpf/test/hwpftest.H8
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types.xml20
-rw-r--r--src/usr/targeting/common/xmltohb/target_types.xml1
-rw-r--r--src/usr/trace/compdesc.C38
-rw-r--r--src/usr/trace/compdesc.H7
-rw-r--r--src/usr/trace/interface.C9
-rw-r--r--src/usr/trace/runtime/rt_service.C4
-rw-r--r--src/usr/trace/service.C2
-rw-r--r--src/usr/trace/service.H4
13 files changed, 125 insertions, 26 deletions
diff --git a/src/include/usr/hwpf/plat/fapiPlatTrace.H b/src/include/usr/hwpf/plat/fapiPlatTrace.H
index 4e80c03b9..cd578fd28 100644
--- a/src/include/usr/hwpf/plat/fapiPlatTrace.H
+++ b/src/include/usr/hwpf/plat/fapiPlatTrace.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -36,6 +38,7 @@
#include <stdio.h>
#include <trace/interface.H>
+#include <config.h>
//******************************************************************************
// Trace buffer names
@@ -43,6 +46,7 @@
const char * const FAPI_TRACE_NAME = "FAPI";
const char * const FAPI_IMP_TRACE_NAME = "FAPI_I";
const char * const FAPI_SCAN_TRACE_NAME = "SCAN";
+const char * const FAPI_MFG_TRACE_NAME = "FAPI_MFG";
//******************************************************************************
// Trace descriptors that are defined in a C file
@@ -50,6 +54,7 @@ const char * const FAPI_SCAN_TRACE_NAME = "SCAN";
extern trace_desc_t* g_fapiTd;
extern trace_desc_t* g_fapiImpTd;
extern trace_desc_t* g_fapiScanTd;
+extern trace_desc_t* g_fapiMfgTd;
// Information traces (go into fast trace buffer that can wrap often)
#define FAPI_INF(_fmt_, _args_...) TRACFCOMP(g_fapiTd, TRACE_FILENAME _fmt_, ##_args_ )
@@ -66,4 +71,23 @@ extern trace_desc_t* g_fapiScanTd;
// Scan traces
#define FAPI_SCAN(_fmt_, _args_...) TRACSCOMP(g_fapiScanTd, _fmt_, ##_args_)
+// FAPI Mfg traces
+#if defined(CONFIG_CONSOLE) && !defined(__HOSTBOOT_RUNTIME) && \
+ !defined(CONFIG_CONSOLE_OUTPUT_TRACE)
+#include <console/consoleif.H>
+// Traces will go to console if attr override set for this
+#define FAPI_MFG(_fmt_, _args_...) \
+ { \
+ if(TRACE::isDebugEnabled(g_fapiMfgTd)) \
+ { \
+ CONSOLE::displayf(FAPI_MFG_TRACE_NAME,_fmt_, ##_args_); \
+ } \
+ }
+#else
+ // Just define to standard TRACS buffer
+#define FAPI_MFG(_fmt_, _args_...) \
+ TRACSCOMP(g_fapiMfgTd, _fmt_, ##_args_)
+#endif
+
+
#endif // PLATTRACE_H_
diff --git a/src/include/usr/trace/trace.H b/src/include/usr/trace/trace.H
index e5ecf8996..fdcce8892 100644
--- a/src/include/usr/trace/trace.H
+++ b/src/include/usr/trace/trace.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -181,6 +181,12 @@ namespace TRACE
*/
void flushBuffers();
+ /**
+ * @brief Return if debug trace is enabled for input trace descriptor
+ *
+ * @param [in] i_td Trace descriptor to check for debug enable
+ */
+ bool isDebugEnabled(ComponentDesc * i_td);
};
diff --git a/src/usr/hwpf/hwp/system_attributes.xml b/src/usr/hwpf/hwp/system_attributes.xml
index 997c20782..da015fe80 100644
--- a/src/usr/hwpf/hwp/system_attributes.xml
+++ b/src/usr/hwpf/hwp/system_attributes.xml
@@ -5,7 +5,9 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
-<!-- COPYRIGHT International Business Machines Corp. 2012,2014 -->
+<!-- Contributors Listed Below - COPYRIGHT 2012,2015 -->
+<!-- [+] International Business Machines Corp. -->
+<!-- -->
<!-- -->
<!-- Licensed under the Apache License, Version 2.0 (the "License"); -->
<!-- you may not use this file except in compliance with the License. -->
@@ -20,7 +22,7 @@
<!-- permissions and limitations under the License. -->
<!-- -->
<!-- IBM_PROLOG_END_TAG -->
-<!-- $Id: system_attributes.xml,v 1.22 2014/05/23 01:13:54 whs Exp $ -->
+<!-- $Id: system_attributes.xml,v 1.23 2015/01/22 19:32:40 andrewg Exp $ -->
<!--
XML file specifying HWPF attributes.
These are platInit attributes associated with the system.
@@ -374,4 +376,18 @@
    <platInit/>
  </attribute>
<!-- ********************************************************************* -->
+  <attribute>
+    <id>ATTR_MFG_TRACE_ENABLE</id>
+    <targetType>TARGET_TYPE_SYSTEM</targetType>
+    <description>
+ Override this to a non-zero value to have the FAPI manufacturing
+ traces output to the console or go to a fsp trace buffer when
+ console not enabled.
+ In cronus, setting this to a non-zero will output the FAPI_MFG
+ traces to the same location as your other FAPI traces.
+    </description>
+    <valueType>uint8</valueType>
+    <platInit/>
+  </attribute>
+ <!-- ********************************************************************* -->
</attributes>
diff --git a/src/usr/hwpf/plat/fapiPlatUtil.C b/src/usr/hwpf/plat/fapiPlatUtil.C
index dcf83d3b5..5e08ece80 100644
--- a/src/usr/hwpf/plat/fapiPlatUtil.C
+++ b/src/usr/hwpf/plat/fapiPlatUtil.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -53,6 +53,7 @@
trace_desc_t* g_fapiTd;
trace_desc_t* g_fapiImpTd;
trace_desc_t* g_fapiScanTd;
+trace_desc_t* g_fapiMfgTd;
//******************************************************************************
// Global TracInit objects. Construction will initialize the trace buffer
@@ -60,6 +61,7 @@ trace_desc_t* g_fapiScanTd;
TRAC_INIT(&g_fapiTd, FAPI_TRACE_NAME, 2*KILOBYTE);
TRAC_INIT(&g_fapiImpTd, FAPI_IMP_TRACE_NAME, 2*KILOBYTE);
TRAC_INIT(&g_fapiScanTd, FAPI_SCAN_TRACE_NAME, 4*KILOBYTE);
+TRAC_INIT(&g_fapiMfgTd, FAPI_MFG_TRACE_NAME, 4*KILOBYTE);
extern "C"
{
diff --git a/src/usr/hwpf/test/hwpftest.H b/src/usr/hwpf/test/hwpftest.H
index 0774111a8..ad416db08 100644
--- a/src/usr/hwpf/test/hwpftest.H
+++ b/src/usr/hwpf/test/hwpftest.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -181,6 +183,10 @@ public:
FAPI_DBG("Test DBG Trace. string: %s", l_pStr);
FAPI_DBG("Test DBG Trace. 0x%x, %s", l_val, l_pStr);
+ FAPI_MFG("Test MFG Trace");
+ FAPI_MFG("Test MFG Trace. hex: 0x%x", l_val);
+ FAPI_MFG("Test MFG Trace. string: %s", l_pStr);
+ FAPI_MFG("Test MFG Trace. 0x%x, %s", l_val, l_pStr);
return;
}
diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml
index 76b9e8046..0301b682e 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types.xml
@@ -15089,9 +15089,21 @@ firmware notes: Platforms should initialize this attribute to AUTO (0)</descript
<readable/>
<writeable/>
</attribute>
-</attributes>
-
-
-
+<attribute>
+ <id>MFG_TRACE_ENABLE</id>
+ <description>
+ Override this to a non-zero value to have the FAPI manufacturing
+ traces output to the console or go to a fsp trace buffer when
+ console not enabled.
+ </description>
+ <simpleType><uint8_t></uint8_t></simpleType>
+ <persistency>volatile-zeroed</persistency>
+ <readable/>
+ <hwpfToHbAttrMap>
+ <id>ATTR_MFG_TRACE_ENABLE</id>
+ <macro>DIRECT</macro>
+ </hwpfToHbAttrMap>
+</attribute>
+</attributes>
diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
index 5f73d87d5..6d641059f 100644
--- a/src/usr/targeting/common/xmltohb/target_types.xml
+++ b/src/usr/targeting/common/xmltohb/target_types.xml
@@ -123,6 +123,7 @@
<attribute><id>NOMINAL_FREQ_MHZ</id></attribute>
<attribute><id>MNFG_FLAGS</id></attribute>
<attribute><id>FABRIC_TO_PHYSICAL_NODE_MAP</id></attribute>
+ <attribute><id>MFG_TRACE_ENABLE</id></attribute>
<!-- Start memory_attributes.xml -->
<attribute><id>ISDIMM_POWER_CURVE_ALGORITHM_VERSION</id></attribute>
<attribute><id>MRW_POWER_CONTROL_REQUESTED</id></attribute>
diff --git a/src/usr/trace/compdesc.C b/src/usr/trace/compdesc.C
index 9e1d77bea..72c7a2476 100644
--- a/src/usr/trace/compdesc.C
+++ b/src/usr/trace/compdesc.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -94,19 +96,35 @@ namespace TRACE
}
#ifndef __HOSTBOOT_RUNTIME // TODO: RTC 79408
- // Check for special SCAN component to force enable debug trace on.
- if (l_rc && !l_rc->iv_debugEnabled &&
- (0 == memcmp(l_compName, "SCAN", 5)))
+ // Check for special SCAN and FAPI_MFG component to
+ // force enable debug trace on.
+ if (l_rc && !l_rc->iv_debugEnabled)
{
- TARGETING::Target* sys = NULL;
- TARGETING::targetService().getTopLevelTarget(sys);
+ if(0 == memcmp(l_compName, "SCAN", 5))
+ {
+ TARGETING::Target* sys = NULL;
+ TARGETING::targetService().getTopLevelTarget(sys);
- TARGETING::HbSettings hbSettings =
- sys->getAttr<TARGETING::ATTR_HB_SETTINGS>();
+ TARGETING::HbSettings hbSettings =
+ sys->getAttr<TARGETING::ATTR_HB_SETTINGS>();
- if (hbSettings.traceScanDebug)
+ if (hbSettings.traceScanDebug)
+ {
+ l_rc->iv_debugEnabled = true;
+ }
+ }
+ else if(0 == memcmp(l_compName, "FAPI_MFG",9))
{
- l_rc->iv_debugEnabled = true;
+ TARGETING::Target* sys = NULL;
+ TARGETING::targetService().getTopLevelTarget(sys);
+
+ TARGETING::ATTR_MFG_TRACE_ENABLE_type l_mfgTraceEnable =
+ sys->getAttr<TARGETING::ATTR_MFG_TRACE_ENABLE>();
+
+ if (l_mfgTraceEnable)
+ {
+ l_rc->iv_debugEnabled = true;
+ }
}
}
#endif
diff --git a/src/usr/trace/compdesc.H b/src/usr/trace/compdesc.H
index 2c5335c87..9b57b32bb 100644
--- a/src/usr/trace/compdesc.H
+++ b/src/usr/trace/compdesc.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -80,6 +82,9 @@ namespace TRACE
Entry* iv_first; //< First (newest) trace entry.
Entry* iv_last; //< Last (oldest) trace entry.
+
+ friend bool TRACE::isDebugEnabled(ComponentDesc * i_td);
+
};
/** @class ComponentList
diff --git a/src/usr/trace/interface.C b/src/usr/trace/interface.C
index b450416f7..134940185 100644
--- a/src/usr/trace/interface.C
+++ b/src/usr/trace/interface.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -115,6 +117,9 @@ namespace TRACE
Singleton<Service>::instance().flushBuffers();
}
-
+ bool isDebugEnabled(ComponentDesc * i_td)
+ {
+ return i_td->iv_debugEnabled;
+ }
};
diff --git a/src/usr/trace/runtime/rt_service.C b/src/usr/trace/runtime/rt_service.C
index 2c07aab17..ecbb26f2a 100644
--- a/src/usr/trace/runtime/rt_service.C
+++ b/src/usr/trace/runtime/rt_service.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013,2014 */
+/* Contributors Listed Below - COPYRIGHT 2013,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
diff --git a/src/usr/trace/service.C b/src/usr/trace/service.C
index db5ea8590..0c125806c 100644
--- a/src/usr/trace/service.C
+++ b/src/usr/trace/service.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
diff --git a/src/usr/trace/service.H b/src/usr/trace/service.H
index 01c42af5d..e32dc1792 100644
--- a/src/usr/trace/service.H
+++ b/src/usr/trace/service.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
OpenPOWER on IntegriCloud