Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Siemens AG |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #ifndef SIEMENS_HWI_LIB_H_ |
| 17 | #define SIEMENS_HWI_LIB_H_ |
| 18 | |
| 19 | #include <types.h> |
| 20 | |
Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 21 | /* Declare all supported fields which can be get with hwilib. */ |
| 22 | typedef enum { |
| 23 | HIB_VerID = 0, |
| 24 | SIB_VerID, |
| 25 | EIB_VerID, |
Werner Zeh | 66c20c4 | 2016-06-28 14:31:30 +0200 | [diff] [blame] | 26 | XIB_VerID, |
Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 27 | HIB_HwRev, |
| 28 | SIB_HwRev, |
Werner Zeh | ba7525d | 2016-11-23 07:31:35 +0100 | [diff] [blame] | 29 | HWID, |
Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 30 | UniqueNum, |
| 31 | Mac1, |
Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 32 | Mac2, |
Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 33 | Mac3, |
Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 34 | Mac4, |
Werner Zeh | 66c20c4 | 2016-06-28 14:31:30 +0200 | [diff] [blame] | 35 | Mac1Aux, |
| 36 | Mac2Aux, |
| 37 | Mac3Aux, |
Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 38 | Mac4Aux, |
| 39 | SPD, |
| 40 | FF_FreezeDis, |
| 41 | FF_FanReq, |
| 42 | BiosFlags, |
| 43 | MacMapping1, |
| 44 | MacMapping2, |
| 45 | MacMapping3, |
| 46 | MacMapping4, |
Werner Zeh | 66c20c4 | 2016-06-28 14:31:30 +0200 | [diff] [blame] | 47 | RTCType, |
Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 48 | PF_Color_Depth, |
| 49 | PF_DisplType, |
| 50 | PF_DisplCon, |
| 51 | Edid, |
Werner Zeh | 66c20c4 | 2016-06-28 14:31:30 +0200 | [diff] [blame] | 52 | VddRef, |
| 53 | T_Warn, |
| 54 | T_Crit, |
| 55 | FANSamplingTime, |
| 56 | FANSetPoint, |
| 57 | FANKp, |
| 58 | FANKi, |
| 59 | FANKd, |
| 60 | FANHystVal, |
| 61 | FANHystThreshold, |
| 62 | FANHystCtrl, |
| 63 | FANMaxSpeed, |
| 64 | FANStartpeed, |
| 65 | FANSensorDelay, |
| 66 | FANSensorNum, |
| 67 | FANSensorSelect, |
| 68 | FANSensorCfg0, |
| 69 | FANSensorCfg1, |
| 70 | FANSensorCfg2, |
| 71 | FANSensorCfg3, |
| 72 | FANSensorCfg4, |
| 73 | FANSensorCfg5, |
| 74 | FANSensorCfg6, |
| 75 | FANSensorCfg7, |
| 76 | XMac1, |
| 77 | XMac2, |
| 78 | XMac3, |
| 79 | XMac4, |
| 80 | XMac5, |
| 81 | XMac6, |
| 82 | XMac7, |
| 83 | XMac8, |
| 84 | XMac9, |
| 85 | XMac10, |
| 86 | XMac1Aux, |
| 87 | XMac2Aux, |
| 88 | XMac3Aux, |
| 89 | XMac4Aux, |
| 90 | XMac5Aux, |
| 91 | XMac6Aux, |
| 92 | XMac7Aux, |
| 93 | XMac8Aux, |
| 94 | XMac9Aux, |
| 95 | XMac10Aux, |
| 96 | XMac1Mapping, |
| 97 | XMac2Mapping, |
| 98 | XMac3Mapping, |
| 99 | XMac4Mapping, |
| 100 | XMac5Mapping, |
| 101 | XMac6Mapping, |
| 102 | XMac7Mapping, |
| 103 | XMac8Mapping, |
| 104 | XMac9Mapping, |
| 105 | XMac10Mapping, |
| 106 | netKind1, |
| 107 | netKind2, |
| 108 | netKind3, |
| 109 | netKind4, |
| 110 | netKind5, |
| 111 | netKind6, |
| 112 | netKind7, |
| 113 | netKind8, |
| 114 | netKind9, |
| 115 | netKind10 |
| 116 | |
Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 117 | } hwinfo_field_t; |
| 118 | |
| 119 | /* Define used values in supported fields */ |
| 120 | #define PF_COLOR_DEPTH_6BIT 0x00 |
| 121 | #define PF_COLOR_DEPTH_8BIT 0x01 |
| 122 | #define PF_COLOR_DEPTH_10BIT 0x02 |
| 123 | #define PF_DISPLCON_LVDS_SINGLE 0x00 |
| 124 | #define PF_DISPLCON_LVDS_DUAL 0x05 |
| 125 | #define FF_FREEZE_DISABLE 0x01 |
| 126 | #define FF_FAN_NEEDED 0x01 |
| 127 | |
| 128 | /* Use this function to find all supported blocks in cbfs. It must be called |
| 129 | * once with a valid cbfs file name before hwilib_get_field() can be used. |
| 130 | */ |
| 131 | enum cb_err hwilib_find_blocks (const char *hwi_filename); |
| 132 | |
| 133 | /* Use this function to get fields out of supported info blocks |
| 134 | * This function returns the number of copied bytes or 0 on error. |
| 135 | */ |
| 136 | uint32_t hwilib_get_field (hwinfo_field_t field, uint8_t *data, uint32_t maxlen); |
| 137 | |
Werner Zeh | 223498f | 2016-04-22 14:14:45 +0200 | [diff] [blame] | 138 | #endif /* SIEMENS_HWI_LIB_H_ */ |