summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2016-06-27 15:42:02 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-06-28 11:34:15 -0700
commit7f67d27a53d521ecb430ec48758020e046c72f43 (patch)
tree7e115d97886f738704161db0956fd933a7226a73
parent9dc2c1471c44a314dfe6dcc48e1527c4315ebf09 (diff)
downloadchrome-ec-7f67d27a53d521ecb430ec48758020e046c72f43.tar.gz
common: Decouple temp sensor from thermal throttling
Not everything with a temperature sensor uses thermal throttling. This change modifies the conditional build to enable building temp sensor source without thermal throttling. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I8c0753f12899e9f203c04477ae520bcda40d5fd8 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/356484 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/amenia/board.h1
-rw-r--r--board/auron/board.h1
-rw-r--r--board/chell/board.h1
-rw-r--r--board/elm/board.h1
-rw-r--r--board/glados/board.h1
-rw-r--r--board/oak/board.h1
-rw-r--r--board/rambi/board.h1
-rw-r--r--board/reef/board.h1
-rw-r--r--board/samus/board.h1
-rw-r--r--board/strago/board.h1
-rw-r--r--board/wheatley/board.h1
-rw-r--r--common/build.mk3
-rw-r--r--include/config.h12
-rw-r--r--test/test_config.h1
14 files changed, 26 insertions, 1 deletions
diff --git a/board/amenia/board.h b/board/amenia/board.h
index e111a83f4d..d2a916c90b 100644
--- a/board/amenia/board.h
+++ b/board/amenia/board.h
@@ -114,6 +114,7 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_G782
+#define CONFIG_THROTTLE_AP
/* Optional feature - used by nuvoton */
#define NPCX_I2C0_BUS2 0 /* 0:GPIOB4/B5 1:GPIOB2/B3 as I2C0 */
diff --git a/board/auron/board.h b/board/auron/board.h
index fbe1c4d1e8..9cf1d59de3 100644
--- a/board/auron/board.h
+++ b/board/auron/board.h
@@ -40,6 +40,7 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_G781
#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_PP3300_DX_EN
+#define CONFIG_THROTTLE_AP
#define CONFIG_UART_HOST 2
#define CONFIG_USB_PORT_POWER_DUMB
#define CONFIG_VBOOT_HASH
diff --git a/board/chell/board.h b/board/chell/board.h
index bfcd96abe2..66dae6e66f 100644
--- a/board/chell/board.h
+++ b/board/chell/board.h
@@ -96,6 +96,7 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_BD99992GW
#define CONFIG_THERMISTOR_NCP15WB
+#define CONFIG_THROTTLE_AP
/*
* Enable 1 slot of secure temporary storage to support
diff --git a/board/elm/board.h b/board/elm/board.h
index 7ba5a5c443..1edd4bcc60 100644
--- a/board/elm/board.h
+++ b/board/elm/board.h
@@ -75,6 +75,7 @@
#undef CONFIG_UART_CONSOLE
#define CONFIG_UART_CONSOLE 1
#define CONFIG_TEMP_SENSOR
+#define CONFIG_THROTTLE_AP
/* Type-C */
#define CONFIG_USBC_SS_MUX
diff --git a/board/glados/board.h b/board/glados/board.h
index 498fd45a04..c28ae699f7 100644
--- a/board/glados/board.h
+++ b/board/glados/board.h
@@ -99,6 +99,7 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_BD99992GW
#define CONFIG_THERMISTOR_NCP15WB
+#define CONFIG_THROTTLE_AP
/*
* Enable 1 slot of secure temporary storage to support
diff --git a/board/oak/board.h b/board/oak/board.h
index dfc154f3cb..1377faae66 100644
--- a/board/oak/board.h
+++ b/board/oak/board.h
@@ -114,6 +114,7 @@
#define CONFIG_UART_CONSOLE 1
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_TMP432
+#define CONFIG_THROTTLE_AP
/* UART DMA */
#undef CONFIG_UART_TX_DMA
diff --git a/board/rambi/board.h b/board/rambi/board.h
index 6a7a4be26d..430aedcbcb 100644
--- a/board/rambi/board.h
+++ b/board/rambi/board.h
@@ -42,6 +42,7 @@
#define CONFIG_SCI_GPIO GPIO_PCH_SCI_L
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_TMP432
+#define CONFIG_THROTTLE_AP
#define CONFIG_USB_PORT_POWER_IN_S3
#define CONFIG_USB_PORT_POWER_SMART
#define CONFIG_USB_PORT_POWER_SMART_SIMPLE
diff --git a/board/reef/board.h b/board/reef/board.h
index 9d6d99a0b4..88ef79d411 100644
--- a/board/reef/board.h
+++ b/board/reef/board.h
@@ -89,6 +89,7 @@
#define CONFIG_POWER_SIGNAL_INTERRUPT_STORM_DETECT_THRESHOLD 30
#define CONFIG_PWM
/* #define CONFIG_TEMP_SENSOR */
+/* #define CONFIG_THROTTLE_AP */
#define CONFIG_SCI_GPIO GPIO_PCH_SCI_L
#define CONFIG_UART_HOST 0
#define CONFIG_VBOOT_HASH
diff --git a/board/samus/board.h b/board/samus/board.h
index 09d8987ca3..9ed424b894 100644
--- a/board/samus/board.h
+++ b/board/samus/board.h
@@ -76,6 +76,7 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_TMP006
#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_PP3300_DSW_GATED_EN
+#define CONFIG_THROTTLE_AP
#define CONFIG_UART_HOST 2
#define CONFIG_USB_PORT_POWER_SMART
#define CONFIG_USB_PORT_POWER_SMART_DEFAULT_MODE USB_CHARGE_MODE_CDP
diff --git a/board/strago/board.h b/board/strago/board.h
index bcaab82188..2c5c79b80b 100644
--- a/board/strago/board.h
+++ b/board/strago/board.h
@@ -60,6 +60,7 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_TMP432
+#define CONFIG_THROTTLE_AP
#define CONFIG_PMIC
diff --git a/board/wheatley/board.h b/board/wheatley/board.h
index 7ef5f22fcd..abfe416a13 100644
--- a/board/wheatley/board.h
+++ b/board/wheatley/board.h
@@ -96,6 +96,7 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_BD99992GW
#define CONFIG_THERMISTOR_NCP15WB
+#define CONFIG_THROTTLE_AP
/* Optional feature - used by nuvoton */
#define NPCX_I2C0_BUS2 0 /* 0:GPIOB4/B5 1:GPIOB2/B3 as I2C0 */
diff --git a/common/build.mk b/common/build.mk
index 54696f4ef9..da386b85ab 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -81,7 +81,8 @@ common-$(CONFIG_SPI_FLASH)+=spi_flash.o spi_flash_reg.o
common-$(CONFIG_SPI_NOR)+=spi_nor.o
common-$(CONFIG_SWITCH)+=switch.o
common-$(CONFIG_SW_CRC)+=crc.o
-common-$(CONFIG_TEMP_SENSOR)+=temp_sensor.o thermal.o throttle_ap.o
+common-$(CONFIG_TEMP_SENSOR)+=temp_sensor.o
+common-$(CONFIG_THROTTLE_AP)+=thermal.o throttle_ap.o
common-$(CONFIG_TPM_SPS)+=tpm_registers.o
common-$(CONFIG_USB_CHARGER)+=usb_charger.o
common-$(CONFIG_USB_PORT_POWER_DUMB)+=usb_port_power_dumb.o
diff --git a/include/config.h b/include/config.h
index 5ffd9f84e7..701536a864 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1730,6 +1730,9 @@
*/
#undef CONFIG_TEMP_SENSOR_POWER_GPIO
+/* Compile common code for throttling the CPU based on the temp sensors */
+#undef CONFIG_THROTTLE_AP
+
/*****************************************************************************/
/* TPM-like configuration */
@@ -2195,6 +2198,15 @@
#define CONFIG_CRC8
#endif /* defined(CONFIG_EXPERIMENTAL_CONSOLE) */
+/******************************************************************************/
+/*
+ * Throttle AP must have temperature sensor enabled to get the readings for
+ * thermal throttling.
+ */
+#if defined(CONFIG_THROTTLE_AP) && !defined(CONFIG_TEMP_SENSOR)
+#define CONFIG_TEMP_SENSOR
+#endif
+
/*****************************************************************************/
/*
* Handle task-dependent configs.
diff --git a/test/test_config.h b/test/test_config.h
index 5b21c8f61c..7e0a9d073d 100644
--- a/test/test_config.h
+++ b/test/test_config.h
@@ -87,6 +87,7 @@ int board_discharge_on_ac(int enabled);
#define CONFIG_I2C
#define CONFIG_I2C_MASTER
#define CONFIG_TEMP_SENSOR
+#define CONFIG_THROTTLE_AP
#define CONFIG_THERMISTOR_NCP15WB
#define I2C_PORT_THERMAL 0
int ncp15wb_calculate_temp(uint16_t adc);