diff options
author | Mike Baiocchi <mbaiocch@us.ibm.com> | 2017-11-10 09:57:21 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-11-17 09:25:29 -0500 |
commit | 8f6cf7d7310dd8980dd1abca6692ed1c59111f62 (patch) | |
tree | 47d3d78350a388a90a31c30b5fb187d987930897 /src/usr/util/utillidmgr.C | |
parent | 663aae09de4001c7d17225f44ae824215e459bc7 (diff) | |
download | talos-hostboot-8f6cf7d7310dd8980dd1abca6692ed1c59111f62.tar.gz talos-hostboot-8f6cf7d7310dd8980dd1abca6692ed1c59111f62.zip |
Add TCE Support to utillidmgr
This commit looks to see if the system is using TCEs and then
uses them in the utillidmgr. There were also some updates to the
TCE interfaces to allow for this support.
Change-Id: Iccaf0137c2924d3f3806fee1a8068ba2e23cb7d2
RTC:68295
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/49530
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/util/utillidmgr.C')
-rw-r--r-- | src/usr/util/utillidmgr.C | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/src/usr/util/utillidmgr.C b/src/usr/util/utillidmgr.C index 6ab0751f8..7f94c50ed 100644 --- a/src/usr/util/utillidmgr.C +++ b/src/usr/util/utillidmgr.C @@ -25,6 +25,7 @@ #include <util/utillidmgr.H> #include <util/util_reasoncodes.H> +#include <util/utiltce.H> #include <vfs/vfs.H> #include <stdio.h> #include <assert.h> @@ -352,6 +353,8 @@ errlHndl_t UtilLidMgr::getLid(void* i_dest, size_t i_destSize) uint8_t* dataPtr = nullptr; void* copyOffset = nullptr; bool img_in_pnor = false; + bool tces_allocated = false; + uint32_t tceToken = 0; do{ ////////////////////////////////////////////////// @@ -368,6 +371,21 @@ errlHndl_t UtilLidMgr::getLid(void* i_dest, size_t i_destSize) //Image not in PNOR, request from FSP. if(iv_spBaseServicesEnabled) { + // If using TCEs, setup TCE Table for FSP to use + if (TCE::utilUseTcesForDmas()) + { + // Use Preverification Location and Size + errl = TCE::utilAllocateTces(MCL_TMP_ADDR, + MCL_TMP_SIZE, + tceToken); + if(errl) + { + UTIL_FT(ERR_MRK"getLid: Error while allocating TCEs."); + break; + } + tces_allocated = true; + } + errl = createMsgQueue(); if(errl) { @@ -384,8 +402,7 @@ errlHndl_t UtilLidMgr::getLid(void* i_dest, size_t i_destSize) UTILLID_ADD_LID_ID( iv_lidId, l_pMsg->data[0] ); UTILLID_ADD_HEADER_FLAG( 0 , l_pMsg->data[0] ); - //change to use TCE Window for improved performance. RTC: 68295 - UTILLID_ADD_TCE_TOKEN( 0 , l_pMsg->data[1] ); + UTILLID_ADD_TCE_TOKEN( tceToken , l_pMsg->data[1] ); errl = sendMboxMessage( SYNCHRONOUS, l_pMsg ); if(errl) @@ -546,6 +563,7 @@ errlHndl_t UtilLidMgr::getLid(void* i_dest, size_t i_destSize) } }while(transferred_data < iv_lidSize); + } if(errl) { @@ -553,6 +571,31 @@ errlHndl_t UtilLidMgr::getLid(void* i_dest, size_t i_destSize) } }while(0); + // If TCEs were allocated previously, deallocate them here + if (tces_allocated) + { + // Use Preverification Location and Size + auto tce_errl = TCE::utilDeallocateTces(tceToken, + MCL_TMP_SIZE); + + if(tce_errl) + { + UTIL_FT(ERR_MRK"getLid: Error while deallocating TCEs."); + + if (errl) + { + // Commit tce_errl here and original error will be passed back + tce_errl->collectTrace(UTIL_COMP_NAME); + errlCommit( tce_errl, UTIL_COMP_ID ); + } + else + { + // Set errl to tce_errl + errl = tce_errl; + } + } + } + if (iv_spBaseServicesEnabled) { unregisterMsgQueue(); |