summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2018-07-17 17:37:42 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-07-18 06:18:12 -0700
commit1107089c5b7bb5282224c3c498d514ae31c5dc87 (patch)
treea1aff2ced3bec9f6d95a3e7b5745cacf2c063eb6
parentfa41f632226147183fb7a45e13b4a21b3b6b3b94 (diff)
downloadchrome-ec-1107089c5b7bb5282224c3c498d514ae31c5dc87.tar.gz
kukui: Disable vsync, motion sensor in RO.
Kukui's RO flash size (stm32f098VC) is 124KB, and the current EC RO consumes 104616 bytes (102.1KB), besides, the compressed AP FW bootblock takes 25088 bytes (24.5KB). The total size of EC RO and AP FW Bootblock (126.6KB) already exceeds the size limit. Here, we disable vsync and motion sensor in EC RO, and this decrease the EC RO to 92736 byte (90.5KB), saving around 11 KB. TEST=make BOARD=kukui -j BUG=b:80159522 BRANCH=None Change-Id: I7846714c888d95b8dbfd22b475972ecc47c28606 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1141451 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--board/kukui/board.c4
-rw-r--r--board/kukui/board.h2
-rw-r--r--board/kukui/ec.tasklist2
-rw-r--r--board/kukui/gpio.inc2
4 files changed, 9 insertions, 1 deletions
diff --git a/board/kukui/board.c b/board/kukui/board.c
index 48bb590dad..1906226cb0 100644
--- a/board/kukui/board.c
+++ b/board/kukui/board.c
@@ -224,11 +224,13 @@ static void board_init(void)
gpio_enable_interrupt(GPIO_AP_EC_WATCHDOG_L);
gpio_enable_interrupt(GPIO_AP_IN_SLEEP_L);
+#ifdef SECTION_IS_RW
/* Enable interrupts from BMI160 sensor. */
gpio_enable_interrupt(GPIO_ACCEL_INT_ODL);
/* Enable interrupt for the camera vsync. */
gpio_enable_interrupt(GPIO_SYNC_INT);
+#endif /* SECTION_IS_RW */
/* Enable interrupt from PMIC. */
gpio_enable_interrupt(GPIO_PMIC_EC_RESETB);
@@ -331,6 +333,7 @@ int board_get_version(void)
/* Motion sensors */
/* Mutexes */
+#ifdef SECTION_IS_RW
static struct mutex g_base_mutex;
static struct bmi160_drv_data_t g_bmi160_data;
@@ -400,6 +403,7 @@ struct motion_sensor_t motion_sensors[] = {
},
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
+#endif /* SECTION_IS_RW */
int board_allow_i2c_passthru(int port)
{
diff --git a/board/kukui/board.h b/board/kukui/board.h
index 9f2c46fbe5..541eb234b4 100644
--- a/board/kukui/board.h
+++ b/board/kukui/board.h
@@ -88,6 +88,7 @@
#define CONFIG_UART_TX_BUF_SIZE 4096
/* Motion Sensors */
+#ifdef SECTION_IS_RW
#define CONFIG_ACCELGYRO_BMI160
#define CONFIG_ACCEL_INTERRUPTS
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT TASK_EVENT_CUSTOM(4)
@@ -96,6 +97,7 @@
#define CONFIG_SYNC
#define CONFIG_SYNC_COMMAND
#define CONFIG_SYNC_INT_EVENT TASK_EVENT_CUSTOM(5)
+#endif /* SECTION_IS_RW */
/* To be able to indicate the device is in tablet mode. */
#define CONFIG_TABLET_MODE_SWITCH
diff --git a/board/kukui/ec.tasklist b/board/kukui/ec.tasklist
index 4219aa45c7..23bb70225f 100644
--- a/board/kukui/ec.tasklist
+++ b/board/kukui/ec.tasklist
@@ -21,7 +21,7 @@
TASK_ALWAYS(CHARGER, charger_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(USB_CHG, usb_charger_task, NULL, TASK_STACK_SIZE) \
TASK_NOTEST(CHIPSET, chipset_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(MOTIONSENSE, motion_sense_task, NULL, VENTI_TASK_STACK_SIZE) \
+ TASK_ALWAYS_RW(MOTIONSENSE, motion_sense_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_NOTEST(PDCMD, pd_command_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \
diff --git a/board/kukui/gpio.inc b/board/kukui/gpio.inc
index b4cd26bdc7..9733a8c2b5 100644
--- a/board/kukui/gpio.inc
+++ b/board/kukui/gpio.inc
@@ -31,10 +31,12 @@ GPIO_INT(WARM_RESET_REQ, PIN(A, 3), GPIO_INT_RISING | GPIO_PULL_DOWN,
GPIO_INT(AP_EC_WATCHDOG_L, PIN(C, 2), GPIO_INT_FALLING,
ap_watchdog_interrupt)
+#ifdef SECTION_IS_RW
GPIO_INT(ACCEL_INT_ODL, PIN(A, 4), GPIO_INT_FALLING | GPIO_SEL_1P8V | GPIO_PULL_UP,
bmi160_interrupt)
GPIO_INT(SYNC_INT, PIN(A, 5), GPIO_INT_RISING | GPIO_PULL_DOWN,
sync_interrupt)
+#endif
GPIO_INT(CHARGER_INT_ODL, PIN(C, 13), GPIO_INPUT | GPIO_PULL_UP,
rt946x_interrupt)
#ifdef SECTION_IS_RO