summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael5 Chen <michael5_chen1@pegatron.corp-partner.google.com>2020-06-30 13:41:47 +0800
committerCommit Bot <commit-bot@chromium.org>2020-07-01 06:16:50 +0000
commitd02c309ae3c1d727c05d004aa62bdc702bef20f8 (patch)
treebf9552747757ace90392281e8205466455e3b428
parent5e62b34f19a0d8a93d82990e7327491ca4ee6a1d (diff)
downloadchrome-ec-d02c309ae3c1d727c05d004aa62bdc702bef20f8.tar.gz
woomax: Initial power signals, ADC and temperature sensors configuration.
Initial power signals, ADC and temperature sensors configuration. BUG=b:158692530 BRANCH=master TEST=manual 1. System bring-up. 2. EC console command "adc". 3. EC console command "temps". Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I7e43af47a8477d43191c7678ed98cab147aedbb9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2275706 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--board/woomax/board.c59
-rw-r--r--board/woomax/gpio.inc2
2 files changed, 57 insertions, 4 deletions
diff --git a/board/woomax/board.c b/board/woomax/board.c
index e142b4fe1c..16b9bd38e4 100644
--- a/board/woomax/board.c
+++ b/board/woomax/board.c
@@ -14,6 +14,7 @@
#include "driver/accel_kx022.h"
#include "driver/retimer/pi3dpx1207.h"
#include "driver/retimer/ps8811.h"
+#include "driver/temp_sensor/sb_tsi.h"
#include "driver/usb_mux/amd_fp5.h"
#include "extpower.h"
#include "fan.h"
@@ -128,8 +129,28 @@ unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
#endif /* HAS_TASK_MOTIONSENSE */
const struct power_signal_info power_signal_list[] = {
+ [X86_SLP_S3_N] = {
+ .gpio = GPIO_PCH_SLP_S3_L,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH,
+ .name = "SLP_S3_DEASSERTED",
+ },
+ [X86_SLP_S5_N] = {
+ .gpio = GPIO_PCH_SLP_S5_L,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH,
+ .name = "SLP_S5_DEASSERTED",
+ },
+ [X86_S0_PGOOD] = {
+ .gpio = GPIO_S0_PGOOD,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH,
+ .name = "S0_PGOOD",
+ },
+ [X86_S5_PGOOD] = {
+ .gpio = GPIO_S5_PGOOD,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH,
+ .name = "S5_PGOOD",
+ },
};
-/* BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); */
+BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
const struct pwm_t pwm_channels[] = {
[PWM_CH_KBLIGHT] = {
@@ -349,12 +370,44 @@ const struct fan_t fans[] = {
BUILD_ASSERT(ARRAY_SIZE(fans) == FAN_CH_COUNT);
const struct adc_t adc_channels[] = {
+ [ADC_TEMP_SENSOR_CHARGER] = {
+ .name = "CHARGER",
+ .input_ch = NPCX_ADC_CH2,
+ .factor_mul = ADC_MAX_VOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ },
+ [ADC_TEMP_SENSOR_SOC] = {
+ .name = "SOC",
+ .input_ch = NPCX_ADC_CH3,
+ .factor_mul = ADC_MAX_VOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ },
};
-/* BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); */
+BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
const struct temp_sensor_t temp_sensors[] = {
+ [TEMP_SENSOR_CHARGER] = {
+ .name = "Charger",
+ .type = TEMP_SENSOR_TYPE_BOARD,
+ .read = board_get_temp,
+ .idx = TEMP_SENSOR_CHARGER,
+ },
+ [TEMP_SENSOR_SOC] = {
+ .name = "SOC",
+ .type = TEMP_SENSOR_TYPE_BOARD,
+ .read = board_get_temp,
+ .idx = TEMP_SENSOR_SOC,
+ },
+ [TEMP_SENSOR_CPU] = {
+ .name = "CPU",
+ .type = TEMP_SENSOR_TYPE_CPU,
+ .read = sb_tsi_get_val,
+ .idx = 0,
+ },
};
-/* BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); */
+BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
const static struct ec_thermal_config thermal_thermistor = {
.temp_host = {
diff --git a/board/woomax/gpio.inc b/board/woomax/gpio.inc
index a6d0b266fa..973b999a79 100644
--- a/board/woomax/gpio.inc
+++ b/board/woomax/gpio.inc
@@ -29,7 +29,7 @@ GPIO_INT(6AXIS_INT_L, PIN(A, 0), GPIO_INT_FALLING | GPIO_PULL_UP, bmi160_interr
/* GPIO_INT_BOTH is required for PSL wake from hibernate, but we don't need an interrupt handler. */
GPIO(EC_RST_ODL, PIN(0, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH)
-GPIO(3AXIS_INT_L, PIN(9, 6), GPIO_INPUT | GPIO_PULL_UP) /* 3 Axis Accel */
+GPIO(3AXIS_INT_L, PIN(9, 6), GPIO_INPUT | GPIO_PULL_DOWN) /* 3 Axis Accel */
GPIO(CCD_MODE_ODL, PIN(C, 6), GPIO_INPUT) /* Case Closed Debug Mode */
GPIO(PROCHOT_ODL, PIN(D, 5), GPIO_ODR_HIGH) /* PROCHOT to SOC */
GPIO(EC_BATT_PRES_ODL, PIN(4, 1), GPIO_INPUT) /* Battery Present */