diff options
author | Rob Barnes <robbarnes@google.com> | 2021-05-19 14:39:05 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-24 20:41:58 +0000 |
commit | a8b87b8e128292db37e53a412742fd2532f14292 (patch) | |
tree | a641a5b3fa7f0f1f2cc2863a356c8533d31a58a6 | |
parent | d4d9349c1198f831d45199209827e91fd21a8d01 (diff) | |
download | chrome-ec-a8b87b8e128292db37e53a412742fd2532f14292.tar.gz |
guybrush: Disable SOC_TEMP for board_version > 1
SOC_TEMP is being replaced with i2c temp sensor in board version 2.
Disable SOC_TEMP so it doesn't cause thermal trips on board version 2.
Move board_get_soc_temp to board level since variants will not need
this logic.
BUG=b:188540408
TEST=Boot guybrush, see SOC temp is correct
BRANCH=None
Signed-off-by: Rob Barnes <robbarnes@google.com>
Change-Id: I8880b74993d0a942894f1c06346c534d1f39466d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2906314
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | baseboard/guybrush/baseboard.c | 9 | ||||
-rw-r--r-- | baseboard/guybrush/baseboard.h | 2 | ||||
-rw-r--r-- | board/guybrush/board.c | 19 |
3 files changed, 22 insertions, 8 deletions
diff --git a/baseboard/guybrush/baseboard.c b/baseboard/guybrush/baseboard.c index 4a370143b7..2cf2da3051 100644 --- a/baseboard/guybrush/baseboard.c +++ b/baseboard/guybrush/baseboard.c @@ -189,7 +189,7 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); /* Temp Sensors */ static int board_get_memory_temp(int, int *); -static int board_get_soc_temp(int, int *); + const struct temp_sensor_t temp_sensors[] = { [TEMP_SENSOR_SOC] = { .name = "SOC", @@ -755,13 +755,6 @@ static int board_get_memory_temp(int idx, int *temp_k) return get_temp_3v3_30k9_47k_4050b(idx, temp_k); } -static int board_get_soc_temp(int idx, int *temp_k) -{ - if (chipset_in_state(CHIPSET_STATE_HARD_OFF)) - return EC_ERROR_NOT_POWERED; - return get_temp_3v3_30k9_47k_4050b(idx, temp_k); -} - /** * Return if VBUS is sagging too low */ diff --git a/baseboard/guybrush/baseboard.h b/baseboard/guybrush/baseboard.h index 84a65e8508..20c298126a 100644 --- a/baseboard/guybrush/baseboard.h +++ b/baseboard/guybrush/baseboard.h @@ -348,6 +348,8 @@ void sbu_fault_interrupt(enum ioex_signal signal); void baseboard_en_pwr_pcore_s0(enum gpio_signal signal); void baseboard_en_pwr_s0(enum gpio_signal signal); +int board_get_soc_temp(int idx, int *temp_k); + /* CBI utility functions */ uint32_t get_sku_id(void); uint32_t get_board_version(void); diff --git a/board/guybrush/board.c b/board/guybrush/board.c index 75ffa3d183..1a7a169ac1 100644 --- a/board/guybrush/board.c +++ b/board/guybrush/board.c @@ -18,6 +18,7 @@ #include "power_button.h" #include "switch.h" #include "tablet_mode.h" +#include "temp_sensor/thermistor.h" #include "usb_mux.h" #include "gpio_list.h" /* Must come after other header files. */ @@ -188,3 +189,21 @@ void motion_interrupt(enum gpio_signal signal) break; } } + +int board_get_soc_temp(int idx, int *temp_k) +{ + uint32_t board_version = get_board_version(); + + if (chipset_in_state(CHIPSET_STATE_HARD_OFF)) + return EC_ERROR_NOT_POWERED; + + if (board_version == 1) + return get_temp_3v3_30k9_47k_4050b(idx, temp_k); + /* + * b/188539950: Read SOC temp from i2c temp sensor. + * + * For now just return 0 so no thermal events are triggered. + */ + *temp_k = 0; + return EC_SUCCESS; +} |