summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/include/usr/hdat/hdat.H10
-rwxr-xr-xsrc/usr/hdat/hdatmsvpd.C9
-rwxr-xr-xsrc/usr/hdat/hdatmsvpd.H8
-rw-r--r--src/usr/runtime/hdatservice.C4
-rw-r--r--src/usr/runtime/hdatstructs.H11
-rw-r--r--src/usr/runtime/populate_hbruntime.C22
6 files changed, 48 insertions, 16 deletions
diff --git a/src/include/usr/hdat/hdat.H b/src/include/usr/hdat/hdat.H
index bdbc7dbe7..2b4c35daa 100755
--- a/src/include/usr/hdat/hdat.H
+++ b/src/include/usr/hdat/hdat.H
@@ -227,6 +227,16 @@ enum hdatMsVpdRhbAddrRangeType : uint8_t
RHB_TYPE_INVALID = 0xFF
};
+/** @enum Permission Types for Reserved Hostboot Memory (RHB)
+ */
+enum hdatRhbPermType : uint8_t
+{
+ RHB_NONE = 0x00,
+ RHB_WRITE_ONLY = 0x80,
+ RHB_READ_ONLY = 0x40,
+ RHB_READ_WRITE = RHB_READ_ONLY | RHB_WRITE_ONLY,
+};
+
/* vpd constants
* Defining vpd constants
*/
diff --git a/src/usr/hdat/hdatmsvpd.C b/src/usr/hdat/hdatmsvpd.C
index 9a488351c..ca079fe4f 100755
--- a/src/usr/hdat/hdatmsvpd.C
+++ b/src/usr/hdat/hdatmsvpd.C
@@ -278,7 +278,8 @@ errlHndl_t HdatMsVpd::addUEAddrRange(hdatMsAddr_t &i_addr)
errlHndl_t HdatMsVpd::addRHBAddrRange(uint32_t i_dbob_id, hdatMsAddr_t &i_start,
hdatMsAddr_t &i_end, uint32_t i_labelSize,
- uint8_t* &i_labelStringPtr)
+ uint8_t* &i_labelStringPtr,
+ hdatRhbPermType i_permission)
{
errlHndl_t l_errlHndl = NULL;
hdatMsVpdRhbAddrRange_t *l_addr;
@@ -318,6 +319,8 @@ errlHndl_t HdatMsVpd::addRHBAddrRange(uint32_t i_dbob_id, hdatMsAddr_t &i_start,
HDAT_INF("hdatmsvpd:addRHBAddrRange "
"i_labelStringPtr is NULL");
}
+ l_addr->hdatRhbPermission = i_permission;
+
iv_RHBaddrRngArrayHdr.hdatArrayCnt++;
}
else
@@ -1367,7 +1370,7 @@ errlHndl_t HdatMsVpd::hdatLoadMsData(uint32_t &o_size, uint32_t &o_count)
l_pMcsTarget->getAttr<TARGETING::ATTR_HUID>());
break;
}
-
+
// Need to get i2c Master data correctly
std::vector<hdatI2cData_t> l_i2cDevEntries;
@@ -1519,7 +1522,7 @@ errlHndl_t HdatMsVpd::hdatLoadMsData(uint32_t &o_size, uint32_t &o_count)
}
if(l_pProcTarget->getAttr<TARGETING::ATTR_MODEL>() == TARGETING::MODEL_NIMBUS)
{
- // Set the memory controller ID
+ // Set the memory controller ID
l_hdatMemcntrlID |= 1 << (31 - l_pMcbistTarget->getAttr<TARGETING::ATTR_CHIP_UNIT>());
l_hdatMemcntrlID |= 1 << (31 - (l_pMcsTarget->getAttr<TARGETING::ATTR_CHIP_UNIT>() + 4));
l_hdatMemcntrlID |= 1 << (31 - (l_pMcaTarget->getAttr<TARGETING::ATTR_CHIP_UNIT>() + 8));
diff --git a/src/usr/hdat/hdatmsvpd.H b/src/usr/hdat/hdatmsvpd.H
index 0f3b7924f..429d4dc3c 100755
--- a/src/usr/hdat/hdatmsvpd.H
+++ b/src/usr/hdat/hdatmsvpd.H
@@ -184,7 +184,8 @@ struct hdatMsVpdRhbAddrRange_t
// address+1
uint32_t hdatRhbLabelSize; // 0x0014 Label size
uint8_t hdatRhbLabelString[64]; // 0x0018 Label string Ptr
- uint8_t reserved[8]; // 0x0058 Reserved
+ hdatRhbPermType hdatRhbPermission; // 0x0058 R/W Permissions
+ uint8_t reserved[7]; // 0x0059 Reserved
} __attribute__ ((packed));
/** @brief Reserved HB length
@@ -388,6 +389,7 @@ class HdatMsVpd : public HdatHdif
* @param[in] i_end - The end address of the range
* @param[in] i_labelSize - RHB Label Size
* @param[in] i_labelStringPtr - RHB Label String
+ * @param[in] i_permission - R/W permissions for RHB.
*
* @return A null error log handle if successful, else the return code
* pointed to by o_errlHndl contains one of:
@@ -397,7 +399,9 @@ class HdatMsVpd : public HdatHdif
errlHndl_t addRHBAddrRange( uint32_t i_dbob_id, hdatMsAddr_t &i_start,
hdatMsAddr_t &i_end, uint32_t i_labelSize,
- uint8_t* &i_labelStringPtr);
+ uint8_t* &i_labelStringPtr,
+ hdatRhbPermType i_permission =
+ HDAT::RHB_READ_WRITE);
/**
* @brief Update the mainstore VPD with Barrier Synchronization Register
diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C
index 0325de8ff..154a588ce 100644
--- a/src/usr/runtime/hdatservice.C
+++ b/src/usr/runtime/hdatservice.C
@@ -1703,7 +1703,8 @@ void hdatMsVpdRhbAddrRange_t::set(const HDAT::hdatMsVpdRhbAddrRangeType i_type,
const uint16_t i_rangeId,
const uint64_t i_startAddr,
const uint64_t i_size,
- const char* i_label)
+ const char* i_label,
+ const HDAT::hdatRhbPermType i_permission)
{
assert(i_label != nullptr, "Null label for hdatMsVpdRhbAddrRange_t");
@@ -1714,6 +1715,7 @@ void hdatMsVpdRhbAddrRange_t::set(const HDAT::hdatMsVpdRhbAddrRangeType i_type,
hdatRhbLabelSize = strlen(i_label) + 1;
memset(hdatRhbLabelString, 0, hdatRhbLabelSize);
memcpy(hdatRhbLabelString, i_label, hdatRhbLabelSize);
+ hdatRhbPermission = i_permission;
}
/********************
diff --git a/src/usr/runtime/hdatstructs.H b/src/usr/runtime/hdatstructs.H
index 6692275e2..1ea8319bd 100644
--- a/src/usr/runtime/hdatstructs.H
+++ b/src/usr/runtime/hdatstructs.H
@@ -344,7 +344,9 @@ struct hdatMsVpdRhbAddrRange_t
hdatMsVpdRhbAddrRange_t(): hdatRhbRngType(HDAT::RHB_TYPE_INVALID),
hdatRhbRngId(0), hdatRhbAddrRngStrAddr(0),
hdatRhbAddrRngEndAddr(0), hdatRhbLabelSize(1),
- hdatRhbLabelString{}, reserved{} {}
+ hdatRhbLabelString{},
+ hdatRhbPermission(HDAT::RHB_READ_WRITE),
+ reserved{} {}
/**
* Set all member variables of class
@@ -353,11 +355,13 @@ struct hdatMsVpdRhbAddrRange_t
* @param[in] i_startAddr, Range Starting Address
* @param[in] i_size, Size of memory region
* @param[in] i_label, Label String Ptr
+ * @param[in] i_permission, R/W permissions for RHB.
* @note size of i_label is calculated in function versus a input parameter.
*/
void set(const HDAT::hdatMsVpdRhbAddrRangeType i_type,
const uint16_t i_rangeId, const uint64_t i_startAddr,
- const uint64_t i_endAddr, const char* i_label);
+ const uint64_t i_endAddr, const char* i_label,
+ const HDAT::hdatRhbPermType i_permission = HDAT::RHB_READ_WRITE);
HDAT::hdatMsVpdRhbAddrRangeType hdatRhbRngType; // 0x0000 Range type
uint8_t hdatRhbRngRes; // 0x0001 Reserved
@@ -366,7 +370,8 @@ struct hdatMsVpdRhbAddrRange_t
uint64_t hdatRhbAddrRngEndAddr; // 0x000C Range ending
uint32_t hdatRhbLabelSize; // 0x0014 Label size
uint8_t hdatRhbLabelString[64]; // 0x0018 Label string Ptr
- uint8_t reserved[8]; // 0x0058 Reserved
+ HDAT::hdatRhbPermType hdatRhbPermission; // 0x0058 R/W Permissions
+ uint8_t reserved[7]; // 0x0059 Reserved
} __attribute__ ((packed));
#endif
diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C
index a7bfdfb24..96ea7524a 100644
--- a/src/usr/runtime/populate_hbruntime.C
+++ b/src/usr/runtime/populate_hbruntime.C
@@ -228,22 +228,25 @@ void traceHbRsvMemRange(hdatMsVpdRhbAddrRange_t* & i_rngPtr )
TRACFCOMP(g_trac_runtime,
"Setting HDAT HB Reserved Memory Range: "
"%s RangeType 0x%X RangeId 0x%X "
- "StartAddress 0x%16llX EndAddress 0x%16llX",
+ "StartAddress 0x%16llX EndAddress 0x%16llX Permissions 0x%.2X",
i_rngPtr->hdatRhbLabelString,
i_rngPtr->hdatRhbRngType,
i_rngPtr->hdatRhbRngId,
i_rngPtr->hdatRhbAddrRngStrAddr,
- i_rngPtr->hdatRhbAddrRngEndAddr);
+ i_rngPtr->hdatRhbAddrRngEndAddr,
+ i_rngPtr->hdatRhbPermission);
CONSOLE::displayf(NULL,
"dw-Setting HDAT HB Reserved Memory Range: "
"%s RangeType 0x%X RangeId 0x%X "
- "StartAddress 0x%016llX EndAddress 0x%016llX",
+ "StartAddress 0x%016llX EndAddress 0x%016llX "
+ "Permissions 0x%.2X ",
i_rngPtr->hdatRhbLabelString,
i_rngPtr->hdatRhbRngType,
i_rngPtr->hdatRhbRngId,
i_rngPtr->hdatRhbAddrRngStrAddr,
- i_rngPtr->hdatRhbAddrRngEndAddr);
+ i_rngPtr->hdatRhbAddrRngEndAddr,
+ i_rngPtr->hdatRhbPermission);
}
/**
@@ -261,7 +264,10 @@ errlHndl_t setNextHbRsvMemEntry(const HDAT::hdatMsVpdRhbAddrRangeType i_type,
const uint16_t i_rangeId,
const uint64_t i_startAddr,
const uint64_t i_size,
- const char* i_label)
+ const char* i_label,
+ const HDAT::hdatRhbPermType i_permission =
+ HDAT::RHB_READ_WRITE
+ )
{
errlHndl_t l_elog = nullptr;
@@ -283,7 +289,8 @@ errlHndl_t setNextHbRsvMemEntry(const HDAT::hdatMsVpdRhbAddrRangeType i_type,
uint64_t l_startAddr = i_startAddr | VmmManager::FORCE_PHYS_ADDR;
// Fill in the entry
- l_rngPtr->set(i_type, i_rangeId, l_startAddr, i_size, i_label);
+ l_rngPtr->set(i_type, i_rangeId, l_startAddr, i_size, i_label,
+ i_permission);
traceHbRsvMemRange(l_rngPtr);
} while(0);
@@ -695,7 +702,8 @@ errlHndl_t hbResvLoadSecureSection (const PNOR::SectionId i_sec,
i_rangeId,
l_imgAdd,
l_imgSizeAligned,
- PNOR::SectionIdToString(i_sec));
+ PNOR::SectionIdToString(i_sec),
+ HDAT::RHB_READ_ONLY);
if(l_elog)
{
TRACFCOMP( g_trac_runtime, ERR_MRK"hbResvloadSecureSection() setNextHbRsvMemEntry PNOR content failed");
OpenPOWER on IntegriCloud