summaryrefslogtreecommitdiff
path: root/board/oak
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/oak
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/oak')
-rw-r--r--board/oak/board.c4
1 files changed, 2 insertions, 2 deletions
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);