diff options
author | Corey Swenson <cswenson@us.ibm.com> | 2014-06-18 16:09:55 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-07-01 13:34:57 -0500 |
commit | 2cc1c594ad2b05919d1742625de0da83ffd7f01d (patch) | |
tree | 57bbbe923325245e809ea51a96c60ffe79b18600 /src/usr/fsi | |
parent | 3bcf5b7982bb8a2d9227dbff7be4ff2ce5fec05c (diff) | |
download | talos-hostboot-2cc1c594ad2b05919d1742625de0da83ffd7f01d.tar.gz talos-hostboot-2cc1c594ad2b05919d1742625de0da83ffd7f01d.zip |
Merge VPD commits from Stradale
Change-Id: I95aa2bb30299c9d22563068741ffbeda48d2d84b
RTC: 97488
Origin: Google Shared Technology
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11661
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/fsi')
-rw-r--r-- | src/usr/fsi/fsipres.C | 150 |
1 files changed, 84 insertions, 66 deletions
diff --git a/src/usr/fsi/fsipres.C b/src/usr/fsi/fsipres.C index 91cba9268..c4ac77ce0 100644 --- a/src/usr/fsi/fsipres.C +++ b/src/usr/fsi/fsipres.C @@ -5,7 +5,10 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2014 */ +/* [+] Google Inc. */ +/* [+] 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. */ @@ -29,6 +32,7 @@ #include <errl/errlmanager.H> #include <hwas/common/hwasCallout.H> #include <targeting/common/predicates/predicatectm.H> +#include <config.h> extern trace_desc_t* g_trac_fsi; @@ -105,45 +109,25 @@ errlHndl_t procPresenceDetect(DeviceFW::OperationType i_opType, } // Next look for valid Module VPD + bool check_for_mvpd = true; +#ifdef CONFIG_MVPD_READ_FROM_HW + check_for_mvpd = fsi_present; +#endif // CONFIG_MVPD_READ_FROM_HW + bool mvpd_present = false; size_t theSize = 0; - l_errl = deviceRead( i_target, - NULL, - theSize, - DEVICE_MVPD_ADDRESS( MVPD::CP00, - MVPD::VD ) ); - if( l_errl ) - { - if( fsi_present ) - { - // Save this plid to use later - l_saved_plid = l_errl->plid(); - - // commit this log because we expected to have VPD - errlCommit( l_errl, - FSI_COMP_ID ); - } - else - { - // just delete this - delete l_errl; - } - } - - if( theSize > 0 ) + if ( check_for_mvpd ) { - uint8_t theData[theSize]; l_errl = deviceRead( i_target, - theData, - theSize, - DEVICE_MVPD_ADDRESS( MVPD::CP00, - MVPD::VD ) ); + NULL, + theSize, + DEVICE_MVPD_ADDRESS( MVPD::CP00, + MVPD::VD ) ); if( l_errl ) { if( fsi_present ) { - // Save this plid to use later l_saved_plid = l_errl->plid(); @@ -157,9 +141,37 @@ errlHndl_t procPresenceDetect(DeviceFW::OperationType i_opType, delete l_errl; } } - else + + if( theSize > 0 ) { - mvpd_present = true; + uint8_t theData[theSize]; + l_errl = deviceRead( i_target, + theData, + theSize, + DEVICE_MVPD_ADDRESS( MVPD::CP00, + MVPD::VD ) ); + if( l_errl ) + { + if( fsi_present ) + { + + // Save this plid to use later + l_saved_plid = l_errl->plid(); + + // commit this log because we expected to have VPD + errlCommit( l_errl, + FSI_COMP_ID ); + } + else + { + // just delete this + delete l_errl; + } + } + else + { + mvpd_present = true; + } } } @@ -275,42 +287,22 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType, bool fsi_present = isSlavePresent(i_target); // Next look for memb FRU VPD + bool check_for_cvpd = true; +#ifdef CONFIG_CVPD_READ_FROM_HW + check_for_cvpd = fsi_present; +#endif // CONFIG_CVPD_READ_FROM_HW + bool cvpd_present = false; size_t theSize = 0; - - l_errl = deviceRead( i_target, - NULL, - theSize, - DEVICE_CVPD_ADDRESS( CVPD::VEIR, - CVPD::PF ) ); - - if( l_errl ) - { - - if( fsi_present ) - { - // Save this plid to use later - l_saved_plid = l_errl->plid(); - - // commit this log because we expected to have VPD - errlCommit( l_errl, - FSI_COMP_ID ); - } - else - { - // just delete this - delete l_errl; - } - } - - if( theSize > 0 ) + + if ( check_for_cvpd ) { - uint8_t theData[theSize]; l_errl = deviceRead( i_target, - theData, + NULL, theSize, DEVICE_CVPD_ADDRESS( CVPD::VEIR, CVPD::PF ) ); + if( l_errl ) { @@ -329,13 +321,40 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType, delete l_errl; } } - else + + if( theSize > 0 ) { - cvpd_present = true; + uint8_t theData[theSize]; + l_errl = deviceRead( i_target, + theData, + theSize, + DEVICE_CVPD_ADDRESS( CVPD::VEIR, + CVPD::PF ) ); + if( l_errl ) + { + + if( fsi_present ) + { + // Save this plid to use later + l_saved_plid = l_errl->plid(); + + // commit this log because we expected to have VPD + errlCommit( l_errl, + FSI_COMP_ID ); + } + else + { + // just delete this + delete l_errl; + } + } + else + { + cvpd_present = true; + } } } - // Finally compare the 2 methods if( fsi_present != cvpd_present ) { @@ -384,7 +403,6 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType, errlCommit( l_errl, FSI_COMP_ID ); } - bool present = fsi_present && cvpd_present; memcpy(io_buffer, &present, sizeof(present)); io_buflen = sizeof(present); |