On 01/12/2017 19:36, David Hendricks wrote:
On Fri, Dec 1, 2017 at 12:11 AM, Andriy Gapon <avg@freebsd.org mailto:avg@freebsd.org> wrote:
Hello. I wonder if anyone here encountered an SPI flash controller (master) that has a three register interface where the first register is used for control and status bits, the second register is used for setting a flash address (if one is needed) and the third is used for reading or writing the flash data. A specific operation is requested by writing an SPI opcode into the control register. The interface seems to be rather simple, but I couldn't find any driver that implements access to anything like that or any documentation that would describe a similar interface. Does it sound familiar to anyone? Could anyone give me some hints / pointers?
Is this an interface that you've actually used before? It sounds too simplistic since at the very least you'd also need to set the number of bytes to transfer, the direction, and have some control over chip select.
Likely, those things are set in the control register, but I don't know the exact meaning of the bits. Also, some status bits are checked in the same register to make sure that the operation is completed. I can make some guesses, but I'd rather find documentation if possible.
Meanwhile, I also looked at Linux drivers and this one seems to be somewhat similar but still different: http://elixir.free-electrons.com/linux/latest/source/drivers/spi/spi-falcon.... See SFCMD / SFADDR / SFDATA.