diff options
-rw-r--r-- | board/link/board.h | 46 | ||||
-rw-r--r-- | board/link/board_temp_sensor.c | 52 |
2 files changed, 23 insertions, 75 deletions
diff --git a/board/link/board.h b/board/link/board.h index 3dc9ff1b40..6dd4fe7738 100644 --- a/board/link/board.h +++ b/board/link/board.h @@ -193,48 +193,28 @@ enum gpio_signal { }; enum temp_sensor_id { - /* I2C die temperature sensor near CPU */ - TEMP_SENSOR_I2C_DIE_NEAR_CPU = 0, - /* I2C object temperature sensor near CPU */ - TEMP_SENSOR_I2C_CPU, - /* I2C die temperature sensor near PCH */ - TEMP_SENSOR_I2C_DIE_NEAR_PCH, - /* I2C object temperature sensor near PCH */ - TEMP_SENSOR_I2C_PCH, - /* I2C die temperature sensor near DDR memory */ - TEMP_SENSOR_I2C_DIE_NEAR_DDR, - /* I2C object temperature sensor near CPU */ - TEMP_SENSOR_I2C_DDR, - /* I2C die temperature sensor near battery charger */ - TEMP_SENSOR_I2C_DIE_NEAR_CHARGER, - /* I2C object temperature sensor near CPU */ - TEMP_SENSOR_I2C_CHARGER, + /* TMP006 U20, die/object temperature near Mini-DP / USB connectors */ + TEMP_SENSOR_I2C_U20_DIE = 0, + TEMP_SENSOR_I2C_U20_OBJECT, + /* TMP006 U11, die/object temperature near PCH */ + TEMP_SENSOR_I2C_U11_DIE, + TEMP_SENSOR_I2C_U11_OBJECT, + /* TMP006 U27, die/object temperature near hinge */ + TEMP_SENSOR_I2C_U27_DIE, + TEMP_SENSOR_I2C_U27_OBJECT, + /* TMP006 U14, die/object temperature near battery charger */ + TEMP_SENSOR_I2C_U14_DIE, + TEMP_SENSOR_I2C_U14_OBJECT, /* EC internal temperature sensor */ TEMP_SENSOR_EC_INTERNAL, /* CPU die temperature via PECI */ TEMP_SENSOR_CPU_PECI, - /* Die temperature of U15 TMP006 temperature sensor */ - TEMP_SENSOR_I2C_U15_DIE, - /* Object temperature of U15 TMP006 temperature sensor */ - TEMP_SENSOR_I2C_U15_OBJECT, - /* Die temperature of U20 TMP006 temperature sensor */ - TEMP_SENSOR_I2C_U20_DIE, - /* Object temperature of U20 TMP006 temperature sensor */ - TEMP_SENSOR_I2C_U20_OBJECT, - /* Die temperature of U27 TMP006 temperature sensor */ - TEMP_SENSOR_I2C_U27_DIE, - /* Object temperature of U27 TMP006 temperature sensor */ - TEMP_SENSOR_I2C_U27_OBJECT, - /* Die temperature of U29 TMP006 temperature sensor */ - TEMP_SENSOR_I2C_U29_DIE, - /* Object temperature of U29 TMP006 temperature sensor */ - TEMP_SENSOR_I2C_U29_OBJECT, TEMP_SENSOR_COUNT }; /* The number of TMP006 sensor chips on the board. */ -#define TMP006_COUNT 8 +#define TMP006_COUNT 4 /* Target value for BOOTCFG. This is set to PE2/USB1_CTL1, which has an external * pullup. If this signal is pulled to ground when the EC boots, the EC will get diff --git a/board/link/board_temp_sensor.c b/board/link/board_temp_sensor.c index f9c99d8ef9..ee886ef1ec 100644 --- a/board/link/board_temp_sensor.c +++ b/board/link/board_temp_sensor.c @@ -5,48 +5,38 @@ /* Link-specific temp sensor module for Chrome EC */ -#include "temp_sensor.h" #include "chip_temp_sensor.h" -#include "board.h" +#include "config.h" #include "i2c.h" #include "peci.h" +#include "temp_sensor.h" #include "tmp006.h" #include "util.h" -#define TEMP_HEATPIPE_REG_ADDR ((0x40 << 1) | I2C_FLAG_BIG_ENDIAN) #define TEMP_PCH_REG_ADDR ((0x41 << 1) | I2C_FLAG_BIG_ENDIAN) -#define TEMP_MEMORY_REG_ADDR ((0x45 << 1) | I2C_FLAG_BIG_ENDIAN) #define TEMP_CHARGER_REG_ADDR ((0x43 << 1) | I2C_FLAG_BIG_ENDIAN) -#define TEMP_DCJACK_REG_ADDR ((0x47 << 1) | I2C_FLAG_BIG_ENDIAN) #define TEMP_USB_REG_ADDR ((0x46 << 1) | I2C_FLAG_BIG_ENDIAN) #define TEMP_HINGE_REG_ADDR ((0x44 << 1) | I2C_FLAG_BIG_ENDIAN) -#define TEMP_SDCARD_REG_ADDR ((0x42 << 1) | I2C_FLAG_BIG_ENDIAN) -#define TEMP_HEATPIPE_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_HEATPIPE_REG_ADDR) #define TEMP_PCH_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_PCH_REG_ADDR) -#define TEMP_MEMORY_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_MEMORY_REG_ADDR) #define TEMP_CHARGER_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_CHARGER_REG_ADDR) -#define TEMP_DCJACK_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_DCJACK_REG_ADDR) #define TEMP_USB_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_USB_REG_ADDR) #define TEMP_HINGE_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_HINGE_REG_ADDR) -#define TEMP_SDCARD_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_SDCARD_REG_ADDR) -/* Temperature sensors data. Must be in the same order as enum - * temp_sensor_id. - */ +/* Temperature sensors data; must be in same order as enum temp_sensor_id. */ const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = { #ifdef CONFIG_TMP006 - {"I2C-Heat Pipe D-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_BOARD, + {"I2C-USB C-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, tmp006_get_val, 0, 7}, - {"I2C-Heat Pipe D-Object", TEMP_SENSOR_POWER_VS, - TEMP_SENSOR_TYPE_IGNORED, tmp006_get_val, 1, 7}, + {"I2C-USB C-Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, + tmp006_get_val, 1, 7}, {"I2C-PCH D-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_BOARD, tmp006_get_val, 2, 7}, {"I2C-PCH D-Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_CASE, tmp006_get_val, 3, 7}, - {"I2C-Memory D-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_BOARD, + {"I2C-Hinge C-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, tmp006_get_val, 4, 7}, - {"I2C-Memory D-Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_CASE, + {"I2C-Hinge C-Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, tmp006_get_val, 5, 7}, {"I2C-Charger D-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_BOARD, tmp006_get_val, 6, 7}, @@ -61,34 +51,12 @@ const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = { {"PECI", TEMP_SENSOR_POWER_CPU, TEMP_SENSOR_TYPE_CPU, peci_temp_sensor_get_val, 0, 2}, #endif -#ifdef CONFIG_TMP006 - {"I2C-DCJack C-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, - tmp006_get_val, 8, 7}, - {"I2C-DCJack C-Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, - tmp006_get_val, 9, 7}, - {"I2C-USB C-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, - tmp006_get_val, 10, 7}, - {"I2C-USB C-Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, - tmp006_get_val, 11, 7}, - {"I2C-Hinge C-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, - tmp006_get_val, 12, 7}, - {"I2C-Hinge C-Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, - tmp006_get_val, 13, 7}, - {"I2C-SDCard D-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, - tmp006_get_val, 14, 7}, - {"I2C-SDCard D-Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_IGNORED, - tmp006_get_val, 15, 7}, -#endif }; const struct tmp006_t tmp006_sensors[TMP006_COUNT] = { /* TODO: Calibrate sensitivity factors. See crosbug.com/p/9599 */ - {"Heat pipe D", TEMP_HEATPIPE_ADDR, 2771}, - {"PCH D", TEMP_PCH_ADDR, 9301}, - {"Memory D", TEMP_MEMORY_ADDR, 3790}, - {"Charger D", TEMP_CHARGER_ADDR, 10426}, - {"DCJack C", TEMP_DCJACK_ADDR, 6400}, {"USB C", TEMP_USB_ADDR, 3648}, + {"PCH D", TEMP_PCH_ADDR, 9301}, {"Hinge C", TEMP_HINGE_ADDR, -2713}, - {"SD Card D", TEMP_SDCARD_ADDR, 4577}, + {"Charger D", TEMP_CHARGER_ADDR, 10426}, }; |