Commit 584db6a1b5b80513b272b788e5bda43da982817a

Authored by Samu Onkalo
Committed by Herbert Xu
1 parent e84c5480b7

crypto: omap-sham - Adjust DMA parameters

DMA is set to use burst mode also for source channel. It should
descrease memory bandwidth needs.

DMA synchronization is set to use prefetch mechanism. SHAM block is behind
L4 bus and it doesn't have fifo. SHAM block is stalling as long as the new
data is available. It takes time to fetch data from memory and transfer it
via L4 bus. With prefetch enabled, data is waiting in DMA fifo and SHAM block
receives new data block faster.
This increases SHA processing speed up to 30 percent depending on the
bus / memory load.

Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff

drivers/crypto/omap-sham.c
... ... @@ -311,7 +311,8 @@
311 311 len32 = DIV_ROUND_UP(length, sizeof(u32));
312 312  
313 313 omap_set_dma_transfer_params(dd->dma_lch, OMAP_DMA_DATA_TYPE_S32, len32,
314   - 1, OMAP_DMA_SYNC_PACKET, dd->dma, OMAP_DMA_DST_SYNC);
  314 + 1, OMAP_DMA_SYNC_PACKET, dd->dma,
  315 + OMAP_DMA_DST_SYNC_PREFETCH);
315 316  
316 317 omap_set_dma_src_params(dd->dma_lch, 0, OMAP_DMA_AMODE_POST_INC,
317 318 dma_addr, 0, 0);
... ... @@ -1071,6 +1072,9 @@
1071 1072  
1072 1073 omap_set_dma_dest_burst_mode(dd->dma_lch,
1073 1074 OMAP_DMA_DATA_BURST_16);
  1075 +
  1076 + omap_set_dma_src_burst_mode(dd->dma_lch,
  1077 + OMAP_DMA_DATA_BURST_4);
1074 1078  
1075 1079 return 0;
1076 1080 }