diff options
| author | Mike Baiocchi <mbaiocch@us.ibm.com> | 2017-03-27 08:13:15 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-04-03 11:22:19 -0400 |
| commit | 5284cb4636143bc16ce06c10f40133639e35a3be (patch) | |
| tree | 989ee196c2e86f855069a5944ef1a90793b18d12 /src/include/usr/pnor | |
| parent | 3eac7d61c5a1f78006c1c4b0e9621d91e2dbf47f (diff) | |
| download | talos-hostboot-5284cb4636143bc16ce06c10f40133639e35a3be.tar.gz talos-hostboot-5284cb4636143bc16ce06c10f40133639e35a3be.zip | |
Read the HW Key Hash from a Processor's SBE Seeprom
This commit adds an interface to read the HW Key Hash located in the HBBL
section of each Processor's two SBE Seeproms.
Change-Id: I906434269746c296c646f7b0594575c58b145294
RTC: 167585
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38465
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/pnor')
| -rw-r--r-- | src/include/usr/pnor/ecc.H | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/include/usr/pnor/ecc.H b/src/include/usr/pnor/ecc.H index 3f4b7cef6..80c993c96 100644 --- a/src/include/usr/pnor/ecc.H +++ b/src/include/usr/pnor/ecc.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2017 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -25,6 +27,10 @@ #include <stdint.h> +#ifdef __HOSTBOOT_MODULE +#include <assert.h> +#endif + /** @file ecc.H * @brief Interfaces for the P8 8-byte ECC algorithm. */ @@ -78,6 +84,23 @@ namespace ECC eccStatus removeECC(uint8_t* io_src, uint8_t* o_dst, size_t i_dstSz); +#ifdef __HOSTBOOT_MODULE + /** Given the size of Data, return the size of Data+ECC + * + * @param[in] i_sizeWithoutEcc Size in bytes of data without ECC + * + * @note i_sizeWithoutEcc must be a multiple of 8 bytes or will assert + * + * @return size of data with ECC + */ + inline size_t sizeWithEcc(const size_t i_sizeWithoutEcc) + { + bool noRemainder = (i_sizeWithoutEcc % 8) == 0 ? true : false; + assert (noRemainder, "PNOR::ECC::sizeWithEcc: input needs to be multiple of 8 bytes"); + return (i_sizeWithoutEcc * 9) / 8; + } +#endif + } } |

