diff options
author | Richard J. Knight <rjknight@us.ibm.com> | 2012-10-26 12:34:46 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-11-15 09:57:35 -0600 |
commit | 7e9680f99f9dccf871b364f034f1eb19e9a1ae30 (patch) | |
tree | 259da5ff97d113ce61190923e1f231480d216195 /src/usr/hwpf/hwp/start_payload | |
parent | b8d95068b788c0f1b1587996ef2852df7d338f37 (diff) | |
download | talos-hostboot-7e9680f99f9dccf871b364f034f1eb19e9a1ae30.tar.gz talos-hostboot-7e9680f99f9dccf871b364f034f1eb19e9a1ae30.zip |
Updates to IPL flow to match doc v1.18
Change-Id: I9fe83e777fde516b6ddbadd2eea4969b87e601fa
RTC: 50424
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2167
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/start_payload')
-rw-r--r-- | src/usr/hwpf/hwp/start_payload/start_payload.C | 134 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/start_payload/start_payload.H | 25 |
2 files changed, 119 insertions, 40 deletions
diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C index fe6c351b7..d7bd14adb 100644 --- a/src/usr/hwpf/hwp/start_payload/start_payload.C +++ b/src/usr/hwpf/hwp/start_payload/start_payload.C @@ -53,6 +53,7 @@ #include <mbox/mboxif.H> #include <initservice/isteps_trace.H> +#include <hwpisteperror.H> // targeting support #include <targeting/common/commontargeting.H> @@ -73,6 +74,7 @@ namespace START_PAYLOAD using namespace TARGETING; using namespace fapi; using namespace ISTEP; +using namespace ISTEP_ERROR; /** * @brief This function will call the Initservice interface to shutdown @@ -98,61 +100,107 @@ errlHndl_t callShutdown ( void ); errlHndl_t notifyFsp ( bool i_istepModeFlag, TARGETING::SpFunctions i_spFuncs ); - // // Wrapper function to call 21.1 : -// host_start_payload +// host_runtime_setup // -void* call_host_start_payload( void *io_pArgs ) +void* call_host_runtime_setup( void *io_pArgs ) { - errlHndl_t l_errl = NULL; TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_host_start_payload entry" ); + "call_host_runtime_setup entry" ); + + errlHndl_t l_err = NULL; + + IStepError l_StepError; + + // Need to wait here until Fsp tells us go + INITSERVICE::waitForSyncPoint(); do { - // Need to wait here until Fsp tells us go - INITSERVICE::waitForSyncPoint(); - // Need to load up the runtime module if it isn't already loaded if ( !VFS::module_is_loaded( "libruntime.so" ) ) { - l_errl = VFS::module_load( "libruntime.so" ); - if ( l_errl ) + l_err = VFS::module_load( "libruntime.so" ); + + if ( l_err ) { // load module returned with errl set TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "Could not load runtime module" ); - - // break out of do block + "Could not load runtime module" ); + // break from do loop if error occured break; } } - // Host Start Payload procedure, per documentation from Patrick. - // - Verify target image - // - TODO - Done via call to Secure Boot ROM. - // - Will be done in future sprints + // Write the HostServices attributes into mainstore + l_err = RUNTIME::populate_attributes(); - // - Update HDAT with updated SLW images - // - TODO - Once we know where they go in the HDAT + // - Update HDAT with tpmd logs - //@todo : Move this to new sub-step with RTC:49501 - // Write the HostServices attributes into mainstore - l_errl = RUNTIME::populate_attributes(); - if( l_errl ) - { - break; - } + } while(0); - // - Run CXX testcases - l_errl = INITSERVICE::executeUnitTests(); + if( l_err ) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "istep start_payload_failed see plid 0x%x", l_err->plid()); - if( l_errl ) - { - break; - } + l_StepError.addErrorDetails(ISTEP_START_PAYLOAD_FAILED, + ISTEP_HOST_RUNTIME_SETUP, l_err ); + + errlCommit(l_err, ISTEP_COMP_ID); + + } + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_host_runtime_setup exit" ); + + return l_StepError.getErrorHandle(); +} + +// +// Wrapper function to call 21.2 : +// host_start_payload +// +void* call_host_verify_hdat( void *io_pArgs ) +{ + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_host_verify_hdat entry" ); + + errlHndl_t l_err = NULL; + + // Host Start Payload procedure, per documentation from Patrick. + // - Verify target image + // - TODO - Done via call to Secure Boot ROM. + // - Will be done in future sprints + + // stub for now.. + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_host_verify_hdat exit" ); + + return l_err; +} +// +// Wrapper function to call 21.3 : +// host_start_payload +// +void* call_host_start_payload( void *io_pArgs ) +{ + errlHndl_t l_errl = NULL; + + IStepError l_StepError; + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_host_start_payload entry" ); + + + // - Run CXX testcases + l_errl = INITSERVICE::executeUnitTests(); + + if( l_errl == NULL ) + { // - Call shutdown using payload base, and payload entry. // - base/entry will be from system attributes @@ -160,17 +208,25 @@ void* call_host_start_payload( void *io_pArgs ) // NOTE: this call will not return if successful. l_errl = callShutdown(); - if( l_errl ) - { - break; - } - } while( 0 ); + }; + + if( l_errl ) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "istep start_payload_failed see plid 0x%x", l_errl->plid()); + + l_StepError.addErrorDetails(ISTEP_START_PAYLOAD_FAILED, + ISTEP_HOST_START_PAYLOAD, l_errl ); + + errlCommit(l_errl, ISTEP_COMP_ID); + + } TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_host_start_payload exit" ); + "call_host_start_payload exit" ); // end task, returning any errorlogs to IStepDisp - return l_errl; + return l_StepError.getErrorHandle(); } diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.H b/src/usr/hwpf/hwp/start_payload/start_payload.H index b4f620842..036efe967 100644 --- a/src/usr/hwpf/hwp/start_payload/start_payload.H +++ b/src/usr/hwpf/hwp/start_payload/start_payload.H @@ -59,12 +59,34 @@ namespace START_PAYLOAD { +/** + * @brief host_runtime_setup + * + * 21.1 : : Host Runtime Setup + * + * param[in,out] - pointer to any arguments, usually NULL + * + * return any error logs to istep + * + */ +void* call_host_runtime_setup( void *io_pArgs ); +/** + * @brief host_verify_hdat + * + * 21.2 : : Secureboot verification of PHYP/AVP image load + * + * param[in,out] - pointer to any arguments, usually NULL + * + * return any error logs to istep + * + */ +void* call_host_verify_hdat( void *io_pArgs ); /** * @brief host_start_payload * - * 21.1 : : Start Payload + * 21.3 : : Start Payload * * param[in,out] - pointer to any arguments, usually NULL * @@ -74,6 +96,7 @@ namespace START_PAYLOAD void* call_host_start_payload( void *io_pArgs ); + }; // end namespace #endif |