path: root/src/import/chips/p9/xip/p9_xip_image.h
diff options
authorClaus Michael Olsen <>2017-03-30 20:20:23 -0500
committerSachin Gupta <>2017-05-12 22:27:58 -0400
commit8fb3f52276fd37466afb34b85a1dbda3c8ee3e9f (patch)
treeff056cec9819cca8d29ffd98c6b341eae770ad4f /src/import/chips/p9/xip/p9_xip_image.h
parent618c88eba551a9a971b8873a3ec1e9a13230f93e (diff)
H-code ddLevel support - Front-end hooks for user and back-end codes.
xip_image.c has been renamed to xip_image.C to take advantage of C++ ability to overload function call arg list to avoid having to introduce additional skinny "xip_dd_get_section" and "xip_dd_append" functions. p9_xip_get_section() and p9_xip_append() APIs have been updated with an additional DD support arg as their last parm. P9XipSection.iv_reserved8[0] converted to iv_ddSupport to enable XIP level knowledge about ddSupport capability of XIP sections. Introduced p9_xip_dd_section_support() that queries a section's iv_ddSupport flag to tell caller true/false about a sections ddLevel support status. Added support in xip_tool.C as follows: - Updated "append" command to accept an optional arg, ddSupport, if section has ddLevel support or not. - Updated "extract" command to accept an optional arg, ddLevel, specifying which ddLevel to extract. - Updated "report" command's listing to show ddLevel support status of sections. Change-Id: I17e1e09d63e894d4f26cb7b324cf10ab784d78a4 Reviewed-on: Tested-by: PPE CI <> Tested-by: Hostboot CI <> Tested-by: Jenkins Server <> Reviewed-by: Jennifer A. Stofer <> Reviewed-on: Tested-by: FSP CI Jenkins <> Reviewed-by: Sachin Gupta <>
Diffstat (limited to 'src/import/chips/p9/xip/p9_xip_image.h')
1 files changed, 50 insertions, 2 deletions
diff --git a/src/import/chips/p9/xip/p9_xip_image.h b/src/import/chips/p9/xip/p9_xip_image.h
index 3961478d..484ce5a8 100644
--- a/src/import/chips/p9/xip/p9_xip_image.h
+++ b/src/import/chips/p9/xip/p9_xip_image.h
@@ -238,6 +238,9 @@ typedef enum {
/// gaurantee that the something will be able to complete any 8-byte load/store.
+/// Local undefined DD level value.
+#define P9_XIP_UNDEFINED_DDLEVEL (uint8_t)0xff
// C Definitions
@@ -306,8 +309,12 @@ typedef struct
/// address. Alignment specifications are required to be a power-of-2.
uint8_t iv_alignment;
+ /// Indicate if section has DD-level support. This value must be set
+ /// to either 1 for true or 0 for false (default).
+ uint8_t iv_ddSupport;
/// Reserved structure alignment padding; Pad to 12 bytes
- uint8_t iv_reserved8[3];
+ uint8_t iv_reserved8[2];
} P9XipSection;
@@ -683,13 +690,21 @@ p9_xip_image_size(void* i_image, uint32_t* o_size);
/// \param[out] o_hostSection Updated to contain the section table entry
/// translated to host byte order.
+/// \param[in] i_ddLevel Specified the DD level of the sub-section within
+/// the XIP section to be extracted.
/// \retval 0 Success
/// \retval non-0 See \ref p9_xip_image_errors
p9_xip_get_section(const void* i_image,
const int i_sectionId,
+#ifdef __PPE__
P9XipSection* o_hostSection);
+ P9XipSection* o_hostSection,
+ uint8_t i_ddLevel=P9_XIP_UNDEFINED_DDLEVEL);
/// Endian translation of a P9XipHeader object
@@ -1150,6 +1165,9 @@ p9_xip_duplicate_section(const void* i_image,
/// byte of the appended data within the indicated section. This return value
/// is invalid in the event of a non-0 return code.
+/// \param[in] i_ddSupport Specifies if the section contains ddLevel sub-
+/// sections (=1) or if it does not have ddLevel support (=0).
/// This API copies data from \a i_data to the end of the indicated \a
/// i_section. The section \a i_section must either be empty, or must be the
/// final (highest address) section in the image. If the section is initially
@@ -1200,7 +1218,8 @@ p9_xip_append(void* io_image,
const void* i_data,
const uint32_t i_size,
const uint32_t i_allocation,
- uint32_t* o_sectionOffset);
+ uint32_t* o_sectionOffset,
+ uint8_t i_ddSupport);
/// Convert a P9-XIP section offset to a relocatable IMAGE address
@@ -1348,6 +1367,27 @@ p9_xip_get_toc(void* i_image,
char** o_strings);
+/// Inform caller if specified sectionId has DD support
+/// \param[in] i_image A pointer to a P9-XIP image in host memory.
+/// \param[in] i_sectionId Identifies the section to be queried. See \ref
+/// p9_xip_sections.
+/// \param[out] o_bDdSupport Updated to contain true or false whether
+/// sectionId has DD support or not.
+/// \retval 0 Success
+/// \retval non-0 See \ref p9_xip_image_errors
+#ifndef __PPE__
+p9_xip_dd_section_support(const void* i_image,
+ const int i_sectionId,
+ bool& o_bDdSupport);
/// \brief Decode a TOC entry from dump file
///\param[in] - i_image - seeprom image
@@ -1458,6 +1498,12 @@ p9_xip_decode_toc_dump(void* i_image, void* i_dump,
/// .rings seciton for specific dd level is larger than the allowable size
#define P9_XIP_SBE_DD_SIZE_ERR 19
+/// Specified section has no ddLevel support
+/// Specified ddLevel was not found in section
/// Applications can expand this macro to declare an array of string forms of
/// the error codes if desired.
#define P9_XIP_ERROR_STRINGS(var) \
@@ -1482,6 +1528,8 @@ p9_xip_decode_toc_dump(void* i_image, void* i_dump,
/// Applications can use this macro to safely index the array of error
OpenPOWER on IntegriCloud