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, |
| 74 | [](auto& ucd, const auto& callout) { ucd.gpuPGOODError(callout); }, |
| 75 | optionFlags::none, |
| 76 | GPIODefinitions{ |
| 77 | GPIODefinition{8, "GPU0"s}, |
| 78 | GPIODefinition{9, "GPU1"s}, |
| 79 | GPIODefinition{10, "GPU2"s}, |
| 80 | GPIODefinition{11, "GPU3"s}, |
| 81 | GPIODefinition{12, "GPU4"s}, |
| 82 | GPIODefinition{13, "GPU5"s}} |
| 83 | }}, |
| 84 | |
| 85 | {extraAnalysisType::gpuOverTemp, |
| 86 | GPIOGroup{ |
| 87 | "/sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c@" |
| 88 | "1e78a000/1e78a400.i2c-bus/i2c-11/11-0060", |
| 89 | gpio::Value::low, |
| 90 | [](auto& ucd, const auto& callout) { ucd.gpuOverTempError(callout); }, |
| 91 | optionFlags::shutdownOnFault, |
| 92 | GPIODefinitions{ |
| 93 | GPIODefinition{2, "GPU0"s}, |
| 94 | GPIODefinition{3, "GPU1"s}, |
| 95 | GPIODefinition{4, "GPU2"s}, |
| 96 | GPIODefinition{5, "GPU3"s}, |
| 97 | GPIODefinition{6, "GPU4"s}, |
| 98 | GPIODefinition{7, "GPU5"s}} |
| 99 | }} |
Matt Spinler | e7e432b | 2017-08-21 15:01:40 -0500 | [diff] [blame] | 100 | } |
| 101 | } |
Matt Spinler | b54357f | 2017-08-21 14:38:54 -0500 | [diff] [blame] | 102 | } |
| 103 | }; |
| 104 | |
| 105 | } |
| 106 | } |