summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Hsu <Henry.Hsu@quantatw.com>2014-01-24 13:08:15 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-01-28 01:02:59 +0000
commita75dd79f5c1559972971a7ea1a5da8c40adcf56b (patch)
tree25ca06081cee53df8f70be14c436d834bfd561d3
parent2e0d4a0a8e6667dd78b6cb950333c3fc76b9d059 (diff)
downloadchrome-ec-a75dd79f5c1559972971a7ea1a5da8c40adcf56b.tar.gz
Add fan default support
Now the fan should be enabled for thermal test. For the draft value is that S.W. throttle: 80, H.W. throttle: 85, Shutdown: 88, fan off: 45, and fan max: 70 for CPU thermal sensor. Fan max speed and min speed is 4600rpm and 3680rpm separately. BUG=chrome-os-partner:24668 BRANCH=glimmer TEST=use ec console command fanduty, fanauto, and faninfo, the fan works praperly. Change-Id: I61825bde9d1e6b3d1ac4cdfe48d3dcfd3616db5d Signed-off-by: Henry Hsu <Henry.Hsu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/183697 Reviewed-by: Dave Parker <dparker@chromium.org>
-rw-r--r--board/glimmer/board.c16
-rw-r--r--board/glimmer/board.h1
2 files changed, 16 insertions, 1 deletions
diff --git a/board/glimmer/board.c b/board/glimmer/board.c
index cf4dc57340..f1cbcaf947 100644
--- a/board/glimmer/board.c
+++ b/board/glimmer/board.c
@@ -11,6 +11,7 @@
#include "common.h"
#include "driver/temp_sensor/tmp432.h"
#include "extpower.h"
+#include "fan.h"
#include "gpio.h"
#include "host_command.h"
#include "i2c.h"
@@ -123,6 +124,7 @@ const struct gpio_alt_func gpio_alt_funcs[] = {
{GPIO_L, 0x3f, 15, MODULE_LPC}, /* LPC */
{GPIO_M, 0x21, 15, MODULE_LPC}, /* LPC */
{GPIO_N, 0x50, 1, MODULE_PWM_LED, GPIO_OPEN_DRAIN}, /* FAN0PWM 3&4 */
+ {GPIO_N, 0x0c, 1, MODULE_PWM_FAN}, /* FAN0PWM2 */
};
const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs);
@@ -170,6 +172,18 @@ const struct pwm_t pwm_channels[] = {
BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
+/* Physical fans. These are logically separate from pwm_channels. */
+const struct fan_t fans[] = {
+ {.flags = FAN_USE_RPM_MODE,
+ .rpm_min = 3680,
+ .rpm_max = 4600,
+ .ch = 2,
+ .pgood_gpio = GPIO_PP5000_PGOOD,
+ .enable_gpio = -1,
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS);
+
/* I2C ports */
const struct i2c_port_t i2c_ports[] = {
{"batt_chg", 0, 100},
@@ -197,7 +211,7 @@ struct ec_thermal_config thermal_params[] = {
{{0, 0, 0}, 0, 0},
{{0, 0, 0}, 0, 0},
{{0, 0, 0}, 0, 0},
- {{0, 0, 0}, 0, 0},
+ {{C_TO_K(80), C_TO_K(85), C_TO_K(88)}, C_TO_K(45), C_TO_K(70)},
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
diff --git a/board/glimmer/board.h b/board/glimmer/board.h
index d8b4d341e0..fd10918af8 100644
--- a/board/glimmer/board.h
+++ b/board/glimmer/board.h
@@ -26,6 +26,7 @@
#define CONFIG_CHIPSET_X86
#define CONFIG_CMD_GSV
#define CONFIG_EXTPOWER_GPIO
+#define CONFIG_FANS 1
#define CONFIG_I2C_PASSTHRU_RESTRICTED
#define CONFIG_KEYBOARD_COL2_INVERTED
#define CONFIG_KEYBOARD_IRQ_GPIO GPIO_KBD_IRQ_L