diff options
| author | Adam Muhle <armuhle@us.ibm.com> | 2012-09-21 11:20:22 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-12-04 09:22:32 -0600 |
| commit | 4204cd1310954b3c4d49554d0d19c71f485c588c (patch) | |
| tree | 5918c3e7bc4707eff62666c85bb9c1e3cb5e53ea /src/usr/ibscom/test | |
| parent | 55ba79e454fc989c561ee5f58435bf610f01dead (diff) | |
| download | talos-hostboot-4204cd1310954b3c4d49554d0d19c71f485c588c.tar.gz talos-hostboot-4204cd1310954b3c4d49554d0d19c71f485c588c.zip | |
IBSCOM Good Path base support
This drop contains only the base IBSCOM good path support
Future Tasks will cover error path, improved test cases,
enabling IBSCOM, etc.
Change-Id: I8405de9c6c46b7c035b664713e5820268863210d
RTC: 50369
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2337
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/ibscom/test')
| -rw-r--r-- | src/usr/ibscom/test/ibscomtest.H | 174 | ||||
| -rw-r--r-- | src/usr/ibscom/test/makefile | 28 |
2 files changed, 202 insertions, 0 deletions
diff --git a/src/usr/ibscom/test/ibscomtest.H b/src/usr/ibscom/test/ibscomtest.H new file mode 100644 index 000000000..189f78049 --- /dev/null +++ b/src/usr/ibscom/test/ibscomtest.H @@ -0,0 +1,174 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/ibscom/test/ibscomtest.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __IBSCOMTEST_H +#define __IBSCOMTEST_H + +/** + * @file ibscomtest.H + * + * @brief Test case for inband scom code +*/ + +#include <cxxtest/TestSuite.H> +#include <errl/errlmanager.H> +#include <errl/errlentry.H> +#include <devicefw/userif.H> +#include <ibscom/ibscomreasoncodes.H> +#include <devicefw/driverif.H> + +extern trace_desc_t* g_trac_ibscom; + +using namespace TARGETING; + + +class IBscomTest: public CxxTest::TestSuite +{ + public: + + /** + * @brief inband scom test #1 + * Write value and read back to verify + */ + void test_IBscom(void) + { + + //TODO Enable and improve test cases RTC: 52900 + return; + + uint64_t fails = 0; + uint64_t total = 0; + errlHndl_t l_err = NULL; + + TARGETING::Target* l_testTarget = NULL; + + // Target: Find a Centaur on the Master processor + TARGETING::Target* l_procTarget = NULL; + TARGETING::targetService().masterProcChipTargetHandle(l_procTarget); + assert(l_procTarget != NULL); + + TARGETING::PredicateCTM l_cent(TARGETING::CLASS_CHIP, + TARGETING::TYPE_MEMBUF, + TARGETING::MODEL_NA); + TARGETING::PredicatePostfixExpr cent_query; + cent_query.push(&l_cent); + + + TARGETING::TargetHandleList centaur_list; + TARGETING::targetService(). + getAssociated(centaur_list, + l_procTarget, + TARGETING::TargetService::CHILD_BY_AFFINITY, + TARGETING::TargetService::ALL, + ¢_query); + + if( centaur_list.size() < 1 ) + { + TS_FAIL( "test_IBscom> ERROR : Unable to find a Centaur chip" ); + return; + } + l_testTarget = *(centaur_list.begin()); + + uint64_t addr = 0x03010E03; + uint64_t orig_data = 0; + uint64_t data = 0x12345678FEEDB0B0; + size_t op_size = sizeof(uint64_t); + + //Save of initial register content + l_err = deviceRead( l_testTarget, + &orig_data, + op_size, + DEVICE_SCOM_ADDRESS(addr) ); + if( l_err ) + { + TRACFCOMP(g_trac_ibscom, + "IBscomTest::test_IBscom> Orig Read: Error from device : addr=0x%X, RC=%X", + addr, l_err->reasonCode() ); + TS_FAIL( "test_IBscom1> ERROR : Unexpected error log from read1" ); + fails++; + errlCommit(l_err,IBSCOM_COMP_ID); + } + + l_err = deviceOp( DeviceFW::WRITE, + l_testTarget, + &data, + op_size, + DEVICE_IBSCOM_ADDRESS(addr) ); + if( l_err ) + { + TRACFCOMP(g_trac_ibscom, + "IBscomTest::test_IBscom> Write: Error from device : addr=0x%X, RC=%X", + addr, l_err->reasonCode() ); + TS_FAIL( "ScomTest::test_IBscom> ERROR : Error log from write1" ); + fails++; + errlCommit(l_err,IBSCOM_COMP_ID); + } + + total++; + + l_err = deviceOp( DeviceFW::READ, + l_testTarget, + &data, + op_size, + DEVICE_IBSCOM_ADDRESS(addr) ); + if( l_err ) + { + TRACFCOMP(g_trac_ibscom, + "IBscomTest::test_IBscom> Read: Error from device : addr=0x%X, RC=%X", + addr, l_err->reasonCode() ); + TS_FAIL( "test_IBscom> ERROR : Error log from read2" ); + fails++; + errlCommit(l_err,IBSCOM_COMP_ID); + } + + total++; + + //Restore original data. + l_err = deviceWrite( l_testTarget, + &orig_data, + op_size, + DEVICE_SCOM_ADDRESS(addr) ); + + if( l_err ) + { + TRACFCOMP(g_trac_ibscom, + "IBscomTest::test_IBscom> Write Orig Data: Error from device : addr=0x%X, RC=%X", + addr, l_err->reasonCode() ); + TS_FAIL( "test_IBscom> ERROR : Error log from write2" ); + fails++; + errlCommit(l_err,IBSCOM_COMP_ID); + } + + + TS_TRACE("test_IBscom runs successfully!"); + TRACFCOMP(g_trac_ibscom, + "IBscomTest::test_IBscom> %d/%d fails", + fails, total ); + + return; + } + + + +}; + +#endif diff --git a/src/usr/ibscom/test/makefile b/src/usr/ibscom/test/makefile new file mode 100644 index 000000000..1a21fa2d3 --- /dev/null +++ b/src/usr/ibscom/test/makefile @@ -0,0 +1,28 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/ibscom/test/makefile $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2012 +# +# p1 +# +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code +# +# The source code for this program is not published or otherwise +# divested of its trade secrets, irrespective of what has been +# deposited with the U.S. Copyright Office. +# +# Origin: 30 +# +# IBM_PROLOG_END_TAG +ROOTPATH = ../../../.. + +MODULE = testibscom +TESTS = *.H + +include ${ROOTPATH}/config.mk |

