summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2017-01-10 16:34:47 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-11 14:46:17 -0800
commitdabc580d7e421e5bb3eb115b72d75dffa268604d (patch)
tree85b14bc786c80bc829b008e9e79e3f2df4198d3b
parent49dff5b7c5521b1c35ce240520cf13200e6f08a4 (diff)
downloadchrome-ec-dabc580d7e421e5bb3eb115b72d75dffa268604d.tar.gz
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>
-rw-r--r--board/poppy/board.h14
-rw-r--r--board/poppy/ec.tasklist6
-rw-r--r--board/poppy/gpio.inc3
3 files changed, 12 insertions, 11 deletions
diff --git a/board/poppy/board.h b/board/poppy/board.h
index d7e4c3f19e..599695d6b4 100644
--- a/board/poppy/board.h
+++ b/board/poppy/board.h
@@ -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 */
diff --git a/board/poppy/ec.tasklist b/board/poppy/ec.tasklist
index 27c3eadea7..376ac1965e 100644
--- a/board/poppy/ec.tasklist
+++ b/board/poppy/ec.tasklist
@@ -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) \
diff --git a/board/poppy/gpio.inc b/board/poppy/gpio.inc
index e3d3ef4271..5b1919e752 100644
--- a/board/poppy/gpio.inc
+++ b/board/poppy/gpio.inc
@@ -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)