coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fan.h File Reference
#include <device/device.h>
Include dependency graph for fan.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FAN_0_OFFSET   0x00
 
#define FAN_1_OFFSET   0x10
 
#define FAN_2_OFFSET   0x20
 
#define FAN_3_OFFSET   0x30
 
#define FAN_4_OFFSET   0x40
 
#define FAN_INPUT_CONTROL_REG   0x00
 
#define FAN_CONTROL_REG   0x01
 
#define FAN_FREQUENCY_REG   0x02
 
#define FAN_LOW_DUTY_REG   0x03
 
#define FAN_MED_DUTY_REG   0x04
 
#define FAN_MULTIPLIER_REG   0x05
 
#define FAN_LOW_TEMP_LO_REG   0x06
 
#define FAN_LOW_TEMP_HI_REG   0x07
 
#define FAN_MED_TEMP_LO_REG   0x08
 
#define FAN_MED_TEMP_HI_REG   0x09
 
#define FAN_HIGH_TEMP_LO_REG   0x0A
 
#define FAN_HIGH_TEMP_HI_REG   0x0B
 
#define FAN_LINEAR_RANGE_REG   0x0C
 
#define FAN_LINEAR_HOLD_REG   0x0D
 
#define FAN_INPUT_INTERNAL_DIODE   0
 
#define FAN_INPUT_TEMP0   1
 
#define FAN_INPUT_TEMP1   2
 
#define FAN_INPUT_TEMP2   3
 
#define FAN_INPUT_TEMP3   4
 
#define FAN_INPUT_TEMP0_FILTER   5
 
#define FAN_INPUT_ZERO   6
 
#define FAN_INPUT_DISABLED   7
 
#define FAN_AUTOMODE   (1 << 0)
 
#define FAN_LINEARMODE   (1 << 1)
 
#define FAN_STEPMODE   0 /* ~(1 << 1) */
 
#define FAN_POLARITY_HIGH   (1 << 2)
 
#define FAN_POLARITY_LOW   0 /*~(1 << 2) */
 
#define FAN_POLARITY_HIGH_MAX_SPEED   0xff
 
#define FAN_POLARITY_LOW_MAX_SPEED   0x00
 
#define FREQ_28KHZ   0x0
 
#define FREQ_25KHZ   0x1
 
#define FREQ_23KHZ   0x2
 
#define FREQ_21KHZ   0x3
 
#define FREQ_29KHZ   0x4
 
#define FREQ_18KHZ   0x5
 
#define FREQ_100HZ   0xF7
 
#define FREQ_87HZ   0xF8
 
#define FREQ_58HZ   0xF9
 
#define FREQ_44HZ   0xFA
 
#define FREQ_35HZ   0xFB
 
#define FREQ_29HZ   0xFC
 
#define FREQ_22HZ   0xFD
 
#define FREQ_14HZ   0xFE
 
#define FREQ_11HZ   0xFF
 
#define IMC_MODE1_FAN_ENABLED   ( 1 << 0 )
 
#define IMC_MODE1_FAN_IMC_CONTROLLED   ( 1 << 2 )
 
#define IMC_MODE1_FAN_LINEAR_MODE   ( 1 << 4 )
 
#define IMC_MODE1_FAN_STEP_MODE   0 /* ~( 1 << 4 ) */
 
#define IMC_MODE1_NO_FANOUT   0 /* ~( 7 << 5 ) */
 
#define IMC_MODE1_FANOUT0   ( 1 << 5 )
 
#define IMC_MODE1_FANOUT1   ( 2 << 5 )
 
#define IMC_MODE1_FANOUT2   ( 3 << 5 )
 
#define IMC_MODE1_FANOUT3   ( 4 << 5 )
 
#define IMC_MODE1_FANOUT4   ( 5 << 5 )
 
#define IMC_MODE2_TEMPIN_NONE   0 /* ~( 7 << 0) */
 
#define IMC_MODE2_TEMPIN_0   1
 
#define IMC_MODE2_TEMPIN_1   2
 
#define IMC_MODE2_TEMPIN_2   3
 
#define IMC_MODE2_TEMPIN_3   4
 
#define IMC_MODE2_INT_TEMPIN   5
 
#define IMC_MODE2_TEMPIN_SB_TSI   6
 
