Skip to content

Commit

Permalink
Level 3 : OCB & OCC procedures
Browse files Browse the repository at this point in the history
Change-Id: I9c41fbb577680070742549f9ba9aec764ce0516c
RTC: 172617
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39636
Tested-by: Jenkins Server <pfd-jenkins+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: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39640
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Sangeetha T S authored and dcrowell77 committed May 19, 2017
1 parent dca4c1b commit 8be1d72
Show file tree
Hide file tree
Showing 13 changed files with 291 additions and 135 deletions.
38 changes: 31 additions & 7 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_ocb_indir_access.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -29,8 +29,8 @@
// *HWP HWP Backup Owner: Greg Still <stillgs@us.ibm.com>
// *HWP FW Owner : Sangeetha T S <sangeet2@in.ibm.com>
// *HWP Team : PM
// *HWP Level : 2
// *HWP Consumed by : FSP:HS
// *HWP Level : 3
// *HWP Consumed by : SBE:HS

///
/// High-level procedure flow:
Expand Down Expand Up @@ -60,6 +60,10 @@ enum
OCB_FULL_POLL_DELAY_SIM = 0
};

// ----------------------------------------------------------------------
// Function definitions
// ----------------------------------------------------------------------

fapi2::ReturnCode p9_pm_ocb_indir_access(
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
const p9ocb::PM_OCB_CHAN_NUM i_ocb_chan,
Expand Down Expand Up @@ -134,12 +138,15 @@ fapi2::ReturnCode p9_pm_ocb_indir_access(
FAPI_TRY(fapi2::putScom(i_target, l_OCBAR_address, l_data64));
}

// PUT Operation
// PUT Operation: Write data to the SRAM in the given location
// via the OCB channel
if ( i_ocb_op == p9ocb::OCB_PUT )
{
FAPI_INF("OCB access for data write operation");
FAPI_ASSERT(io_ocb_buffer != NULL,
fapi2::PM_OCB_PUT_NO_DATA_ERROR(),
fapi2::PM_OCB_PUT_NO_DATA_ERROR().
set_CHANNEL(i_ocb_chan).
set_DATA_SIZE(i_ocb_req_length),
"No data provided for PUT operation");

fapi2::buffer<uint64_t> l_data64;
Expand Down Expand Up @@ -186,7 +193,9 @@ fapi2::ReturnCode p9_pm_ocb_indir_access(

FAPI_ASSERT((true == l_push_ok_flag),
fapi2::PM_OCB_PUT_DATA_POLL_NOT_FULL_ERROR().
set_PUSHQ_STATE(l_data64),
set_CHANNEL(i_ocb_chan).
set_DATA_SIZE(i_ocb_req_length).
set_TARGET(i_target),
"Polling timeout waiting on push non-full");
}
}
Expand All @@ -196,6 +205,13 @@ fapi2::ReturnCode p9_pm_ocb_indir_access(
for(uint32_t l_index = 0; l_index < i_ocb_req_length; l_index++)
{
l_data64.insertFromRight(io_ocb_buffer[l_index], 0, 64);
/* The data read is done via this getscom operation.
* A data write failure will be logged off as a simple scom failure.
* Need to find a way to distiniguish this error and collect
* additional information incase of a failure.*/
// @TODO RTC 173286 - FAPI2: FAPI_TRY (or surrogate name)
// that allows access to the return code for
// HWP reaction
FAPI_TRY(fapi2::putScom(i_target, l_OCBDR_address, l_data64),
"ERROR:Failed to complete write to channel data register");
o_ocb_act_length++;
Expand All @@ -205,17 +221,25 @@ fapi2::ReturnCode p9_pm_ocb_indir_access(

FAPI_DBG("%d blocks(64bits each) of data put", o_ocb_act_length);
}
// GET Operation
// GET Operation: Data read from the given location in SRAM via OCB channel
else if( i_ocb_op == p9ocb::OCB_GET )
{
FAPI_INF("OCB access for data read operation");

fapi2::buffer<uint64_t> l_data64;
uint64_t l_data = 0;

// Read data from the Channel Data Register in blocks of 64 bits.
for (uint32_t l_loopCount = 0; l_loopCount < i_ocb_req_length;
l_loopCount++)
{
/* The data read is done via this getscom operation.
* A data read failure will be logged off as a simple scom failure.
* Need to find a way to distiniguish this error and collect
* additional information incase of a failure.*/
// @TODO RTC 173286 - FAPI2: FAPI_TRY (or surrogate name)
// that allows access to the return code for
// HWP reaction
FAPI_TRY(fapi2::getScom(i_target, l_OCBDR_address, l_data64),
"ERROR: Failed to read data from channel %d", i_ocb_chan);
l_data64.extract(l_data, 0, 64);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -31,8 +31,8 @@
// *HWP HWP Backup Owner: Greg Still <stillgs@us.ibm.com>
// *HWP FW Owner : Sangeetha T S <sangeet2@in.ibm.com>
// *HWP Team : PM
// *HWP Level : 2
// *HWP Consumed by : FSP:HS
// *HWP Level : 3
// *HWP Consumed by : SBE:HS

#ifndef _P9_PM_OCB_INDIR_ACCESS_H_
#define _P9_PM_OCB_INDIR_ACCESS_H_
Expand Down
19 changes: 10 additions & 9 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_ocb_init.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -26,14 +26,13 @@
/// @file p9_pm_ocb_init.C
/// @brief Setup and configure OCB channels
///
// *HWP HWP Owner: Amit Kumar <akumar3@us.ibm.com>
// *HWP FW Owner: Sangeetha T S <sangeet2@in.ibm.com>
// *HWP Team: PM
// *HWP Level: 2
// *HWP Consumed by: FSP:HS
// *HWP HWP Owner : Amit Kumar <akumar3@us.ibm.com>
// *HWP HWP Backup Owner: Greg Still <stillgs@us.ibm.com>
// *HWP FW Owner : Sangeetha T S <sangeet2@in.ibm.com>
// *HWP Team : PM
// *HWP Level : 3
// *HWP Consumed by : SBE:HS

/// Add support for linear window mode
///
/// High-level procedure flow:
///
/// - if mode = PM_INIT
Expand Down Expand Up @@ -293,7 +292,9 @@ fapi2::ReturnCode pm_ocb_setup(
FAPI_ASSERT(
false,
fapi2::PM_OCBINIT_BAD_Q_LENGTH_PARM().
set_BADQLENGTH(i_ocb_q_len),
set_BADQLENGTH(i_ocb_q_len).
set_CHANNEL(i_ocb_chan).
set_TYPE(i_ocb_type),
"ERROR: Bad Queue Length Passed to Procedure => %d",
i_ocb_q_len);
}
Expand Down
7 changes: 4 additions & 3 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_ocb_init.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -27,10 +27,11 @@
/// @brief Setup and configure OCB channels
///
// *HWP HWP Owner: Amit Kumar <akumar3@us.ibm.com>
// *HWP HWP Backup Owner: Greg Still <stillgs@us.ibm.com>
// *HWP FW Owner: Sangeetha T S <sangeet2@in.ibm.com>
// *HWP Team: PM
// *HWP Level: 2
// *HWP Consumed by: FSP:HS
// *HWP Level: 3
// *HWP Consumed by: SBE:HS

#ifndef _P9_PM_OCB_INIT_H_
#define _P9_PM_OCB_INIT_H_
Expand Down

0 comments on commit 8be1d72

Please sign in to comment.