[okl4-developer] OKL4 v2.1: How does a stream interface work?
Frank Kaiser
frank.kaiser at opensynergy.com
Thu Sep 4 00:32:58 EST 2008
Hello
I am currently implementing an SPI driver for my AT91RM9200 platform
which proves to be quite difficult due to the lack of documentation.
What I could derive from the only given example, the s3c2410_spi driver,
is that it is handled thru a stream interface. I also found some
artefacts of a special spi interface, but it does not look like a valid
implementation.
The implementation of the s3c2410_spi driver looks dubious, since it
only exchanges one-by-one byte on each interrupt. My SPI controller
deactivates the chip select, when the next transmit byte is not written
in time to the data output register, which would render the SPI access
incomplete. At high data rates this is likely to occur due to interrupt
latency.
The outcome is to use the internal DMA which gives the SPI interface
FIFOs to handle a complete TX/RX data exchange. To find out how a stream
interface cooperates with driver FIFOs I turned to the uart_8250 driver.
This driver implementation shows that the stream interface requires some
management to work properly (something I do not see at all in the
s3c2410_spi driver implementation). On an UART the receive and transmit
paths work independently while on an SPI the transmit and receive paths
work synchronous, and a transmit and a receive packte have the same
size. So I cannot just copy and paste the UART implementation of the
stream interface. To get it right for my SPI interface I need to know
how it works, and how the SPI server applies it to consider SPI-specific
constraints. In the documentation about the IGUANA driver framework I
found nothing about the stream interface, so it would be helpful if
somebody could fill the gap.
Additionally I wonder how an SPI driver handled thru a stream interface
is expected to work with different SPI devices. On my platform 4 chip
selects are associated with the SPI interfaces: how is it possible to
select a certain device by methods given with the stream interface and
the device interface?
Any help is appreciated, since my current approach to gain unterstanding
by analysing given code is time-consuming and error-prone.
Regards
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20080903/57abe026/attachment.htm
More information about the Developer
mailing list