summaryrefslogtreecommitdiffstats
path: root/openpower/patches/vesnin-patches/hostboot-p8/hostboot-0005-Fill-empty-sensor-id-to-reserved-id-0xFF.patch
blob: 5b4bcc74cf60d30019f1471a5b0936dfa3e8e5c9 (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
From f03937aa32b79e8bde0fa5ff09a0e11e4750bb6f Mon Sep 17 00:00:00 2001
From: Corey Swenson <cswenson@us.ibm.com>
Date: Mon, 14 Jan 2019 12:46:22 -0600
Subject: [PATCH] Vesnin patch

Change-Id: I1116c92f9176d53630a9316312656c03f2a16723

Hank Chang: This patch achieves the following goals:
a. Auto set all empty sensors with reserved ID - 0xFF instead of being 0x0 in
   the mrw process (would cause some duplicate sensor@0 in skiboot)
b. In this way, they could simply save 128 empty DIMM_Temp* IDs to become
   all 0xFF, and OCC would still report all the non-zero ID's DIMM_Temp*
   reading in the poll response.
   And then, apply another "occ-0001-Add-DIMM-temperature-sensors.patch"
   can customize/override these 0xFF temp_sid again based on the different
   CPU/Cen/DIMM index which can be decoded by OpenBMC accordingly.
c. Just simply prints the "N/A" (0xFF) string in the *.rpt file for reviewing
   all the undefined/reserved sensor targets.

Originally created by MSI (S188)

Signed-off-by: Artem Senichev <a.senichev@yadro.com>
---
 src/usr/ipmiext/ipmisensor.C           |  6 ++----
 src/usr/targeting/common/processMrw.pl | 25 ++++++++++++++++++++-----
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/src/usr/ipmiext/ipmisensor.C b/src/usr/ipmiext/ipmisensor.C
index e3c6405..63a4196 100644
--- a/src/usr/ipmiext/ipmisensor.C
+++ b/src/usr/ipmiext/ipmisensor.C
@@ -6,6 +6,7 @@
 /* OpenPOWER HostBoot Project                                             */
 /*                                                                        */
 /* Contributors Listed Below - COPYRIGHT 2014,2019                        */
+/* [+] International Business Machines Corp.                              */
 /*                                                                        */
 /*                                                                        */
 /* Licensed under the Apache License, Version 2.0 (the "License");        */
@@ -214,14 +215,11 @@ namespace SENSOR
         }
         else
         {
-            TRACFCOMP(g_trac_ipmi,"We were not able to find a sensor number in"
+            TRACFCOMP(g_trac_ipmi,"Found a reserved sensor number (0xFF) in"
                       " the IPMI_SENSORS attribute for sensor_name=0x%x"
                       "for target with huid=0x%x, skipping call to "
                       "sendSetSensorReading()",
                     iv_name, TARGETING::get_huid( iv_target ));
-
-            assert(false);
-
         }
 
         return l_err;
diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl
index 8bfa7bd..66783c8 100644
--- a/src/usr/targeting/common/processMrw.pl
+++ b/src/usr/targeting/common/processMrw.pl
@@ -6,7 +6,7 @@
 #
 # OpenPOWER HostBoot Project
 #
-# Contributors Listed Below - COPYRIGHT 2015,2017
+# Contributors Listed Below - COPYRIGHT 2015,2019
 # [+] International Business Machines Corp.
 #
 #
@@ -239,14 +239,29 @@ sub processIpmiSensors {
                 $sensor_name=$name."_".$name_suffix;
             }
             my $attribute_name="";
-            my $s=sprintf("0x%02X%02X,0x%02X",
-                  oct($sensor_type),oct($entity_id),oct($sensor_id));
-            push(@sensors,$s);
+
+            if ($sensor_id ne "")
+            {
+                my $s = sprintf("0x%02X%02X,0x%02X",
+                        oct($sensor_type), oct($entity_id), oct($sensor_id));
+                push(@sensors, $s);
+            }
+            else
+            {
+                my $s = sprintf("0x%02X%02X,0xFF",
+                                oct($sensor_type), oct($entity_id));
+                push(@sensors, $s);
+            }
+
             my $sensor_id_str = "";
             if ($sensor_id ne "")
             {
                 $sensor_id_str = sprintf("0x%02X",oct($sensor_id));
             }
+            else
+            {
+                $sensor_id_str = sprintf("N/A");
+            }
             my $str=sprintf(
                 " %30s | %10s |  0x%02X  | 0x%02X |    0x%02x   |" .
                 " %4s | %4d | %4d | %10s | %s\n",
@@ -1428,7 +1443,7 @@ Options:
     exit(1);
 }
 
-# eliminate extra whitespace 
+# eliminate extra whitespace
 #    Input: string to chop
 sub nowhitespace
 {
-- 
1.8.2.2

OpenPOWER on IntegriCloud