poppy: Add ARC++ sensor support.

Very similar to CL:424846, enable sensor FIFO, accel interrupt.

BUG=chrome-os-partner:61098
TEST=Not test on actual hardware.
BRANCH=none

Change-Id: Ie5c7304fcc00919cce62ed47a548104e8d0ac454
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/426880
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
This commit is contained in:
Gwendal Grignou
2017-01-10 16:34:47 -08:00
committed by chrome-bot
parent 49dff5b7c5
commit dabc580d7e
3 changed files with 12 additions and 11 deletions

View File

@@ -91,20 +91,19 @@
/* TODO(crosbug.com/p/61098): Is this the correct thermistor? */
#define CONFIG_THERMISTOR_NCP15WB
#define CONFIG_MKBP_EVENT
#define CONFIG_MKBP_USE_HOST_EVENT
#define CONFIG_ACCELGYRO_BMI160
#define CONFIG_MAG_BMI160_BMM150
#define CONFIG_ACCEL_INTERRUPTS
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT TASK_EVENT_CUSTOM(4)
#define BMM150_I2C_ADDRESS BMM150_ADDR0 /* 8-bit address */
#define CONFIG_MAG_CALIBRATE
#define CONFIG_BARO_BMP280
/* FIFO size is in power of 2. */
/*
* TODO(crosbug.com/p/61098): Uncomment this when AP is reading sensor
* data. For now, it's commented so that the data can be read from the EC
* console.
*/
/*#define CONFIG_ACCEL_FIFO 1024*/
#define CONFIG_ACCEL_FIFO 1024
/* Depends on how fast the AP boots and typical ODRs */
#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3)
@@ -242,6 +241,9 @@ void board_reset_pd_mcu(void);
void board_set_tcpc_power_mode(int port, int mode);
void board_print_tcpc_fw_version(int port);
/* Sensors without hardware FIFO are in forced mode */
#define CONFIG_ACCEL_FORCE_MODE_MASK (1 << LID_BARO)
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */

View File

@@ -23,10 +23,10 @@
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(ALS, als_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(USB_CHG_P0, usb_charger_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(USB_CHG_P1, usb_charger_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(USB_CHG_P0, usb_charger_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(USB_CHG_P1, usb_charger_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(CHARGER, charger_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_NOTEST(MOTIONSENSE, motion_sense_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_ALWAYS(MOTIONSENSE, motion_sense_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_NOTEST(CHIPSET, chipset_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_NOTEST(PDCMD, pd_command_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \

View File

@@ -27,6 +27,7 @@ GPIO_INT(WP_L, PIN(4, 0), GPIO_INT_BOTH, switch_interrupt)
GPIO_INT(AC_PRESENT, PIN(C, 1), GPIO_INT_BOTH, extpower_interrupt)
GPIO_INT(USB_C0_BC12_INT_L, PIN(D, 3), GPIO_INT_FALLING, usb0_evt)
GPIO_INT(USB_C1_BC12_INT_L, PIN(3, 3), GPIO_INT_FALLING, usb1_evt)
GPIO_INT(ACCELGYRO3_INT_L, PIN(3, 0), GPIO_INT_FALLING, bmi160_interrupt)
GPIO(PCH_RTCRST, PIN(E, 7), GPIO_OUT_LOW) /* RTCRST# to SOC */
GPIO(ENABLE_BACKLIGHT, PIN(2, 6), GPIO_OUT_LOW) /* Enable Backlight */
@@ -47,8 +48,6 @@ GPIO(ENTERING_RW, PIN(7, 6), GPIO_OUTPUT) /* EC Entering RW */
GPIO(PMIC_INT_L, PIN(6, 0), GPIO_INPUT) /* PMIC interrupt */
/* Sensor interrupts, not implemented yet */
/* TODO(crosbug.com/p/61098): Implement */
GPIO(ACCELGYRO3_INT_L, PIN(3, 6), GPIO_INPUT)
GPIO(ALS_INT_L, PIN(2, 5), GPIO_INPUT)
GPIO(FP_INT_L, PIN(5, 6), GPIO_INPUT)