From c93fdde6061cd2b10ccd556f174d095de8341ea2 Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Tue, 14 Mar 2017 09:36:57 -0500 Subject: Enable indirect scom logic for HBRT under PHYP PHYP is fine with HBRT handling the indirect scom logic, including the polling events. Change-Id: Ic2994065615a24121eccfaa7f6b78bb5be803319 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37903 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Corey V. Swenson Reviewed-by: Matthew A. Ploetz Reviewed-by: Daniel M. Crowell --- src/usr/scom/scom.C | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/usr/scom') diff --git a/src/usr/scom/scom.C b/src/usr/scom/scom.C index cca8b45d6..0df0c44b0 100644 --- a/src/usr/scom/scom.C +++ b/src/usr/scom/scom.C @@ -173,12 +173,27 @@ errlHndl_t checkIndirectAndDoScom(DeviceFW::OperationType i_opType, errlHndl_t l_err = NULL; do { - // In HOSTBOOT_RUNTIME we always defer indirect scoms to Sapphire. -#ifndef __HOSTBOOT_RUNTIME + // Do we need to do the indirect logic or not? + bool l_runIndirectLogic = true; + // If the indirect scom bit is 0, then doing a regular scom if( (i_addr & 0x8000000000000000) == 0) { + l_runIndirectLogic = false; + } + + // In HOSTBOOT_RUNTIME we always defer indirect scoms to + // Sapphire, but PHYP wants us to do it ourselves +#ifdef __HOSTBOOT_RUNTIME + if( TARGETING::is_sapphire_load() ) + { + l_runIndirectLogic = false; + } #endif // __HOSTBOOT_RUNTIME + + // Not indirect (or skipping that) so just do regular scom + if( l_runIndirectLogic == false ) + { l_err = doScomOp(i_opType, i_target, io_buffer, @@ -187,8 +202,11 @@ errlHndl_t checkIndirectAndDoScom(DeviceFW::OperationType i_opType, i_addr); //all done break; -#ifndef __HOSTBOOT_RUNTIME } + + //---------------------------------------------- + //--- Below here is the indirect scom logic --- + uint64_t l_io_buffer = 0; uint64_t temp_scomAddr = 0; uint8_t form = 0; @@ -263,7 +281,6 @@ errlHndl_t checkIndirectAndDoScom(DeviceFW::OperationType i_opType, break; } -#endif // __HOSTBOOT_RUNTIME } while(0); return l_err; -- cgit v1.2.1