#define IMC_MODE2_TEMPIN_OTHER   7
 
#define IMC_MODE2_FANIN_NONE   0 /* ~ (7 << 3) */
 
#define IMC_MODE2_FANIN0   ( 1 << 3 )
 
#define IMC_MODE2_FANIN1   ( 2 << 3 )
 
#define IMC_MODE2_FANIN2   ( 3 << 3 )
 
#define IMC_MODE2_FANIN3   ( 4 << 3 )
 
#define IMC_MODE2_FANIN4   ( 5 << 3 )
 
#define IMC_MODE2_TEMP_AVERAGING_ENABLED   ( 1 << 6 )
 
#define IMC_MODE2_TEMP_AVERAGING_DISABLED   0 /* ~( 1 << 6 ) */
 
#define IMC_TEMP_SENSOR_ON_SMBUS_0   0
 
#define IMC_TEMP_SENSOR_ON_SMBUS_2   1
 
#define IMC_TEMP_SENSOR_ON_SMBUS_3   2
 
#define IMC_TEMP_SENSOR_ON_SMBUS_4   3
 
#define IMC_ZONE0   0
 
#define IMC_ZONE1   1
 
#define IMC_ZONE2   2
 
#define IMC_ZONE3   3
 
#define IMC_ZONE4   4
 
#define IMC_TEMPIN_TUNING_DEFAULT_MODE   0
 
#define IMC_TEMPIN_TUNING_HIGH_CURRENT_RATIO   1
 
#define IMC_TEMPIN_TUNING_HIGH_CURRENT   2
 
#define IMC_TEMPIN_TUNING_DISABLE_FILTERING   ( 1 << 2 )
 
#define IMC_ENABLE_ZONE0   0x111
 
#define IMC_ENABLE_ZONE1   0x222
 
#define IMC_ENABLE_ZONE2   0x333
 
#define IMC_ENABLE_ZONE3   0x444
 
#define IMC_ENABLE_TEMPIN0   ( 1 << 12 )
 
#define IMC_ENABLE_TEMPIN1   ( 1 << 13 )
 
#define IMC_ENABLE_TEMPIN2   ( 1 << 14 )
 
#define IMC_ENABLE_TEMPIN3   ( 1 << 15 )
 
#define IMC_FAN_THRESHOLD_COUNT   9
 
#define IMC_FAN_SPEED_COUNT   8
 
#define IMC_FAN_CONFIG_COUNT   8
 
#define FAN_REGISTER_COUNT   15
 

Functions

void init_sb800_IMC_fans (struct device *dev)
 
void init_sb800_MANUAL_fans (struct device *dev)
 

Macro Definition Documentation

◆ FAN_0_OFFSET

#define FAN_0_OFFSET   0x00

Definition at line 12 of file fan.h.

◆ FAN_1_OFFSET

#define FAN_1_OFFSET   0x10

Definition at line 13 of file fan.h.

◆ FAN_2_OFFSET

#define FAN_2_OFFSET   0x20

Definition at line 14 of file fan.h.

◆ FAN_3_OFFSET

#define FAN_3_OFFSET   0x30

Definition at line 15 of file fan.h.

◆ FAN_4_OFFSET

#define FAN_4_OFFSET   0x40

Definition at line 16 of file fan.h.

◆ FAN_AUTOMODE

#define FAN_AUTOMODE   (1 << 0)

Definition at line 44 of file fan.h.

◆ FAN_CONTROL_REG

#define FAN_CONTROL_REG   0x01

Definition at line 19 of file fan.h.

◆ FAN_FREQUENCY_REG

#define FAN_FREQUENCY_REG   0x02

Definition at line 20 of file fan.h.

◆ FAN_HIGH_TEMP_HI_REG

#define FAN_HIGH_TEMP_HI_REG   0x0B

Definition at line 29 of file fan.h.

◆ FAN_HIGH_TEMP_LO_REG

#define FAN_HIGH_TEMP_LO_REG   0x0A

Definition at line 28 of file fan.h.

◆ FAN_INPUT_CONTROL_REG

#define FAN_INPUT_CONTROL_REG   0x00

Definition at line 18 of file fan.h.

◆ FAN_INPUT_DISABLED

#define FAN_INPUT_DISABLED   7

