diff options
| author | crgeddes <crgeddes@us.ibm.com> | 2016-03-31 10:57:35 -0500 |
|---|---|---|
| committer | Stephen Cprek <smcprek@us.ibm.com> | 2016-04-21 13:51:39 -0500 |
| commit | d32a58cf2c6d9c3b7698a5a088f120b67ee287fc (patch) | |
| tree | f2c3a275f5336a35b84d43fac0f4293a1b531d15 /src/include/usr | |
| parent | fe1d7934857366cab8695381ac6a7f5e3b7ed29a (diff) | |
| download | talos-hostboot-d32a58cf2c6d9c3b7698a5a088f120b67ee287fc.tar.gz talos-hostboot-d32a58cf2c6d9c3b7698a5a088f120b67ee287fc.zip | |
Implement DO_NOT_WAKEUP opMode for Scom access
During runtime we occasionally will read scoms from various chiplets.
Usually if the chiplet is in winkle mode (stopped, idle, etc) then we will
wake it up. If this opmode is set, it is indicating the attempted read is not
very important and not worth the time/energy to wake up the chiplet.
Change-Id: Ieaaffe42fda3459e0295597fcf41c07bbaee72b4
RTC: 150454
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22986
Tested-by: Jenkins Server
Tested-by: FSP CI Jenkins
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/include/usr')
| -rw-r--r-- | src/include/usr/devicefw/userif.H | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/src/include/usr/devicefw/userif.H b/src/include/usr/devicefw/userif.H index 06195f326..970a747a6 100644 --- a/src/include/usr/devicefw/userif.H +++ b/src/include/usr/devicefw/userif.H @@ -71,14 +71,51 @@ namespace DeviceFW }; #ifndef PARSER + + /** Single argument version of the macro to provide the correct information + * to perform a scomRead or scomWrite. Takes in a scom address + * + * @param[in] i_address - scom address that you are writing to or reading from + */ + #define DEVICE_SCOM_ADDRESS_1_ARGS(i_address)\ + DeviceFW::SCOM, static_cast<uint64_t>((i_address)), static_cast<uint64_t>(0) + + /** 2 argument version of the macro to provide the correct information to + * preform a scomRead or scomWrite. Takes in a scom address and an opmode + * + * @param[in] i_address - scom addr that you are writing to or reading from + * @param[in] i_opMode - fapi2 opMode used by HWPs to conduct scoms in a + * certain way + */ + #define DEVICE_SCOM_ADDRESS_2_ARGS(i_address, i_opMode)\ + DeviceFW::SCOM, static_cast<uint64_t>((i_address)), static_cast<uint64_t>(i_opMode) + + /** This is the trick to figuring out if the second argument is there or not + * by using this in conjunction with __VA_ARGS__ , which has variable length + * you can select the appropriate macro for the number of arguments present + * + * @param[in] arg1 - __VA_ARGS__ that you are trying to determine size of + * @param[in] arg2 - 2 argument version of macro + * @param[in] arg1 - 1 argument version of macro + */ + #define GET_3RD_ARG(arg1, arg2, arg3, ...) arg3 + + /** This is the implementation GET_3RD_ARG macro that selects either + * the 1 argument macro for scom address that only takes an addressing + * or else use the 2 arg macro that takes in an address as well as an opmode + * + * @param[in] _VA_ARGS__ - __VA_ARGS__ that you are trying to determine size of + */ + #define DEVICE_SCOM_ADDRESS_MACRO_CHOOSER(...) \ + GET_3RD_ARG(__VA_ARGS__, DEVICE_SCOM_ADDRESS_2_ARGS, DEVICE_SCOM_ADDRESS_1_ARGS ) + /** Construct the device addressing parameters for SCOM device ops. - * @param[in] i_address - Scom address to operate on. - */ - #define DEVICE_SCOM_ADDRESS(i_address) \ - DeviceFW::SCOM, static_cast<uint64_t>((i_address)) + * @param[in] i_address - Scom address to operate on. + */ + #define DEVICE_SCOM_ADDRESS(...) DEVICE_SCOM_ADDRESS_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__) /** Construct the device addressing parameters for the PRESENT device ops. - */ + */ #define DEVICE_PRESENT_ADDRESS() \ DeviceFW::PRESENT |

