summaryrefslogtreecommitdiffstats
path: root/src/vendorcode/siemens/hwilib/hwilib.h
blob: 1f418cac750b5bd2f27a756dcbadd3e5a4ca3ade (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef SIEMENS_HWI_LIB_H_
#define SIEMENS_HWI_LIB_H_

#include <types.h>

/* Declare all supported fields which can be get with hwilib. */
typedef enum {
	HIB_VerID = 0,
	SIB_VerID,
	EIB_VerID,
	XIB_VerID,
	HIB_HwRev,
	SIB_HwRev,
	HWID,
	UniqueNum,
	Mac1,
	Mac2,
	Mac3,
	Mac4,
	Mac1Aux,
	Mac2Aux,
	Mac3Aux,
	Mac4Aux,
	SPD,
	FF_FreezeDis,
	FF_FanReq,
	NvramVirtTimeDsaveReset,
	BiosFlags,
	MacMapping1,
	MacMapping2,
	MacMapping3,
	MacMapping4,
	RTCType,
	BL_Brightness,
	PF_PwmFreq,
	PF_Color_Depth,
	PF_DisplType,
	PF_DisplCon,
	Edid,
	VddRef,
	T_Warn,
	T_Crit,
	FANSamplingTime,
	FANSetPoint,
	FANKp,
	FANKi,
	FANKd,
	FANHystVal,
	FANHystThreshold,
	FANHystCtrl,
	FANMaxSpeed,
	FANStartSpeed,
	FANSensorDelay,
	FANSensorNum,
	FANSensorSelect,
	FANSensorCfg0,
	FANSensorCfg1,
	FANSensorCfg2,
	FANSensorCfg3,
	FANSensorCfg4,
	FANSensorCfg5,
	FANSensorCfg6,
	FANSensorCfg7,
	XMac1,
	XMac2,
	XMac3,
	XMac4,
	XMac5,
	XMac6,
	XMac7,
	XMac8,
	XMac9,
	XMac10,
	XMac1Aux,
	XMac2Aux,
	XMac3Aux,
	XMac4Aux,
	XMac5Aux,
	XMac6Aux,
	XMac7Aux,
	XMac8Aux,
	XMac9Aux,
	XMac10Aux,
	XMac1Mapping,
	XMac2Mapping,
	XMac3Mapping,
	XMac4Mapping,
	XMac5Mapping,
	XMac6Mapping,
	XMac7Mapping,
	XMac8Mapping,
	XMac9Mapping,
	XMac10Mapping,
	netKind1,
	netKind2,
	netKind3,
	netKind4,
	netKind5,
	netKind6,
	netKind7,
	netKind8,
	netKind9,
	netKind10,
	LegacyDelay
} hwinfo_field_t;

/* Define used values in supported fields */
#define PF_COLOR_DEPTH_6BIT	0x00
#define PF_COLOR_DEPTH_8BIT	0x01
#define PF_COLOR_DEPTH_10BIT	0x02
#define PF_DISPLCON_LVDS_SINGLE	0x00
#define PF_DISPLCON_LVDS_DUAL	0x05
#define FF_FREEZE_DISABLE	0x01
#define FF_FAN_NEEDED		0x01

/* Use this function to find all supported blocks in cbfs. It must be called
 * once with a valid cbfs file name before hwilib_get_field() can be used.
 */
enum cb_err hwilib_find_blocks (const char *hwi_filename);

/* Use this function to get fields out of supported info blocks
 * This function returns the number of copied bytes or 0 on error.
 */
uint32_t hwilib_get_field (hwinfo_field_t field, uint8_t *data, uint32_t maxlen);

#endif /* SIEMENS_HWI_LIB_H_ */