blob: 001c958f195483a7f4d4a1f25f1a96b2c26a37f7 [file] [log] [blame]
Werner Zeh223498f2016-04-22 14:14:45 +02001/*
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 Zeh223498f2016-04-22 14:14:45 +020021/* Declare all supported fields which can be get with hwilib. */
22typedef enum {
23 HIB_VerID = 0,
24 SIB_VerID,
25 EIB_VerID,
Werner Zeh66c20c42016-06-28 14:31:30 +020026 XIB_VerID,
Werner Zeh223498f2016-04-22 14:14:45 +020027 HIB_HwRev,
28 SIB_HwRev,
Werner Zehba7525d2016-11-23 07:31:35 +010029 HWID,
Werner Zeh223498f2016-04-22 14:14:45 +020030 UniqueNum,
31 Mac1,
Werner Zeh223498f2016-04-22 14:14:45 +020032 Mac2,
Werner Zeh223498f2016-04-22 14:14:45 +020033 Mac3,
Werner Zeh223498f2016-04-22 14:14:45 +020034 Mac4,
Werner Zeh66c20c42016-06-28 14:31:30 +020035 Mac1Aux,
36 Mac2Aux,
37 Mac3Aux,
Werner Zeh223498f2016-04-22 14:14:45 +020038 Mac4Aux,
39 SPD,
40 FF_FreezeDis,
41 FF_FanReq,
42 BiosFlags,
43 MacMapping1,
44 MacMapping2,
45 MacMapping3,
46 MacMapping4,
Werner Zeh66c20c42016-06-28 14:31:30 +020047 RTCType,
Werner Zeh223498f2016-04-22 14:14:45 +020048 PF_Color_Depth,
49 PF_DisplType,
50 PF_DisplCon,
51 Edid,
Werner Zeh66c20c42016-06-28 14:31:30 +020052 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 Zeh223498f2016-04-22 14:14:45 +0200117} 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 */
131enum 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 */
136uint32_t hwilib_get_field (hwinfo_field_t field, uint8_t *data, uint32_t maxlen);
137
Werner Zeh223498f2016-04-22 14:14:45 +0200138#endif /* SIEMENS_HWI_LIB_H_ */