Skip to contentSkip to conversation

propper support of 5 wire SPI (SPI_READY signal)

DISCUSSION Oleksij Rempel 3 participants 9 messages Feb 19, 2016 – Mar 13, 2016 7 messages not in the archive SPI

lore
Share & tools
lore
#0 lore raw

Hallo all,

i'm working on a project which depends on 5 Wire SPI communication. It is probably identical to spi-davinci.c with SPI_READY signal. Only difference is that SPI_READY is not supported by hardware, in this case GPIO input is used.

Currently this project implements SPI_READY and CS on top of spidev driver. What makes it really ugly, slow and complicated.

My question is, are there any better, upstreamable way to implement it? For example directly insight of spi framework? Any suggestions and comments are welcome.

Signature · 2 lines
Regards,
Oleksij

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 11 lines · Oleksij Rempel

i'm working on a project which depends on 5 Wire SPI communication. It is probably identical to spi-davinci.c with SPI_READY signal. Only difference is that SPI_READY is not supported by hardware, in this case GPIO input is used.

Currently this project implements SPI_READY and CS on top of spidev driver. What makes it really ugly, slow and complicated.

My question is, are there any better, upstreamable way to implement it? For example directly insight of spi framework? Any suggestions and comments are welcome.

Unless the hardware support SPI_READY a GPIO is going to be as good as it gets I think, someone else might have better ideas but nothing springs to mind for me. I'd be OK with a GPIO based implementation in the core for systems that don't have hardware support for it but I don't see anything that'd be fundamentally better in terms of system performance right now.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Am 20.02.2016 um 20:56 schrieb Mark Brown:

Quoted 14 lines · Oleksij Rempel
Quoted 6 lines

i'm working on a project which depends on 5 Wire SPI communication. It is probably identical to spi-davinci.c with SPI_READY signal. Only difference is that SPI_READY is not supported by hardware, in this case GPIO input is used.

Quoted 6 lines

Currently this project implements SPI_READY and CS on top of spidev driver. What makes it really ugly, slow and complicated.

My question is, are there any better, upstreamable way to implement it? For example directly insight of spi framework? Any suggestions and comments are welcome.

Quoted 7 lines

Unless the hardware support SPI_READY a GPIO is going to be as good as it gets I think, someone else might have better ideas but nothing springs to mind for me. I'd be OK with a GPIO based implementation in the core for systems that don't have hardware support for it but I don't see anything that'd be fundamentally better in terms of system performance right now.

Ok, i'm working on it.

