summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2018-11-16 12:49:06 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-11-20 14:15:21 -0800
commit590a45db85507787af77cf6bfc8ae63499cbf1cc (patch)
tree7087866600dc5ad4bed9c02e1dd3be476dcf5399
parentc86e5363b920984b9310057ad12b9447cce6e4e5 (diff)
downloadchrome-ec-590a45db85507787af77cf6bfc8ae63499cbf1cc.tar.gz
Servo v4: reduce RO flash size
Currently, the servo_v4 build is within 48 bytes of exceeding its RO flash size. With this change to remove the USART3 code from the RO image, there should be just about 350 free bytes of space. BRANCH=None BUG=None TEST=builds, hey_flash_used in RO elf file shows 0x170 free bytes Change-Id: I7ee8f6c964eb3e0fb009fba61430bab656c03c2e Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1340545 Reviewed-by: Nick Sanders <nsanders@chromium.org>
-rw-r--r--board/servo_v4/board.c8
-rw-r--r--board/servo_v4/board.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/board/servo_v4/board.c b/board/servo_v4/board.c
index 982ed9ccfb..84a78fe9e8 100644
--- a/board/servo_v4/board.c
+++ b/board/servo_v4/board.c
@@ -97,7 +97,7 @@ BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
/******************************************************************************
* Forward USART3 as a simple USB serial interface.
*/
-
+#ifdef SECTION_IS_RW
static struct usart_config const usart3;
struct usb_stream_config const usart3_usb;
@@ -123,7 +123,7 @@ USB_STREAM_CONFIG(usart3_usb,
USB_STREAM_TX_SIZE,
usb_to_usart3,
usart3_to_usb)
-
+#endif /* SECTION_IS_RW */
/******************************************************************************
* Forward USART4 as a simple USB serial interface.
@@ -412,13 +412,17 @@ int board_get_version(void)
static void board_init(void)
{
/* USB to serial queues */
+#ifdef SECTION_IS_RW
queue_init(&usart3_to_usb);
queue_init(&usb_to_usart3);
+#endif
queue_init(&usart4_to_usb);
queue_init(&usb_to_usart4);
/* UART init */
+#ifdef SECTION_IS_RW
usart_init(&usart3);
+#endif
usart_init(&usart4);
/* Delay DUT hub to avoid brownout. */
diff --git a/board/servo_v4/board.h b/board/servo_v4/board.h
index 1493d24fc8..1c41366352 100644
--- a/board/servo_v4/board.h
+++ b/board/servo_v4/board.h
@@ -22,7 +22,9 @@
/* Enable USART1,3,4 and USB streams */
#define CONFIG_STREAM_USART
+#ifdef SECTION_IS_RW
#define CONFIG_STREAM_USART3
+#endif
#define CONFIG_STREAM_USART4
#define CONFIG_STREAM_USB
#define CONFIG_CMD_USART_INFO