summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSue Chen <sue.chen@quanta.corp-partner.google.com>2021-12-30 11:48:31 +0800
committerCommit Bot <commit-bot@chromium.org>2022-01-05 03:06:12 +0000
commit8b891b257e55517818267476d2e94ead55759d95 (patch)
tree4b025e6e30a89bda910f1972c5836ed098dce920
parent9040b4033c7f52dfa8e1aa9b64bd61fa9913d1b3 (diff)
downloadchrome-ec-8b891b257e55517818267476d2e94ead55759d95.tar.gz
baseboard/guybrush: move fan setting to board level
Create new file thermal.c and move fan settings, fans[], fan_rpm and fan_conf to it. BUG=none BRANCH=none TEST="make BAORD=$BOARD" pass for guybrush family. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I83c476b3569f24722ff375a19e4dfabbd7bede07 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3361069 Reviewed-by: Rob Barnes <robbarnes@google.com>
-rw-r--r--baseboard/guybrush/baseboard.c19
-rw-r--r--board/dewatt/build.mk2
-rw-r--r--board/dewatt/thermal.c34
-rw-r--r--board/guybrush/build.mk2
-rw-r--r--board/guybrush/thermal.c34
-rw-r--r--board/nipperkin/thermal.c19
6 files changed, 89 insertions, 21 deletions
diff --git a/baseboard/guybrush/baseboard.c b/baseboard/guybrush/baseboard.c
index 447365a313..dd44c5feb5 100644
--- a/baseboard/guybrush/baseboard.c
+++ b/baseboard/guybrush/baseboard.c
@@ -373,25 +373,6 @@ const struct mft_t mft_channels[] = {
};
BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT);
-const struct fan_conf fan_conf_0 = {
- .flags = FAN_USE_RPM_MODE,
- .ch = MFT_CH_0, /* Use MFT id to control fan */
- .pgood_gpio = GPIO_S0_PGOOD,
- .enable_gpio = -1,
-};
-const struct fan_rpm fan_rpm_0 = {
- .rpm_min = 1000,
- .rpm_start = 1000,
- .rpm_max = 6500,
-};
-const struct fan_t fans[] = {
- [FAN_CH_0] = {
- .conf = &fan_conf_0,
- .rpm = &fan_rpm_0,
- },
-};
-BUILD_ASSERT(ARRAY_SIZE(fans) == FAN_CH_COUNT);
-
/*
* USB C0 port SBU mux use standalone FSUSB42UMX
* chip and it needs a board specific driver.
diff --git a/board/dewatt/build.mk b/board/dewatt/build.mk
index e4fdcf4afd..8f2b78ddc8 100644
--- a/board/dewatt/build.mk
+++ b/board/dewatt/build.mk
@@ -9,4 +9,4 @@
BASEBOARD:=guybrush
board-y=board.o
-board-y+=board_fw_config.o led.o battery.o
+board-y+=board_fw_config.o led.o battery.o thermal.o
diff --git a/board/dewatt/thermal.c b/board/dewatt/thermal.c
new file mode 100644
index 0000000000..606d21cfdf
--- /dev/null
+++ b/board/dewatt/thermal.c
@@ -0,0 +1,34 @@
+/* Copyright 2022 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Guybrush board-specific configuration */
+
+#include "console.h"
+#include "fan.h"
+#include "thermal.h"
+#include "util.h"
+
+/* Console output macros */
+#define CPUTS(outstr) cputs(CC_THERMAL, outstr)
+#define CPRINTS(format, args...) cprints(CC_THERMAL, format, ## args)
+
+const struct fan_conf fan_conf_0 = {
+ .flags = FAN_USE_RPM_MODE,
+ .ch = MFT_CH_0, /* Use MFT id to control fan */
+ .pgood_gpio = GPIO_S0_PGOOD,
+ .enable_gpio = -1,
+};
+const struct fan_rpm fan_rpm_0 = {
+ .rpm_min = 1000,
+ .rpm_start = 1000,
+ .rpm_max = 6500,
+};
+const struct fan_t fans[] = {
+ [FAN_CH_0] = {
+ .conf = &fan_conf_0,
+ .rpm = &fan_rpm_0,
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(fans) == FAN_CH_COUNT);
diff --git a/board/guybrush/build.mk b/board/guybrush/build.mk
index 5c8bde1a2b..a7865db889 100644
--- a/board/guybrush/build.mk
+++ b/board/guybrush/build.mk
@@ -9,4 +9,4 @@
BASEBOARD:=guybrush
board-y=board.o
-board-y+=board_fw_config.o led.o battery.o
+board-y+=board_fw_config.o led.o battery.o thermal.o
diff --git a/board/guybrush/thermal.c b/board/guybrush/thermal.c
new file mode 100644
index 0000000000..606d21cfdf
--- /dev/null
+++ b/board/guybrush/thermal.c
@@ -0,0 +1,34 @@
+/* Copyright 2022 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Guybrush board-specific configuration */
+
+#include "console.h"
+#include "fan.h"
+#include "thermal.h"
+#include "util.h"
+
+/* Console output macros */
+#define CPUTS(outstr) cputs(CC_THERMAL, outstr)
+#define CPRINTS(format, args...) cprints(CC_THERMAL, format, ## args)
+
+const struct fan_conf fan_conf_0 = {
+ .flags = FAN_USE_RPM_MODE,
+ .ch = MFT_CH_0, /* Use MFT id to control fan */
+ .pgood_gpio = GPIO_S0_PGOOD,
+ .enable_gpio = -1,
+};
+const struct fan_rpm fan_rpm_0 = {
+ .rpm_min = 1000,
+ .rpm_start = 1000,
+ .rpm_max = 6500,
+};
+const struct fan_t fans[] = {
+ [FAN_CH_0] = {
+ .conf = &fan_conf_0,
+ .rpm = &fan_rpm_0,
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(fans) == FAN_CH_COUNT);
diff --git a/board/nipperkin/thermal.c b/board/nipperkin/thermal.c
index 7266e80b14..3ead6da3e5 100644
--- a/board/nipperkin/thermal.c
+++ b/board/nipperkin/thermal.c
@@ -18,6 +18,25 @@
#define CPUTS(outstr) cputs(CC_THERMAL, outstr)
#define CPRINTS(format, args...) cprints(CC_THERMAL, format, ## args)
+const struct fan_conf fan_conf_0 = {
+ .flags = FAN_USE_RPM_MODE,
+ .ch = MFT_CH_0, /* Use MFT id to control fan */
+ .pgood_gpio = GPIO_S0_PGOOD,
+ .enable_gpio = -1,
+};
+const struct fan_rpm fan_rpm_0 = {
+ .rpm_min = 1000,
+ .rpm_start = 1000,
+ .rpm_max = 6500,
+};
+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 fan_step {
/*
* Sensor 1~4 trigger point, set -1 if we're not using this