diff options
-rw-r--r-- | board/strago/board.c | 29 | ||||
-rw-r--r-- | board/strago/board.h | 11 |
2 files changed, 40 insertions, 0 deletions
diff --git a/board/strago/board.c b/board/strago/board.c index bfd574d5cf..586eac8552 100644 --- a/board/strago/board.c +++ b/board/strago/board.c @@ -4,6 +4,7 @@ */ /* Strago board-specific configuration */ +#include "driver/temp_sensor/tmp432.h" #include "extpower.h" #include "gpio.h" #include "i2c.h" @@ -11,6 +12,9 @@ #include "power.h" #include "power_button.h" #include "registers.h" +#include "temp_sensor.h" +#include "temp_sensor_chip.h" +#include "thermal.h" #include "util.h" #define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP) @@ -35,3 +39,28 @@ const struct i2c_port_t i2c_ports[] = { {"thermal", 3, 100} }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); + +/* + * Temperature sensors data; must be in same order as enum temp_sensor_id. + * Sensor index and name must match those present in coreboot: + * src/mainboard/google/${board}/acpi/dptf.asl + */ +const struct temp_sensor_t temp_sensors[] = { + {"TMP432_Internal", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val, + TMP432_IDX_LOCAL, 4}, + {"TMP432_Sensor_1", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val, + TMP432_IDX_REMOTE1, 4}, + {"TMP432_Sensor_2", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val, + TMP432_IDX_REMOTE2, 4}, +}; +BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); + +/* Thermal limits for each temp sensor. All temps are in degrees K. Must be in + * same order as enum temp_sensor_id. To always ignore any temp, use 0. + */ +struct ec_thermal_config thermal_params[] = { + {{0, 0, 0}, 0, 0}, /* TMP432_Internal */ + {{0, 0, 0}, 0, 0}, /* TMP432_Sensor_1 */ + {{0, 0, 0}, 0, 0}, /* TMP432_Sensor_2 */ +}; +BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); diff --git a/board/strago/board.h b/board/strago/board.h index edfca0a6dd..4a46c8745c 100644 --- a/board/strago/board.h +++ b/board/strago/board.h @@ -31,6 +31,9 @@ #define CONFIG_SPI_FLASH_SIZE 524288 #define CONFIG_SPI_FLASH_W25Q64 +#define CONFIG_TEMP_SENSOR +#define CONFIG_TEMP_SENSOR_TMP432 + #define CONFIG_I2C /* I2C ports */ @@ -66,6 +69,14 @@ enum power_signal { POWER_SIGNAL_COUNT }; +enum temp_sensor_id { + /* TMP432 local and remote sensors */ + TEMP_SENSOR_I2C_TMP432_LOCAL, + TEMP_SENSOR_I2C_TMP432_REMOTE1, + TEMP_SENSOR_I2C_TMP432_REMOTE2, + + TEMP_SENSOR_COUNT +}; #endif /* !__ASSEMBLER__ */ #endif /* __BOARD_H */ |