summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/occ
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2013-09-17 10:14:10 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-10-09 19:22:52 -0500
commit317a6c4dd591a626168c54df1ebc10b3e4faff24 (patch)
tree8b0d123ce5c013556738ac4901f4f3bba7d6da03 /src/usr/hwpf/hwp/occ
parent2ffd66d3fe29208a1a08dac4ef7f21c51198f3e5 (diff)
downloadtalos-hostboot-317a6c4dd591a626168c54df1ebc10b3e4faff24.tar.gz
talos-hostboot-317a6c4dd591a626168c54df1ebc10b3e4faff24.zip
SBE start workaround HWP for SPLess, p8_ocb_* HWP
Change-Id: Ie420cb8ef0fe15a0f5bc3c7f9229a3995c11f775 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6199 Tested-by: Jenkins Server Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/occ')
-rw-r--r--src/usr/hwpf/hwp/occ/makefile4
-rw-r--r--src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_access.C388
-rw-r--r--src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_access.H122
-rw-r--r--src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_setup_linear.C82
-rw-r--r--src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_setup_linear.H56
5 files changed, 651 insertions, 1 deletions
diff --git a/src/usr/hwpf/hwp/occ/makefile b/src/usr/hwpf/hwp/occ/makefile
index 3a7473721..51a499680 100644
--- a/src/usr/hwpf/hwp/occ/makefile
+++ b/src/usr/hwpf/hwp/occ/makefile
@@ -70,7 +70,9 @@ OBJS = occ.o \
#they can implement OCC Reset.
OBJS+= p8_pm_prep_for_reset.o \
proc_cpu_special_wakeup.o \
- p8_pmc_force_vsafe.o
+ p8_pmc_force_vsafe.o \
+ p8_ocb_indir_access.o \
+ p8_ocb_indir_setup_linear.o
## NOTE: add a new directory onto the vpaths when you add a new HWP
## EXAMPLE:
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_access.C b/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_access.C
new file mode 100644
index 000000000..27f8f988d
--- /dev/null
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_access.C
@@ -0,0 +1,388 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_access.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013 */
+/* */
+/* 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 */
+// $Id: p8_ocb_indir_access.C,v 1.2 2012/12/08 14:01:47 stillgs Exp $
+// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_ocb_indir_access.C,v $
+//------------------------------------------------------------------------------
+// *! (C) Copyright International Business Machines Corp. 2011
+// *! All Rights Reserved -- Property of IBM
+// *! *** IBM Confidential ***
+//------------------------------------------------------------------------------
+// *! OWNER NAME: Greg Still Email: stillgs@us.ibm.com
+// *!
+/// \file p8_ocb_indir_access.C
+/// \brief Performs the data transfer to/from an OCB indirect channel
+///
+///
+/// \todo add to required proc ENUM requests
+///
+/// High-level procedure flow:
+/// \verbatim
+///
+///
+/// Per HW220256, for Murano DD1, a push (Put) must first check for non-full
+/// condition to avoid a data corruption scenario. This is fixed in
+/// Venice DD1.
+/// \endverbatim
+///
+//------------------------------------------------------------------------------
+
+
+// ----------------------------------------------------------------------
+// Includes
+// ----------------------------------------------------------------------
+#include "p8_pm.H"
+#include "p8_ocb_indir_access.H"
+
+
+using namespace fapi;
+
+extern "C" {
+
+// ----------------------------------------------------------------------
+// Constant definitions
+// ----------------------------------------------------------------------
+
+// Needed for HW220256 protection
+// Set to 10ms at 2us per read
+//#define OCB_FULL_POLL_MAX 10000/2
+// temp for sim
+#define OCB_FULL_POLL_MAX 4
+#define OCB_FULL_POLL_DELAY_HDW 0
+#define OCB_FULL_POLL_DELAY_SIM 0
+
+// ----------------------------------------------------------------------
+// Global variables
+// ----------------------------------------------------------------------
+
+// ----------------------------------------------------------------------
+// Function prototypes
+// ----------------------------------------------------------------------
+
+// ----------------------------------------------------------------------
+// Function definitions
+// ----------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+// Function prototype
+//------------------------------------------------------------------------------
+/// \param[in] &i_target Chip target
+/// \param[in] i_ocb_chan OCB channel number (0, 1, 2, 3)
+/// \param[in] i_ocb_op Operation (Get, Put)
+/// \param[in] i_ocb_req_length Requested length in the number of 8B
+/// elements to be accessed (unit origin)
+/// Number of bytes = (i_ocb_req_length) *
+/// 8B
+/// \param[in/out] &io_ocb_buffer Reference to ecmdDataBuffer
+/// \param[out] &o_ocb_act_length Address containing to contain the actual
+/// length in the number of 8B elements to
+/// be accessed (zero origin)
+/// Number of bytes = (i_ocb_act_length+1) *
+/// 8B
+/// \param[in] i_oci_address_valid Indicator that oci_address is to be used
+/// \param[in] i_oci_address OCI Address to be used for the operation
+
+
+/// \retval ECMD_SUCCESS if something good happens,
+/// \retval BAD_RETURN_CODE otherwise
+fapi::ReturnCode
+p8_ocb_indir_access( const fapi::Target& i_target, \
+ uint32_t i_ocb_chan, \
+ uint32_t i_ocb_op, \
+ uint32_t i_ocb_req_length, \
+ ecmdDataBufferBase& io_ocb_buffer, \
+ uint32_t& o_ocb_act_length, \
+ bool i_oci_address_valid, \
+ uint32_t i_oci_address)
+{
+
+ fapi::ReturnCode rc;
+ uint32_t l_ecmdRc = 0;
+ ecmdDataBufferBase data(64);
+ ecmdDataBufferBase address(64);
+
+ uint64_t OCBAR_address = 0;
+ uint64_t OCBDR_address = 0;
+ uint64_t OCBCSR_address = 0;
+ uint64_t OCBSHCR_address = 0;
+ uint64_t temp_address = 0;
+
+ uint32_t buffer_ptr;
+
+ FAPI_INF("Executing p8_ocb_indir_access op %x channel %x of length (in 8B) %x....",
+ i_ocb_op, i_ocb_chan, i_ocb_req_length);
+
+ FAPI_DBG("Checking channel validity");
+ switch ( i_ocb_chan )
+ {
+ case 0:
+ OCBAR_address = OCB0_ADDRESS_0x0006B010;
+ OCBDR_address = OCB0_DATA_0x0006B015;
+ OCBCSR_address = OCB0_STATUS_CONTROL_0x0006B011;
+ OCBSHCR_address = OCB0_PUSH_STATUS_CONTROL_0x0006A204;
+ break;
+ case 1:
+ OCBAR_address = OCB1_ADDRESS_0x0006B030;
+ OCBDR_address = OCB1_DATA_0x0006B035;
+ OCBCSR_address = OCB1_STATUS_CONTROL_0x0006B031;
+ OCBSHCR_address = OCB1_PUSH_STATUS_CONTROL_0x0006A214;
+ break;
+ case 2:
+ OCBAR_address = OCB2_ADDRESS_0x0006B050;
+ OCBDR_address = OCB2_DATA_0x0006B055;
+ OCBCSR_address = OCB2_STATUS_CONTROL_0x0006B051;
+ OCBSHCR_address = OCB2_PUSH_STATUS_CONTROL_0x0006A224;
+ break;
+ case 3:
+ OCBAR_address = OCB3_ADDRESS_0x0006B070;
+ OCBDR_address = OCB3_DATA_0x0006B075;
+ break;
+ default:
+ FAPI_ERR("Invalid OCB access channel %x", i_ocb_chan);
+ FAPI_SET_HWP_ERROR(rc, RC_PROCPM_OCB_ACCESS_CHANNEL);
+ return rc;
+ }
+
+ /// -------------------------------
+ /// Deal with oci_address_valid condition.
+ /// If address is valid, write the relevant channel OCBAR
+ if ( i_oci_address_valid )
+ {
+
+ /// The following cases apply:
+ /// Circular Channel: OCBAR is irrelevant; write it anyway
+ /// Linear: OCBAR will set the accessed location
+ /// Linear Stream: OCBAR will establish the address from which
+ /// auto-increment will commence after
+ /// the first access
+
+ /// \todo: need to perform relevant error checking on the address value
+
+ FAPI_DBG("OCI Address Valid set with OCI Address = %08x",
+ i_oci_address);
+
+ l_ecmdRc |= data.flushTo0();
+ l_ecmdRc |= data.setWord(0, i_oci_address);
+ if (l_ecmdRc)
+ {
+ FAPI_ERR("Error (0x%x) setting up ecmdDataBufferBase", l_ecmdRc);
+ rc.setEcmdError(l_ecmdRc);
+ return rc;
+ }
+
+ rc=fapiPutScom(i_target, (const uint64_t)OCBAR_address, data);
+ if(rc)
+ {
+ FAPI_ERR("OCBAR Putscom failed");
+ return rc;
+ }
+
+ }
+
+ /// The else case is to not touch the OCBAR.
+ /// The following cases apply:
+ /// Circular Channel: OCBAR is irrelevant
+ /// Linear: OCBAR will continue to access the same location
+ /// Linear Stream: OCBAR will auto-increment
+
+ // Initialize output length
+ o_ocb_act_length = 0;
+
+ /// Based on the op, perform the data access
+ if ( i_ocb_op == OCB_PUT )
+ {
+
+ // Start HW220256 protection
+
+ // Determine if the channel is in circular mode. If so, proceed with
+ // checks.
+
+ temp_address = OCBCSR_address;
+ rc=fapiGetScom(i_target, temp_address, data);
+ if (rc)
+ {
+ FAPI_ERR("Get SCOM error for address 0x%08llX", temp_address);
+ return rc;
+ }
+
+ if (data.isBitSet(4) && data.isBitSet(5))
+ {
+ FAPI_DBG("Put: (MurDD1) Circular mode Put detected. Engage extra checks");
+
+ // Check if push queue is enabled. If not, let the store occur
+ // anyway to let the PIB error response return occur. (that is
+ // what will happen if this checking code were not here)
+ temp_address = OCBSHCR_address;
+ rc=fapiGetScom(i_target, temp_address, data);
+ if (rc)
+ {
+ FAPI_ERR("Get SCOM error for address 0x%08llX", temp_address);
+ return rc;
+ }
+
+ if (data.isBitSet(31))
+ {
+ FAPI_DBG("Put: (MurDD1) Poll for a non-full condition to a push "
+ "queue to avoid data corruption problem");
+
+ bool push_ok_flag = false;
+ int p = 0;
+ do
+ {
+ // If the OCB_OCI_OCBSHCS0_PUSH_FULL bit (bit 0) is clear, proceed.
+ // Otherwise, poll
+ if (data.isBitClear(0))
+ {
+ push_ok_flag = true;
+ FAPI_DBG("Put: (MurDD1) Push queue not full. Proceeding.");
+ break;
+ }
+
+ // Point to put in any needed delay.
+ // rc=fapiDelay(OCB_FULL_POLL_DELAY_HDW, OCB_FULL_POLL_DELAY_SIM);
+
+ rc=fapiGetScom(i_target, temp_address, data);
+ if (rc)
+ {
+ FAPI_ERR("Get SCOM error for address 0x%08llX", temp_address);
+ return rc;
+ }
+
+ p++;
+
+ } while (p < OCB_FULL_POLL_MAX);
+
+ if (!push_ok_flag)
+ {
+ FAPI_ERR("Put: Polling timeout waiting on push non-full");
+ FAPI_SET_HWP_ERROR(rc, RC_PROCPM_OCB_PUT_DATA_POLL_NOT_FULL_ERROR);
+ return rc;
+
+ }
+ }
+ }
+ // End HW220256 protection
+
+ FAPI_DBG("Put: Doublewords in passed io_ocb_buffer %x",
+ io_ocb_buffer.getDoubleWordLength());
+ if (io_ocb_buffer.getDoubleWordLength() == 0)
+ {
+ FAPI_ERR("Put: No data passed in io_ocb_buffer");
+ FAPI_SET_HWP_ERROR(rc, RC_PROCPM_OCB_PUT_DATA_LENGTH_ERROR);
+ return rc;
+ }
+
+ FAPI_DBG("Put: Checking buffer lengths - i_ocb_req_length: %x; io_ocb_buffer: %x",
+ i_ocb_req_length, io_ocb_buffer.getDoubleWordLength());
+
+ if ((i_ocb_req_length) != io_ocb_buffer.getDoubleWordLength())
+ {
+ FAPI_ERR("Put: io_ocb_buffer length does not match i_ocb_req_length");
+ FAPI_SET_HWP_ERROR(rc, RC_PROCPM_OCB_PUT_DATA_LENGTH_ERROR);
+ return rc;
+ }
+
+
+ // Walk the input buffer (io_ocb_buffer) 8B (64bits) at a time to write
+ // the channel data register
+ for (buffer_ptr=0; buffer_ptr < (i_ocb_req_length)*64; buffer_ptr+=64)
+ {
+
+ FAPI_DBG("Put: Copy 8B from parameter buffer at location %x into "
+ "working data buffer.", buffer_ptr);
+
+ l_ecmdRc |= data.insert(io_ocb_buffer, 0, 64, buffer_ptr);
+ if (l_ecmdRc)
+ {
+ FAPI_ERR("Put: data insert failed");
+ rc.setEcmdError(l_ecmdRc);
+ return rc;
+ }
+
+ rc = fapiPutScom(i_target, (const uint64_t)OCBDR_address, data);
+ if (rc)
+ {
+ FAPI_ERR("Put SCOM error for OCB indirect access");
+ return rc;
+ }
+ o_ocb_act_length++;
+ FAPI_DBG("Put: Increment output length to %x", o_ocb_act_length);
+ }
+ }
+ else if ( i_ocb_op == OCB_GET )
+ {
+
+ FAPI_DBG("Get: Setting the io_ocb_buffer size to %x doublewords",
+ i_ocb_req_length);
+ // Note: i_ocb_req_length is unit origin (eg 8B = length of 1)
+ l_ecmdRc |= io_ocb_buffer.setDoubleWordLength(i_ocb_req_length);
+ if (l_ecmdRc)
+ {
+ FAPI_ERR("Get: setDoubleWord failed");
+ rc.setEcmdError(l_ecmdRc);
+ return rc;
+ }
+
+ for (buffer_ptr=0; buffer_ptr < (i_ocb_req_length)*64; buffer_ptr+=64)
+ {
+ rc=fapiGetScom(i_target, (const uint64_t)OCBDR_address, data);
+ if (rc)
+ {
+ FAPI_ERR("Get SCOM error for OCB indirect access");
+ return rc;
+ }
+
+ FAPI_DBG("Get: Copy 8B from working data buffer into parameter "
+ "buffer at location: %x", buffer_ptr);
+ l_ecmdRc |= io_ocb_buffer.insert(data, buffer_ptr, 64, 0);
+ if (l_ecmdRc)
+ {
+ FAPI_ERR("Get Buffer copy error");
+ rc.setEcmdError(l_ecmdRc);
+ return rc;
+ }
+ o_ocb_act_length++;
+ FAPI_DBG("Get: Increment output length to %x", o_ocb_act_length);
+ }
+ }
+ else
+ {
+ FAPI_ERR("Invalid OCB access operation %x", i_ocb_op);
+ FAPI_SET_HWP_ERROR(rc, RC_PROCPM_OCB_ACCESS_OP);
+ return rc;
+ }
+
+ // If not non-zero SCOM rc, check that the lengths match.
+ if (i_ocb_req_length != o_ocb_act_length)
+ {
+ FAPI_ERR("OCB access length check failure: input = %8X; output = %8X",
+ i_ocb_req_length, o_ocb_act_length);
+ FAPI_SET_HWP_ERROR(rc, RC_PROCPM_OCB_ACCESS_LENGTH_CHECK);
+ return rc;
+ }
+
+ return rc;
+
+}
+
+
+} // extern "C"
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_access.H b/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_access.H
new file mode 100644
index 000000000..97e32d5f5
--- /dev/null
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_access.H
@@ -0,0 +1,122 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_access.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013 */
+/* */
+/* 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 */
+// $Id: p8_ocb_indir_access.H,v 1.1 2012/08/23 04:58:50 stillgs Exp $
+// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_ocb_indir_access.H,v $
+//------------------------------------------------------------------------------
+// *|
+// *! (C) Copyright International Business Machines Corp. 2011
+// *! All Rights Reserved -- Property of IBM
+// *! *** IBM Confidential ***
+// *|
+// *! TITLE : p8_ocb_indir_access.H
+// *! DESCRIPTION : Access procedure to the OCC OCB indirect channels
+// *!
+// *! OWNER NAME : Jim Yacynych Email: jimyac@us.ibm.com
+// *! BACKUP NAME : Greg Still Email: stillgs@us.ibm.com
+
+//------------------------------------------------------------------------------
+
+#ifndef _P8_OCBINDIRACC_H_
+#define _P8_OCBINDIRACC_H_
+
+
+extern "C" {
+
+
+//------------------------------------------------------------------------------
+// Includes
+//------------------------------------------------------------------------------
+
+
+// function pointer typedef definition for HWP call support
+typedef fapi::ReturnCode (*p8_ocb_indir_access_FP_t)
+ ( const fapi::Target&,
+ uint32_t,
+ uint32_t,
+ uint32_t,
+ ecmdDataBufferBase&,
+ uint32_t&,
+ bool,
+ uint32_t
+ );
+
+//------------------------------------------------------------------------------
+// Constant definitions
+//------------------------------------------------------------------------------
+
+#ifndef _P8_OCB_ACCESS_OP_
+#define _P8_OCB_ACCESS_OP_
+enum P8_OCB_ACCESS_OP {
+ OCB_GET = 0x1,
+ OCB_PUT = 0x2
+ };
+#endif // _P8_OCB_ACCESS_OP_
+
+
+//------------------------------------------------------------------------------
+// Parameter structure definitions
+//------------------------------------------------------------------------------
+
+
+
+//------------------------------------------------------------------------------
+// Function prototype
+//------------------------------------------------------------------------------
+
+/// \brief Provides for the abstract access to an OCB indirect channel that has
+/// been configured previously via p8_ocb_indir_setup_[linear/circular]
+/// procedures
+///
+/// \param[in] &i_target Chip target
+/// \param[in] i_ocb_chan OCB channel number (0, 1, 2, 3)
+/// \param[in] i_ocb_op Operation (Get, Put)
+/// \param[in] i_ocb_req_length Requested length in the number of 8B
+/// elements to be accessed (unit origin)
+/// Number of bytes = (i_ocb_req_length) *
+/// 8B
+/// \param[in/out] &io_ocb_buffer Reference to ecmdDataBuffer
+/// \param[out] &o_ocb_act_length Address containing to contain the actual
+/// length in the number of 8B elements to
+/// be accessed (zero origin)
+/// Number of bytes = (i_ocb_act_length+1) *
+/// 8B
+/// \param[in] i_oci_address_valid Indicator that oci_address is to be used
+/// \param[in] i_oci_address OCI Address to be used for the operation
+
+/// \retval ECMD_SUCCESS if something good happens,
+/// \retval BAD_RETURN_CODE otherwise
+fapi::ReturnCode
+p8_ocb_indir_access(const fapi::Target& i_target,
+ uint32_t i_ocb_chan,
+ uint32_t i_ocb_op,
+ uint32_t i_ocb_req_length,
+ ecmdDataBufferBase& io_ocb_buffer,
+ uint32_t& o_ocb_act_length,
+ bool i_oci_address_valid,
+ uint32_t i_oci_address);
+
+
+
+} // extern "C"
+
+#endif // _P8_OCBINDIRACC_H_
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_setup_linear.C b/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_setup_linear.C
new file mode 100644
index 000000000..919e154d9
--- /dev/null
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_setup_linear.C
@@ -0,0 +1,82 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_setup_linear.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013 */
+/* */
+/* 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 */
+// $Id: p8_ocb_indir_setup_linear.C,v 1.2 2012/10/10 14:47:19 pchatnah Exp $
+// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_ocb_indir_setup_linear.C,v $
+//------------------------------------------------------------------------------
+// *! (C) Copyright International Business Machines Corp. 2012
+// *! All Rights Reserved -- Property of IBM
+// *! *** IBM Confidential ***
+//------------------------------------------------------------------------------
+// *! OWNER NAME: Jim Yacynych Email: jimyac@us.ibm.com
+// *!
+/// \file p8_ocb_indir_setup_linear.C
+/// \brief Configure OCB Channel for Linear Streaming or Non-streaming mode
+///
+/// High-level procedure flow:
+/// \verbatim
+/// Setup specified channel to linear streaming or non-streaming mode by calling proc proc_ocb_init
+///
+/// Procedure Prereq:
+/// - System clocks are running
+/// \endverbatim
+///
+//------------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------
+// Includes
+// ----------------------------------------------------------------------
+
+#include "p8_pm.H"
+#include "p8_ocb_indir_setup_linear.H"
+
+extern "C" {
+
+using namespace fapi;
+
+// ----------------------------------------------------------------------
+// Function definitions
+// ----------------------------------------------------------------------
+/// \param[in] i_target => Chip Target
+/// \param[in] i_ocb_chan => select channel 0-3 to set up (see p8_ocb_init.H)
+/// \param[in] i_ocb_type => linear streaming or non-streaming (see p8_ocb_init.H)
+/// \param[in] i_ocb_bar => 32-bit channel base address (29 bits + "000")
+/// \retval FAPI_RC_SUCCESS
+/// \retval ERROR defined in xml for p8_ocb_init
+
+ReturnCode
+p8_ocb_indir_setup_linear(const Target& i_target, uint8_t i_ocb_chan, uint8_t i_ocb_type, uint32_t i_ocb_bar)
+{
+ ReturnCode rc;
+
+ FAPI_INF("Executing p8_ocb_indir_setup_linear for channel %x as type %x to address 0x%x\n", i_ocb_chan, i_ocb_type, i_ocb_bar);
+
+ FAPI_EXEC_HWP(rc, p8_ocb_init, i_target, PM_SETUP_PIB, i_ocb_chan, i_ocb_type, i_ocb_bar, 0, OCB_Q_ITPTYPE_NULL, OCB_Q_ITPTYPE_NULL);
+ if (!rc.ok()) {
+ FAPI_ERR("Error calling proc_ocb_init from p8_ocb_indir_setup_linear. \n");
+ return rc;
+ }
+
+ return rc;
+}
+
+} //end extern C
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_setup_linear.H b/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_setup_linear.H
new file mode 100644
index 000000000..5697ecebb
--- /dev/null
+++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_setup_linear.H
@@ -0,0 +1,56 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/occ/occ_procedures/p8_ocb_indir_setup_linear.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013 */
+/* */
+/* 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 */
+// $Id: p8_ocb_indir_setup_linear.H,v 1.3 2012/11/30 00:06:44 jimyac Exp $
+// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_ocb_indir_setup_linear.H,v $
+#ifndef _P8_OCB_INDIR_SETUP_LINEAR_H_
+#define _P8_OCB_INDIR_SETUP_LINEAR_H_
+
+#include <fapi.H>
+#include "p8_pm.H"
+#include "p8_ocb_init.H"
+
+// function pointer typedef definition for HWP call support
+typedef fapi::ReturnCode (*p8_ocb_indir_setup_linear_FP_t) (const fapi::Target&,
+ const uint8_t,
+ const uint8_t,
+ const uint32_t);
+
+extern "C" {
+
+//------------------------------------------------------------------------------
+// Function prototype
+//------------------------------------------------------------------------------
+/// \brief Configure OCB Channel for Linear Streaming or Non-streaming mode
+/// \param[in] i_target => Chip Target
+/// \param[in] i_ocb_chan => select channel 0-3 to set up (see p8_ocb_init.H)
+/// \param[in] i_ocb_type => linear streaming or non-streaming (see p8_ocb_init.H)
+/// \param[in] i_ocb_bar => 32-bit channel base address (29 bits + "000")
+
+fapi::ReturnCode p8_ocb_indir_setup_linear(const fapi::Target& i_target,
+ const uint8_t i_ocb_chan,
+ const uint8_t i_ocb_type,
+ const uint32_t i_ocb_bar);
+
+} // extern "C"
+
+#endif
OpenPOWER on IntegriCloud