diff options
author | Mary Ruthven <mruthven@chromium.org> | 2016-06-27 15:42:02 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2016-06-29 18:51:49 +0000 |
commit | 01e6d4ba8b958af32ee6e879159ab4c660a2b680 (patch) | |
tree | 7513577b0034b2b86b369ecb377b27fe5d5652f8 | |
parent | cc2a9711fe6e6307322a5b8393dd65f501b58f5f (diff) | |
download | chrome-ec-01e6d4ba8b958af32ee6e879159ab4c660a2b680.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=lucid
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>
(cherry picked from commit 7f67d27a53d521ecb430ec48758020e046c72f43)
Reviewed-on: https://chromium-review.googlesource.com/357120
-rw-r--r-- | board/auron/board.h | 1 | ||||
-rw-r--r-- | board/chell/board.h | 1 | ||||
-rw-r--r-- | board/glados/board.h | 1 | ||||
-rw-r--r-- | board/kunimitsu/board.h | 1 | ||||
-rw-r--r-- | board/lars/board.h | 1 | ||||
-rw-r--r-- | board/oak/board.h | 1 | ||||
-rw-r--r-- | board/rambi/board.h | 1 | ||||
-rw-r--r-- | board/samus/board.h | 1 | ||||
-rw-r--r-- | board/strago/board.h | 1 | ||||
-rw-r--r-- | board/wheatley/board.h | 1 | ||||
-rw-r--r-- | common/build.mk | 3 | ||||
-rw-r--r-- | include/config.h | 12 | ||||
-rw-r--r-- | test/test_config.h | 1 |
13 files changed, 25 insertions, 1 deletions
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 b28e720bdb..6bbb4a9539 100644 --- a/board/chell/board.h +++ b/board/chell/board.h @@ -93,6 +93,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/glados/board.h b/board/glados/board.h index c1891cb0d9..70390942e5 100644 --- a/board/glados/board.h +++ b/board/glados/board.h @@ -98,6 +98,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/kunimitsu/board.h b/board/kunimitsu/board.h index 126ce385e9..966f2dc947 100644 --- a/board/kunimitsu/board.h +++ b/board/kunimitsu/board.h @@ -105,6 +105,7 @@ #define CONFIG_TEMP_SENSOR #define CONFIG_TEMP_SENSOR_TMP432 +#define CONFIG_THROTTLE_AP /* * Enable 1 slot of secure temporary storage to support diff --git a/board/lars/board.h b/board/lars/board.h index 04b4f7b74f..7025d383ef 100644 --- a/board/lars/board.h +++ b/board/lars/board.h @@ -108,6 +108,7 @@ #define CONFIG_TEMP_SENSOR #define CONFIG_TEMP_SENSOR_TMP432 +#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 82ee7291ac..36ffd89d12 100644 --- a/board/oak/board.h +++ b/board/oak/board.h @@ -112,6 +112,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 76ba1691f2..5853d76aae 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/samus/board.h b/board/samus/board.h index a9221f2de9..878ca35cbc 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 77f26afdb3..63070b163d 100644 --- a/board/strago/board.h +++ b/board/strago/board.h @@ -55,6 +55,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 a98aae6b3c..934c2d1a49 100644 --- a/board/wheatley/board.h +++ b/board/wheatley/board.h @@ -95,6 +95,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 4995cfe6e8..d2f610594f 100644 --- a/common/build.mk +++ b/common/build.mk @@ -78,7 +78,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 196990ac05..0e029e9b44 100644 --- a/include/config.h +++ b/include/config.h @@ -1685,6 +1685,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 */ @@ -2101,6 +2104,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 d7e4b7b172..6fbd22a31e 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); |