summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2017-01-05 09:46:34 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-09 23:47:13 -0800
commita61ef28c1506d037b290ad49c7efd6d2f775044a (patch)
tree3f14cae77fdd534f9a57eae38ef5ea45f5845e96
parent618b127c4903a171731730b4b53472f8c645e543 (diff)
downloadchrome-ec-a61ef28c1506d037b290ad49c7efd6d2f775044a.tar.gz
eve: Enable Sensor FIFO
Enable to FIFO to allow ARC++ sensor support and sensor tests. BUG=chrome-os-partner:59144 BRANCH=eve TEST=On an eve machine, check the ring sensor is receiving data: cd /sys/bus/iio/devices/iio:device0 # cros-ec-ring for i in scan_elements/*_en ; do echo 1 > $i ;done echo 1024 > buffer/length echo 1 > buffer/enable cd /sys/bus/iio/devices/iio:device1 # cros-ec-accel echo 1000 > sampling_frequency # 1s echo 25000 > frequency # 25Hz Check we are receiving data with: od -x /dev/iio\:device0& ... 0031560 0001 0400 ff5e c072 7719 873e 002a 0000 0031600 0001 03e1 ff61 c0be 983e 8995 002a 0000 0031620 0001 03ea ff50 c095 b963 8bec 002a 0000 0031640 0001 03fb ff5c c0c8 da88 8e43 002a 0000 0031660 0001 03ed ff63 c0b0 fbad 909a 002a 0000 ... Change-Id: I0401df4233f4fa1514dfa6d368ba463dcc705895 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/424846
-rw-r--r--board/eve/board.h14
-rw-r--r--board/eve/gpio.inc2
2 files changed, 9 insertions, 7 deletions
diff --git a/board/eve/board.h b/board/eve/board.h
index d5b93ae0ca..5e6e57a546 100644
--- a/board/eve/board.h
+++ b/board/eve/board.h
@@ -93,6 +93,8 @@
#define CONFIG_POWER_SIGNAL_INTERRUPT_STORM_DETECT_THRESHOLD 30
/* Sensor */
+#define CONFIG_MKBP_EVENT
+#define CONFIG_MKBP_USE_HOST_EVENT
#define CONFIG_ACCEL_KXCJ9
#define CONFIG_ALS_ISL29035
#define CONFIG_TEMP_SENSOR
@@ -101,16 +103,13 @@
#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
/* FIFO size is in power of 2. */
-/*
- * TODO (crosbug.com/p/59144): 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)
@@ -248,6 +247,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_ACCEL)
+
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/eve/gpio.inc b/board/eve/gpio.inc
index ffa47a85a1..f631d2c288 100644
--- a/board/eve/gpio.inc
+++ b/board/eve/gpio.inc
@@ -22,6 +22,7 @@ GPIO_INT(VOLUME_DOWN_L, PIN(8, 3), GPIO_INT_BOTH | GPIO_PULL_UP, button_interru
GPIO_INT(VOLUME_UP_L, PIN(8, 2), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt)
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(ACCELGYRO3_INT_L, PIN(9, 3), GPIO_INT_FALLING, bmi160_interrupt)
GPIO(PCH_RTCRST, PIN(E, 7), GPIO_OUT_LOW) /* RTCRST# to SOC */
GPIO(ENABLE_BACKLIGHT, PIN(5, 6), GPIO_OUT_LOW) /* Enable Backlight */
@@ -44,7 +45,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 */
-GPIO(ACCELGYRO3_INT_L, PIN(9, 3), GPIO_INPUT)
GPIO(ACCEL1_INT_L, PIN(C, 7), GPIO_INPUT)
/* I2C pins - these will be reconfigured for alternate function below */