Definition at line 41 of file fan.h.

◆ FAN_INPUT_INTERNAL_DIODE

#define FAN_INPUT_INTERNAL_DIODE   0

Definition at line 34 of file fan.h.

◆ FAN_INPUT_TEMP0

#define FAN_INPUT_TEMP0   1

Definition at line 35 of file fan.h.

◆ FAN_INPUT_TEMP0_FILTER

#define FAN_INPUT_TEMP0_FILTER   5

Definition at line 39 of file fan.h.

◆ FAN_INPUT_TEMP1

#define FAN_INPUT_TEMP1   2

Definition at line 36 of file fan.h.

◆ FAN_INPUT_TEMP2

#define FAN_INPUT_TEMP2   3

Definition at line 37 of file fan.h.

◆ FAN_INPUT_TEMP3

#define FAN_INPUT_TEMP3   4

Definition at line 38 of file fan.h.

◆ FAN_INPUT_ZERO

#define FAN_INPUT_ZERO   6

Definition at line 40 of file fan.h.

◆ FAN_LINEAR_HOLD_REG

#define FAN_LINEAR_HOLD_REG   0x0D

Definition at line 31 of file fan.h.

◆ FAN_LINEAR_RANGE_REG

#define FAN_LINEAR_RANGE_REG   0x0C

Definition at line 30 of file fan.h.

◆ FAN_LINEARMODE

#define FAN_LINEARMODE   (1 << 1)

Definition at line 45 of file fan.h.

◆ FAN_LOW_DUTY_REG

#define FAN_LOW_DUTY_REG   0x03

Definition at line 21 of file fan.h.

◆ FAN_LOW_TEMP_HI_REG

#define FAN_LOW_TEMP_HI_REG   0x07

Definition at line 25 of file fan.h.

◆ FAN_LOW_TEMP_LO_REG

#define FAN_LOW_TEMP_LO_REG   0x06

Definition at line 24 of file fan.h.

◆ FAN_MED_DUTY_REG

#define FAN_MED_DUTY_REG   0x04

Definition at line 22 of file fan.h.

◆ FAN_MED_TEMP_HI_REG

#define FAN_MED_TEMP_HI_REG   0x09

Definition at line 27 of file fan.h.

◆ FAN_MED_TEMP_LO_REG

#define FAN_MED_TEMP_LO_REG   0x08

Definition at line 26 of file fan.h.

◆ FAN_MULTIPLIER_REG

#define FAN_MULTIPLIER_REG   0x05

Definition at line 23 of file fan.h.

◆ FAN_POLARITY_HIGH

#define FAN_POLARITY_HIGH   (1 << 2)

Definition at line 47 of file fan.h.

◆ FAN_POLARITY_HIGH_MAX_SPEED

#define FAN_POLARITY_HIGH_MAX_SPEED   0xff

Definition at line 51 of file fan.h.

◆ FAN_POLARITY_LOW

#define FAN_POLARITY_LOW   0 /*~(1 << 2) */

Definition at line 48 of file fan.h.

◆ FAN_POLARITY_LOW_MAX_SPEED

#define FAN_POLARITY_LOW_MAX_SPEED   0x00

Definition at line 52 of file fan.h.

◆ FAN_REGISTER_COUNT

#define FAN_REGISTER_COUNT   15

Definition at line 132 of file fan.h.

◆ FAN_STEPMODE

#define FAN_STEPMODE   0 /* ~(1 << 1) */

Definition at line 46 of file fan.h.

◆ FREQ_100HZ

#define FREQ_100HZ   0xF7

Definition at line 63 of file fan.h.

◆ FREQ_11HZ

#define FREQ_11HZ   0xFF

Definition at line 71 of file fan.h.

◆ FREQ_14HZ

#define FREQ_14HZ   0xFE

Definition at line 70 of file fan.h.

◆ FREQ_18KHZ

#define FREQ_18KHZ   0x5

Definition at line 61 of file fan.h.

◆ FREQ_21KHZ

#define FREQ_21KHZ   0x3

Definition at line 59 of file fan.h.

◆ FREQ_22HZ

#define FREQ_22HZ   0xFD

Definition at line 69 of file fan.h.

◆ FREQ_23KHZ

#define FREQ_23KHZ   0x2

