Re: [U-Boot] [PATCH 1/2] SPI: Add support for preamble bytes

2013-05-11 Thread Simon Glass
On Fri, Mar 22, 2013 at 12:29 AM, Rajeshwari Shinde
 wrote:
> A SPI slave may take time to react to a request. For SPI flash devices
> this time is defined as one bit time, or a whole byte for 'fast read'
> mode.
>
> If the SPI slave is another CPU, then the time it takes to react may
> vary. It is convenient to allow the slave device to tag the start of
> the actual reply so that the host can determine when this 'preamble'
> finishes and the actual message starts.
>
> Add a preamble flag to the available SPI flags. If supported by the
> driver then it will ignore any received bytes before the preamble
> on each transaction. This ensures that reliable communication with
> the slave is possible.
>
> Signed-off-by: Simon Glass 
> Signed-off-by: Rajeshwari Shinde 

Acked-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] SPI: Add support for preamble bytes

2013-03-21 Thread Rajeshwari Shinde
A SPI slave may take time to react to a request. For SPI flash devices
this time is defined as one bit time, or a whole byte for 'fast read'
mode.

If the SPI slave is another CPU, then the time it takes to react may
vary. It is convenient to allow the slave device to tag the start of
the actual reply so that the host can determine when this 'preamble'
finishes and the actual message starts.

Add a preamble flag to the available SPI flags. If supported by the
driver then it will ignore any received bytes before the preamble
on each transaction. This ensures that reliable communication with
the slave is possible.

Signed-off-by: Simon Glass 
Signed-off-by: Rajeshwari Shinde 
---
 include/spi.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/spi.h b/include/spi.h
index 60e85db..5351c59 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -37,11 +37,16 @@
 #defineSPI_LSB_FIRST   0x08/* per-word 
bits-on-wire */
 #defineSPI_3WIRE   0x10/* SI/SO signals shared 
*/
 #defineSPI_LOOP0x20/* loopback mode */
+#defineSPI_SLAVE   0x40/* slave mode */
+#defineSPI_PREAMBLE0x80/* Skip preamble bytes 
*/
 
 /* SPI transfer flags */
 #define SPI_XFER_BEGIN 0x01/* Assert CS before transfer */
 #define SPI_XFER_END   0x02/* Deassert CS after transfer */
 
+/* Header byte that marks the start of the message */
+#define SPI_PREAMBLE_END_BYTE  0xec
+
 /*---
  * Representation of a SPI slave, i.e. what we're communicating with.
  *
-- 
1.7.4.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot