summaryrefslogtreecommitdiffstats
path: root/openpower/patches/p8dtu-patches/hostboot-p8/0008-Fill-board-mfg-time-and-date-in-FRU3.-It-is-read-fro.patch
blob: 41c24b37386df1305baf1e979848e562ee08ead8 (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
96
97
98
99
From ed60d5736559c4e100e5db20de942a584b58b6f0 Mon Sep 17 00:00:00 2001
From: Jim Yuan <jim.yuan@supermicro.com>
Date: Wed, 25 May 2016 15:24:40 -0700
Subject: [PATCH 08/14] Fill board mfg time and date in FRU3. It is read from
 PVPD:VNDR:IN.

Signed-off-by: Jim Yuan <jim.yuan@supermicro.com>
---
 src/usr/ipmiext/ipmifruinv.C | 65 +++++++++++++++++++++++++++++++++-----------
 1 file changed, 49 insertions(+), 16 deletions(-)

diff --git a/src/usr/ipmiext/ipmifruinv.C b/src/usr/ipmiext/ipmifruinv.C
index 23aaf9b97..11fbd7677 100644
--- a/src/usr/ipmiext/ipmifruinv.C
+++ b/src/usr/ipmiext/ipmifruinv.C
@@ -1279,31 +1279,64 @@ errlHndl_t backplaneIpmiFruInv::buildChassisInfoArea(
     return l_errl;
 }
 
+// Quick hexdigit to binary converter.
+// Hopefull someday to replaced by strtoul
+uint8_t aschex2bin(char c)
+{
+    if(c >= 'a' && c <= 'f')
+    {
+        c = c + 10 - 'a';
+    }
+    else if (c >= 'A' && c <= 'F')
+    {
+        c = c + 10 - 'A';
+    }
+    else if (c >= '0' && c <= '9')
+    {
+       c -= '0';
+    }
+    else return 0;// else it's not a hex digit, return 0
+
+    return c;
+}
+
+
 errlHndl_t backplaneIpmiFruInv::buildBoardInfoArea(
                                               std::vector<uint8_t> &io_data)
 {
     errlHndl_t l_errl = NULL;
+	std::vector<uint8_t> oem_data; //jim052316
+	uint8_t i, data1, data2, data3;//jim052316
 
     do {
         //Set formatting data that goes at the beginning of the record
         preFormatProcessing(io_data, true);
 
-        // Set Mfg Build date
-        // Grab VPD data into seperate data vector
-        std::vector<uint8_t> mfgDateData;
-        l_errl = addVpdData(mfgDateData, PVPD::OPFR, PVPD::MB, false, false);
-        if (l_errl)
-        {
-            // The MB keyword was optional on older cards so just ignore
-            //  any errors
-            delete l_errl;
-            l_errl = NULL;
-        }
-        else
-        {
-            // Pass that to the function that sets the Build date
-            setMfgData(io_data, mfgDateData);
-        }
+        l_errl = addVpdData(oem_data, PVPD::VNDR, PVPD::IN, true);
+        if (l_errl) { break; }
+
+		for (i=0; i < oem_data.size(); i++)
+		TRACFCOMP(g_trac_ipmi,"Jimdebug board VNDR:IN data is 0x%x", oem_data[i]);
+
+		data1 = (aschex2bin(oem_data[5]) << 4) | aschex2bin(oem_data[6]);//jim052416
+		data2 = (aschex2bin(oem_data[3]) << 4) | aschex2bin(oem_data[4]);
+		data3 = (aschex2bin(oem_data[1]) << 4) | aschex2bin(oem_data[2]);  
+
+		
+		TRACFCOMP(g_trac_ipmi,"Jimdebug push data1 is 0x%x", data1);
+		TRACFCOMP(g_trac_ipmi,"Jimdebug push data2 is 0x%x", data2);
+		TRACFCOMP(g_trac_ipmi,"Jimdebug push data3 is 0x%x", data3);
+
+		
+        io_data.push_back(data1); 
+        io_data.push_back(data2);
+        io_data.push_back(data3);
+
+
+        //Set MFG Date/Time - Blank
+        //io_data.push_back(0x5E); //jim52016
+        //io_data.push_back(0x9A);
+        //io_data.push_back(0xA3);
 
         //Set Vendor Name - ascii formatted data
         l_errl = addVpdData(io_data, PVPD::OPFR, PVPD::VN, true);
-- 
2.16.2.windows.1

OpenPOWER on IntegriCloud