summaryrefslogtreecommitdiffstats
path: root/src/usr/sbe/sbe_update.H
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2016-06-23 11:23:49 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-09-03 17:12:56 -0400
commit6d2eeb4ee3c422de6075052b89a651bf625d45f2 (patch)
tree16db0fecf2a02427ff63af5cdfbbbe9b285dffe6 /src/usr/sbe/sbe_update.H
parent945d73f8dd0053c2a9929d4adabc46b5f3edd819 (diff)
downloadtalos-hostboot-6d2eeb4ee3c422de6075052b89a651bf625d45f2.tar.gz
talos-hostboot-6d2eeb4ee3c422de6075052b89a651bf625d45f2.zip
Changes for P9 SBE - Enable/Remove Istep calls/processing
3) Clean up TODO's in isteps 08, 09, and 10 In istep08 enable resolveProcessorSbeSeeproms call from call_host_slave_sbe_config.C and remove findSBEInPnor call and other processing from call_proc_check_slave_sbe_seeprom_complete.C. In istep09 remove updateProcessorSbeSeeproms call and nest frequency processing from call_fabric_erepair.C. In istep10 enable updateProcessorSbeSeeproms call from call_host_slave_sbe_update.C and enable loop to set use of xscom in call_proc_build_smp.C. Change-Id: I79237f530738e3088d1b3aedafdc6ad1139d21a8 RTC: 156597 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/26801 Tested-by: Jenkins Server <pfd-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>
Diffstat (limited to 'src/usr/sbe/sbe_update.H')
-rw-r--r--src/usr/sbe/sbe_update.H92
1 files changed, 85 insertions, 7 deletions
diff --git a/src/usr/sbe/sbe_update.H b/src/usr/sbe/sbe_update.H
index ae9b6e6e1..18fb8e10e 100644
--- a/src/usr/sbe/sbe_update.H
+++ b/src/usr/sbe/sbe_update.H
@@ -30,9 +30,11 @@
#include <builtins.h>
#include <errl/errlentry.H>
#include <pnor/pnorif.H>
+#include <pnor/ecc.H>
#include <vmmconst.h>
#include <targeting/common/targetservice.H>
#include <i2c/eepromif.H>
+#include <p9_infrastruct_help.H>
namespace SBE
{
@@ -73,8 +75,15 @@ namespace SBE
const uint64_t SBE_SEEPROM_STRUCT_INVALID = 0x494E56414C494400;
// Used for locations of SBE_Version and SBE Image on a SEEPROM
- const uint64_t SBE_IMAGE_SEEPROM_ADDRESS = 0x400; // 1KB
- const uint64_t SBE_VERSION_SEEPROM_ADDRESS = 0x300; // 1KB - 256B
+ const uint64_t SBE_IMAGE_SEEPROM_ADDRESS = 0x00; // 0
+ const uint64_t SBE_VERSION_SPACE_WITH_ECC = (256 * 9) / 8; // 256B + ECC
+ const uint64_t SBE_SEEPROM_SIZE = 64*KILOBYTE; // 64KB
+ const uint64_t SBE_SEEPROM_ECC_PAD = SBE_SEEPROM_SIZE % 9;
+ // SBE Version (with ECC) kept at end of fourth 64KB memory
+ // Adjust end of usable memory with ECC to be a multiple of 9 bytes
+ const uint64_t SBE_VERSION_SEEPROM_ADDRESS = 4*SBE_SEEPROM_SIZE
+ - SBE_SEEPROM_ECC_PAD
+ - SBE_VERSION_SPACE_WITH_ECC;
//Used to read SBE Boot Side from processor
const uint64_t SBE_VITAL_REG_0x0005001C = 0x005001C;
@@ -87,7 +96,7 @@ namespace SBE
const uint32_t SUPPORTED_TOC_VER = 0x00000001;
// MVPD SB Keyword contants
- const size_t MVPD_SB_RECORD_SIZE = 49;
+ const size_t MVPD_SB_RECORD_SIZE = 129;
// PERMANENT FLAG - bit 0: 0x0 -> indicates 0 is permanent.
const uint8_t PERMANENT_FLAG_MASK = 0x80;
@@ -123,15 +132,13 @@ namespace SBE
/******************************************/
enum {
FIXED_SEEPROM_WORK_SPACE = 128 * 1024,
- FIXED_RING_BUF_SIZE = 60000,
- MAX_SEEPROM_IMAGE_SIZE = 56 * 1024,
SBE_IMG_VADDR = VMM_VADDR_SBE_UPDATE,
RING_BUF1_VADDR = FIXED_SEEPROM_WORK_SPACE + SBE_IMG_VADDR,
RING_BUF2_VADDR = RING_BUF1_VADDR + FIXED_RING_BUF_SIZE,
//NOTE: recycling the same memory space for different
//steps in the process.
- SBE_ECC_IMG_VADDR = RING_BUF1_VADDR,
- SBE_ECC_IMG_MAX_SIZE = VMM_VADDR_SBE_UPDATE_END - SBE_ECC_IMG_VADDR,
+ SBE_ECC_IMG_VADDR = VMM_VADDR_SBE_UPDATE + (VMM_SBE_UPDATE_SIZE / 2),
+ SBE_ECC_IMG_MAX_SIZE = (MAX_SEEPROM_IMAGE_SIZE * 9 / 8),
};
// Used for MVPD function
@@ -233,6 +240,10 @@ namespace SBE
uint32_t seeprom_1_data_crc;
uint8_t seeprom_1_short_version[SBE_MVPD_SHORT_IMAGE_VERSION_SIZE];
+ uint8_t mvpdSbPad[MVPD_SB_RECORD_SIZE - sizeof(flags)
+ - sizeof(seeprom_0_data_crc)
+ - sizeof(seeprom_1_data_crc)
+ - (SBE_MVPD_SHORT_IMAGE_VERSION_SIZE * 2)];
} PACKED;
@@ -543,5 +554,72 @@ namespace SBE
errlHndl_t checkNestFreqSettings(sbeTargetState_t& io_sbeState);
+ /**
+ * @brief Calculates ECC size for a block of code or data allowing for
+ * padding at device boundaries so 9-byte segment (8 bytes of code
+ * or data and 1 byte of ECC) does not straddle the boundary.
+ *
+ * @param[in] i_srcSz Size of source code or data
+ *
+ * @param[in] i_offset Offset into device for storing destination
+ *
+ * @param[in] i_boundary Device boundary
+ *
+ * @return Size of source code or data with ECC and padding
+ */
+ size_t setECCSize(size_t i_srcSz,
+ const uint64_t i_offset = SBE_IMAGE_SEEPROM_ADDRESS,
+ const uint64_t i_boundary = SBE_SEEPROM_SIZE);
+
+
+ /**
+ * @brief Injects ECC into a block of code or data. Pads output at device
+ * boundaries so 9-byte segment (8 bytes of code or data and 1 byte
+ * of ECC) does not straddle the boundary.
+ *
+ * @param[in] i_src Location of source code or data without ECC
+ *
+ * @param[in] i_srcSz Size of source code or data
+ *
+ * @param[in] i_offset Offset into device for storing destination
+ *
+ * @param[in] i_boundary Device boundary
+ *
+ * @param[out] o_dst Location of destination code or data with ECC
+ *
+ * @return void
+ */
+ void injectECC(const uint8_t* i_src,
+ size_t i_srcSz,
+ const uint64_t i_offset,
+ const uint64_t i_boundary,
+ uint8_t* o_dst);
+
+
+ /**
+ * @brief Removes ECC from a block of code or data. Removes padding at
+ * device boundaries where 9-byte segment (8 bytes of code or data
+ * and 1 byte of ECC) was moved to next device so as to not straddle
+ * the boundary.
+ *
+ * @param[in/out] io_src Location of source code or data with ECC
+ *
+ * @param[out] o_dst Location of destination code or data without ECC
+ *
+ * @param[in] i_dstSz Size of destination code or data
+ *
+ * @param[in] i_offset Offset into device where source was stored
+ *
+ * @param[in] i_boundary Device boundary
+ *
+ * @return eccStatus ECC status from removing ECC.
+ */
+ PNOR::ECC::eccStatus removeECC(uint8_t* io_src,
+ uint8_t* o_dst,
+ size_t i_dstSz,
+ const uint64_t i_offset,
+ const uint64_t i_boundary);
+
+
} //end namespace SBE
#endif
OpenPOWER on IntegriCloud