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 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 18 | // Separated out to facilitate possible future generation of file. |
Matt Spinler | b54357f | 2017-08-21 14:38:54 -0500 | [diff] [blame] | 19 | |
| 20 | namespace witherspoon |
| 21 | { |
| 22 | namespace power |
| 23 | { |
| 24 | |
| 25 | using namespace ucd90160; |
| 26 | using namespace std::string_literals; |
| 27 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 28 | const DeviceMap UCD90160::deviceMap{ |
| 29 | {0, |
| 30 | DeviceDefinition{ |
| 31 | "/sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@1e78a000/" |
| 32 | "1e78a400.i2c-bus/i2c-11/11-0064", |
Matt Spinler | e7e432b | 2017-08-21 15:01:40 -0500 | [diff] [blame] | 33 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 34 | RailNames{"5.0VCS"s, "12.0V"s, "3.3V"s, "1.8V"s, "1.1V"s, "1.0V"s, |
| 35 | "0.9V"s, "VDN-A"s, "VDN-B"s, "AVDD"s, "VIO-A"s, "VIO-B"s, |
| 36 | "VDD-A"s, "VDD-B"s, "VCS-A"s, "VCS-B"s}, |
Matt Spinler | d998b73 | 2017-08-21 15:35:54 -0500 | [diff] [blame] | 37 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 38 | GPIConfigs{ |
| 39 | GPIConfig{1, 8, "PGOOD_5P0V"s, false, extraAnalysisType::none}, |
| 40 | GPIConfig{2, 9, "MEM_GOOD0"s, false, extraAnalysisType::none}, |
| 41 | GPIConfig{3, 10, "MEM_GOOD1"s, false, extraAnalysisType::none}, |
| 42 | GPIConfig{4, 14, "GPU_PGOOD"s, false, extraAnalysisType::gpuPGOOD}, |
| 43 | GPIConfig{5, 17, "GPU_TH_OVERT"s, true, |
| 44 | extraAnalysisType::gpuOverTemp}, |
| 45 | GPIConfig{6, 11, "SOFTWARE_PGOOD"s, false, |
| 46 | extraAnalysisType::none}}, |
Matt Spinler | 2d248ae | 2017-09-19 11:06:48 -0500 | [diff] [blame] | 47 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 48 | GPIOAnalysis{ |
| 49 | {extraAnalysisType::gpuPGOOD, |
| 50 | GPIOGroup{ |
| 51 | "/sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@" |
| 52 | "1e78a000/1e78a400.i2c-bus/i2c-11/11-0060", |
| 53 | gpio::Value::low, |
| 54 | [](auto& ucd, const auto& callout) { |
| 55 | ucd.gpuPGOODError(callout); |
| 56 | }, |
| 57 | optionFlags::none, |
| 58 | GPIODefinitions{ |
| 59 | GPIODefinition{8, |
| 60 | "/system/chassis/motherboard/gv100card0"s}, |
| 61 | GPIODefinition{9, |
| 62 | "/system/chassis/motherboard/gv100card1"s}, |
| 63 | GPIODefinition{10, |
| 64 | "/system/chassis/motherboard/gv100card2"s}, |
| 65 | GPIODefinition{11, |
| 66 | "/system/chassis/motherboard/gv100card3"s}, |
| 67 | GPIODefinition{12, |
| 68 | "/system/chassis/motherboard/gv100card4"s}, |
| 69 | GPIODefinition{ |
| 70 | 13, "/system/chassis/motherboard/gv100card5"s}}}}, |
Matt Spinler | 2d248ae | 2017-09-19 11:06:48 -0500 | [diff] [blame] | 71 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 72 | {extraAnalysisType::gpuOverTemp, |
| 73 | GPIOGroup{ |
| 74 | "/sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@" |
| 75 | "1e78a000/1e78a400.i2c-bus/i2c-11/11-0060", |
| 76 | gpio::Value::low, |
| 77 | [](auto& ucd, |
| 78 | const auto& callout) { ucd.gpuOverTempError(callout); }, |
| 79 | optionFlags::shutdownOnFault, |
| 80 | GPIODefinitions{ |
| 81 | GPIODefinition{2, |
| 82 | "/system/chassis/motherboard/gv100card0"s}, |
| 83 | GPIODefinition{3, |
| 84 | "/system/chassis/motherboard/gv100card1"s}, |
| 85 | GPIODefinition{4, |
| 86 | "/system/chassis/motherboard/gv100card2"s}, |
| 87 | GPIODefinition{5, |
| 88 | "/system/chassis/motherboard/gv100card3"s}, |
| 89 | GPIODefinition{6, |
| 90 | "/system/chassis/motherboard/gv100card4"s}, |
| 91 | GPIODefinition{ |
| 92 | 7, "/system/chassis/motherboard/gv100card5"s}}}}}}}}; |
Matt Spinler | b54357f | 2017-08-21 14:38:54 -0500 | [diff] [blame] | 93 | |
Matt Spinler | f0f02b9 | 2018-10-25 16:12:43 -0500 | [diff] [blame] | 94 | } // namespace power |
| 95 | } // namespace witherspoon |