summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2
diff options
context:
space:
mode:
authorClaus Michael Olsen <cmolsen@us.ibm.com>2017-07-16 09:51:43 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-05 09:31:43 -0400
commite286748a94bde253ec0d0d5bfae7d1df99393546 (patch)
tree2d13581564bea3b6607aa1caff632291ddc59d7e /src/usr/fapi2
parent3661916096ea58e7a99f031a46982106d593a0b2 (diff)
downloadtalos-hostboot-e286748a94bde253ec0d0d5bfae7d1df99393546.tar.gz
talos-hostboot-e286748a94bde253ec0d0d5bfae7d1df99393546.zip
Code restruct: ring_apply
- Consolidating the three <ppe>_image_ring_generation functions into a single shared, and renamed, ring_section_generation function, - Moving several data centric functions into common_ringId API, - Use of sizeof(<type or var>) instead of hardcoded assumptions about structure or data type sizes, - Renaming of variables which makes sense in the context of the scope of this commit, such as: - ringBuffer renamed to ringSection - ringBufSize renamed to ringSectionSize and type changed to uint32_t - Removes the backward compatibility to TORV3/V4 and now only works with latest TOR version, i.e. 6 at this point. About the Hw_ImageBuild_Prereq: - 51511 must have fully propagated into all repos and drivers used in FSP CI tests before this commit (43175) can be merged. 43175 removes the TORV3/V4 backwards compatibility to support TOR ring sections that have TOR level DD coordination. Key_Cronus_Test=XIP_REGRESS Change-Id: I0af25fa623c1c523eb0297e475066497787f3d15 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43175 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> Tested-by: Cronus HW CI <cronushw-ci+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52211 Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2')
-rw-r--r--src/usr/fapi2/plat_utils.C45
1 files changed, 36 insertions, 9 deletions
diff --git a/src/usr/fapi2/plat_utils.C b/src/usr/fapi2/plat_utils.C
index 5c2b30bb3..0d2c0d747 100644
--- a/src/usr/fapi2/plat_utils.C
+++ b/src/usr/fapi2/plat_utils.C
@@ -45,15 +45,11 @@
#include <pnor/pnorif.H>
#include <p9_xip_image.h>
#include <p9_tor.H>
-#include <common_ringId.H>
#include <p9_scan_compression.H>
+#include <cen_ringId.H>
#include "handleSpecialWakeup.H"
-namespace CEN_RID {
-#include <cen_ringId.H>
-}
-
//******************************************************************************
// Trace descriptors
//******************************************************************************
@@ -96,7 +92,7 @@ ReturnCode current_err;
template<>
ReturnCode get_ring(Target<TARGET_TYPE_MEMBUF_CHIP>i_target,
- const uint16_t i_ringId,
+ const RingId_t i_ringId,
unsigned char *&o_ringData,
size_t &o_ringLength,
uint64_t &o_ringAddress)
@@ -227,7 +223,7 @@ ReturnCode get_ring(Target<TARGET_TYPE_MEMBUF_CHIP>i_target,
FAPI_INF("get_ring() - got the ring section..");
- char ringName[50] = {0};
+ char ringName[MAX_RING_NAME_LENGTH] = {0};
// only a single instance for centaur
uint8_t instanceId = 1;
@@ -348,8 +344,39 @@ ReturnCode get_ring(Target<TARGET_TYPE_MEMBUF_CHIP>i_target,
o_ringLength = l_ringSizeInBits;
// grab the address from the Generic ring id list
- GenRingIdList* l_idList =
- CEN_RID::ringid_get_ring_list(l_ringId);
+ GenRingIdList* l_idList;
+
+ rc = ringid_get_ring_list(CT_CEN, l_ringId, &l_idList);
+
+ if (rc != INFRASTRUCT_RC_SUCCESS)
+ {
+ FAPI_ERR("get_ring() - call to ringid_get_ring_list() "
+ "failed w/rc=%d", rc);
+
+ /*@
+ * @errortype
+ * @moduleid fapi2::MOD_FAPI2_GET_RING
+ * @reasoncode fapi2::RC_FAILED_TO_GET_RING_LIST
+ * @userdata1 return code from ringid_get_ring_list
+ * @devdesc There was an error returned from the
+ * common ringid_get_ring_list API - see
+ * userdata1 for return code value.
+ * @custdesc Internal firmware error
+ */
+ l_err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi2::MOD_FAPI2_GET_RING,
+ fapi2::RC_FAILED_TO_GET_RING_LIST,
+ rc,
+ 0,
+ true /*SW error*/);
+
+ l_err->collectTrace(FAPI_TRACE_NAME);
+
+ l_fapi2Rc.setPlatDataPtr(reinterpret_cast<void *>(l_err));
+
+ break;
+ }
o_ringAddress = l_idList->scanScomAddress;
OpenPOWER on IntegriCloud