diff options
author | Thi Tran <thi@us.ibm.com> | 2015-12-11 12:49:53 -0600 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2017-11-16 17:59:43 -0500 |
commit | bcef4f1931d8cd755b2185435cc8e67cfe143295 (patch) | |
tree | 8002401822e1733fa5be86050caf54d6e3151b52 /src/import/chips | |
parent | f01a301bb62629f4cfdb6bfb62d36074fc6cdbae (diff) | |
download | talos-hostboot-bcef4f1931d8cd755b2185435cc8e67cfe143295.tar.gz talos-hostboot-bcef4f1931d8cd755b2185435cc8e67cfe143295.zip |
L2 - p9_build_smp HWPs
Change-Id: Ic86f724429233ca03f71475f18201bb71ae8e6c0
Original-Change-Id: Ic3b000e1c9844499c478e29f2d370d037a8fc262
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22704
Tested-by: Jenkins Server
Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com>
Tested-by: Auto Mirror
Tested-by: PPE CI
Tested-by: Hostboot CI
Reviewed-by: CHRISTINA L. GRAVES <clgraves@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/49795
Tested-by: Jenkins Server <pfd-jenkins+hostboot@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: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/nest/p9_adu_access.C | 36 | ||||
-rw-r--r-- | src/import/chips/p9/procedures/hwp/nest/p9_pba_constants.H | 29 |
2 files changed, 55 insertions, 10 deletions
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_adu_access.C b/src/import/chips/p9/procedures/hwp/nest/p9_adu_access.C index 66c527a12..141f72eb0 100644 --- a/src/import/chips/p9/procedures/hwp/nest/p9_adu_access.C +++ b/src/import/chips/p9/procedures/hwp/nest/p9_adu_access.C @@ -57,10 +57,18 @@ extern "C" { const bool i_lastGranule, uint8_t io_data[]) { + + bool l_busyBitStatus = false; + adu_status_busy_handler l_busyHandling; + // mark HWP entry FAPI_DBG("Entering ...\n"); - if(i_lastGranule && (i_flags & FLAG_AUTOINC)) + // Process input flag + p9_ADU_oper_flag l_myAduFlag; + l_myAduFlag.getFlag(i_flags); + + if( i_lastGranule && l_myAduFlag.getAutoIncrement() ) { //call this function to clear the altd_auto_inc bit before the last iteration FAPI_TRY(p9_adu_coherent_clear_autoinc(i_target), "Error from p9_adu_coherent_clear_autoinc"); @@ -69,21 +77,32 @@ extern "C" { if (i_rnw) { //read the data - FAPI_TRY(p9_adu_coherent_adu_read(i_target, i_firstGranule, i_address, i_flags, io_data), + FAPI_TRY(p9_adu_coherent_adu_read(i_target, i_firstGranule, i_address, l_myAduFlag, io_data), "Error from p9_adu_coherent_adu_read"); } else { //write the data - FAPI_TRY(p9_adu_coherent_adu_write(i_target, i_firstGranule, i_address, i_flags, io_data), + FAPI_TRY(p9_adu_coherent_adu_write(i_target, i_firstGranule, i_address, l_myAduFlag, io_data), "Error from p9_adu_coherent_adu_write"); } //If we are not in fastmode or this is the last granule, we want to check the status - if ((i_lastGranule) || !(i_flags & FLAG_FASTMODE)) + if ( (i_lastGranule) || (l_myAduFlag.getFastMode() == false) ) { - FAPI_TRY(p9_adu_coherent_status_check(i_target, ((i_flags & FLAG_AUTOINC) - && !i_lastGranule)), "Error from p9_adu_coherent_status_check"); + if ( (l_myAduFlag.getAutoIncrement()) && !i_lastGranule ) + { + // Only expect ADU busy if in AUTOINC AND it's not the last granule + l_busyHandling = EXPECTED_BUSY_BIT_SET; + } + else + { + l_busyHandling = EXPECTED_BUSY_BIT_CLEAR; + } + + FAPI_TRY(p9_adu_coherent_status_check(i_target, l_busyHandling, false, + l_busyBitStatus), + "Error from p9_adu_coherent_status_check"); //If it's the last read/write if (i_lastGranule) @@ -95,11 +114,10 @@ extern "C" { fapi_try_exit: - if (fapi2::current_err - && !(i_flags & FLAG_LEAVE_DIRTY)) + if ( fapi2::current_err && l_myAduFlag.getOperFailCleanup() ) { (void) p9_adu_coherent_utils_reset_adu(i_target); - uint32_t num_attempts = i_flags & FLAG_LOCK_TRIES; + uint32_t num_attempts = l_myAduFlag.getNumLockAttempts(); (void) p9_adu_coherent_manage_lock(i_target, false, false, num_attempts); } diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_pba_constants.H b/src/import/chips/p9/procedures/hwp/nest/p9_pba_constants.H index a5c7df6d3..6bcfbe053 100644 --- a/src/import/chips/p9/procedures/hwp/nest/p9_pba_constants.H +++ b/src/import/chips/p9/procedures/hwp/nest/p9_pba_constants.H @@ -44,14 +44,39 @@ extern "C" //---------------------------------------------------------------------------------------------- // Constant definitions //---------------------------------------------------------------------------------------------- + enum pba_flags + { + // Fastmode flag + // If this flag is set it means we will not check for errors until + // the very last granule for the read/write + FLAG_PBA_FASTMODE = 0x80000000ull, + + // TTYPE flag + // PBA operation type + // 0b000: DMA + // 0b001: LCO_M + // 0b010: ATOMIC + // 0b011: CACHE_INJ + // 0b100: CI_PR_W + // Same as in the documentation and how they will be passed to the register + FLAG_PBA_TTYPE = 0x70000000ull + }; +// TTYPE shift position + const uint64_t FLAG_PBA_TTYPE_SHIFT = 28; + const uint64_t FLAG_PBA_TTYPE_MASK = 0b111; + +// -------------------------------------------------------------------- +// TODO: RTC 147511 - Remove this definition when SBE code is updated +// and use PBA class. +// --------------------------------------------------------------------- //these give the bit mask for each flag enum p9_pba_flags { //fastmode flag, if this flag is set it means we will not check for errors until the very last granule for the read/write FLAG_FASTMODE = 0x80000000ull, //ttype flag, this is 3 bits, will be set to 0 for dma, 1, to lco_m, 2 for atomic, 3 for cache_inj, and 4 for ci_pr_w --same as in the documentation and how they will be passed to the register - FLAG_TTYPE = 0x70000000ull + FLAG_TTYPE = 0x70000000ull }; enum p9_pba_write_ttype @@ -64,6 +89,8 @@ extern "C" }; const uint64_t FLAG_TTYPE_SHIFT = 28; +// ----------------------------------------------------- + } //extern "C" |