summaryrefslogtreecommitdiff
path: root/board/oak_pd
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-10-19 11:45:44 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-10-20 13:02:19 -0700
commitceb35e56584fbf7ece433c444b8de7bae0ba77be (patch)
tree90bbdb4148a6720db28f4226a4a2db57c6395085 /board/oak_pd
parentb8957abf5ebf2f6a00779896dd6aa72cbc80f0c5 (diff)
downloadchrome-ec-ceb35e56584fbf7ece433c444b8de7bae0ba77be.tar.gz
oak_pd: reduce image size and build full RO and RW
Modify oak_pd to build a full RO and RW binary. Note that in order to fit RO and RW into the small flash size, this CL removes the console task and adds one-way debug printfs to save space. For debugging purposes, you add the console back in by uncommenting the CONSOLE task in ec.tasklist. This will build an RW image only that has a full console. BUG=chrome-os-partner:41959 BRANCH=none TEST=load on oak_pd and verify host commands from EC work and charging with zinger works. also test that software sync works. Change-Id: I54f7263599684cab333c62796edf57837fe43469 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/307032 Tested-by: Rong Chang <rongchang@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/oak_pd')
-rw-r--r--board/oak_pd/board.h28
-rw-r--r--board/oak_pd/ec.tasklist2
2 files changed, 22 insertions, 8 deletions
diff --git a/board/oak_pd/board.h b/board/oak_pd/board.h
index d0f88b5ae2..f1ad61ea46 100644
--- a/board/oak_pd/board.h
+++ b/board/oak_pd/board.h
@@ -11,6 +11,13 @@
#include "board_revs.h"
/*
+ * The console task is too big to include in both RO and RW images. Therefore,
+ * if the console task is defined, then only build an RW image. This can be
+ * useful for debugging to have a full console. Otherwise, without this task,
+ * a full RO and RW is built with a limited one-way output console.
+ */
+#ifdef HAS_TASK_CONSOLE
+/*
* The flash size is only 32kB.
* No space for 2 partitions,
* put only RW at the beginning of the flash
@@ -23,6 +30,7 @@
/* Fake full size if we had a RO partition */
#undef CONFIG_RW_SIZE
#define CONFIG_RW_SIZE CONFIG_FLASH_SIZE
+#endif /* HAS_TASK_CONSOLE */
/* 48 MHz SYSCLK clock frequency */
#define CPU_CLOCK 48000000
@@ -33,15 +41,9 @@
/* Optional features */
#define CONFIG_ADC
+#undef CONFIG_ADC_WATCHDOG
#define CONFIG_BOARD_PRE_INIT
-#undef CONFIG_CMD_I2C_SCAN
-#undef CONFIG_CMD_I2C_XFER
-#undef CONFIG_CMD_IDLE_STATS
-#undef CONFIG_CMD_SHMEM
#define CONFIG_COMMON_GPIO_SHORTNAMES
-#define CONFIG_CONSOLE_CMDHELP
-#undef CONFIG_CONSOLE_HISTORY
-#define CONFIG_CONSOLE_HISTORY 2
#undef CONFIG_DEBUG_ASSERT
#define CONFIG_FORCE_CONSOLE_RESUME
#define CONFIG_HIBERNATE
@@ -52,6 +54,7 @@
#define CONFIG_I2C_SLAVE_ONLY
#undef CONFIG_LID_SWITCH
#define CONFIG_LOW_POWER_IDLE
+#define CONFIG_LTO
#define CONFIG_STM_HWTIMER32
#undef CONFIG_TASK_PROFILING
#undef CONFIG_UART_TX_BUF_SIZE
@@ -68,6 +71,17 @@
#undef CONFIG_WATCHDOG
#undef CONFIG_WATCHDOG_HELP
+#ifdef HAS_TASK_CONSOLE
+#undef CONFIG_CONSOLE_HISTORY
+#define CONFIG_CONSOLE_HISTORY 2
+
+#else
+#undef CONFIG_CONSOLE_CMDHELP
+#define CONFIG_DEBUG_PRINTF
+#define UARTN CONFIG_UART_CONSOLE
+#define UARTN_BASE STM32_USART_BASE(CONFIG_UART_CONSOLE)
+#endif /* HAS_TASK_CONSOLE */
+
/* Use PSTATE embedded in the RO image, not in its own erase block */
#undef CONFIG_FLASH_PSTATE_BANK
#undef CONFIG_FW_PSTATE_SIZE
diff --git a/board/oak_pd/ec.tasklist b/board/oak_pd/ec.tasklist
index 676c13e60d..6401c10057 100644
--- a/board/oak_pd/ec.tasklist
+++ b/board/oak_pd/ec.tasklist
@@ -19,6 +19,6 @@
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_NOTEST(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \
- TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) \
+ /* TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) */ \
TASK_ALWAYS(PD_C0, pd_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(PD_C1, pd_task, NULL, TASK_STACK_SIZE)