Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142545
b: refs/heads/master
c: 8cf5858
h: refs/heads/master
i:
  142543: c7f8a0b
v: v3
  • Loading branch information
Vitja Makarov authored and Linus Torvalds committed Apr 7, 2009
1 parent 81d8be8 commit c5a4167
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3bcfa9e47a7d1be6faef3be6c4b2049e585e2f38
refs/heads/master: 8cf5858c51f88208fe56b195251ab4f21265386c
23 changes: 20 additions & 3 deletions trunk/drivers/spi/spi_bfin5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include <asm/portmux.h>
#include <asm/bfin5xx_spi.h>

/* reserved_mem_dcache_on and cache friends */
#include <asm/cplbinit.h>
#include <asm/cacheflush.h>

#define DRV_NAME "bfin-spi"
#define DRV_AUTHOR "Bryan Wu, Luke Yang"
#define DRV_DESC "Blackfin BF5xx on-chip SPI Controller Driver"
Expand Down Expand Up @@ -738,9 +742,10 @@ static void pump_transfers(unsigned long data)
width, transfer->len);

/*
* Try to map dma buffer and do a dma transfer if
* successful use different way to r/w according to
* drv_data->cur_chip->enable_dma
* Try to map dma buffer and do a dma transfer. If successful use,
* different way to r/w according to the enable_dma settings and if
* we are not doing a full duplex transfer (since the hardware does
* not support full duplex DMA transfers).
*/
if (!full_duplex && drv_data->cur_chip->enable_dma
&& drv_data->len > 6) {
Expand Down Expand Up @@ -795,6 +800,12 @@ static void pump_transfers(unsigned long data)
/* set transfer mode, and enable SPI */
dev_dbg(&drv_data->pdev->dev, "doing DMA in.\n");

/* invalidate caches, if needed */
if (bfin_addr_dcachable((unsigned long) drv_data->rx))
invalidate_dcache_range((unsigned long) drv_data->rx,
(unsigned long) (drv_data->rx +
drv_data->len));

/* clear tx reg soformer data is not shifted out */
write_TDBR(drv_data, 0xFFFF);

Expand All @@ -815,6 +826,12 @@ static void pump_transfers(unsigned long data)
} else if (drv_data->tx != NULL) {
dev_dbg(&drv_data->pdev->dev, "doing DMA out.\n");

/* flush caches, if needed */
if (bfin_addr_dcachable((unsigned long) drv_data->tx))
flush_dcache_range((unsigned long) drv_data->tx,
(unsigned long) (drv_data->tx +
drv_data->len));

/* start dma */
dma_enable_irq(drv_data->dma_channel);
dma_config = (RESTART | dma_width | DI_EN);
Expand Down

0 comments on commit c5a4167

Please sign in to comment.