diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2018-07-22 09:35:44 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-23 09:27:22 -0700 |
commit | 3ce275436e56d72c9af99ee4a739b7732a986a83 (patch) | |
tree | 339067b000f9676869560ec7d49d39fa8747da86 /board/scarlet | |
parent | c2eb6e680eba251626c768578a2f8e095cfa071a (diff) | |
download | chrome-ec-3ce275436e56d72c9af99ee4a739b7732a986a83.tar.gz |
board: Clean up DMA channel mapping
The code to remap DMA channels on STM32F09x is a little obscure,
let's try to make it a bit clearer by using simpler masks.
A more proper fix might be to setup better macros, or use the
existing dma_select_channel function, but this already improves
readability.
BRANCH=none
BUG=b:80159522
TEST=Flash kukui, see that UART and eMMC emulation work.
TEST=Compare binaries for elm kukui oak rainier rowan scarlet
before and after this change, and see that resulting binaries
are identical.
Change-Id: Id4d2b9cfec86230b2329fa04a4c1992ec13be4e1
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1146128
Reviewed-by: Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'board/scarlet')
-rw-r--r-- | board/scarlet/board.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/board/scarlet/board.c b/board/scarlet/board.c index fb40b6d0cf..9eb055e9f6 100644 --- a/board/scarlet/board.c +++ b/board/scarlet/board.c @@ -267,12 +267,11 @@ void board_config_pre_init(void) /* * Remap USART1 and SPI2 DMA: * - * Ch4: USART1_TX / Ch5: USART1_RX - * Ch6: SPI2_RX / Ch7: SPI2_TX + * Ch4: USART1_TX / Ch5: USART1_RX (1000) + * Ch6: SPI2_RX / Ch7: SPI2_TX (0011) */ - STM32_DMA_CSELR(STM32_DMAC_CH4) = (1 << 15) | (1 << 19) | - (1 << 20) | (1 << 21) | - (1 << 24) | (1 << 25); + STM32_DMA_CSELR(STM32_DMAC_CH4) = (8 << 12) | (8 << 16) | + (3 << 20) | (3 << 24); } enum scarlet_board_version { |