blob: 5b4bcc74cf60d30019f1471a5b0936dfa3e8e5c9 [file] [log] [blame]
Corey Swenson074d7482019-01-14 13:19:59 -06001From f03937aa32b79e8bde0fa5ff09a0e11e4750bb6f Mon Sep 17 00:00:00 2001
2From: Corey Swenson <cswenson@us.ibm.com>
3Date: Mon, 14 Jan 2019 12:46:22 -0600
4Subject: [PATCH] Vesnin patch
Artem Senichev67355a82018-03-16 12:35:51 +03005
Corey Swenson074d7482019-01-14 13:19:59 -06006Change-Id: I1116c92f9176d53630a9316312656c03f2a16723
Artem Senichev18bb8e52018-04-02 11:46:13 +03007
8Hank Chang: This patch achieves the following goals:
9a. Auto set all empty sensors with reserved ID - 0xFF instead of being 0x0 in
10 the mrw process (would cause some duplicate sensor@0 in skiboot)
11b. In this way, they could simply save 128 empty DIMM_Temp* IDs to become
12 all 0xFF, and OCC would still report all the non-zero ID's DIMM_Temp*
13 reading in the poll response.
14 And then, apply another "occ-0001-Add-DIMM-temperature-sensors.patch"
15 can customize/override these 0xFF temp_sid again based on the different
16 CPU/Cen/DIMM index which can be decoded by OpenBMC accordingly.
17c. Just simply prints the "N/A" (0xFF) string in the *.rpt file for reviewing
18 all the undefined/reserved sensor targets.
19
Artem Senichev67355a82018-03-16 12:35:51 +030020Originally created by MSI (S188)
21
22Signed-off-by: Artem Senichev <a.senichev@yadro.com>
23---
Corey Swenson074d7482019-01-14 13:19:59 -060024 src/usr/ipmiext/ipmisensor.C | 6 ++----
25 src/usr/targeting/common/processMrw.pl | 25 ++++++++++++++++++++-----
26 2 files changed, 22 insertions(+), 9 deletions(-)
Artem Senichev67355a82018-03-16 12:35:51 +030027
Corey Swenson074d7482019-01-14 13:19:59 -060028diff --git a/src/usr/ipmiext/ipmisensor.C b/src/usr/ipmiext/ipmisensor.C
29index e3c6405..63a4196 100644
30--- a/src/usr/ipmiext/ipmisensor.C
31+++ b/src/usr/ipmiext/ipmisensor.C
32@@ -6,6 +6,7 @@
33 /* OpenPOWER HostBoot Project */
34 /* */
35 /* Contributors Listed Below - COPYRIGHT 2014,2019 */
36+/* [+] International Business Machines Corp. */
37 /* */
38 /* */
39 /* Licensed under the Apache License, Version 2.0 (the "License"); */
40@@ -214,14 +215,11 @@ namespace SENSOR
Artem Senichev67355a82018-03-16 12:35:51 +030041 }
42 else
43 {
44- TRACFCOMP(g_trac_ipmi,"We were not able to find a sensor number in"
45+ TRACFCOMP(g_trac_ipmi,"Found a reserved sensor number (0xFF) in"
46 " the IPMI_SENSORS attribute for sensor_name=0x%x"
47 "for target with huid=0x%x, skipping call to "
48 "sendSetSensorReading()",
49 iv_name, TARGETING::get_huid( iv_target ));
50-
51- assert(false);
52-
53 }
54
55 return l_err;
56diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl
Corey Swenson074d7482019-01-14 13:19:59 -060057index 8bfa7bd..66783c8 100644
Artem Senichev67355a82018-03-16 12:35:51 +030058--- a/src/usr/targeting/common/processMrw.pl
59+++ b/src/usr/targeting/common/processMrw.pl
Corey Swenson074d7482019-01-14 13:19:59 -060060@@ -6,7 +6,7 @@
61 #
62 # OpenPOWER HostBoot Project
63 #
64-# Contributors Listed Below - COPYRIGHT 2015,2017
65+# Contributors Listed Below - COPYRIGHT 2015,2019
66 # [+] International Business Machines Corp.
67 #
68 #
Artem Senichev67355a82018-03-16 12:35:51 +030069@@ -239,14 +239,29 @@ sub processIpmiSensors {
70 $sensor_name=$name."_".$name_suffix;
71 }
72 my $attribute_name="";
73- my $s=sprintf("0x%02X%02X,0x%02X",
74- oct($sensor_type),oct($entity_id),oct($sensor_id));
75- push(@sensors,$s);
76+
77+ if ($sensor_id ne "")
78+ {
79+ my $s = sprintf("0x%02X%02X,0x%02X",
80+ oct($sensor_type), oct($entity_id), oct($sensor_id));
81+ push(@sensors, $s);
82+ }
83+ else
84+ {
85+ my $s = sprintf("0x%02X%02X,0xFF",
86+ oct($sensor_type), oct($entity_id));
87+ push(@sensors, $s);
88+ }
89+
90 my $sensor_id_str = "";
91 if ($sensor_id ne "")
92 {
93 $sensor_id_str = sprintf("0x%02X",oct($sensor_id));
94 }
95+ else
96+ {
97+ $sensor_id_str = sprintf("N/A");
98+ }
99 my $str=sprintf(
100 " %30s | %10s | 0x%02X | 0x%02X | 0x%02x |" .
101 " %4s | %4d | %4d | %10s | %s\n",
Corey Swenson074d7482019-01-14 13:19:59 -0600102@@ -1428,7 +1443,7 @@ Options:
103 exit(1);
104 }
105
106-# eliminate extra whitespace
107+# eliminate extra whitespace
108 # Input: string to chop
109 sub nowhitespace
110 {
Artem Senichev67355a82018-03-16 12:35:51 +0300111--
Corey Swenson074d7482019-01-14 13:19:59 -06001121.8.2.2
Artem Senichev67355a82018-03-16 12:35:51 +0300113