Matt Spinler | b54357f | 2017-08-21 14:38:54 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Copyright © 2017 IBM Corporation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #include "ucd90160.hpp" |
| 17 | |
| 18 | //Separated out to facilitate possible future generation of file. |
| 19 | |
| 20 | namespace witherspoon |
| 21 | { |
| 22 | namespace power |
| 23 | { |
| 24 | |
| 25 | using namespace ucd90160; |
| 26 | using namespace std::string_literals; |
| 27 | |
| 28 | const DeviceMap UCD90160::deviceMap |
| 29 | { |
| 30 | {0, DeviceDefinition{ |
| 31 | "/sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@1e78a000/" |
Matt Spinler | e7e432b | 2017-08-21 15:01:40 -0500 | [diff] [blame] | 32 | "1e78a400.i2c-bus/i2c-11/11-0064", |
| 33 | |
| 34 | RailNames{ |
| 35 | "5.0VCS"s, |
| 36 | "12.0V"s, |
| 37 | "3.3V"s, |
| 38 | "1.8V"s, |
| 39 | "1.1V"s, |
| 40 | "1.0V"s, |
| 41 | "0.9V"s, |
| 42 | "VDN-A"s, |
| 43 | "VDN-B"s, |
| 44 | "AVDD"s, |
| 45 | "VIO-A"s, |
| 46 | "VIO-B"s, |
| 47 | "VDD-A"s, |
| 48 | "VDD-B"s, |
| 49 | "VCS-A"s, |
| 50 | "VCS-B"s |
Matt Spinler | d998b73 | 2017-08-21 15:35:54 -0500 | [diff] [blame] | 51 | }, |
| 52 | |
| 53 | GPIConfigs{ |
Matt Spinler | 2d248ae | 2017-09-19 11:06:48 -0500 | [diff] [blame] | 54 | GPIConfig{1, 8, "PGOOD_5P0V"s, false, |
| 55 | extraAnalysisType::none}, |
| 56 | GPIConfig{2, 9, "MEM_GOOD0"s, false, |
| 57 | extraAnalysisType::none}, |
| 58 | GPIConfig{3, 10, "MEM_GOOD1"s, false, |
| 59 | extraAnalysisType::none}, |
Matt Spinler | 701eef6 | 2017-12-13 13:27:03 -0600 | [diff] [blame] | 60 | GPIConfig{4, 14, "GPU_PGOOD"s, false, |
Matt Spinler | 2d248ae | 2017-09-19 11:06:48 -0500 | [diff] [blame] | 61 | extraAnalysisType::gpuPGOOD}, |
| 62 | GPIConfig{5, 17, "GPU_TH_OVERT"s, true, |
| 63 | extraAnalysisType::gpuOverTemp}, |
| 64 | GPIConfig{6, 11, "SOFTWARE_PGOOD"s, false, |
| 65 | extraAnalysisType::none} |
| 66 | }, |
| 67 | |
| 68 | GPIOAnalysis{ |
| 69 | {extraAnalysisType::gpuPGOOD, |
| 70 | GPIOGroup{ |
| 71 | "/sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@" |
| 72 | "1e78a000/1e78a400.i2c-bus/i2c-11/11-0060", |
| 73 | gpio::Value::low, |
Matt Spinler | 0e45ced | 2018-02-12 14:36:07 -0600 | [diff] [blame] | 74 | [](auto& ucd, const auto& callout) |
| 75 | { ucd.gpuPGOODError(callout); }, |
Matt Spinler | 2d248ae | 2017-09-19 11:06:48 -0500 | [diff] [blame] | 76 | optionFlags::none, |
| 77 | GPIODefinitions{ |
Matt Spinler | 0e45ced | 2018-02-12 14:36:07 -0600 | [diff] [blame] | 78 | GPIODefinition{8, |
| 79 | "/system/chassis/motherboard/gv100card0"s}, |
| 80 | GPIODefinition{9, |
| 81 | "/system/chassis/motherboard/gv100card1"s}, |
| 82 | GPIODefinition{10, |
| 83 | "/system/chassis/motherboard/gv100card2"s}, |
| 84 | GPIODefinition{11, |
| 85 | "/system/chassis/motherboard/gv100card3"s}, |
| 86 | GPIODefinition{12, |
| 87 | "/system/chassis/motherboard/gv100card4"s}, |
| 88 | GPIODefinition{13, |
| 89 | "/system/chassis/motherboard/gv100card5"s}} |
Matt Spinler | 2d248ae | 2017-09-19 11:06:48 -0500 | [diff] [blame] | 90 | }}, |
| 91 | |
| 92 | {extraAnalysisType::gpuOverTemp, |
| 93 | GPIOGroup{ |
| 94 | "/sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@" |
| 95 | "1e78a000/1e78a400.i2c-bus/i2c-11/11-0060", |
| 96 | gpio::Value::low, |
Matt Spinler | 0e45ced | 2018-02-12 14:36:07 -0600 | [diff] [blame] | 97 | [](auto& ucd, const auto& callout) |
| 98 | { ucd.gpuOverTempError(callout); }, |
Matt Spinler | 2d248ae | 2017-09-19 11:06:48 -0500 | [diff] [blame] | 99 | optionFlags::shutdownOnFault, |
| 100 | GPIODefinitions{ |
Matt Spinler | 0e45ced | 2018-02-12 14:36:07 -0600 | [diff] [blame] | 101 | GPIODefinition{2, |
| 102 | "/system/chassis/motherboard/gv100card0"s}, |
| 103 | GPIODefinition{3, |
| 104 | "/system/chassis/motherboard/gv100card1"s}, |
| 105 | GPIODefinition{4, |
| 106 | "/system/chassis/motherboard/gv100card2"s}, |
| 107 | GPIODefinition{5, |
| 108 | "/system/chassis/motherboard/gv100card3"s}, |
| 109 | GPIODefinition{6, |
| 110 | "/system/chassis/motherboard/gv100card4"s}, |
| 111 | GPIODefinition{7, |
| 112 | "/system/chassis/motherboard/gv100card5"s}} |
Matt Spinler | 2d248ae | 2017-09-19 11:06:48 -0500 | [diff] [blame] | 113 | }} |
Matt Spinler | e7e432b | 2017-08-21 15:01:40 -0500 | [diff] [blame] | 114 | } |
| 115 | } |
Matt Spinler | b54357f | 2017-08-21 14:38:54 -0500 | [diff] [blame] | 116 | } |
| 117 | }; |
| 118 | |
| 119 | } |
| 120 | } |