summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Cprek <smcprek@us.ibm.com>2017-03-27 17:10:06 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-04-10 17:37:12 -0400
commit1b1db6100e117c9c4d848a784cfe8be885ca9696 (patch)
treef4732980aa490b7496d0c59c0e044734e44431b6 /src
parentc560af088949a2195a3dc86eb16daa7628daf0e9 (diff)
downloadtalos-hostboot-1b1db6100e117c9c4d848a784cfe8be885ca9696.tar.gz
talos-hostboot-1b1db6100e117c9c4d848a784cfe8be885ca9696.zip
Move certain pnor_utils.H function to pnorif.H that are used externally
Change-Id: Ic44c769f777a458d627bc306458f3e1c3c532a63 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38542 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/bootloader/bootloader.C2
-rw-r--r--src/include/usr/pnor/pnorif.H26
-rw-r--r--src/usr/pnor/pnor_utils.C3
-rw-r--r--src/usr/pnor/pnor_utils.H26
-rw-r--r--src/usr/secureboot/base/makefile2
-rw-r--r--src/usr/secureboot/trusted/base/trustedboot_base.C1
-rw-r--r--src/usr/testcore/rtloader/loader.H1
-rw-r--r--src/usr/testcore/rtloader/makefile2
8 files changed, 28 insertions, 35 deletions
diff --git a/src/bootloader/bootloader.C b/src/bootloader/bootloader.C
index 4c0e70034..097fc0549 100644
--- a/src/bootloader/bootloader.C
+++ b/src/bootloader/bootloader.C
@@ -47,6 +47,8 @@
#include <secureboot/secure_reasoncodes.H>
#include <p9_sbe_hb_structures.H>
+#include <pnor/pnorif.H>
+
extern uint64_t kernel_other_thread_spinlock;
extern PNOR::SectionData_t bootloader_hbbSection;
extern char bootloader_end_address;
diff --git a/src/include/usr/pnor/pnorif.H b/src/include/usr/pnor/pnorif.H
index 7f55748f8..cbafd37c0 100644
--- a/src/include/usr/pnor/pnorif.H
+++ b/src/include/usr/pnor/pnorif.H
@@ -191,6 +191,32 @@ void getPnorInfo( PnorInfo_t& o_pnorInfo );
*/
errlHndl_t setSecure(const uint32_t i_secId, SectionData_t* io_TOC);
+/**
+ * @brief Returns string representation of a PNOR SectionId.
+ * If id requested is out of range of known string array
+ * - Hostboot asserts
+ * - Bootloader terminates
+ *
+ * @param[in] i_secIdIndex PNOR section id which also represents the index
+ * into the string array.
+ *
+ * @return const char* - String associated with Section ID
+ *
+*/
+const char * SectionIdToString( uint32_t i_secIdIndex );
+
+/**
+ * @brief Memcmp a vaddr to the known secureboot magic number
+ *
+ * @param[in] i_vaddr: vaddr of secureboot header to check for magic number
+ * Note: must point to a buffer of size >= 4 bytes
+ * Nullptr asserts or terminates bootloader
+ *
+ * @return bool - True if the magic number and starting bytes of the vaddr
+ * match. False otherwise.
+ */
+bool cmpSecurebootMagicNumber(const uint8_t* i_vaddr);
+
} // PNOR
#endif
diff --git a/src/usr/pnor/pnor_utils.C b/src/usr/pnor/pnor_utils.C
index fc68fef6f..5a8d39065 100644
--- a/src/usr/pnor/pnor_utils.C
+++ b/src/usr/pnor/pnor_utils.C
@@ -54,10 +54,7 @@ extern trace_desc_t* g_trac_pnor;
#include <config.h>
#include <securerom/ROM.H>
-#ifndef BOOTLOADER
-// Includes needed when hostboot uses this file
#include <pnor/pnorif.H>
-#endif
/**
* @brief calculates the checksum on data(ffs header/entry) and will return
diff --git a/src/usr/pnor/pnor_utils.H b/src/usr/pnor/pnor_utils.H
index fad0dee38..6007b3492 100644
--- a/src/usr/pnor/pnor_utils.H
+++ b/src/usr/pnor/pnor_utils.H
@@ -227,32 +227,6 @@ parseEntries (ffs_hdr* i_ffs_hdr,
bool isEnforcedSecureSection(const uint32_t i_section);
/**
- * @brief Returns string representation of a PNOR SectionId.
- * If id requested is out of range of known string array
- * - Hostboot asserts
- * - Bootloader terminates
- *
- * @param[in] i_secIdIndex PNOR section id which also represents the index
- * into the string array.
- *
- * @return const char* - String associated with Section ID
- *
-*/
-const char * SectionIdToString( uint32_t i_secIdIndex );
-
-/**
- * @brief Memcmp a vaddr to the known secureboot magic number
- *
- * @param[in] i_vaddr: vaddr of secureboot header to check for magic number
- * Note: must point to a buffer of size >= 4 bytes
- * Nullptr asserts or terminates bootloader
- *
- * @return bool - True if the magic number and starting bytes of the vaddr
- * match. False otherwise.
- */
-bool cmpSecurebootMagicNumber(const uint8_t* i_vaddr);
-
-/**
* @brief Determines if a section has a Header and that it is not a Secure Header
*
* @param[out] i_secInfo PNOR information of section
diff --git a/src/usr/secureboot/base/makefile b/src/usr/secureboot/base/makefile
index c58c54487..58d79be86 100644
--- a/src/usr/secureboot/base/makefile
+++ b/src/usr/secureboot/base/makefile
@@ -47,7 +47,5 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/secureboot/trusted/base
VPATH += ${ROOTPATH}/src/usr/secureboot/trusted/base
VPATH += ${ROOTPATH}/src/securerom
-EXTRAINCDIR += ${ROOTPATH}/src/usr/pnor/
-
CFLAGS += -iquote ../
include ${ROOTPATH}/config.mk
diff --git a/src/usr/secureboot/trusted/base/trustedboot_base.C b/src/usr/secureboot/trusted/base/trustedboot_base.C
index 063608f09..fe1784a17 100644
--- a/src/usr/secureboot/trusted/base/trustedboot_base.C
+++ b/src/usr/secureboot/trusted/base/trustedboot_base.C
@@ -50,7 +50,6 @@
#include "../trustedbootCmds.H"
#include "../trustedbootUtils.H"
#include "trustedbootMsg.H"
-#include <pnor_utils.H>
// ----------------------------------------------
// Trace definitions
diff --git a/src/usr/testcore/rtloader/loader.H b/src/usr/testcore/rtloader/loader.H
index f131d9a7e..8e07cf021 100644
--- a/src/usr/testcore/rtloader/loader.H
+++ b/src/usr/testcore/rtloader/loader.H
@@ -42,7 +42,6 @@
#include <devicefw/userif.H>
#include <pnor/ecc.H>
#include <ipmi/ipmiif.H>
-#include <pnor_utils.H>
trace_desc_t* g_trac_hbrt = NULL;
TRAC_INIT(&g_trac_hbrt, "HBRT_TEST", 2*KILOBYTE);
diff --git a/src/usr/testcore/rtloader/makefile b/src/usr/testcore/rtloader/makefile
index d253d3f06..b7b3706c6 100644
--- a/src/usr/testcore/rtloader/makefile
+++ b/src/usr/testcore/rtloader/makefile
@@ -24,8 +24,6 @@
# IBM_PROLOG_END_TAG
ROOTPATH = ../../../..
-EXTRAINCDIR += ${ROOTPATH}/src/usr/pnor/
-
MODULE = testrtloader
TESTS = *.H
OpenPOWER on IntegriCloud