diff options
author | Greg Still <stillgs@us.ibm.com> | 2016-09-18 21:55:32 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2016-11-08 12:16:33 -0500 |
commit | e1772ea328f61cc705b3622fdea877a4b4d86ff6 (patch) | |
tree | 10182d15cec190ee500eac7d1a78fe4dab1055e2 /src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C | |
parent | 2aea752457905fb8ef595c4432ec82bcb405962f (diff) | |
download | talos-hostboot-e1772ea328f61cc705b3622fdea877a4b4d86ff6.tar.gz talos-hostboot-e1772ea328f61cc705b3622fdea877a4b4d86ff6.zip |
p9_pstates.h breakup
- content needed by all platforms
- cmeqm content created by p9_pstate_parameter_block for CME Hcode
- occ content created by p9_pstate_parameter_block for OCC FW
- pgpe content created by p9_pstate_parameter_block for PGPE Hcode
- API definitions between PGPE Hcode and OCC FW including the current
shared memory definition.
- the IPC commands are update to better match OCC discussions
- Addressed OCC FW<>PGPE Hcode review / Gerrit comments
- Still have a HB and Jenkins fail with the p9_pm_utils. Cronus is fine.
- Deleted ../hwp/lib/p9_pstate_parameter_block.C in deference to already
merged ../hwp/pm/p9_pstate_parameter_block.C
- Update IDDQ member names to be more descriptive to match WOF discussion
- Remove endianess checks in p9_pm_utils.H
Change-Id: I6ab884af08d5598da08bded1707b57c471f2f594
RTC: 163927
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29915
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: RAHUL BATRA <rbatra@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29917
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C b/src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C index 46b6618bc..a30bc4dd4 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C @@ -41,6 +41,75 @@ #include <p9_pm_utils.H> #include <p9_const_common.H> +/// Byte-reverse a 16-bit integer if on a little-endian machine + +uint16_t +revle16(const uint16_t i_x) +{ + uint16_t rx; + +#ifndef _BIG_ENDIAN + uint8_t* pix = (uint8_t*)(&i_x); + uint8_t* prx = (uint8_t*)(&rx); + + prx[0] = pix[1]; + prx[1] = pix[0]; +#else + rx = i_x; +#endif + + return rx; +} + +/// Byte-reverse a 32-bit integer if on a little-endian machine + +uint32_t +revle32(const uint32_t i_x) +{ + uint32_t rx; + +#ifndef _BIG_ENDIAN + uint8_t* pix = (uint8_t*)(&i_x); + uint8_t* prx = (uint8_t*)(&rx); + + prx[0] = pix[3]; + prx[1] = pix[2]; + prx[2] = pix[1]; + prx[3] = pix[0]; +#else + rx = i_x; +#endif + + return rx; +} + + +/// Byte-reverse a 64-bit integer if on a little-endian machine + +uint64_t +revle64(const uint64_t i_x) +{ + uint64_t rx; + +#ifndef _BIG_ENDIAN + uint8_t* pix = (uint8_t*)(&i_x); + uint8_t* prx = (uint8_t*)(&rx); + + prx[0] = pix[7]; + prx[1] = pix[6]; + prx[2] = pix[5]; + prx[3] = pix[4]; + prx[4] = pix[3]; + prx[5] = pix[2]; + prx[6] = pix[1]; + prx[7] = pix[0]; +#else + rx = i_x; +#endif + + return rx; +} + fapi2::ReturnCode p9_pm_glob_fir_trace( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, const char* i_msg) |