diff options
-rw-r--r-- | src/include/runtime/interface.h | 15 | ||||
-rw-r--r-- | src/include/usr/hwpf/hwp/occ/occ.H | 11 | ||||
-rw-r--r-- | src/include/usr/isteps/istep21list.H | 5 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/occ/occ.C | 55 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/occ/runtime/rt_occ.C | 25 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/start_payload/HBconfig | 4 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/start_payload/start_payload.C | 59 | ||||
-rw-r--r-- | src/usr/hwpf/test/runtime/rt_occtest.H | 6 |
8 files changed, 109 insertions, 71 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h index 910e83c3b..dcc7523b3 100644 --- a/src/include/runtime/interface.h +++ b/src/include/runtime/interface.h @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -174,7 +176,7 @@ typedef struct runtimeInterfaces * @param[in] i_chip - XSCOM chip id of processor based on devtree defn * @return 0 on success else return code */ - int(*loadOCC)(uint64_t i_homer_addr_phys, + int(*occ_load)(uint64_t i_homer_addr_phys, uint64_t i_homer_addr_va, uint64_t i_common_addr_phys, uint64_t i_common_addr_va, @@ -188,7 +190,7 @@ typedef struct runtimeInterfaces * @param[in] i_num_chips - Number of chips in the array * @return 0 on success else return code */ - int (*startOCCs)(uint64_t* i_chip, + int (*occ_start)(uint64_t* i_chip, size_t i_num_chips); /** Stop OCC hold OCCs in reset @@ -199,9 +201,14 @@ typedef struct runtimeInterfaces * @param[in] i_num_chips - Number of chips in the array * @return 0 on success else return code */ - int (*stopOCCs)(uint64_t* i_chip, + int (*occ_stop)(uint64_t* i_chip, size_t i_num_chips); + /** Reset OCC upon failure + * @param [in]: i_chipId: Id of processor with failing OCC + * @return NONE + */ + void (*occ_error) (uint64_t i_chipId); // Reserve some space for future growth. void (*reserved[32])(void); diff --git a/src/include/usr/hwpf/hwp/occ/occ.H b/src/include/usr/hwpf/hwp/occ/occ.H index aa00823d5..ea9e4c1c7 100644 --- a/src/include/usr/hwpf/hwp/occ/occ.H +++ b/src/include/usr/hwpf/hwp/occ/occ.H @@ -52,10 +52,19 @@ namespace HBOCC { * @brief Starts OCCs on all Processors in the node * This is intended to be used for AVP testing. * + * @param[out] o_failedOccTarget: Pointer to the target failing + * loadnStartAllOccs * @return errlHndl_t Error log if OCC load failed */ - errlHndl_t loadnStartAllOccs(); + errlHndl_t loadnStartAllOccs(TARGETING::Target *& o_failedOccTarget); + /** + * @brief Starts OCCs on all Processors in the node + * This is intended to be used for Open Power. + * + * @return errlHndl_t Error log if OCC load failed + */ + errlHndl_t activateOCC (); } //end OCC namespace #endif diff --git a/src/include/usr/isteps/istep21list.H b/src/include/usr/isteps/istep21list.H index 53c02bb82..6959f079d 100644 --- a/src/include/usr/isteps/istep21list.H +++ b/src/include/usr/isteps/istep21list.H @@ -90,12 +90,7 @@ const DepModInfo g_istep21Dependancies = { #ifdef CONFIG_SET_NOMINAL_PSTATE DEP_LIB(libpstates.so), #endif -/* - * This library is loaded dynamically when needed in start_payload. - * Adding statement here to make listdeps.pl happy. - DEP_LIB(libocc.so), -*/ NULL } }; diff --git a/src/usr/hwpf/hwp/occ/occ.C b/src/usr/hwpf/hwp/occ/occ.C index e28a51415..a154893dd 100644 --- a/src/usr/hwpf/hwp/occ/occ.C +++ b/src/usr/hwpf/hwp/occ/occ.C @@ -24,6 +24,7 @@ /* IBM_PROLOG_END_TAG */ #include <stdint.h> +#include <config.h> #include <occ/occ.H> #include <initservice/taskargs.H> @@ -490,7 +491,7 @@ namespace HBOCC //////////////////////////////////////////////// - errlHndl_t loadnStartAllOccs() + errlHndl_t loadnStartAllOccs(TARGETING::Target *& o_failedOccTarget) { errlHndl_t l_errl = NULL; void* homerVirtAddrBase = NULL; @@ -573,11 +574,16 @@ namespace HBOCC homerPhysAddrBase); if(l_errl) { - TRACFCOMP( g_fapiImpTd, ERR_MRK"loadnStartAllOccs: loadnStartOcc failed!" ); + o_failedOccTarget = *itr; + TRACFCOMP( g_fapiImpTd, ERR_MRK + "loadnStartAllOccs:loadnStartOcc failed"); break; } } - + if (l_errl) + { + break; + } } else @@ -625,15 +631,24 @@ namespace HBOCC homerPhysAddrBase); if(l_errl) { - TRACFCOMP( g_fapiImpTd, ERR_MRK"loadnStartAllOccs: loadnStartOcc failed!" ); + o_failedOccTarget = *itr; + TRACFCOMP( g_fapiImpTd, ERR_MRK + "loadnStartAllOccs:loadnStartOcc failed"); break; } } + if (l_errl) + { + break; + } } } while(0); errlHndl_t l_tmpErrl = NULL; +//Unless HTMGT is in use, there are no further accesses to HOMER memory +//required during the IPL +#ifndef CONFIG_HTMGT if(homerVirtAddrBase) { int rc = 0; @@ -671,7 +686,7 @@ namespace HBOCC } } } - +#endif //make sure we always unload the module if (winkle_loaded) { @@ -696,6 +711,36 @@ namespace HBOCC return l_errl; } + errlHndl_t activateOCC () + { + errlHndl_t l_errl = NULL; + TARGETING::Target* l_failedOccTarget = NULL; + //uint8_t l_errStatus = 0; + + l_errl = loadnStartAllOccs (l_failedOccTarget); + if (l_errl) + { + errlCommit (l_errl, HWPF_COMP_ID); + //l_errStatus = 1; + } + + //TODO RTC:116027 + //HB configures/enables the occ buffers + + //TODO RTC:115636 + //HB enables the scon-via-i2c logic on the OCCs +#ifdef CONFIG_HTMGT + //TODO RTC:115585 + //HTMGT::htmgtOccLoadStartStatus + // (l_errStatus,l_failedOccTarget); + if (l_errl) + { + errlCommit (l_errl, HWPF_COMP_ID); + } +#endif + return l_errl; + } + } //end OCC namespace diff --git a/src/usr/hwpf/hwp/occ/runtime/rt_occ.C b/src/usr/hwpf/hwp/occ/runtime/rt_occ.C index 07f63e79f..27160e478 100644 --- a/src/usr/hwpf/hwp/occ/runtime/rt_occ.C +++ b/src/usr/hwpf/hwp/occ/runtime/rt_occ.C @@ -70,6 +70,24 @@ namespace RT_OCC //------------------------------------------------------------------------ + void occ_error (uint64_t i_chipId) + { + do + { + TARGETING::Target* l_failedOccTarget = NULL; + errlHndl_t l_errl =RT_TARG::getHbTarget(i_chipId,l_failedOccTarget); + if (l_errl) + { + TRACFCOMP (g_fapiTd, "occ_error: getHbTarget failed at %d chipId", i_chipId); + errlCommit (l_errl, HWPF_COMP_ID); + break; + } + //TODO RTC: 114906 + //HTMGT::htmgtProcessOccError(l_failedOccTarget); + } while (0); + } + + //--------------------------------------------------------------------- errlHndl_t addHostData(uint64_t i_hostdata_addr) { errlHndl_t err = NULL; @@ -612,9 +630,10 @@ namespace RT_OCC { runtimeInterfaces_t * rt_intf = getRuntimeInterfaces(); rt_intf->get_lid_list = &UtilLidMgr::getLidList; - rt_intf->loadOCC = &executeLoadOCC; - rt_intf->startOCCs = &executeStartOCCs; - rt_intf->stopOCCs = &executeStopOCCs; + rt_intf->occ_load = &executeLoadOCC; + rt_intf->occ_start = &executeStartOCCs; + rt_intf->occ_stop = &executeStopOCCs; + rt_intf->occ_error = &occ_error; // If we already loaded OCC during the IPL we need to fix up // the virtual address because we're now not using virtual diff --git a/src/usr/hwpf/hwp/start_payload/HBconfig b/src/usr/hwpf/hwp/start_payload/HBconfig index 3ab9e3e8d..70fdcb55e 100644 --- a/src/usr/hwpf/hwp/start_payload/HBconfig +++ b/src/usr/hwpf/hwp/start_payload/HBconfig @@ -2,3 +2,7 @@ config SET_NOMINAL_PSTATE default n help Set the PState to Nominal just before starting the payload. +config START_OCC_DURING_BOOT + default n + help + Activates all the OCCs during IPL diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C index 19fb2dcec..920edcc0b 100644 --- a/src/usr/hwpf/hwp/start_payload/start_payload.C +++ b/src/usr/hwpf/hwp/start_payload/start_payload.C @@ -86,7 +86,6 @@ #include <sys/mm.h> #include <algorithm> #include <config.h> - // Uncomment these files as they become available: // #include "host_start_payload/host_start_payload.H" @@ -313,58 +312,18 @@ void* call_host_runtime_setup( void *io_pArgs ) break; } - //Start OCC in AVP - if( is_avp_load() ) - { - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Starting OCC" ); - - //Load modules needed by OCC - bool occ_loaded = false; - - if ( !VFS::module_is_loaded( "libocc.so" ) ) - { - l_err = VFS::module_load( "libocc.so" ); - - if ( l_err ) - { - // load module returned with errl set - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "Could not load occ module" ); - // break from do loop if error occured - break; - } - occ_loaded = true; - } - - l_err = HBOCC::loadnStartAllOccs(); - if(l_err) - { - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - ERR_MRK"loadnStartAllOccs failed" ); - } - - //make sure we always unload the module - if (occ_loaded) - { - errlHndl_t l_tmpErrl = NULL; - l_tmpErrl = VFS::module_unload( "libocc.so" ); - if ( l_tmpErrl ) - { - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - ERR_MRK"Error unloading libocc module" ); - if(l_err) - { - errlCommit( l_tmpErrl, HWPF_COMP_ID ); - } - else - { - l_err = l_tmpErrl; - } - } - } + bool l_activateOCC = is_avp_load(); +#ifdef CONFIG_START_OCC_DURING_BOOT + l_activateOCC = true; +#endif + if(l_activateOCC) + { + l_err = HBOCC::activateOCC(); if (l_err) { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "activateOCC failed"); break; } } diff --git a/src/usr/hwpf/test/runtime/rt_occtest.H b/src/usr/hwpf/test/runtime/rt_occtest.H index 2ddfd5dbe..33a189d10 100644 --- a/src/usr/hwpf/test/runtime/rt_occtest.H +++ b/src/usr/hwpf/test/runtime/rt_occtest.H @@ -54,17 +54,17 @@ class OccTest: public CxxTest::TestSuite TS_FAIL("runtimeInterfaces->get_lid_list not set"); } - if( rt_intf->loadOCC == NULL ) + if( rt_intf->occ_load == NULL ) { TS_FAIL("runtimeInterfaces->loadOCC not set"); } - if( rt_intf->startOCCs == NULL ) + if( rt_intf->occ_start == NULL ) { TS_FAIL("runtimeInterfaces->startOCCs not set"); } - if( rt_intf->stopOCCs == NULL ) + if( rt_intf->occ_stop == NULL ) { TS_FAIL("runtimeInterfaces->stopOCCs not set"); } |