Definition at line 58 of file fan.h.

◆ FREQ_25KHZ

#define FREQ_25KHZ   0x1

Definition at line 57 of file fan.h.

◆ FREQ_28KHZ

#define FREQ_28KHZ   0x0

Definition at line 56 of file fan.h.

◆ FREQ_29HZ

#define FREQ_29HZ   0xFC

Definition at line 68 of file fan.h.

◆ FREQ_29KHZ

#define FREQ_29KHZ   0x4

Definition at line 60 of file fan.h.

◆ FREQ_35HZ

#define FREQ_35HZ   0xFB

Definition at line 67 of file fan.h.

◆ FREQ_44HZ

#define FREQ_44HZ   0xFA

Definition at line 66 of file fan.h.

◆ FREQ_58HZ

#define FREQ_58HZ   0xF9

Definition at line 65 of file fan.h.

◆ FREQ_87HZ

#define FREQ_87HZ   0xF8

Definition at line 64 of file fan.h.

◆ IMC_ENABLE_TEMPIN0

#define IMC_ENABLE_TEMPIN0   ( 1 << 12 )

Definition at line 123 of file fan.h.

◆ IMC_ENABLE_TEMPIN1

#define IMC_ENABLE_TEMPIN1   ( 1 << 13 )

Definition at line 124 of file fan.h.

◆ IMC_ENABLE_TEMPIN2

#define IMC_ENABLE_TEMPIN2   ( 1 << 14 )

Definition at line 125 of file fan.h.

◆ IMC_ENABLE_TEMPIN3

#define IMC_ENABLE_TEMPIN3   ( 1 << 15 )

Definition at line 126 of file fan.h.

◆ IMC_ENABLE_ZONE0

#define IMC_ENABLE_ZONE0   0x111

Definition at line 119 of file fan.h.

◆ IMC_ENABLE_ZONE1

#define IMC_ENABLE_ZONE1   0x222

Definition at line 120 of file fan.h.

◆ IMC_ENABLE_ZONE2

#define IMC_ENABLE_ZONE2   0x333

Definition at line 121 of file fan.h.

◆ IMC_ENABLE_ZONE3

#define IMC_ENABLE_ZONE3   0x444

Definition at line 122 of file fan.h.

◆ IMC_FAN_CONFIG_COUNT

#define IMC_FAN_CONFIG_COUNT   8

Definition at line 131 of file fan.h.

◆ IMC_FAN_SPEED_COUNT

#define IMC_FAN_SPEED_COUNT   8

Definition at line 130 of file fan.h.

◆ IMC_FAN_THRESHOLD_COUNT

#define IMC_FAN_THRESHOLD_COUNT   9

Definition at line 129 of file fan.h.

◆ IMC_MODE1_FAN_ENABLED

#define IMC_MODE1_FAN_ENABLED   ( 1 << 0 )

Definition at line 74 of file fan.h.

◆ IMC_MODE1_FAN_IMC_CONTROLLED

#define IMC_MODE1_FAN_IMC_CONTROLLED   ( 1 << 2 )

Definition at line 75 of file fan.h.

◆ IMC_MODE1_FAN_LINEAR_MODE

#define IMC_MODE1_FAN_LINEAR_MODE   ( 1 << 4 )

Definition at line 76 of file fan.h.

◆ IMC_MODE1_FAN_STEP_MODE

#define IMC_MODE1_FAN_STEP_MODE   0 /* ~( 1 << 4 ) */

Definition at line 77 of file fan.h.

◆ IMC_MODE1_FANOUT0

#define IMC_MODE1_FANOUT0   ( 1 << 5 )

Definition at line 79 of file fan.h.

◆ IMC_MODE1_FANOUT1

#define IMC_MODE1_FANOUT1   ( 2 << 5 )

Definition at line 80 of file fan.h.

◆ IMC_MODE1_FANOUT2

#define IMC_MODE1_FANOUT2   ( 3 << 5 )

Definition at line 81 of file fan.h.

◆ IMC_MODE1_FANOUT3

#define IMC_MODE1_FANOUT3   ( 4 << 5 )

Definition at line 82 of file fan.h.

◆ IMC_MODE1_FANOUT4

#define IMC_MODE1_FANOUT4   ( 5 << 5 )

