summaryrefslogtreecommitdiffstats
path: root/src/include/usr/pnor
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2015-08-26 13:50:30 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2016-03-03 16:17:52 -0500
commitc73c1d03450fb1dfa0ef9c98485999aeaa0257d7 (patch)
tree70056c4a6b064db49d7419d2d5040f6569ea51fc /src/include/usr/pnor
parent8f30c7db00a3ce2940900ec2ba67838bcf432b98 (diff)
downloadtalos-hostboot-c73c1d03450fb1dfa0ef9c98485999aeaa0257d7.tar.gz
talos-hostboot-c73c1d03450fb1dfa0ef9c98485999aeaa0257d7.zip
FFS Support for Bootloader
This commit moves functionality out of pnor_common.C and puts it in a new file pnor_utils.C this file will be shared with bootloader and hostboot code. Quite a few files were pulled apart in order to make includes easier across modules. These are lpc_const.H and pnor_const.H. bl_pnorAccess leverages the new pnor_utils.C file that will help the bootloader parse pnor TOC Change-Id: I740f6f8a707760756a261535e62e2d0a849324f8 RTC:134064 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/696 Tested-by: Jenkins Server Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/include/usr/pnor')
-rw-r--r--src/include/usr/pnor/pnor_const.H122
-rw-r--r--src/include/usr/pnor/pnor_reasoncodes.H6
-rw-r--r--src/include/usr/pnor/pnorif.H98
3 files changed, 135 insertions, 91 deletions
diff --git a/src/include/usr/pnor/pnor_const.H b/src/include/usr/pnor/pnor_const.H
new file mode 100644
index 000000000..1f0b08574
--- /dev/null
+++ b/src/include/usr/pnor/pnor_const.H
@@ -0,0 +1,122 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/pnor/pnor_const.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __PNOR_PNOR_CONST_H
+#define __PNOR_PNOR_CONST_H
+
+#include <stdint.h>
+#include <builtins.h>
+
+namespace PNOR
+{
+
+/**
+ * PNOR Sections
+ */
+enum SectionId
+{
+ TOC, /**< Table of Contents */
+ // Value of HB_EXT_CODE must be 1 for debug framework.
+ HB_EXT_CODE, /**< Hostboot Extended Image */
+ GLOBAL_DATA, /**< Global Data */
+ HB_BASE_CODE, /**< Hostboot Base Image */
+ CENTAUR_SBE, /**< Centaur Self-Boot Engine image */
+ SBE_IPL, /**< Self-Boot Engine IPL image */
+ WINK, /**< Sleep Winkle Reference image */
+ PAYLOAD, /**< HAL/OPAL */
+ HB_RUNTIME, /**< Hostboot Runtime (for Sapphire) */
+ HB_DATA, /**< Hostboot Data */
+ GUARD_DATA, /**< Guard Data */
+ HB_ERRLOGS, /**< Hostboot Error log Repository */
+ DIMM_JEDEC_VPD, /**< DIMM JEDEC VPD */
+ MODULE_VPD, /**< Module VPD */
+ CENTAUR_VPD, /**< Centaur VPD */
+ NVRAM, /**< Opal NVRAM */
+ OCC, /**< OCC lid */
+ FIRDATA, /**< FIRDATA */
+ ATTR_TMP, /**< Temporary Attribute Override */
+ ATTR_PERM, /**< Permanent Attribute Override */
+ CAPP, /**< CAPP lid */
+ VERSION, /**< PNOR version string section */
+ HB_BOOTLOADER, /**< Hostboot Bootloader image */
+ TEST, /**< Scratch space for PNOR test cases */
+ TESTRO, /**< Scratch space for PNOR ReadOnly test cases */
+ BACKUP_PART, /**< Backup of TOC*/
+ NUM_SECTIONS, /**< Number of defined sections */
+
+ FIRST_SECTION = TOC, /**< First section (for looping) */
+ /**< Used for error cases, initialization */
+ INVALID_SECTION = NUM_SECTIONS,
+};
+
+/**
+ * Information about a section of PNOR
+ */
+ // Size and layout of this structure must be maintained for debug framework.
+struct SectionInfo_t
+{
+ SectionId id; /**< Identifier for this section */
+ const char* name; /**< Name of the section */
+ uint64_t vaddr; /**< Virtual address of the start of the section */
+ uint32_t flashAddr; /**< Flash address of the start of the section*/
+ uint64_t size; /**< Size of partition in bytes */
+ bool eccProtected; /**< Section is ECC protected */
+ bool sha512Version; /**< Version Checking */
+ bool sha512perEC; /**< Version Checking perEC */
+ bool readOnly; /**< Section is read only */
+};
+
+/**
+ * PNOR Sides
+ */
+enum SideId
+{
+ WORKING = 0,
+#ifdef CONFIG_PNOR_TWO_SIDE_SUPPORT
+ ALTERNATE = 1,
+#endif
+ NUM_SIDES,
+ INVALID_SIDE = NUM_SIDES,
+ FIRST_SIDE = WORKING,
+};
+
+enum
+{
+ INVALID_OFFSET = 0xFFFFFFF, // Invalid primary or alternate TOC
+ BACKUP_TOC_OFFSET = 0x8000,
+ INVALID_FLASH_OFFSET = 0xFFFFFFFF,
+};
+
+/** @brief PNOR::TEST section offsets for test cases to prevent
+ * concurrency problems
+ */
+enum TestSectionOffset{
+ pnorTestSec_readwrite_offset = 0x100,
+ pnorTestSec_smartwrite_offset = 0x120,
+ pnorTestSec_rt_readwrite_offset = 0x6000,
+};
+
+}
+
+#endif \ No newline at end of file
diff --git a/src/include/usr/pnor/pnor_reasoncodes.H b/src/include/usr/pnor/pnor_reasoncodes.H
index 4133c8a0f..d10cd44c6 100644
--- a/src/include/usr/pnor/pnor_reasoncodes.H
+++ b/src/include/usr/pnor/pnor_reasoncodes.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* Contributors Listed Below - COPYRIGHT 2011,2016 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -153,6 +153,10 @@ namespace PNOR
RC_INVALID_WORKING_TOC = PNOR_COMP_ID | 0x28,
RC_INVALID_TOC = PNOR_COMP_ID | 0x29,
RC_WRONG_SIZE_FROM_READ = PNOR_COMP_ID | 0x2A,
+ RC_NULL_TOC_BUFFER = PNOR_COMP_ID | 0x2B,
+ RC_TOC_HDR_CHECKSUM_ERR = PNOR_COMP_ID | 0x2C,
+ RC_PNOR_PARSE_ENTRIES_ERR = PNOR_COMP_ID | 0x2D,
+ RC_PNOR_SET_VADDR_FAILED = PNOR_COMP_ID | 0x2E,
//@fixme-RTC:131607-Temporary value to allow HWSV compile
//termination_rc
diff --git a/src/include/usr/pnor/pnorif.H b/src/include/usr/pnor/pnorif.H
index 79a9a0f62..1a18750b5 100644
--- a/src/include/usr/pnor/pnorif.H
+++ b/src/include/usr/pnor/pnorif.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* Contributors Listed Below - COPYRIGHT 2011,2016 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -28,6 +28,7 @@
#include <stdint.h>
#include <builtins.h>
+#include <pnor/pnor_const.H>
#include <errl/errlentry.H>
#include <utility>
#include <config.h>
@@ -36,75 +37,6 @@ namespace PNOR
{
/**
- * PNOR Sections
- */
-enum SectionId
-{
- TOC, /**< Table of Contents */
- // Value of HB_EXT_CODE must be 1 for debug framework.
- HB_EXT_CODE, /**< Hostboot Extended Image */
- GLOBAL_DATA, /**< Global Data */
- HB_BASE_CODE, /**< Hostboot Base Image */
- CENTAUR_SBE, /**< Centaur Self-Boot Engine image */
- SBE_IPL, /**< Self-Boot Engine IPL image */
- WINK, /**< Sleep Winkle Reference image */
- PAYLOAD, /**< HAL/OPAL */
- HB_RUNTIME, /**< Hostboot Runtime (for Sapphire) */
- HB_DATA, /**< Hostboot Data */
- GUARD_DATA, /**< Guard Data */
- HB_ERRLOGS, /**< Hostboot Error log Repository */
- DIMM_JEDEC_VPD, /**< DIMM JEDEC VPD */
- MODULE_VPD, /**< Module VPD */
- CENTAUR_VPD, /**< Centaur VPD */
- NVRAM, /**< Opal NVRAM */
- OCC, /**< OCC lid */
- FIRDATA, /**< FIRDATA */
- ATTR_TMP, /**< Temporary Attribute Override */
- ATTR_PERM, /**< Permanent Attribute Override */
- CAPP, /**< CAPP lid */
- VERSION, /**< PNOR version string section */
- TEST, /**< Scratch space for PNOR test cases */
- TESTRO, /**< Scratch space for PNOR ReadOnly test cases */
-
- NUM_SECTIONS, /**< Number of defined sections */
-
- FIRST_SECTION = TOC, /**< First section (for looping) */
- LAST_SECTION = TEST, /**< Last section (for looping) */
- INVALID_SECTION = NUM_SECTIONS, /**< Used for error cases, initialization */
-};
-
-/**
- * Information about a section of PNOR
- */
- // Size and layout of this structure must be maintained for debug framework.
-struct SectionInfo_t
-{
- SectionId id; /**< Identifier for this section */
- const char* name; /**< Name of the section */
- uint64_t vaddr; /**< Virtual address of the start of the section */
- uint32_t flashAddr; /**< Flash address of the start of the section*/
- uint64_t size; /**< Size of partition in bytes */
- bool eccProtected; /**< Section is ECC protected */
- bool sha512Version; /**< Version Checking */
- bool sha512perEC; /**< Version Checking perEC */
- bool readOnly; /**< Section is read only */
-};
-
-/**
- * PNOR Sides
- */
-enum SideId
-{
- WORKING = 0,
-#ifdef CONFIG_PNOR_TWO_SIDE_SUPPORT
- ALTERNATE = 1,
-#endif
- NUM_SIDES,
- INVALID_SIDE = NUM_SIDES,
- FIRST_SIDE = WORKING,
-};
-
-/**
* Information about a side of PNOR
*/
struct SideInfo_t
@@ -120,9 +52,12 @@ struct SideInfo_t
uint64_t hbbMmioOffset; /**< HBB MMIO Offset associated with hbbAddress*/
};
-enum
+/** Information about PNOR Layout */
+struct PnorInfo_t
{
- INVALID_OFFSET = 0xFFFFFFF, // Invalid primary or alternate TOC
+ uint32_t mmioOffset; //< Address of MMIO access
+ uint32_t norWorkarounds; //< NOR flash workarounds
+ uint32_t flashSize; //< Size of PNOR in bytes
};
/**
@@ -190,23 +125,6 @@ errlHndl_t clearSection(PNOR::SectionId i_section);
*/
errlHndl_t validateAltMaster( void );
-/** @brief PNOR::TEST section offsets for test cases to prevent
- * concurrency problems
- */
-enum TestSectionOffset{
- pnorTestSec_readwrite_offset = 0x100,
- pnorTestSec_smartwrite_offset = 0x120,
- pnorTestSec_rt_readwrite_offset = 0x6000,
-};
-
-/** Information about PNOR Layout */
-struct PnorInfo_t
-{
- uint32_t mmioOffset; //< Address of MMIO access
- uint32_t norWorkarounds; //< NOR flash workarounds
- uint32_t flashSize; //< Size of PNOR in bytes
-};
-
/**
* @brief Retrieve some information about the PNOR/SFC hardware
*
@@ -214,6 +132,6 @@ struct PnorInfo_t
*/
void getPnorInfo( PnorInfo_t& o_pnorInfo );
-}
+} // PNOR
#endif
OpenPOWER on IntegriCloud