summaryrefslogtreecommitdiffstats
path: root/openpower/patches/p8dtu-patches/hostboot-p8/0007-read-riser-id-from-CPLD.patch
blob: af19f7426b727f0a8780ca0de01cd5d46219bbb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
From 94de2f7f944a2cabbdf699adcbc6679a091ad324 Mon Sep 17 00:00:00 2001
From: Leoluo <leoluo@supermicro.com>
Date: Tue, 8 Mar 2016 17:01:26 -0800
Subject: [PATCH 07/14] read riser id from CPLD

Signed-off-by: Jim Yuan <jim.yuan@supermicro.com>
---
 src/include/usr/ipmi/ipmiif.H                  |  3 ++
 src/usr/hwpf/hwp/nest_chiplets/nest_chiplets.C | 42 +++++++++++++++++++++++++-
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/src/include/usr/ipmi/ipmiif.H b/src/include/usr/ipmi/ipmiif.H
index 8039adbf7..9dfd8ee63 100644
--- a/src/include/usr/ipmi/ipmiif.H
+++ b/src/include/usr/ipmi/ipmiif.H
@@ -238,6 +238,9 @@ namespace IPMI
     inline const command_t get_capabilities(void)
     { return std::make_pair(NETFUN_APP, 0x36); }
 
+    inline const command_t master_readwrite(void)
+    { return std::make_pair(NETFUN_APP, 0x52); }
+
 
     // Chassis messages
     inline const command_t chassis_power_off(void)
diff --git a/src/usr/hwpf/hwp/nest_chiplets/nest_chiplets.C b/src/usr/hwpf/hwp/nest_chiplets/nest_chiplets.C
index d122ae4de..73f1a0a3f 100644
--- a/src/usr/hwpf/hwp/nest_chiplets/nest_chiplets.C
+++ b/src/usr/hwpf/hwp/nest_chiplets/nest_chiplets.C
@@ -58,6 +58,8 @@
 //  MVPD
 #include <devicefw/userif.H>
 #include <vpd/mvpdenums.H>
+#include <ipmi/ipmiif.H>
+
 
 #include <config.h>
 
@@ -1743,7 +1745,40 @@ errlHndl_t computeProcPcieConfigAttrs(
             effectiveLaneSwap[iop] = laneSwap;
         }
 #endif
-
+   uint8_t riser_id = 0 ;
+	errlHndl_t l_err = NULL;
+	
+	
+	size_t len = 4;
+	
+	//create request data buffer
+	uint8_t* data = new uint8_t[len];
+	
+	IPMI::completion_code cc = IPMI::CC_UNKBAD;
+	
+	data[0] = 0x3;  
+	data[1] = 0x70;  
+	data[2] = 0x1;  
+	data[3] = 0x1;  
+	l_err = IPMI::sendrecv(IPMI::master_readwrite(), cc, len, data);
+	
+	if( l_err == NULL )
+	{
+		if( cc == IPMI::CC_OK )
+		{
+		riser_id = data[0];
+		}
+		
+		delete[] data;
+	}
+
+
+       if((i_pProcChipTarget->getAttr<TARGETING::ATTR_HUID>()) == 0x50001 && (riser_id == 0xE) ){	   	
+		effectiveLaneMask[1][0] = 0xFFFF;
+	    effectiveLaneMask[1][1] = 0x0000;      
+          effectiveLaneSwap[1] = 0x0;
+       	}
+	   
         i_pProcChipTarget->setAttr<
             TARGETING::ATTR_PROC_PCIE_LANE_MASK>(effectiveLaneMask);
 
@@ -1797,6 +1832,11 @@ errlHndl_t computeProcPcieConfigAttrs(
             iopConfig = laneConfigItr->laneConfig;
             phbActiveMask = laneConfigItr->phbActive;
 
+			if((i_pProcChipTarget->getAttr<TARGETING::ATTR_HUID>()) == 0x50001 && (riser_id == 0xE) ){
+	   	       iopConfig = 0 ;
+	           phbActiveMask = PHB0_MASK|PHB1_MASK;
+       	      }
+
             // Disable applicable PHBs
             phbActiveMask &= (~disabledPhbs);
             (void)_deconfigPhbsBasedOnPciState(
-- 
2.16.2.windows.1

OpenPOWER on IntegriCloud