How should I integrate my SPI driver into kernel?

Patryk pbiel7 at gmail.com
Sat Nov 4 08:13:36 EDT 2023


Hi,
First, let me explain what I would like to achieve.
I'm using the NXP LS1028a CPU, which will be used as a base for our SoM.
This CPU features two types of SPI controllers:
- 1 FlexSPI (cabable of Single/Dual/Quad/Octal mode)
- 3 traditional SPIs
Because of the design of our SoM all traditional SPIs are not available
(designed to be used for other needs), so the only one left is FlexSPI.
This FlexSPI will be used to communicate with 3 different things:
- SPI NOR Flash
- SPI NOR Flash
- Hilsher netX90
As far as I understand FlexSPI is designed to work with Flash-like devices,
which are obviously Flash memories. Each time one wants to send something
over this FlexSPI it puts the data on the bus like this:
- opcode | addr | dummy | data

So communication with Flash memories won't be a problem. The problem I see
is the communication with this Hilsher thing. Fortunately, we can put on
the Hilsher our own FW that will handle SPI communication. So my idea was
to:
- develop a FW designed for Hilsher that will behave like a Flash device
- develop a driver on the Linux side that will use this FlexSPI controller
to communicate with Hisler in a Flash (thus FlexSPI) compatible manner.

However, I'm not sure how I should go about this. I checked and e.g. driver
that we use to communicate with SPI NOR Flash (jedec,spi-nor) uses
something like spi-nor which in turn uses a driver spi-mem.
Obviously, I get that the spi-nor is designed to work with SPI NOR flashes
so that's not the way I'm going to go, however, I'm curious about this
spi-mem thing.
Is this spi-mem designed to work with devices that are like memory-mapped
but not necessarily flash memories?

What would you advise in this case?

BR
Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20231104/7af26ae4/attachment.html>


More information about the Kernelnewbies mailing list