diff options
author | Philip Chen <philipchen@google.com> | 2017-08-10 13:52:25 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-08-15 18:29:22 -0700 |
commit | abd446b806d4f4367d4649db0a84df56a47ed0b5 (patch) | |
tree | f420cf09bb2880650020d0553c51e04ca57ac05f /board/scarlet | |
parent | f747f70816ca825a4ff4f9c6234f97e93611dbaa (diff) | |
download | chrome-ec-abd446b806d4f4367d4649db0a84df56a47ed0b5.tar.gz |
scarlet: Remap DMA channels for USART1
To enable console with DMA, we need to specifically
remap DMA channels for USART1.
ch2/3 and ch6/7 are already used by SPI1/2 modules.
So we have to remap USART1_TX to ch4 and USART1_RX to ch5.
BUG=b:64575809
BRANCH=none
TEST=confirm ec console works on scarlet rev1
Change-Id: Ie2bb141c72252aee98e4cd4a284a01b4d57605f4
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/611147
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/scarlet')
-rw-r--r-- | board/scarlet/board.c | 10 | ||||
-rw-r--r-- | board/scarlet/board.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/board/scarlet/board.c b/board/scarlet/board.c index 0366778a9f..7ae9598490 100644 --- a/board/scarlet/board.c +++ b/board/scarlet/board.c @@ -297,6 +297,16 @@ static void board_init(void) } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); +void board_config_pre_init(void) +{ + STM32_RCC_AHBENR |= STM32_RCC_HB_DMA1; + /* + * Remap USART1 DMA: + * Ch4 : USART1_TX / Ch5 : USART1_RX + */ + STM32_DMA_CSELR(STM32_DMAC_CH4) = (1 << 15) | (1 << 19); +} + void board_hibernate(void) { int rv; diff --git a/board/scarlet/board.h b/board/scarlet/board.h index dafe40a5de..b8e3db549c 100644 --- a/board/scarlet/board.h +++ b/board/scarlet/board.h @@ -44,6 +44,7 @@ #define CONFIG_BUTTON_COUNT 2 #define CONFIG_BUTTON_RECOVERY #define CONFIG_HOST_COMMAND_STATUS +#define CONFIG_BOARD_PRE_INIT /* By default, set hcdebug to off */ #undef CONFIG_HOSTCMD_DEBUG_MODE #define CONFIG_HOSTCMD_DEBUG_MODE HCDEBUG_OFF |