Jim Yuan | f5da1de | 2019-03-25 09:49:24 -0700 | [diff] [blame] | 1 | From 94de2f7f944a2cabbdf699adcbc6679a091ad324 Mon Sep 17 00:00:00 2001 |
| 2 | From: Leoluo <leoluo@supermicro.com> |
| 3 | Date: Tue, 8 Mar 2016 17:01:26 -0800 |
| 4 | Subject: [PATCH 07/14] read riser id from CPLD |
| 5 | |
| 6 | Signed-off-by: Jim Yuan <jim.yuan@supermicro.com> |
| 7 | --- |
| 8 | src/include/usr/ipmi/ipmiif.H | 3 ++ |
| 9 | src/usr/hwpf/hwp/nest_chiplets/nest_chiplets.C | 42 +++++++++++++++++++++++++- |
| 10 | 2 files changed, 44 insertions(+), 1 deletion(-) |
| 11 | |
| 12 | diff --git a/src/include/usr/ipmi/ipmiif.H b/src/include/usr/ipmi/ipmiif.H |
| 13 | index 8039adbf7..9dfd8ee63 100644 |
| 14 | --- a/src/include/usr/ipmi/ipmiif.H |
| 15 | +++ b/src/include/usr/ipmi/ipmiif.H |
| 16 | @@ -238,6 +238,9 @@ namespace IPMI |
| 17 | inline const command_t get_capabilities(void) |
| 18 | { return std::make_pair(NETFUN_APP, 0x36); } |
| 19 | |
| 20 | + inline const command_t master_readwrite(void) |
| 21 | + { return std::make_pair(NETFUN_APP, 0x52); } |
| 22 | + |
| 23 | |
| 24 | // Chassis messages |
| 25 | inline const command_t chassis_power_off(void) |
| 26 | diff --git a/src/usr/hwpf/hwp/nest_chiplets/nest_chiplets.C b/src/usr/hwpf/hwp/nest_chiplets/nest_chiplets.C |
| 27 | index d122ae4de..73f1a0a3f 100644 |
| 28 | --- a/src/usr/hwpf/hwp/nest_chiplets/nest_chiplets.C |
| 29 | +++ b/src/usr/hwpf/hwp/nest_chiplets/nest_chiplets.C |
| 30 | @@ -58,6 +58,8 @@ |
| 31 | // MVPD |
| 32 | #include <devicefw/userif.H> |
| 33 | #include <vpd/mvpdenums.H> |
| 34 | +#include <ipmi/ipmiif.H> |
| 35 | + |
| 36 | |
| 37 | #include <config.h> |
| 38 | |
| 39 | @@ -1743,7 +1745,40 @@ errlHndl_t computeProcPcieConfigAttrs( |
| 40 | effectiveLaneSwap[iop] = laneSwap; |
| 41 | } |
| 42 | #endif |
| 43 | - |
| 44 | + uint8_t riser_id = 0 ; |
| 45 | + errlHndl_t l_err = NULL; |
| 46 | + |
| 47 | + |
| 48 | + size_t len = 4; |
| 49 | + |
| 50 | + //create request data buffer |
| 51 | + uint8_t* data = new uint8_t[len]; |
| 52 | + |
| 53 | + IPMI::completion_code cc = IPMI::CC_UNKBAD; |
| 54 | + |
| 55 | + data[0] = 0x3; |
| 56 | + data[1] = 0x70; |
| 57 | + data[2] = 0x1; |
| 58 | + data[3] = 0x1; |
| 59 | + l_err = IPMI::sendrecv(IPMI::master_readwrite(), cc, len, data); |
| 60 | + |
| 61 | + if( l_err == NULL ) |
| 62 | + { |
| 63 | + if( cc == IPMI::CC_OK ) |
| 64 | + { |
| 65 | + riser_id = data[0]; |
| 66 | + } |
| 67 | + |
| 68 | + delete[] data; |
| 69 | + } |
| 70 | + |
| 71 | + |
| 72 | + if((i_pProcChipTarget->getAttr<TARGETING::ATTR_HUID>()) == 0x50001 && (riser_id == 0xE) ){ |
| 73 | + effectiveLaneMask[1][0] = 0xFFFF; |
| 74 | + effectiveLaneMask[1][1] = 0x0000; |
| 75 | + effectiveLaneSwap[1] = 0x0; |
| 76 | + } |
| 77 | + |
| 78 | i_pProcChipTarget->setAttr< |
| 79 | TARGETING::ATTR_PROC_PCIE_LANE_MASK>(effectiveLaneMask); |
| 80 | |
| 81 | @@ -1797,6 +1832,11 @@ errlHndl_t computeProcPcieConfigAttrs( |
| 82 | iopConfig = laneConfigItr->laneConfig; |
| 83 | phbActiveMask = laneConfigItr->phbActive; |
| 84 | |
| 85 | + if((i_pProcChipTarget->getAttr<TARGETING::ATTR_HUID>()) == 0x50001 && (riser_id == 0xE) ){ |
| 86 | + iopConfig = 0 ; |
| 87 | + phbActiveMask = PHB0_MASK|PHB1_MASK; |
| 88 | + } |
| 89 | + |
| 90 | // Disable applicable PHBs |
| 91 | phbActiveMask &= (~disabledPhbs); |
| 92 | (void)_deconfigPhbsBasedOnPciState( |
| 93 | -- |
| 94 | 2.16.2.windows.1 |
| 95 | |