altos/stm: Set SPI slave DMA priority to HIGH/VERY_HIGH
authorKeith Packard <keithp@keithp.com>
Sat, 3 Sep 2016 06:21:34 +0000 (01:21 -0500)
committerKeith Packard <keithp@keithp.com>
Sat, 3 Sep 2016 06:23:51 +0000 (01:23 -0500)
Set spi slave DMA priority MOSI to HIGH and MISO to VERY_HIGH. Slave
SPI doesn't have the luxury of slowing down when the system is busy,
so provide it maximum memory bandwidth to try and keep up with the
master.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/ao_spi_stm_slave.c

index de07a7fc1502b65df41c349beb8975b0ac4da826..5bb5105d6ccfbbfa96fb5aef647156e974b3e65d 100644 (file)
@@ -55,7 +55,7 @@ ao_spi_slave_send(void *block, uint16_t len)
                            block,
                            len,
                            (0 << STM_DMA_CCR_MEM2MEM) |
-                           (STM_DMA_CCR_PL_MEDIUM << STM_DMA_CCR_PL) |
+                           (STM_DMA_CCR_PL_HIGH << STM_DMA_CCR_PL) |
                            (STM_DMA_CCR_MSIZE_8 << STM_DMA_CCR_MSIZE) |
                            (STM_DMA_CCR_PSIZE_8 << STM_DMA_CCR_PSIZE) |
                            (1 << STM_DMA_CCR_MINC) |
@@ -75,7 +75,7 @@ ao_spi_slave_send(void *block, uint16_t len)
                            &spi_dev_null,
                            len,
                            (0 << STM_DMA_CCR_MEM2MEM) |
-                           (STM_DMA_CCR_PL_MEDIUM << STM_DMA_CCR_PL) |
+                           (STM_DMA_CCR_PL_VERY_HIGH << STM_DMA_CCR_PL) |
                            (STM_DMA_CCR_MSIZE_8 << STM_DMA_CCR_MSIZE) |
                            (STM_DMA_CCR_PSIZE_8 << STM_DMA_CCR_PSIZE) |
                            (0 << STM_DMA_CCR_MINC) |
@@ -111,7 +111,7 @@ ao_spi_slave_recv(void *block, uint16_t len)
                            &spi_dev_null,
                            len,
                            (0 << STM_DMA_CCR_MEM2MEM) |
-                           (STM_DMA_CCR_PL_MEDIUM << STM_DMA_CCR_PL) |
+                           (STM_DMA_CCR_PL_HIGH << STM_DMA_CCR_PL) |
                            (STM_DMA_CCR_MSIZE_8 << STM_DMA_CCR_MSIZE) |
                            (STM_DMA_CCR_PSIZE_8 << STM_DMA_CCR_PSIZE) |
                            (0 << STM_DMA_CCR_MINC) |
@@ -128,7 +128,7 @@ ao_spi_slave_recv(void *block, uint16_t len)
                            block,
                            len,
                            (0 << STM_DMA_CCR_MEM2MEM) |
-                           (STM_DMA_CCR_PL_MEDIUM << STM_DMA_CCR_PL) |
+                           (STM_DMA_CCR_PL_VERY_HIGH << STM_DMA_CCR_PL) |
                            (STM_DMA_CCR_MSIZE_8 << STM_DMA_CCR_MSIZE) |
                            (STM_DMA_CCR_PSIZE_8 << STM_DMA_CCR_PSIZE) |
                            (1 << STM_DMA_CCR_MINC) |