summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/nest/p9_phb_hv_access.C
diff options
context:
space:
mode:
authorJoe McGill <jmcgill@us.ibm.com>2017-09-30 14:56:01 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-10-16 13:56:39 -0400
commitc80b7f135edcfea347a5213beaf2e827af910b67 (patch)
treec061a103ebd32b42b403db1872a39116b556b809 /src/import/chips/p9/procedures/hwp/nest/p9_phb_hv_access.C
parent4b4eded7e95f7548fef9e9b3c097ae202ffe485d (diff)
downloadtalos-hostboot-c80b7f135edcfea347a5213beaf2e827af910b67.tar.gz
talos-hostboot-c80b7f135edcfea347a5213beaf2e827af910b67.zip
update HWP level metadata for nest, common files
Change-Id: If6f5b8548bb7b64bb868497c6de39ae12306eb1b Original-Change-Id: I451695b8ae1d8f7d5ed6d512631992dea98b5ee8 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46967 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Benjamin Gass <bgass@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48380 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/nest/p9_phb_hv_access.C')
-rw-r--r--src/import/chips/p9/procedures/hwp/nest/p9_phb_hv_access.C113
1 files changed, 50 insertions, 63 deletions
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_phb_hv_access.C b/src/import/chips/p9/procedures/hwp/nest/p9_phb_hv_access.C
index 815060ab1..bfadd7520 100644
--- a/src/import/chips/p9/procedures/hwp/nest/p9_phb_hv_access.C
+++ b/src/import/chips/p9/procedures/hwp/nest/p9_phb_hv_access.C
@@ -22,7 +22,7 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
-//-----------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
//
/// @file p9_phb_hv_access.C
/// @brief Perform read/write to PHB HV register space. (FAPI)
@@ -30,85 +30,72 @@
// *HWP HWP Owner: Ricardo Mata Jr. ricmata@us.ibm.com
// *HWP FW Owner: Thi Tran thi@us.ibm.com
// *HWP Team: Nest
-// *HWP Level: 2
+// *HWP Level: 3
// *HWP Consumed by: HB
//
-//-----------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
-//-----------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// Includes
-//-----------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
#include <p9_phb_hv_access.H>
#include <p9_phb_hv_utils.H>
-extern "C"
-{
- //---------------------------------------------------------------------------------
- // Function definitions
- //---------------------------------------------------------------------------------
-
- //------------------------------------------------------------------------------
- // name: p9_phb_hv_access
- //------------------------------------------------------------------------------
- // purpose:
- // Performs read/write to PHB HV register space.
- //
- // parameters:
- // 'i_target' is reference to phb target.
- // 'i_address' is the PHB HV register offset between 0x0000 - 0x1FFF
- // 'i_rnw' is flag to specify read (1) or write (0).
- // 'i_size' is flag to specify 4B op (1) or 8B op (0).
- // 'io_data' input data for writes or output data for reads.
- //
- // returns:
- // FAPI_RC_SUCCESS (success)
- //
- // getscom/putscom fapi errors
- // fapi error assigned from eCMD function failure
- //
- //------------------------------------------------------------------------------
- fapi2::ReturnCode p9_phb_hv_access(const fapi2::Target<fapi2::TARGET_TYPE_PHB>& i_target, const uint32_t i_address,
- bool const i_rnw, bool const i_size, uint64_t& io_data)
- {
+//------------------------------------------------------------------------------
+// Function definitions
+//------------------------------------------------------------------------------
- uint8_t l_phb_id = 0;
+fapi2::ReturnCode p9_phb_hv_access(
+ const fapi2::Target<fapi2::TARGET_TYPE_PHB>& i_target,
+ const uint32_t i_address,
+ bool const i_rnw,
+ bool const i_size,
+ uint64_t& io_data)
+{
- //Get the PHB id
- FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, i_target, l_phb_id));
+ uint8_t l_phb_id = 0;
- FAPI_DBG("PHB%i: Start PHB HV read/write access", l_phb_id);
+ //Get the PHB id
+ FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, i_target, l_phb_id));
- //Check ETU state
- FAPI_TRY(p9_phb_hv_check_etu_state(i_target), " Error from p9_phb_hv_check_etu_state");
+ FAPI_DBG("PHB%i: Start PHB HV read/write access", l_phb_id);
- //Check arguments
- FAPI_TRY(p9_phb_hv_check_args(i_target, i_address, i_size), " Error from p9_phb_hv_check_args");
+ //Check ETU state
+ FAPI_TRY(p9_phb_hv_check_etu_state(i_target),
+ "Error from p9_phb_hv_check_etu_state");
- //Clear contents of PHB HV Indirect Address Register
- FAPI_TRY(p9_phb_hv_clear(i_target), " Error from p9_phb_hv_clear");
+ //Check arguments
+ FAPI_TRY(p9_phb_hv_check_args(i_target, i_address, i_size),
+ "Error from p9_phb_hv_check_args");
- //setup the PHB HV registers for the read/write
- FAPI_TRY(p9_phb_hv_setup(i_target, i_address, i_size), " Error from p9_phb_hv_setup");
+ //Clear contents of PHB HV Indirect Address Register
+ FAPI_TRY(p9_phb_hv_clear(i_target),
+ "Error from p9_phb_hv_clear");
- if (i_rnw)
- {
- //Setup PHB HV Indirect for read access
- FAPI_TRY(p9_phb_hv_read(i_target, i_address, i_size, io_data), " Error from p9_phb_hv_read");
- }
- else
- {
- //Setup PHB HV Indirect for write access
- FAPI_TRY(p9_phb_hv_write(i_target, i_address, i_size, io_data), " Error from p9_phb_hv_write");
- }
+ //setup the PHB HV registers for the read/write
+ FAPI_TRY(p9_phb_hv_setup(i_target, i_address, i_size),
+ "Error from p9_phb_hv_setup");
- //Clear contents of PHB HV Indirect Address Register
- FAPI_TRY(p9_phb_hv_clear(i_target), " Error from p9_phb_hv_clear");
+ if (i_rnw)
+ {
+ //Setup PHB HV Indirect for read access
+ FAPI_TRY(p9_phb_hv_read(i_target, i_address, i_size, io_data),
+ "Error from p9_phb_hv_read");
+ }
+ else
+ {
+ //Setup PHB HV Indirect for write access
+ FAPI_TRY(p9_phb_hv_write(i_target, i_address, i_size, io_data),
+ "Error from p9_phb_hv_write");
+ }
+ //Clear contents of PHB HV Indirect Address Register
+ FAPI_TRY(p9_phb_hv_clear(i_target),
+ "Error from p9_phb_hv_clear");
- fapi_try_exit:
- FAPI_DBG("PHB%i: End PHB HV read/write Procedure", l_phb_id);
- return fapi2::current_err;
- }
+fapi_try_exit:
+ FAPI_DBG("PHB%i: End PHB HV read/write Procedure", l_phb_id);
+ return fapi2::current_err;
-} // extern "C
+}
OpenPOWER on IntegriCloud