summaryrefslogtreecommitdiffstats
path: root/src/sbefw
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2018-01-04 00:42:17 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2018-01-19 04:25:55 -0500
commitc149d7d8d8b884aba84cc90ddc98597a9e35581e (patch)
treee1fe87e960f236a7899897395d9e9286ff76c197 /src/sbefw
parent56882277747caed6530c617bc9ffe53323c06a93 (diff)
downloadtalos-sbe-c149d7d8d8b884aba84cc90ddc98597a9e35581e.tar.gz
talos-sbe-c149d7d8d8b884aba84cc90ddc98597a9e35581e.zip
Enable new ADU flags
Support for the new ADU flags required to use ADU chipops to switch fabric configuration Change-Id: Ia2ace86c0ceb63e6f0c58882d660cf176967c3b4 RTC:177901 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51439 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/sbefw')
-rw-r--r--src/sbefw/core/sbeSpMsg.H73
-rw-r--r--src/sbefw/core/sbe_sp_intf.H31
-rw-r--r--src/sbefw/core/sbecmdmemaccess.C32
3 files changed, 96 insertions, 40 deletions
diff --git a/src/sbefw/core/sbeSpMsg.H b/src/sbefw/core/sbeSpMsg.H
index 86f7b9e6..56bde0f0 100644
--- a/src/sbefw/core/sbeSpMsg.H
+++ b/src/sbefw/core/sbeSpMsg.H
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -34,6 +35,8 @@
#include "sbe_sp_intf.H"
+#include "p9_adu_coherent_utils.H"
+
// @NOTE Make sure all FIFO structures are 32 bit alligned ( the largest
// member should be atleast 4 byte). It is required as in sbe fifo
// operation we are casting these structures to uint32_t pointer. It can
@@ -345,17 +348,6 @@ typedef struct
}
/**
- * @brief Determines if Cache Inhibited mode is set
- *
- * @return Returns True if Cache Inhibited Mode flag is set
- * False if Cache Inhibited Mode flag is not set
- */
- bool isCacheInhibitModeFlagSet() const
- {
- return ((flags & SBE_MEM_ACCESS_FLAGS_CACHE_INHIBIT) ? true : false);
- }
-
- /**
* @brief Determines if PBA flag is set
*
* @return Returns True if PBA Flag is set
@@ -439,6 +431,63 @@ typedef struct
return ((flags & SBE_MEM_ACCESS_FLAGS_HOST_PASS_THROUGH) ? true : false);
}
+ /**
+ * @brief Map SBE mem access flags to ADU operation type flag
+ *
+ */
+ void setADUOperationType(p9_ADU_oper_flag &o_aduFlag) const
+ {
+ if(flags & SBE_MEM_ACCESS_FLAGS_CACHE_INHIBIT)
+ {
+ o_aduFlag.setOperationType(p9_ADU_oper_flag::CACHE_INHIBIT);
+ }
+ else if(flags & SBE_MEM_ACCESS_FLAGS_PB_DIS)
+ {
+ o_aduFlag.setOperationType(p9_ADU_oper_flag::PB_DIS_OPER);
+ }
+ else if(flags & SBE_MEM_ACCESS_FLAGS_SWITCH)
+ {
+ o_aduFlag.setOperationType(p9_ADU_oper_flag::PMISC_OPER);
+ }
+ else if(flags & SBE_MEM_ACCESS_FLAGS_PB_INIT)
+ {
+ o_aduFlag.setOperationType(p9_ADU_oper_flag::PB_INIT_OPER);
+ }
+ else if(flags & SBE_MEM_ACCESS_FLAGS_PRESWITCH_AB)
+ {
+ o_aduFlag.setOperationType(p9_ADU_oper_flag::PRE_SWITCH_AB);
+ }
+ else if(flags & SBE_MEM_ACCESS_FLAGS_PRESWITCH_CD)
+ {
+ o_aduFlag.setOperationType(p9_ADU_oper_flag::PRE_SWITCH_CD);
+ }
+ else if(flags & SBE_MEM_ACCESS_FLAGS_POSTSWITCH)
+ {
+ o_aduFlag.setOperationType(p9_ADU_oper_flag::POST_SWITCH);
+ }
+ }
+
+ /**
+ * @brief check if the given flags are trusted operations,
+ * which doesn't work with address and data passed
+ *
+ */
+ bool isTrustedOp() const
+ {
+ bool trusted = false;
+ if(flags &
+ (SBE_MEM_ACCESS_FLAGS_PB_DIS |
+ SBE_MEM_ACCESS_FLAGS_SWITCH |
+ SBE_MEM_ACCESS_FLAGS_PB_INIT |
+ SBE_MEM_ACCESS_FLAGS_PRESWITCH_AB |
+ SBE_MEM_ACCESS_FLAGS_PRESWITCH_CD |
+ SBE_MEM_ACCESS_FLAGS_POSTSWITCH))
+ {
+ trusted = true;
+ }
+ return trusted;
+ }
+
}sbeMemAccessReqMsgHdr_t;
/**
diff --git a/src/sbefw/core/sbe_sp_intf.H b/src/sbefw/core/sbe_sp_intf.H
index 23881746..50afe17f 100644
--- a/src/sbefw/core/sbe_sp_intf.H
+++ b/src/sbefw/core/sbe_sp_intf.H
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -292,17 +293,23 @@ enum
*/
enum sbeMemoryAccessFlags
{
- SBE_MEM_ACCESS_FLAGS_TARGET_PROC = 0x0001, //required in ADU
- SBE_MEM_ACCESS_FLAGS_TARGET_PBA = 0x0002, //required in PBA
- SBE_MEM_ACCESS_FLAGS_AUTO_INCR_ON = 0x0004,
- SBE_MEM_ACCESS_FLAGS_ECC_REQUIRED = 0x0008, //required only in ADU-GET
- SBE_MEM_ACCESS_FLAGS_ECC_OVERRIDE = 0x0008, //required only in ADU-PUT
- SBE_MEM_ACCESS_FLAGS_ITAG = 0x0010, //ITAG Mode in ADU
- SBE_MEM_ACCESS_FLAGS_FAST_MODE_ON = 0x0020,
- SBE_MEM_ACCESS_FLAGS_LCO_ENABLED = 0x0040, //required only in PBA-PUT
- SBE_MEM_ACCESS_FLAGS_CACHE_INHIBIT = 0x0080, //required in I/O oper ADU
- SBE_MEM_ACCESS_FLAGS_HOST_PASS_THROUGH = 0x0100, // Host pass through mode (PBA)
- SBE_MEM_ACCESS_FLAGS_INJECT_ON = 0x0200, // Inject mode ( PBA put )
+ SBE_MEM_ACCESS_FLAGS_TARGET_PROC = 0x00000001, //required in ADU
+ SBE_MEM_ACCESS_FLAGS_TARGET_PBA = 0x00000002, //required in PBA
+ SBE_MEM_ACCESS_FLAGS_AUTO_INCR_ON = 0x00000004,
+ SBE_MEM_ACCESS_FLAGS_ECC_REQUIRED = 0x00000008, //required only in ADU-GET
+ SBE_MEM_ACCESS_FLAGS_ECC_OVERRIDE = 0x00000008, //required only in ADU-PUT
+ SBE_MEM_ACCESS_FLAGS_ITAG = 0x00000010, //ITAG Mode in ADU
+ SBE_MEM_ACCESS_FLAGS_FAST_MODE_ON = 0x00000020,
+ SBE_MEM_ACCESS_FLAGS_LCO_ENABLED = 0x00000040, //required only in PBA-PUT
+ SBE_MEM_ACCESS_FLAGS_CACHE_INHIBIT = 0x00000080, //required in I/O oper ADU
+ SBE_MEM_ACCESS_FLAGS_HOST_PASS_THROUGH = 0x00000100, // Host pass through mode (PBA)
+ SBE_MEM_ACCESS_FLAGS_INJECT_ON = 0x00000200, // Inject mode ( PBA put )
+ SBE_MEM_ACCESS_FLAGS_PB_DIS = 0x00000400,
+ SBE_MEM_ACCESS_FLAGS_SWITCH = 0x00000800,
+ SBE_MEM_ACCESS_FLAGS_PB_INIT = 0x00001000,
+ SBE_MEM_ACCESS_FLAGS_PRESWITCH_CD = 0x00002000,
+ SBE_MEM_ACCESS_FLAGS_PRESWITCH_AB = 0x00004000,
+ SBE_MEM_ACCESS_FLAGS_POSTSWITCH = 0x00008000,
};
/**
diff --git a/src/sbefw/core/sbecmdmemaccess.C b/src/sbefw/core/sbecmdmemaccess.C
index 1160043d..36263eb3 100644
--- a/src/sbefw/core/sbecmdmemaccess.C
+++ b/src/sbefw/core/sbecmdmemaccess.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -422,12 +423,6 @@ uint32_t processAduRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
{
l_aduFlag.setFastMode(true);
}
- // Set DMA_PARTIAL mode by default
- l_aduFlag.setOperationType(p9_ADU_oper_flag::DMA_PARTIAL);
- if(i_hdr.isCacheInhibitModeFlagSet())
- {
- l_aduFlag.setOperationType(p9_ADU_oper_flag::CACHE_INHIBIT);
- }
if(i_hdr.isItagFlagSet())
{
l_aduFlag.setItagMode(true);
@@ -453,6 +448,8 @@ uint32_t processAduRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
}
}
+ i_hdr.setADUOperationType(l_aduFlag);
+
// Input Data length in alignment with ADU
// 1 for 1/2/4 Bytes else number of multiples of 8 Bytes
uint64_t l_lenCacheAligned = i_hdr.getDataLenCacheAlign();
@@ -467,16 +464,19 @@ uint32_t processAduRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
SBE_MEM_ACCESS_READ :
SBE_MEM_ACCESS_WRITE),
sbeMemAccessInterface::ADU_GRAN_SIZE_BYTES);
- // Check if the access to the address is allowed
- l_respHdr.secondaryStatus = mainStoreSecMemRegionManager.isAccessAllowed(
- {l_addr,
- i_hdr.len,
- (i_isFlagRead ? static_cast<uint8_t>(memRegionMode::READ):
- static_cast<uint8_t>(memRegionMode::WRITE))});
- if(l_respHdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL)
+ if(false == i_hdr.isTrustedOp())
{
- l_respHdr.primaryStatus = SBE_PRI_UNSECURE_ACCESS_DENIED;
- break;
+ // Check if the access to the address is allowed
+ l_respHdr.secondaryStatus = mainStoreSecMemRegionManager.isAccessAllowed(
+ {l_addr,
+ i_hdr.len,
+ (i_isFlagRead ? static_cast<uint8_t>(memRegionMode::READ):
+ static_cast<uint8_t>(memRegionMode::WRITE))});
+ if(l_respHdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL)
+ {
+ l_respHdr.primaryStatus = SBE_PRI_UNSECURE_ACCESS_DENIED;
+ break;
+ }
}
// 8Byte granule for ADU access
uint64_t l_dataFifo[MAX_ADU_BUFFER] = {0};
OpenPOWER on IntegriCloud