Skip to content

Commit

Permalink
Modify putrRing code to pull rings from centaur hw image
Browse files Browse the repository at this point in the history
    -Remove hardcoded data data used for centaur init
    -Add code to extract RS4 compressed ring data from centaur
     hardware image

Change-Id: If3f5faaebe384a4e0756b06f518b270c7bd2062b
RTC: 171739
CMVC-Prereq: 1043602
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52063
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
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: Thi N. Tran <thi@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
rjknight authored and dcrowell77 committed Mar 6, 2018
1 parent 82aaa7d commit b456c82
Show file tree
Hide file tree
Showing 10 changed files with 539 additions and 2,058 deletions.
8 changes: 7 additions & 1 deletion src/include/usr/fapi2/hwpf_fapi2_reasoncodes.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,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -63,6 +63,7 @@ namespace fapi2
MOD_FAPI2_GET_ATTR_CEN_VPD_VERSION = 0x14,
MOD_FAPI2_GET_MB_VPD_ATTR = 0x15,
MOD_FAPI2_GET_PLL_BUCKET = 0x16,
MOD_FAPI2_GET_RING = 0x17,
};

/**
Expand Down Expand Up @@ -135,6 +136,11 @@ namespace fapi2
RC_INVALID_TARGET_TYPE = FAPI2_COMP_ID | 0x37,
RC_NO_PARENT_MEMBUF = FAPI2_COMP_ID | 0x38,
RC_INVALID_PARENT_TARGET_FOUND = FAPI2_COMP_ID | 0x39,
RC_GET_RING_SECTION_FAILED = FAPI2_COMP_ID | 0x3A,
RC_ACCESS_RING_FAILED = FAPI2_COMP_ID | 0x3B,
RC_FAILED_TO_DECOMPRESS_RING = FAPI2_COMP_ID | 0x3C,
RC_INCORRECT_HW_IMAGE_TYPE = FAPI2_COMP_ID | 0x3D,
RC_DD_SUPPORT_CHECK_FAILED = FAPI2_COMP_ID | 0x3E,

// HWP generated errors
RC_HWP_GENERATED_ERROR = HWPF_COMP_ID | 0x0f,
Expand Down
4 changes: 1 addition & 3 deletions src/include/usr/fapi2/plat_hw_access.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,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -255,7 +255,6 @@ ReturnCode platPutRing(const Target<T>& i_target,

}


/// @brief Writes a ring to a chip. For MEMBUF targets the ring data will
/// be extracted from the centaur hw image using the ring id.
///
Expand All @@ -267,7 +266,6 @@ ReturnCode platPutRing(const Target<TARGET_TYPE_MEMBUF_CHIP>& i_target,
const RingId_t i_ringID,
const RingMode i_ringMode);


//--------------------------------------------------------------------------
// Operational Mode Error Functions
//--------------------------------------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion src/include/usr/fapi2/plat_utils.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,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -38,6 +38,10 @@
namespace fapi2
{

// max ring size in centaur is 76490 bits - allocate a 10k byte
// buffer as the max size
#define MAX_CENTAUR_RING_SIZE 10 * 1024

///
/// @brief This function answers the question, is scand tracing turned on?
/// The implementation of this function is specific to the platform.
Expand Down
1,960 changes: 0 additions & 1,960 deletions src/include/usr/fapi2/ring_data.H

This file was deleted.

4 changes: 4 additions & 0 deletions src/usr/fapi2/fapi2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ EXTRAINCDIR += ${ROOTPATH}/src/include/usr
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/
EXTRAINCDIR += ${ROOTPATH}/src/import/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/xip/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/centaur/common/include/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/centaur/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs/
EXTRAINCDIR += $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/
EXTRAINCDIR += $(ROOTPATH)/src/import/chips/p9/procedures/hwp/memory/
Expand Down Expand Up @@ -159,6 +161,7 @@ include $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundv_bucke
include $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundv_bucket_attr.mk
include $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundw_bucket.mk
include $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundw_bucket_attr.mk
include $(ROOTPATH)/src/import/chips/centaur/utils/imageProcs/cen_ringId.mk

# We specifically removed this from the istep10.so and placed it here because
# we have to reapply this init on the shutdown path after the interrupt resource
Expand Down Expand Up @@ -187,5 +190,6 @@ VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/
VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/
VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/lib/
VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/initfiles/
VPATH += ${ROOTPATH}/src/import/chips/centaur/utils/imageProcs/
VPATH += ${CENTAUR_VPD_PATH}/
VPATH += ${GENPATH}
21 changes: 12 additions & 9 deletions src/usr/fapi2/plat_hw_access.C
Original file line number Diff line number Diff line change
Expand Up @@ -943,13 +943,15 @@ ReturnCode platPutRing(const Target<TARGET_TYPE_MEMBUF_CHIP>& i_target,
// trace in common fapi2_hw_access.H
bool l_traceit = platIsScanTraceEnabled();

unsigned char * l_ringData = nullptr;
// max ring size in centaur is 76490 bits - allocate a 10k byte
// buffer as the max size
uint8_t * l_ringData = (uint8_t*)malloc(MAX_CENTAUR_RING_SIZE);

size_t l_ringLength = 0;
uint64_t l_ringAddress = 0;

// grab the ring data from the cen.hw_image
l_rc = get_ring(i_target, i_ringID, l_ringData,
l_ringLength, l_ringAddress);
l_rc = get_ring(i_target, i_ringID, l_ringData,l_ringLength, l_ringAddress);

if( l_rc == fapi2::FAPI2_RC_SUCCESS )
{
Expand Down Expand Up @@ -999,12 +1001,10 @@ ReturnCode platPutRing(const Target<TARGET_TYPE_MEMBUF_CHIP>& i_target,
}
else
{
// $TODO RTC:171739 - add error case, current procedure calls
// with ring ids for rings which currently do not have any known
// content but were scanned in p8 - Joe confirmed these rings do
// not currently have content - we will need to decide if procedure
// should be updated to remove the calls or we continue to ignore
FAPI_INF("platPutRing: called with unsupported ring ID %d!", i_ringID);
// Design decision was to add a trace but not error out for rings
// which did not exist in the hw image
FAPI_INF("platPutRing: ring ID %d not present in hw image",
i_ringID);
}
}
else
Expand All @@ -1013,6 +1013,9 @@ ReturnCode platPutRing(const Target<TARGET_TYPE_MEMBUF_CHIP>& i_target,
FAPI_ERR("get_ring() returned error");
}

free(l_ringData);
l_ringData = nullptr;

FAPI_DBG(EXIT_MRK "platPutRing() with RingId_t");
return l_rc;
}
Expand Down

0 comments on commit b456c82

Please sign in to comment.