Corey Swenson | 074d748 | 2019-01-14 13:19:59 -0600 | [diff] [blame^] | 1 | From f03937aa32b79e8bde0fa5ff09a0e11e4750bb6f Mon Sep 17 00:00:00 2001 |
| 2 | From: Corey Swenson <cswenson@us.ibm.com> |
| 3 | Date: Mon, 14 Jan 2019 12:46:22 -0600 |
| 4 | Subject: [PATCH] Vesnin patch |
Artem Senichev | 67355a8 | 2018-03-16 12:35:51 +0300 | [diff] [blame] | 5 | |
Corey Swenson | 074d748 | 2019-01-14 13:19:59 -0600 | [diff] [blame^] | 6 | Change-Id: I1116c92f9176d53630a9316312656c03f2a16723 |
Artem Senichev | 18bb8e5 | 2018-04-02 11:46:13 +0300 | [diff] [blame] | 7 | |
| 8 | Hank Chang: This patch achieves the following goals: |
| 9 | a. 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) |
| 11 | b. 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. |
| 17 | c. Just simply prints the "N/A" (0xFF) string in the *.rpt file for reviewing |
| 18 | all the undefined/reserved sensor targets. |
| 19 | |
Artem Senichev | 67355a8 | 2018-03-16 12:35:51 +0300 | [diff] [blame] | 20 | Originally created by MSI (S188) |
| 21 | |
| 22 | Signed-off-by: Artem Senichev <a.senichev@yadro.com> |
| 23 | --- |
Corey Swenson | 074d748 | 2019-01-14 13:19:59 -0600 | [diff] [blame^] | 24 | src/usr/ipmiext/ipmisensor.C | 6 ++---- |
| 25 | src/usr/targeting/common/processMrw.pl | 25 ++++++++++++++++++++----- |
| 26 | 2 files changed, 22 insertions(+), 9 deletions(-) |
Artem Senichev | 67355a8 | 2018-03-16 12:35:51 +0300 | [diff] [blame] | 27 | |
Corey Swenson | 074d748 | 2019-01-14 13:19:59 -0600 | [diff] [blame^] | 28 | diff --git a/src/usr/ipmiext/ipmisensor.C b/src/usr/ipmiext/ipmisensor.C |
| 29 | index 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 Senichev | 67355a8 | 2018-03-16 12:35:51 +0300 | [diff] [blame] | 41 | } |
| 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; |
| 56 | diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl |
Corey Swenson | 074d748 | 2019-01-14 13:19:59 -0600 | [diff] [blame^] | 57 | index 8bfa7bd..66783c8 100644 |
Artem Senichev | 67355a8 | 2018-03-16 12:35:51 +0300 | [diff] [blame] | 58 | --- a/src/usr/targeting/common/processMrw.pl |
| 59 | +++ b/src/usr/targeting/common/processMrw.pl |
Corey Swenson | 074d748 | 2019-01-14 13:19:59 -0600 | [diff] [blame^] | 60 | @@ -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 Senichev | 67355a8 | 2018-03-16 12:35:51 +0300 | [diff] [blame] | 69 | @@ -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 Swenson | 074d748 | 2019-01-14 13:19:59 -0600 | [diff] [blame^] | 102 | @@ -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 Senichev | 67355a8 | 2018-03-16 12:35:51 +0300 | [diff] [blame] | 111 | -- |
Corey Swenson | 074d748 | 2019-01-14 13:19:59 -0600 | [diff] [blame^] | 112 | 1.8.2.2 |
Artem Senichev | 67355a8 | 2018-03-16 12:35:51 +0300 | [diff] [blame] | 113 | |