summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-02-25 15:24:14 -0700
committerCommit Bot <commit-bot@chromium.org>2020-02-27 00:56:14 +0000
commit331de6dbdf9b024d4c3f6e183df868d3f7cabac2 (patch)
treeb74b3a5fa64138b7e9e5fce9011d6963649a176b /baseboard
parent4baea4e432c476e66d1defb81391ce982e3cdfd8 (diff)
downloadchrome-ec-331de6dbdf9b024d4c3f6e183df868d3f7cabac2.tar.gz
zork: Move fan into variant_trembyle.c
BUG=b:147297680 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Icc77e0d27db794b1aed0d65c7d30de3ccc3747ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2071391 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/zork/baseboard.c63
-rw-r--r--baseboard/zork/baseboard.h10
-rw-r--r--baseboard/zork/variant_trembyle.c60
3 files changed, 66 insertions, 67 deletions
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c
index 42cceca866..0b3febe39c 100644
--- a/baseboard/zork/baseboard.c
+++ b/baseboard/zork/baseboard.c
@@ -29,8 +29,6 @@
#include "driver/usb_mux/amd_fp5.h"
#include "ec_commands.h"
#include "extpower.h"
-#include "fan.h"
-#include "fan_chip.h"
#include "gpio.h"
#include "hooks.h"
#include "ioexpander.h"
@@ -171,26 +169,6 @@ const struct i2c_port_t i2c_ports[] = {
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
-/* Physical fans. These are logically separate from pwm_channels. */
-const struct fan_conf fan_conf_0 = {
- .flags = FAN_USE_RPM_MODE,
- .ch = MFT_CH_0, /* Use MFT id to control fan */
- .pgood_gpio = -1,
- .enable_gpio = -1,
-};
-const struct fan_rpm fan_rpm_0 = {
- .rpm_min = 3100,
- .rpm_start = 3100,
- .rpm_max = 6900,
-};
-const struct fan_t fans[] = {
- [FAN_CH_0] = {
- .conf = &fan_conf_0,
- .rpm = &fan_rpm_0,
- },
-};
-BUILD_ASSERT(ARRAY_SIZE(fans) == FAN_CH_COUNT);
-
struct ppc_config_t ppc_chips[] = {
[USBC_PORT_C0] = {
/* Device does not talk I2C */
@@ -892,40 +870,6 @@ const struct temp_sensor_t temp_sensors[] = {
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
-const static struct ec_thermal_config thermal_thermistor = {
- .temp_host = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(75),
- [EC_TEMP_THRESH_HALT] = C_TO_K(80),
- },
- .temp_host_release = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
- },
- .temp_fan_off = C_TO_K(25),
- .temp_fan_max = C_TO_K(50),
-};
-
-const static struct ec_thermal_config thermal_cpu = {
- .temp_host = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(85),
- [EC_TEMP_THRESH_HALT] = C_TO_K(95),
- },
- .temp_host_release = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
- },
- .temp_fan_off = C_TO_K(25),
- .temp_fan_max = C_TO_K(50),
-};
-
-struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT];
-
-static void setup_fans(void)
-{
- thermal_params[TEMP_SENSOR_CHARGER] = thermal_thermistor;
- thermal_params[TEMP_SENSOR_SOC] = thermal_thermistor;
- thermal_params[TEMP_SENSOR_CPU] = thermal_cpu;
-}
-
-
#ifndef TEST_BUILD
void lid_angle_peripheral_enable(int enable)
{
@@ -993,13 +937,6 @@ void board_overcurrent_event(int port, int is_overcurrented)
}
}
-static void baseboard_init(void)
-{
- /* Initialize Fans */
- setup_fans();
-}
-DECLARE_HOOK(HOOK_INIT, baseboard_init, HOOK_PRIO_DEFAULT);
-
void board_hibernate(void)
{
int port;
diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h
index 89fdd3f287..9f18d663a3 100644
--- a/baseboard/zork/baseboard.h
+++ b/baseboard/zork/baseboard.h
@@ -84,10 +84,12 @@
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
-#define CONFIG_FANS FAN_CH_COUNT
-#undef CONFIG_FAN_INIT_SPEED
-#define CONFIG_FAN_INIT_SPEED 50
-#define CONFIG_THROTTLE_AP
+#ifdef VARIANT_ZORK_TREMBYLE
+ #define CONFIG_FANS FAN_CH_COUNT
+ #undef CONFIG_FAN_INIT_SPEED
+ #define CONFIG_FAN_INIT_SPEED 50
+ #define CONFIG_THROTTLE_AP
+#endif
#define CONFIG_LED_COMMON
#define CONFIG_CMD_LEDTEST
diff --git a/baseboard/zork/variant_trembyle.c b/baseboard/zork/variant_trembyle.c
index b8f70c6295..7d5c05a7ab 100644
--- a/baseboard/zork/variant_trembyle.c
+++ b/baseboard/zork/variant_trembyle.c
@@ -6,6 +6,8 @@
#include "common.h"
#include "console.h"
#include "driver/retimer/ps8811.h"
+#include "fan.h"
+#include "fan_chip.h"
#include "gpio.h"
#include "hooks.h"
#include "i2c.h"
@@ -15,6 +17,64 @@
#define CPRINTFUSB(format, args...) cprintf(CC_USBCHARGE, format, ## args)
/*****************************************************************************
+ * Fan
+ */
+
+/* Physical fans. These are logically separate from pwm_channels. */
+const struct fan_conf fan_conf_0 = {
+ .flags = FAN_USE_RPM_MODE,
+ .ch = MFT_CH_0, /* Use MFT id to control fan */
+ .pgood_gpio = -1,
+ .enable_gpio = -1,
+};
+const struct fan_rpm fan_rpm_0 = {
+ .rpm_min = 3100,
+ .rpm_start = 3100,
+ .rpm_max = 6900,
+};
+const struct fan_t fans[] = {
+ [FAN_CH_0] = {
+ .conf = &fan_conf_0,
+ .rpm = &fan_rpm_0,
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(fans) == FAN_CH_COUNT);
+
+const static struct ec_thermal_config thermal_thermistor = {
+ .temp_host = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(75),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(80),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
+ },
+ .temp_fan_off = C_TO_K(25),
+ .temp_fan_max = C_TO_K(50),
+};
+
+const static struct ec_thermal_config thermal_cpu = {
+ .temp_host = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(85),
+ [EC_TEMP_THRESH_HALT] = C_TO_K(95),
+ },
+ .temp_host_release = {
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
+ },
+ .temp_fan_off = C_TO_K(25),
+ .temp_fan_max = C_TO_K(50),
+};
+
+struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT];
+
+static void setup_fans(void)
+{
+ thermal_params[TEMP_SENSOR_CHARGER] = thermal_thermistor;
+ thermal_params[TEMP_SENSOR_SOC] = thermal_thermistor;
+ thermal_params[TEMP_SENSOR_CPU] = thermal_cpu;
+}
+DECLARE_HOOK(HOOK_INIT, setup_fans, HOOK_PRIO_DEFAULT);
+
+/*****************************************************************************
* USB-A Retimer tuning
*/
#define PS8811_ACCESS_RETRIES 2