Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: SPI driver

On Thu, 7 Feb 2019, Michael van Elst wrote:
I've written a userland interface to our spi(4) driver.

Neat. I'm interested in SPI, but pardon me if I am a bit ignorant. If you don't have time to answer it's no problem.

crw-------  1 root  wheel  346, 0 Jan  5 16:02 /dev/spi0

I assume there is no concept of a block-mode for SPI, directly. It's only a transport like I2C or JTAG right? Don't SD cards use it for IO or something related ?

SPI_IOCTL_CONFIGURE calls spi_configure() to chose operational mode and clock.

I see the struct sets a clock in Hz. Is SPI always synchronous ? Can one vary the clock frequency ? Is there a way to sense what the other side will max out at ? How can one know the width of data-bits in a cycle or does it not matter and you just set sendlen & recvlen and not worry about it ?

The interface is different from spigen(4) used by FreeBSD and also different from an early example of an SPI driver by Jonathan Kollasch.

Why didn't you just steal it? I'm kidding, but still a bit curious.

As there is no kind of session handling,

Is SPI meant to be stateful but the driver can't do it yet or is that just how SPI works intrinsically ? Isn't it kinda low level bit-banging stuff where you control which wire is doing what and who's on edge vs level etc... ? So, you're saying "sessions" are just the responsibility of the user/implementer, right ?

Thanks for your hard work, Michael.


Home | Main Index | Thread Index | Old Index