summaryrefslogtreecommitdiff
path: root/board/elm
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2018-07-22 09:35:44 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-07-23 09:27:22 -0700
commit3ce275436e56d72c9af99ee4a739b7732a986a83 (patch)
tree339067b000f9676869560ec7d49d39fa8747da86 /board/elm
parentc2eb6e680eba251626c768578a2f8e095cfa071a (diff)
downloadchrome-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/elm')
-rw-r--r--board/elm/board.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/board/elm/board.c b/board/elm/board.c
index 0e08f0d6da..7ebf20225b 100644
--- a/board/elm/board.c
+++ b/board/elm/board.c
@@ -268,9 +268,8 @@ static void board_init(void)
/* Update VBUS supplier */
usb_charger_vbus_change(0, !gpio_get_level(GPIO_USB_C0_VBUS_WAKE_L));
- /* Remap SPI2 to DMA channels 6 and 7 */
- REG32(STM32_DMA1_BASE + 0xa8) |= (1 << 20) | (1 << 21) |
- (1 << 24) | (1 << 25);
+ /* Remap SPI2 to DMA channels 6 and 7 (0011) */
+ STM32_DMA_CSELR(STM32_DMAC_CH6) |= (3 << 20) | (3 << 24);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);