Definition at line 83 of file fan.h.

◆ IMC_MODE1_NO_FANOUT

#define IMC_MODE1_NO_FANOUT   0 /* ~( 7 << 5 ) */

Definition at line 78 of file fan.h.

◆ IMC_MODE2_FANIN0

#define IMC_MODE2_FANIN0   ( 1 << 3 )

Definition at line 94 of file fan.h.

◆ IMC_MODE2_FANIN1

#define IMC_MODE2_FANIN1   ( 2 << 3 )

Definition at line 95 of file fan.h.

◆ IMC_MODE2_FANIN2

#define IMC_MODE2_FANIN2   ( 3 << 3 )

Definition at line 96 of file fan.h.

◆ IMC_MODE2_FANIN3

#define IMC_MODE2_FANIN3   ( 4 << 3 )

Definition at line 97 of file fan.h.

◆ IMC_MODE2_FANIN4

#define IMC_MODE2_FANIN4   ( 5 << 3 )

Definition at line 98 of file fan.h.

◆ IMC_MODE2_FANIN_NONE

#define IMC_MODE2_FANIN_NONE   0 /* ~ (7 << 3) */

Definition at line 93 of file fan.h.

◆ IMC_MODE2_INT_TEMPIN

#define IMC_MODE2_INT_TEMPIN   5

Definition at line 90 of file fan.h.

◆ IMC_MODE2_TEMP_AVERAGING_DISABLED

#define IMC_MODE2_TEMP_AVERAGING_DISABLED   0 /* ~( 1 << 6 ) */

Definition at line 100 of file fan.h.

◆ IMC_MODE2_TEMP_AVERAGING_ENABLED

#define IMC_MODE2_TEMP_AVERAGING_ENABLED   ( 1 << 6 )

Definition at line 99 of file fan.h.

◆ IMC_MODE2_TEMPIN_0

#define IMC_MODE2_TEMPIN_0   1

Definition at line 86 of file fan.h.

◆ IMC_MODE2_TEMPIN_1

#define IMC_MODE2_TEMPIN_1   2

Definition at line 87 of file fan.h.

◆ IMC_MODE2_TEMPIN_2

#define IMC_MODE2_TEMPIN_2   3

Definition at line 88 of file fan.h.

◆ IMC_MODE2_TEMPIN_3

#define IMC_MODE2_TEMPIN_3   4

Definition at line 89 of file fan.h.

◆ IMC_MODE2_TEMPIN_NONE

#define IMC_MODE2_TEMPIN_NONE   0 /* ~( 7 << 0) */

Definition at line 85 of file fan.h.

◆ IMC_MODE2_TEMPIN_OTHER

#define IMC_MODE2_TEMPIN_OTHER   7

Definition at line 92 of file fan.h.

◆ IMC_MODE2_TEMPIN_SB_TSI

#define IMC_MODE2_TEMPIN_SB_TSI   6

Definition at line 91 of file fan.h.

◆ IMC_TEMP_SENSOR_ON_SMBUS_0

#define IMC_TEMP_SENSOR_ON_SMBUS_0   0

Definition at line 102 of file fan.h.

◆ IMC_TEMP_SENSOR_ON_SMBUS_2

#define IMC_TEMP_SENSOR_ON_SMBUS_2   1

Definition at line 103 of file fan.h.

◆ IMC_TEMP_SENSOR_ON_SMBUS_3

#define IMC_TEMP_SENSOR_ON_SMBUS_3   2

Definition at line 104 of file fan.h.

◆ IMC_TEMP_SENSOR_ON_SMBUS_4

#define IMC_TEMP_SENSOR_ON_SMBUS_4   3

Definition at line 105 of file fan.h.

◆ IMC_TEMPIN_TUNING_DEFAULT_MODE

#define IMC_TEMPIN_TUNING_DEFAULT_MODE   0

Definition at line 113 of file fan.h.

◆ IMC_TEMPIN_TUNING_DISABLE_FILTERING

#define IMC_TEMPIN_TUNING_DISABLE_FILTERING   ( 1 << 2 )

Definition at line 116 of file fan.h.

◆ IMC_TEMPIN_TUNING_HIGH_CURRENT

#define IMC_TEMPIN_TUNING_HIGH_CURRENT   2

