From 3ce275436e56d72c9af99ee4a739b7732a986a83 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Sun, 22 Jul 2018 09:35:44 +0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/1146128 Reviewed-by: Yilun Lin --- board/oak/board.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'board/oak') diff --git a/board/oak/board.c b/board/oak/board.c index a9f05c4e86..ae5fbbbb2e 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -241,8 +241,8 @@ static void board_init(void) /* SPI sensors: put back the GPIO in its expected state */ gpio_set_level(GPIO_SPI2_NSS, 1); - /* 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); /* Enable SPI for BMI160 */ gpio_config_module(MODULE_SPI_MASTER, 1); -- cgit v1.2.1