summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2017-03-06 16:36:11 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-04-16 21:32:17 -0400
commit6677ffcbda04c73a7d3ed1e651e3394c8218e503 (patch)
tree2de578165f3517ecd95dd56548a4e5ebdfa4bb8b /src/include/usr
parent6274618ff6a4b0cd8447c1e31940c66b40fa1c42 (diff)
downloadblackbird-hostboot-6677ffcbda04c73a7d3ed1e651e3394c8218e503.tar.gz
blackbird-hostboot-6677ffcbda04c73a7d3ed1e651e3394c8218e503.zip
Propagate attribute overrides up to the HBRT code
Attribute overrides are stored in a separate tank of memory from the regular attribute values. This tank will be added as an additional reserved memory section for HBRT to consume (only if overrides exist). Also fixed a couple bugs encountered while testing: - No longer crashes if an error is created inside the targeting initialization code. - Added reserved bytes to RHB definition. Change-Id: I5b10f7ad8dfcb58c550868bb83c4d843f48e1aae RTC: 169942 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38547 Tested-by: Jenkins Server <pfd-jenkins+hostboot@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: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/fapi2/plat_attr_override_sync.H6
-rw-r--r--src/include/usr/targeting/attrPlatOverride.H11
-rw-r--r--src/include/usr/targeting/attrrp.H45
-rw-r--r--src/include/usr/targeting/targplatreasoncodes.H6
4 files changed, 52 insertions, 16 deletions
diff --git a/src/include/usr/fapi2/plat_attr_override_sync.H b/src/include/usr/fapi2/plat_attr_override_sync.H
index acb2d26df..83d8fff53 100644
--- a/src/include/usr/fapi2/plat_attr_override_sync.H
+++ b/src/include/usr/fapi2/plat_attr_override_sync.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -53,6 +53,8 @@ namespace TARGETING
{
errlHndl_t getAttrOverrides(PNOR::SectionInfo_t &i_sectionInfo,
AttributeTank* io_tanks[AttributeTank::TANK_LAYER_LAST]);
+
+ class AttrRP;
}
namespace RT_TARG
@@ -106,6 +108,8 @@ public:
friend int RT_TARG::apply_attr_override(uint8_t* i_data,
size_t i_size );
+ friend class TARGETING::AttrRP;
+
/**
* @brief Maximum size of a direct attribute override
*/
diff --git a/src/include/usr/targeting/attrPlatOverride.H b/src/include/usr/targeting/attrPlatOverride.H
index 266f1976e..2ac3af20a 100644
--- a/src/include/usr/targeting/attrPlatOverride.H
+++ b/src/include/usr/targeting/attrPlatOverride.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2015 */
+/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -52,13 +52,8 @@ struct AttrOverrideSection
* enums and make it obvious which layers map to what PNOR section.
* Currrently the pair is only used in a test case to keep it in order
*/
-const std::pair<AttributeTank::TankLayer, PNOR::SectionId>
- tankLayerToPnor[AttributeTank::TANK_LAYER_LAST] =
- {
- std::make_pair(AttributeTank::TANK_LAYER_FAPI, PNOR::ATTR_TMP),
- std::make_pair(AttributeTank::TANK_LAYER_TARG, PNOR::ATTR_TMP),
- std::make_pair(AttributeTank::TANK_LAYER_PERM, PNOR::ATTR_PERM)
- };
+extern const std::pair<AttributeTank::TankLayer, PNOR::SectionId>
+ tankLayerToPnor[AttributeTank::TANK_LAYER_LAST];
/**
* @brief This function gets any Attribute Overrides in PNOR
diff --git a/src/include/usr/targeting/attrrp.H b/src/include/usr/targeting/attrrp.H
index 50eb200d9..b9059db96 100644
--- a/src/include/usr/targeting/attrrp.H
+++ b/src/include/usr/targeting/attrrp.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -41,6 +41,7 @@
#include <targeting/adapters/types.H>
#include <targeting/common/targetservice.H>
#include <targeting/attrsync.H>
+#include <targeting/common/attributeTank.H>
namespace TARGETING
{
@@ -161,12 +162,9 @@ class AttrRP
/**
* @brief Copies all present attribute sections to memory.
*
- * The copy will grow down from the input address.
- *
* @param[in,out] i_addr
- * Physical address at the top of the desired region to
- * place. After function will be the address at the bottom of
- * the region.
+ * Physical address at the bottom of the desired region to
+ * place.
*
* @return Virtual address to the region.
*/
@@ -181,6 +179,21 @@ class AttrRP
* @return Size of all attribute sections
*/
static uint64_t maxSize( );
+
+ /**
+ * @brief Copies all present attribute override tanks to memory.
+ *
+ * @param[in] i_dest
+ * Physical address to copy override data into
+ * @param[in,out] io_size
+ * in: Maximum size of allocated space in bytes
+ * out: Actual number of bytes used (zero means no overrides)
+ *
+ * @return Error log
+ */
+ static errlHndl_t saveOverrides( uint8_t* i_dest,
+ size_t& io_size );
+
#endif
protected:
@@ -315,6 +328,26 @@ class AttrRP
/** Internal implementation of save function. */
void* _save(uint64_t&);
+ /** Internal implementation of saveOverrides function. */
+ errlHndl_t _saveOverrides( uint8_t* i_dest,
+ size_t& io_size );
+
+ /**
+ * @brief Serialize and copy a single override tank out to memory
+ *
+ * @param[in] i_dest Starting address to copy data into
+ * @param[inout] io_size Input: Size of i_dest buffer
+ * Output: Size of serialized data
+ * @param[in] i_tank Override tank to serialize out
+ * @param[in] i_layer Type of tank being worked on
+ *
+ * @return Error log
+ */
+ errlHndl_t saveOverrideTank( uint8_t* i_dest,
+ size_t& io_size,
+ AttributeTank* i_tank,
+ AttributeTank::TankLayer i_layer );
+
/**
* @brief Starts the attribute provider's message processor
*
diff --git a/src/include/usr/targeting/targplatreasoncodes.H b/src/include/usr/targeting/targplatreasoncodes.H
index ea8a2ea63..56faa3025 100644
--- a/src/include/usr/targeting/targplatreasoncodes.H
+++ b/src/include/usr/targeting/targplatreasoncodes.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. */
@@ -54,6 +56,7 @@ enum PlatTargetingModuleId
TARG_MOD_QUERY_MASTER_PROC_CHIP = 0x80,
TARG_MOD_SET_MASTER_NODE = 0x81,
TARG_MOD_ATTRRP_RT = 0x82,
+ TARG_MOD_SAVE_OVERRIDE_TANK = 0x83,
};
/**
@@ -66,6 +69,7 @@ enum PlatTargetingReasonCode
{
TARG_RC_INVALID_NODE = TARG_COMP_ID | 0x80,
TARG_RC_TARGET_NOT_FOUND = TARG_COMP_ID | 0x81,
+ TARG_SPACE_OVERRUN = TARG_COMP_ID | 0x82,
};
} // End TARGETING namespace
OpenPOWER on IntegriCloud