Definition at line 115 of file fan.h.

◆ IMC_TEMPIN_TUNING_HIGH_CURRENT_RATIO

#define IMC_TEMPIN_TUNING_HIGH_CURRENT_RATIO   1

Definition at line 114 of file fan.h.

◆ IMC_ZONE0

#define IMC_ZONE0   0

Definition at line 107 of file fan.h.

◆ IMC_ZONE1

#define IMC_ZONE1   1

Definition at line 108 of file fan.h.

◆ IMC_ZONE2

#define IMC_ZONE2   2

Definition at line 109 of file fan.h.

◆ IMC_ZONE3

#define IMC_ZONE3   3

Definition at line 110 of file fan.h.

◆ IMC_ZONE4

#define IMC_ZONE4   4

Definition at line 111 of file fan.h.

Function Documentation

◆ init_sb800_IMC_fans()

void init_sb800_IMC_fans ( struct device dev)

Definition at line 44 of file fan.c.

References device::chip_info, IMC_ENABLE_TEMPIN0, IMC_ENABLE_TEMPIN1, IMC_ENABLE_TEMPIN2, IMC_ENABLE_TEMPIN3, IMC_ENABLE_ZONE0, IMC_ENABLE_ZONE1, IMC_ENABLE_ZONE2, IMC_ENABLE_ZONE3, IMC_FAN_CONFIG_COUNT, IMC_FAN_SPEED_COUNT, IMC_FAN_THRESHOLD_COUNT, southbridge_amd_cimx_sb800_config::imc_fan_zone0_enabled, southbridge_amd_cimx_sb800_config::imc_fan_zone1_enabled, southbridge_amd_cimx_sb800_config::imc_fan_zone2_enabled, southbridge_amd_cimx_sb800_config::imc_fan_zone3_enabled, southbridge_amd_cimx_sb800_config::imc_port_address, southbridge_amd_cimx_sb800_config::imc_tempin0_at, southbridge_amd_cimx_sb800_config::imc_tempin0_ct, southbridge_amd_cimx_sb800_config::imc_tempin0_enabled, southbridge_amd_cimx_sb800_config::imc_tempin0_tuning_param, southbridge_amd_cimx_sb800_config::imc_tempin1_at, southbridge_amd_cimx_sb800_config::imc_tempin1_ct, southbridge_amd_cimx_sb800_config::imc_tempin1_enabled, southbridge_amd_cimx_sb800_config::imc_tempin1_tuning_param, southbridge_amd_cimx_sb800_config::imc_tempin2_at, southbridge_amd_cimx_sb800_config::imc_tempin2_ct, southbridge_amd_cimx_sb800_config::imc_tempin2_enabled, southbridge_amd_cimx_sb800_config::imc_tempin2_tuning_param, southbridge_amd_cimx_sb800_config::imc_tempin3_at, southbridge_amd_cimx_sb800_config::imc_tempin3_ct, southbridge_amd_cimx_sb800_config::imc_tempin3_enabled, southbridge_amd_cimx_sb800_config::imc_tempin3_tuning_param, IMC_ZONE0, southbridge_amd_cimx_sb800_config::imc_zone0_config_vals, southbridge_amd_cimx_sb800_config::imc_zone0_fanspeeds, southbridge_amd_cimx_sb800_config::imc_zone0_thresholds, IMC_ZONE1, southbridge_amd_cimx_sb800_config::imc_zone1_config_vals, southbridge_amd_cimx_sb800_config::imc_zone1_fanspeeds, southbridge_amd_cimx_sb800_config::imc_zone1_thresholds, IMC_ZONE2, southbridge_amd_cimx_sb800_config::imc_zone2_config_vals, southbridge_amd_cimx_sb800_config::imc_zone2_fanspeeds, southbridge_amd_cimx_sb800_config::imc_zone2_thresholds, IMC_ZONE3, southbridge_amd_cimx_sb800_config::imc_zone3_config_vals, southbridge_amd_cimx_sb800_config::imc_zone3_fanspeeds, southbridge_amd_cimx_sb800_config::imc_zone3_thresholds, init_sb800_MANUAL_fans(), pci_write_config16(), and sb_config.

Referenced by sb800_enable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_sb800_MANUAL_fans()