coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <arch/io.h>
#include <console/console.h>
#include "../common/fan_control.h"
#include "f81803a_hwm.h"
Go to the source code of this file.
Data Structures | |
struct | cross_ref |
Functions | |
static const char * | get_msg (int err) |
static int | message_invalid_1 (int err, u8 fan) |
static int | message_invalid_2 (int err, u8 fan) |
static void | write_hwm_reg (u16 address, u8 index, u8 value) |
static u8 | read_hwm_reg (u16 address, u8 index) |
static void | hwm_reg_modify (u16 address, u8 index, u8 shift, u8 mask, u8 value) |
static void | select_hwm_bank (u16 address, u8 value) |
static int | check_value_seq (u8 *values, u8 count) |
int | set_sensor_type (u16 base_address, external_sensor sensor, temp_sensor_type type) |
int | set_fan_temperature_source (u16 base_address, u8 fan, fan_temp_source source) |
int | set_fan_type_mode (u16 base_address, u8 fan, fan_type type, fan_mode mode) |
int | set_pwm_frequency (u16 base_address, u8 fan, fan_pwm_freq frequency) |
int | set_sections (u16 base_address, u8 fan, u8 *boundaries, u8 *sections) |
int | set_fan_speed_change_rate (u16 base_address, u8 fan, fan_rate_up rate_up, fan_rate_down rate_down) |
int | set_fan_follow (u16 base_address, u8 fan, fan_follow follow) |
Variables | |
static const char | msg_err_invalid [] = "Error: invalid" |
static const char | msg_err_wrong_order [] = "Error: wrong order," |
static const char | msg_err_fan [] = "fan" |
static const char | msg_err_temp_source [] = "temperature source" |
static const char | msg_err_type [] = "type" |
static const char | msg_err_mode [] = "mode" |
static const char | msg_err_rate [] = "change rate" |
static const char | msg_err_frequency [] = "frequency" |
static const char | msg_err_temp_sensor [] = "temperature sensor" |
static const char | msg_err_bondary [] = "boundary" |
static const char | msg_err_section [] = "section" |
static const char | no_msg [] = "" |
static struct cross_ref | msg_table [] |
Definition at line 124 of file fan_control.c.
References count, CPU_DAMAGE_TEMP, HWM_STATUS_SUCCESS, STATUS_INVALID_ORDER, and STATUS_INVALID_VALUE.
Referenced by set_sections().
|
static |
Definition at line 36 of file fan_control.c.
References cross_ref::message, msg_table, no_msg, and cross_ref::selection.
Referenced by message_invalid_1().
Definition at line 97 of file fan_control.c.
References address, mask, read_hwm_reg(), value, and write_hwm_reg().
Referenced by select_hwm_bank(), set_fan_follow(), set_fan_speed_change_rate(), set_fan_temperature_source(), set_fan_type_mode(), set_pwm_frequency(), and set_sensor_type().
|
static |
Definition at line 47 of file fan_control.c.
References BIOS_ERR, get_msg(), HWM_STATUS_INVALID_FAN, msg_err_invalid, and printk.
Referenced by set_fan_follow(), set_fan_speed_change_rate(), set_fan_temperature_source(), set_fan_type_mode(), set_pwm_frequency(), set_sections(), and set_sensor_type().
|
static |
Definition at line 56 of file fan_control.c.
References BIOS_ERR, HWM_STATUS_BOUNDARY_WRONG_ORDER, HWM_STATUS_INVALID_BOUNDARY_VALUE, HWM_STATUS_INVALID_SECTION_VALUE, HWM_STATUS_SECTIONS_WRONG_ORDER, msg_err_bondary, msg_err_invalid, msg_err_section, msg_err_wrong_order, and printk.
Referenced by set_sections().
Definition at line 88 of file fan_control.c.
References address, inb(), and outb().
Referenced by hwm_reg_modify(), set_pwm_frequency(), and set_sensor_type().
Definition at line 113 of file fan_control.c.
References address, FAN_BIT_MASK, FAN_FAULT_TIME_REG, FAN_FUNC_PROG_SEL_SHIFT, hwm_reg_modify(), and value.
Referenced by set_fan_speed_change_rate(), set_fan_temperature_source(), set_fan_type_mode(), and set_pwm_frequency().
int set_fan_follow | ( | u16 | base_address, |
u8 | fan, | ||
fan_follow | follow | ||
) |
Definition at line 338 of file fan_control.c.
References BIOS_DEBUG, FAN_ADJUST, FAN_BIT_MASK, FAN_INTERPOLATION_SHIFT, FAN_TMP_MAPPING, FIRST_FAN, hwm_reg_modify(), HWM_STATUS_INVALID_FAN, HWM_STATUS_SUCCESS, LAST_FAN, message_invalid_1(), and printk.
Referenced by set_fan().
int set_fan_speed_change_rate | ( | u16 | base_address, |
u8 | fan, | ||
fan_rate_up | rate_up, | ||
fan_rate_down | rate_down | ||
) |
Definition at line 291 of file fan_control.c.
References BIOS_DEBUG, FAN_ADJUST, FAN_BIT_MASK, FAN_DOWN_RATE_DEFAULT, FAN_DOWN_RATE_DIFF_FROM_UP_SHIFT, FAN_DOWN_RATE_JUMP, FAN_DOWN_RATE_REG, FAN_DOWN_RATE_SAME_AS_UP, FAN_JUMP_DOWN_SHIFT, FAN_JUMP_UP_SHIFT, FAN_RATE_MASK, FAN_RATE_SHIFT, FAN_TMP_MAPPING, FAN_UP_RATE_DEFAULT, FAN_UP_RATE_JUMP, FAN_UP_RATE_REG, FIRST_FAN, hwm_reg_modify(), HWM_STATUS_INVALID_FAN, HWM_STATUS_SUCCESS, LAST_FAN, message_invalid_1(), printk, and select_hwm_bank().
Referenced by set_fan().
int set_fan_temperature_source | ( | u16 | base_address, |
u8 | fan, | ||
fan_temp_source | source | ||
) |
Definition at line 170 of file fan_control.c.
References BIOS_DEBUG, FAN1_ADJ_SEL_MASK, FAN1_ADJ_SEL_SHIFT, FAN_ADJUST, FAN_BIT_MASK, FAN_MODE_REG, FAN_TEMP_SEL_HIGH_SHIFT, FAN_TEMP_SEL_LOW_MASK, FAN_TEMP_SEL_LOW_SHIFT, FAN_TMP_MAPPING, FIRST_FAN, hwm_reg_modify(), HWM_STATUS_INVALID_FAN, HWM_STATUS_SUCCESS, LAST_FAN, message_invalid_1(), printk, and select_hwm_bank().
Referenced by set_fan().
Definition at line 203 of file fan_control.c.
References BIOS_DEBUG, FAN_MODE_DEFAULT, FAN_MODE_MASK, FAN_MODE_REG, FAN_MODE_SHIFT, FAN_TYPE_MASK, FAN_TYPE_REG, FAN_TYPE_RESERVED, FAN_TYPE_SHIFT, FIRST_FAN, hwm_reg_modify(), HWM_STATUS_INVALID_FAN, HWM_STATUS_SUCCESS, LAST_FAN, message_invalid_1(), printk, select_hwm_bank(), and type.
Referenced by set_fan().
int set_pwm_frequency | ( | u16 | base_address, |
u8 | fan, | ||
fan_pwm_freq | frequency | ||
) |
Definition at line 224 of file fan_control.c.
References BIOS_DEBUG, BIOS_WARNING, FAN_ADJUST, FAN_BIT_MASK, FAN_FREQ_SEL_ADD_SHIFT, FAN_MODE_REG, FAN_PWM_FREQ_SEL_SHIFT, FAN_TMP_MAPPING, FAN_TYPE_PWM_CHECK, FAN_TYPE_REG, FAN_TYPE_SHIFT, FIRST_FAN, hwm_reg_modify(), HWM_STATUS_INVALID_FAN, HWM_STATUS_SUCCESS, HWM_STATUS_WARNING_FAN_NOT_PWM, LAST_FAN, message_invalid_1(), printk, read_hwm_reg(), and select_hwm_bank().
Referenced by set_fan().
Definition at line 250 of file fan_control.c.
References BIOS_DEBUG, check_value_seq(), FAN_ADJUST, FAN_BOUND_TEMP, FAN_SECTION_SPEED, FINTEK_BOUNDARIES_SIZE, FINTEK_SECTIONS_SIZE, FIRST_FAN, HWM_STATUS_BOUNDARY_WRONG_ORDER, HWM_STATUS_INVALID_BOUNDARY_VALUE, HWM_STATUS_INVALID_FAN, HWM_STATUS_INVALID_SECTION_VALUE, HWM_STATUS_SECTIONS_WRONG_ORDER, HWM_STATUS_SUCCESS, LAST_FAN, message_invalid_1(), message_invalid_2(), printk, STATUS_INVALID_VALUE, value, and write_hwm_reg().
Referenced by set_fan().
int set_sensor_type | ( | u16 | base_address, |
external_sensor | sensor, | ||
temp_sensor_type | type | ||
) |
Definition at line 139 of file fan_control.c.
References BIOS_DEBUG, BIOS_WARNING, EXTERNAL_SENSOR1, EXTERNAL_SENSOR2, hwm_reg_modify(), HWM_STATUS_INVALID_TEMP_SENSOR, HWM_STATUS_SUCCESS, HWM_STATUS_WARNING_SENSOR_DISCONNECTED, IGNORE_SENSOR, message_invalid_1(), printk, read_hwm_reg(), TP_DIODE_STATUS, TP_EXTERNAL_SENSOR1_OPEN, TP_EXTERNAL_SENSOR2_OPEN, TP_SENSOR1_TYPE_SHIFT, TP_SENSOR2_TYPE_SHIFT, TP_SENSOR_TYPE, TP_SENSOR_TYPE_MASK, and type.
Referenced by set_fan().
Definition at line 79 of file fan_control.c.
References address, outb(), and value.
Referenced by hwm_reg_modify(), and set_sections().
|
static |
Definition at line 17 of file fan_control.c.
Referenced by message_invalid_2().
|
static |
Definition at line 10 of file fan_control.c.
|
static |
Definition at line 15 of file fan_control.c.
|
static |
Definition at line 8 of file fan_control.c.
Referenced by message_invalid_1(), and message_invalid_2().
|
static |
Definition at line 13 of file fan_control.c.
|
static |
Definition at line 14 of file fan_control.c.
|
static |
Definition at line 18 of file fan_control.c.
Referenced by message_invalid_2().
|
static |
Definition at line 16 of file fan_control.c.
|
static |
Definition at line 11 of file fan_control.c.
|
static |
Definition at line 12 of file fan_control.c.
|
static |
Definition at line 9 of file fan_control.c.
Referenced by message_invalid_2().
|
static |
Definition at line 19 of file fan_control.c.
Referenced by get_msg().
|
static |
Definition at line 19 of file fan_control.c.
Referenced by get_msg().