summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/utils/stopreg
diff options
context:
space:
mode:
authorPrem Shanker Jha <premjha2@in.ibm.com>2016-01-28 07:54:55 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-03-21 10:53:01 -0400
commit60685e0878ee18e61616c4c10162f746e38f7933 (patch)
treec8264831e159bac5c80733776b9bc026c6ca0599 /src/import/chips/p9/procedures/utils/stopreg
parentfb9ba37e882c15425e9db071b60aefe5fdda083e (diff)
downloadtalos-hostboot-60685e0878ee18e61616c4c10162f746e38f7933.tar.gz
talos-hostboot-60685e0878ee18e61616c4c10162f746e38f7933.zip
PM: Added hcode image build support for SGPE and CME.
In this commit, nested xip structure of hardware image is traversed and hcode for following platform is copied to to relevant area in HOMER: - SGPE - CME - P9 Self Restore code RTC: 145583 Change-Id: I5127ab5d4e498e1b2db9ae8bcefef933be961855 Original-Change-Id: I8f91e34aff81b4c9218be5a380e3336913cbd7c9 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/10675 Tested-by: Jenkins Server Tested-by: Auto Mirror Reviewed-by: AMIT KUMAR <akumar3@us.ibm.com> Tested-by: Hostboot CI Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Gregory S. Still <stillgs@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22229 Tested-by: FSP CI Jenkins
Diffstat (limited to 'src/import/chips/p9/procedures/utils/stopreg')
-rw-r--r--src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.mk5
-rwxr-xr-xsrc/import/chips/p9/procedures/utils/stopreg/p9_stop_section_defines.H4
-rwxr-xr-xsrc/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C11
-rwxr-xr-xsrc/import/chips/p9/procedures/utils/stopreg/p9_stop_util.H122
4 files changed, 13 insertions, 129 deletions
diff --git a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.mk b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.mk
index a4a1a93f7..b90aae0ee 100644
--- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.mk
+++ b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.mk
@@ -7,7 +7,7 @@
#
# EKB Project
#
-# COPYRIGHT 2015
+# COPYRIGHT 2015,2016
# [+] International Business Machines Corp.
#
#
@@ -17,5 +17,8 @@
#
# IBM_PROLOG_END_TAG
PROCEDURE=p9_stop_api
+STOP_UTIL=$(ROOTPATH)/chips/p9/procedures/utils/stopreg/
+STOP_UTIL+=$(ROOTPATH)/chips/p9/procedures/hwp/lib
libp9_stop_util_DEPLIBS += p9_stop_util
+$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(STOP_UTIL))
$(call BUILD_PROCEDURE)
diff --git a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_section_defines.H b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_section_defines.H
index 435931983..32b1223a3 100755
--- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_section_defines.H
+++ b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_section_defines.H
@@ -7,7 +7,7 @@
/* */
/* EKB Project */
/* */
-/* COPYRIGHT 2015 */
+/* COPYRIGHT 2015,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -51,7 +51,7 @@ enum
// start offset for SPR register restore, core scom or cache scom register
// restore regions in homer image.
CORE_SCOM_SECTN_START = ( TWO_MB + ( 256 * ONE_KB )), //offset from start of chip HOMER
- CACHE_SCOM_SECTN_START = ( ONE_MB + ( 32 * ONE_KB )), // start of cache section
+ CACHE_SCOM_SECTN_START = ( ONE_MB + ( 128 * ONE_KB )), // start of cache section
//constants in HOMER's header area.
REGULAR_MODE = 0xAA,
diff --git a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
index 28dffb71d..4eaf9edfa 100755
--- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
+++ b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
@@ -7,7 +7,7 @@
/* */
/* EKB Project */
/* */
-/* COPYRIGHT 2015 */
+/* COPYRIGHT 2015,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -53,14 +53,17 @@ StopReturnCode_t isFusedMode( void* const i_pImage, bool& o_fuseMode )
break;
}
- HomerImgDesc_t* pHomer = (HomerImgDesc_t*)i_pImage;
+ HomerSection_t* pHomerDesc = ( HomerSection_t* ) i_pImage;
+ HomerImgDesc_t* pHomer = (HomerImgDesc_t*)( pHomerDesc->interrruptHandler );
- if( HOMER_MAGIC_WORD != pHomer->homerMagicNumber )
+ if( SWIZZLE_8_BYTE(HOMER_MAGIC_WORD) != pHomer->homerMagicNumber )
{
- MY_ERR("corrupt or invalid HOMER image location");
+ MY_ERR("corrupt or invalid HOMER image location 0x%016llx",
+ pHomer->homerMagicNumber );
break;
}
+
if( (uint8_t) FUSE_MODE == pHomer->fuseModeStatus )
{
o_fuseMode = true;
diff --git a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.H b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.H
deleted file mode 100755
index 5d276f870..000000000
--- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.H
+++ /dev/null
@@ -1,122 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: chips/p9/procedures/utils/stopreg/p9_stop_util.H $ */
-/* */
-/* IBM CONFIDENTIAL */
-/* */
-/* EKB Project */
-/* */
-/* COPYRIGHT 2015 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* 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. */
-/* */
-/* IBM_PROLOG_END_TAG */
-#ifndef __P9_STOP_UTIL_
-#define __P9_STOP_UTIL_
-
-#ifdef __HOS_AIX__
- #define __BYTE_ORDER __BIG_ENDIAN
-#else
- #include <endian.h>
-#endif
-
-#include "p9_stop_api.H"
-
-#ifdef FAPI_2
- #include <fapi2.H>
-#endif
-
-///
-/// @file p9_stop_util.H
-/// @brief describes some utilty functions for STOP API.
-///
-// *HWP HW Owner : Greg Still <stillgs@us.ibm.com>
-// *HWP FW Owner : Prem Shanker Jha <premjha2@in.ibm.com>
-// *HWP Team : PM
-// *HWP Level : 2
-// *HWP Consumed by : HB:HYP
-namespace stopImageSection
-{
-/**
- * @brief helper function to swizzle given input data
- * @note swizles bytes to handle endianess issue.
- */
-#if( __BYTE_ORDER == __BIG_ENDIAN )
-
-// NOP if it is a big endian system
-#define SWIZZLE_2_BYTE(WORD) WORD
-#define SWIZZLE_4_BYTE(WORD) WORD
-#define SWIZZLE_8_BYTE(WORD) WORD
-
-#else
-#define SWIZZLE_2_BYTE(WORD) \
- ( (((WORD) >> 8) & 0x00FF) | (((WORD) << 8) & 0xFF00) )
-
-#define SWIZZLE_4_BYTE(WORD) \
- ( (((WORD) >> 24) & 0x000000FF) | (((WORD) >> 8) & 0x0000FF00) | \
- (((WORD) << 8) & 0x00FF0000) | (((WORD) << 24) & 0xFF000000) )
-
-#define SWIZZLE_8_BYTE(WORD) \
- ( (((WORD) >> 56) & 0x00000000000000FF) | \
- (((WORD) >> 40) & 0x000000000000FF00)| \
- (((WORD) >> 24) & 0x0000000000FF0000) | \
- (((WORD) >> 8) & 0x00000000FF000000) | \
- (((WORD) << 8) & 0x000000FF00000000) | \
- (((WORD) << 24) & 0x0000FF0000000000) | \
- (((WORD) << 40) & 0x00FF000000000000) | \
- (((WORD) << 56) & 0xFF00000000000000) )
-#endif
-
-/**
- * @brief describes details of start section of chip's HOMER image.
- */
-typedef struct
-{
- uint64_t attnOpcodes;
- uint64_t homerMagicNumber;
- uint32_t buildDate;
- uint32_t version;
- uint8_t reserve[7];
- uint8_t fuseModeStatus;
- uint32_t cmeHcodeOffset;
- uint32_t cmeHcodeLength;
- uint32_t cmeCommonRingOffset;
- uint32_t cmeCommonRingLength;
- uint32_t cmePstateOffset;
- uint32_t cmePstateLength;
-} HomerImgDesc_t;
-
-/**
- * @brief enumerates bit(s) positions of interest for PIR.
- */
-enum
-{
- FUSE_BIT0 = 0x08,
- FUSE_BIT1 = 0x04,
- FUSE_BIT2 = 0x02,
- FUSE_BIT3 = 0x01,
- QUAD_BITS = 0x70
-};
-
-/**
- * @brief returns core id and thread id by parsing a given PIR.
- * @param i_pStopImage points to STOP image associated with a proc chip.
- * @param i_pir PIR associated with a core's thread.
- * @param o_coreId core id obtained from PIR.
- * @param o_threadId thread id obtained from PIR.
- * @return SUCCESS if function suceeds, error code otherwise.
- */
-StopReturnCode_t getCoreAndThread( void* const i_pStopImage,
- const uint64_t i_pir,
- uint32_t& o_coreId, uint32_t& o_threadId );
-
-} // namespace stopImageSection ends
-
-#endif
-
-
OpenPOWER on IntegriCloud