diff options
author | Caleb Palmer <cnpalmer@us.ibm.com> | 2016-02-04 09:36:23 -0600 |
---|---|---|
committer | Stephen Cprek <smcprek@us.ibm.com> | 2016-04-21 13:51:30 -0500 |
commit | 9e85b54b1858fe7c4b876fdb1947df3aa60f524c (patch) | |
tree | f84082593013cf6e3275e5dc9bcf4667b2398a7c /src/usr/diag/prdf/test | |
parent | 31d4fe68b8c1b45237ce6af1b4cef95d9b0f0fde (diff) | |
download | blackbird-hostboot-9e85b54b1858fe7c4b876fdb1947df3aa60f524c.tar.gz blackbird-hostboot-9e85b54b1858fe7c4b876fdb1947df3aa60f524c.zip |
PRD: Restore SCOM Interfaces for P9
Change-Id: Iab41fe8422a0f28cb2f47bfe1773065db22b1f7c
RTC: 144696
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21191
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/23126
Tested-by: FSP CI Jenkins
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf/test')
-rwxr-xr-x | src/usr/diag/prdf/test/makefile | 3 | ||||
-rw-r--r-- | src/usr/diag/prdf/test/prdfTest_ScomAccessInterface.H | 123 | ||||
-rwxr-xr-x | src/usr/diag/prdf/test/prdfsimHomRegisterAccess.C | 7 | ||||
-rwxr-xr-x | src/usr/diag/prdf/test/prdfsimHomRegisterAccess.H | 8 |
4 files changed, 134 insertions, 7 deletions
diff --git a/src/usr/diag/prdf/test/makefile b/src/usr/diag/prdf/test/makefile index 6119a5615..dd3ff3fbd 100755 --- a/src/usr/diag/prdf/test/makefile +++ b/src/usr/diag/prdf/test/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2012,2015 +# Contributors Listed Below - COPYRIGHT 2012,2016 # [+] International Business Machines Corp. # # @@ -49,5 +49,6 @@ TESTS += prdfTest_WriteHomerFir.H endif TESTS += prdfTest_MfgSync.H +TESTS += prdfTest_ScomAccessInterface.H include ${ROOTPATH}/config.mk diff --git a/src/usr/diag/prdf/test/prdfTest_ScomAccessInterface.H b/src/usr/diag/prdf/test/prdfTest_ScomAccessInterface.H new file mode 100644 index 000000000..492e5e376 --- /dev/null +++ b/src/usr/diag/prdf/test/prdfTest_ScomAccessInterface.H @@ -0,0 +1,123 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/test/prdfTest_ScomAccessInterface.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef __TEST_PRDFSCOMACCESS_H +#define __TEST_PRDFSCOMACCESS_H + +/** + * @file prdfTest_ScomAccessInterface.H + * + * @brief prdf unit test for scom access interfaces + */ + +#ifdef __HOSTBOOT_MODULE + #include <cxxtest/TestSuite.H> + #include <errl/errlentry.H> + #include <errl/errlmanager.H> +#else + #include <cxxtest/TestSuite.h> + #include <fsp/FipsGlobalFixture.H> + #include <errlentry.H> +#endif + +#include <prdfTrace.H> +#include <prdfMain.H> +#include "prdfsimMacros.H" + +#include <prdfPlatServices.H> +#include <prdfBitString.H> +#include <prdfScomRegister.H> + +using namespace PRDF; + + +class ScomAccessInterface: public CxxTest::TestSuite +{ +public: + + void TestScomInterfaces(void) + { + TS_TRACE(ENTER_MRK "-Scom Access Interface Test 1 - Put Scom - Start-"); + + uint32_t rc = SUCCESS; + TARGETING::TargetHandle_t target; + + //we will be using bit 61 of this address which is a spare bit in the + //OCC fir, which shouldn't generate an attention + uint64_t address = 0x01010800; + CPU_WORD l_cpuWord[(64)/(sizeof(CPU_WORD)*8)] = {0}; + BIT_STRING_CLASS exp(64, l_cpuWord); + BIT_STRING_CLASS bs(64, l_cpuWord); + + TARGETING::TargetHandleList targetList = + PRDF::PlatServices::getFunctionalTargetList(TARGETING::TYPE_PROC); + + do + { + + if (0 == targetList.size()) + { + TS_FAIL("List of functional procs is empty"); + break; + } + else + { + target = targetList[0]; + } + + //spare bit in OCC fir + bs.Set(61); + + rc = PRDF::PlatServices::putScom(target, bs, address); + + exp.SetBits(bs); + + if (SUCCESS != rc) + { + TS_FAIL("Unexpected error calling PRDF::PlatServices::putScom"); + break; + } + bs.Clear(); + + rc = PRDF::PlatServices::getScom(target, bs, address); + + if (SUCCESS != rc) + { + TS_FAIL("Unexpected error calling PRDF::PlatServices::getScom"); + break; + } + + if (!(exp == bs)) + { + TS_FAIL("Unexpected data from getScom"); + break; + } + }while(0); + + TS_TRACE(EXIT_MRK "- Scom Access Interface Test 1 - Put Scom - End -"); + } + +}; +#endif diff --git a/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.C b/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.C index 266254198..e040b7777 100755 --- a/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.C +++ b/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.C @@ -40,13 +40,13 @@ SimScomAccessor::~SimScomAccessor() } -errlHndl_t SimScomAccessor::Access(TARGETING::TargetHandle_t i_target, +uint32_t SimScomAccessor::Access(TARGETING::TargetHandle_t i_target, BIT_STRING_CLASS & bs, uint64_t registerId, MopRegisterAccess::Operation operation) const { PRDF_DENTER("SimScomAccessor::Access()"); - errlHndl_t errlH = NULL; + uint32_t rc = SUCCESS; ScrDB::SimOp l_op = ScrDB::MAX_OP; do @@ -57,6 +57,7 @@ errlHndl_t SimScomAccessor::Access(TARGETING::TargetHandle_t i_target, case MopRegisterAccess::READ: l_op = ScrDB::READ; break; default: PRDF_ERR( "SimScomAccessor::Access() unsupported operation: 0x%X", operation ); + rc = PRD_SCANCOM_FAILURE; break; } getSimServices().processCmd(i_target, bs, registerId, l_op); @@ -65,7 +66,7 @@ errlHndl_t SimScomAccessor::Access(TARGETING::TargetHandle_t i_target, PRDF_DEXIT("SimScomAccessor::Access()"); - return errlH; + return rc; } } // End namespace PRDF diff --git a/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.H b/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.H index f61ad846e..5a6b6ffb7 100755 --- a/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.H +++ b/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2016 */ +/* [+] 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. */ @@ -63,12 +65,12 @@ class SimScomAccessor : public ScomAccessor @param BIT_STRING_CLASS - holds data read or to write @param register address @param [READ|WRITE] - @returns NULL if success, valid error handle otherwise + @returns SUCCESS or PRD_SCANCOM_FAILURE @pre bs.Length() must be size of register data to read/write @post For read operation, bs is modified to reflect hardware register state @note */ - virtual errlHndl_t Access(TARGETING::TargetHandle_t i_target, + virtual uint32_t Access(TARGETING::TargetHandle_t i_target, BIT_STRING_CLASS & bs, uint64_t registerId, MopRegisterAccess::Operation operation) const; |