I would need some naming suggestions (we call our protokol SSI). It looks like the protocol used by us has some differences with Davinci. The Dav. using SPI_READY line only
to allow or pause transmission (fix me if i'm wrong)
We call it Request line and use it to: Ready to Receive; Receive Finished; and Request data shift by slave.

In this case probably spi framework need to be extended with kind of request call back. If data is currently not transmitted and Req line is not used for flow control, then call driver specific function to initiate data shift.

Signature · 2 lines
Regards,
Oleksij

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 6 lines · Oleksij Rempel

I would need some naming suggestions (we call our protokol SSI). It looks like the protocol used by us has some differences with Davinci. The Dav. using SPI_READY line only
to allow or pause transmission (fix me if i'm wrong)
We call it Request line and use it to: Ready to Receive; Receive Finished; and Request data shift by slave.

Oh, so this isn't SPI_READY?

Quoted 4 lines

In this case probably spi framework need to be extended with kind of request call back. If data is currently not transmitted and Req line is not used for flow control, then call driver specific function to initiate data shift.

This is sounding awfully like SPI slave support?

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

Am 22.02.2016 um 12:09 schrieb Mark Brown:

Quoted 10 lines · Oleksij Rempel
Quoted 7 lines

I would need some naming suggestions (we call our protokol SSI). It looks like the protocol used by us has some differences with Davinci. The Dav. using SPI_READY line only
to allow or pause transmission (fix me if i'm wrong)
We call it Request line and use it to: Ready to Receive; Receive Finished; and Request data shift by slave.

Oh, so this isn't SPI_READY?

Not 100%.
According to TI documentation, transfer initiated by master looks like:
1. Master: SPIx_CS (on)
2. Slave: SPIx_READY (on)
3. Master: Date transfer
4. Slave: SPIx_READY (off)
5. Master: SPIx_CS (off)

Bosch version of 5-wire transfer initiated by master:
1. Master: SPIx_CS (on)
2. Slave: SPIx_REQUEST (on)
3. Master: Date transfer
4. Master: SPIx_CS (off) <----- different order.
5. Slave: SPIx_REQUEST (on) <-----

Quoted 7 lines
Quoted 5 lines

In this case probably spi framework need to be extended with kind of request call back. If data is currently not transmitted and Req line is not used for flow control, then call driver specific function to initiate data shift.

This is sounding awfully like SPI slave support?

Not completely. Transfer initiated by Slave has only one difference to Master transfer.

Bosch version of 5-wire transfer initiated by slave:
1. Slave: SPIx_REQUEST (on) <----- different order.
2. Master: SPIx_CS (on) <----
3. Master: Date transfer
4. Master: SPIx_CS (off)
5. Slave: SPIx_REQUEST (off)

Signature · 2 lines
Regards,
Oleksij

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 12 lines · Oleksij Rempel

Am 22.02.2016 um 12:09 schrieb Mark Brown:

Quoted 1 line

Oh, so this isn't SPI_READY?

Not 100%.
According to TI documentation, transfer initiated by master looks like:
1. Master: SPIx_CS (on)
2. Slave: SPIx_READY (on)
3. Master: Date transfer
4. Slave: SPIx_READY (off)
5. Master: SPIx_CS (off)

Quoted 6 lines

Bosch version of 5-wire transfer initiated by master:
1. Master: SPIx_CS (on)
2. Slave: SPIx_REQUEST (on)
3. Master: Date transfer
4. Master: SPIx_CS (off) <----- different order.
5. Slave: SPIx_REQUEST (on) <-----

I can't tell the difference between these two cases. In the first case the device gets busy after the data is transferred, in the second case it never changes the request line but really there's no meaningful difference I can see.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw

Am 12.03.2016 um 08:21 schrieb Mark Brown:

Quoted 20 lines · Oleksij Rempel
Quoted 12 lines

Am 22.02.2016 um 12:09 schrieb Mark Brown:

Quoted 1 line

Oh, so this isn't SPI_READY?

Not 100%.
According to TI documentation, transfer initiated by master looks like:
1. Master: SPIx_CS (on)
2. Slave: SPIx_READY (on)
3. Master: Date transfer
4. Slave: SPIx_READY (off)
5. Master: SPIx_CS (off)

Quoted 6 lines

Bosch version of 5-wire transfer initiated by master:
1. Master: SPIx_CS (on)
2. Slave: SPIx_REQUEST (on)
3. Master: Date transfer
4. Master: SPIx_CS (off) <----- different order.
5. Slave: SPIx_REQUEST (on) <-----

Quoted 5 lines

I can't tell the difference between these two cases. In the first case the device gets busy after the data is transferred, in the second case it never changes the request line but really there's no meaningful difference I can see.

There is no difference from device point of view, the difference is only on Master side. The TI SPI Master can be stopped by Slave in the middle of transfer, and if the data transfer was actually done, then Master will dessert CS line.
This is why i'm trying to make a difference between slaves which will only confirm start of transfer but will never try to stop it, and Slaves which will do it.
Because if device can use Ready line to hold or stop data transfer, then this support can be implemented only by limited number of SPI Master controllers (for example, currently only by: spi-davinci and spi-gpio).

In case of Bosch implementation, the slave should actually confirm change of CS.

Signature · 2 lines
Regards,
Oleksij
#13 lore raw
In reply to a message not in the archive

Hi Oleksij,

Quoted 4 lines · Oleksij Rempel

i'm working on a project which depends on 5 Wire SPI communication. It is probably identical to spi-davinci.c with SPI_READY signal. Only difference is that SPI_READY is not supported by hardware, in this case GPIO input is used.

Sounds interesting!

Quoted 2 lines

Currently this project implements SPI_READY and CS on top of spidev driver. What makes it really ugly, slow and complicated.

Can you please point me to some SPI slave hardware that supports this?

Thanks a lot!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAMuHMdW0P-uNBA94jvvVQqXH2c4DY45U4GnYufkPDQAqZm7u9g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#15 lore raw

Am 22.02.2016 um 10:21 schrieb Geert Uytterhoeven:

Quoted 8 lines

Hi Oleksij,

Quoted 4 lines · Oleksij Rempel

i'm working on a project which depends on 5 Wire SPI communication. It is probably identical to spi-davinci.c with SPI_READY signal. Only difference is that SPI_READY is not supported by hardware, in this case GPIO input is used.

Quoted 6 lines

Sounds interesting!

Quoted 2 lines

Currently this project implements SPI_READY and CS on top of spidev driver. What makes it really ugly, slow and complicated.

Can you please point me to some SPI slave hardware that supports this?

It is automotive filed. Used for inter chip communication. There are many products with it. Currently i can't say more :(

Quoted 14 lines

Thanks a lot!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

Signature · 2 lines
Regards,
Oleksij