Patchwork [arm-devs,v1,08/15] xilinx_spips: Add automatic start support

login
register
mail settings
Submitter Peter Crosthwaite
Date April 3, 2013, 4:33 a.m.
Message ID <0e8464eacb6aba9ae36176e0dc9e300b678ad68f.1364962908.git.peter.crosthwaite@xilinx.com>
Download mbox | patch
Permalink /patch/233226/
State New
Headers show

Comments

Peter Crosthwaite - April 3, 2013, 4:33 a.m.
SPI has a mode where it automatically starts based on tx fifo
occupancy. Implemented.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 hw/xilinx_spips.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/xilinx_spips.c b/hw/xilinx_spips.c
index 4f921f8..f7d942e 100644
--- a/hw/xilinx_spips.c
+++ b/hw/xilinx_spips.c
@@ -446,7 +446,8 @@  static void xilinx_spips_write(void *opaque, hwaddr addr,
     }
     s->regs[addr] = (s->regs[addr] & ~mask) | (value & mask);
 no_reg_update:
-    if (man_start_com) {
+    if ((man_start_com && s->regs[R_CONFIG] & MAN_START_EN) ||
+            (fifo8_is_empty(&s->tx_fifo) && s->regs[R_CONFIG] & MAN_START_EN)) {
         xilinx_spips_flush_txfifo(s);
     }
     xilinx_spips_update_ixr(s);