payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / superio / fintek / f81803a / f81803a_hwm.h
blobbb018859804bdc0e44e0f4c7bb5dadf77f7f383a
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef SUPERIO_FINTEK_F81803_HWM_H
4 #define SUPERIO_FINTEK_F81803_HWM_H
6 #define TP_SENSOR_TYPE 0x6b
7 #define TP_SENSOR1_TYPE_SHIFT 1
8 #define TP_SENSOR2_TYPE_SHIFT 2
9 #define TP_SENSOR_TYPE_MASK 0x01
10 #define TP_DIODE_STATUS 0x6f
11 #define TP_MMX_OPEN 0x40
12 #define TP_PECI_OPEN 0x20
13 #define TP_TSI_OPEN 0x10
14 #define TP_EXTERNAL_SENSOR2_OPEN 0x04
15 #define TP_EXTERNAL_SENSOR1_OPEN 0x02
17 #define FAN_TYPE_REG 0x94
18 #define FAN_TYPE_SHIFT(fan) ((fan - 1) * 2)
19 #define FAN_TYPE_MASK 0x03
20 #define FAN_MODE_REG 0x96
21 /* FUNC_PROG_SEL = 0 */
22 #define FAN_MODE_SHIFT(fan) ((fan - 1) * 4)
23 #define FAN_MODE_MASK 0x07
24 /* FUNC_PROG_SEL = 1 */
25 #define FAN1_ADJ_SEL_SHIFT 0
26 #define FAN1_ADJ_SEL_MASK 0x07
27 #define FAN_FREQ_SEL_ADD_SHIFT(fan) (fan + 2)
28 #define FAN_UP_RATE_REG 0x9a
29 #define FAN_RATE_SHIFT(fan) ((fan - 1) * 2)
30 #define FAN_RATE_MASK 0x03
31 #define FAN_DOWN_RATE_REG 0x9b
32 #define FAN_DOWN_RATE_DIFF_FROM_UP_SHIFT 7 /* FUNC_PROG_SEL = 1 */
33 #define FAN_DIRECT_LOAD_EN_SHIFT 6 /* FUNC_PROG_SEL = 1 */
34 #define FAN_FAULT_TIME_REG 0x9f
35 #define FAN_FUNC_PROG_SEL_SHIFT 7
37 #define FAN_BOUND_TEMP 0xa6 /* 4 temperatures */
38 #define FAN_SECTION_SPEED 0xaa /* 5 sections */
39 #define FAN_TMP_MAPPING 0xaf
40 #define FAN_TEMP_SEL_HIGH_SHIFT 7
41 #define FAN_PWM_FREQ_SEL_SHIFT 6
42 #define FAN_INTERPOLATION_SHIFT 4
43 #define FAN_JUMP_UP_SHIFT 3
44 #define FAN_JUMP_DOWN_SHIFT 2
45 #define FAN_TEMP_SEL_LOW_SHIFT 0
46 #define FAN_TEMP_SEL_LOW_MASK 0x03
47 #define FAN_BIT_MASK 0x01
49 #define FAN_ADJUST(fan, start) (((fan - 1) * 0x10) + start)
51 #define STATUS_INVALID_VALUE -1
52 #define STATUS_INVALID_ORDER -2
54 #define FIRST_FAN 1
55 #define LAST_FAN 2
56 #define MAX_DUTY 100
58 #endif /* SUPERIO_FINTEK_F81803_HWM_H */