-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev quad ad77681 #1490
base: main
Are you sure you want to change the base?
Dev quad ad77681 #1490
Conversation
The SPI_CLK needs to be the reference clk divided by 2. Signed-off-by: PopPaul2021 <[email protected]>
Signed-off-by: sarpadi <[email protected]>
Signed-off-by: Pop Ioan Daniel <[email protected]>
Signed-off-by: Pop Ioan Daniel <[email protected]>
Signed-off-by: Pop Ioan Daniel <[email protected]>
Signed-off-by: Pop Ioan Daniel <[email protected]>
Rename the project and update the files that are affected. Signed-off-by: Pop Ioan Daniel <[email protected]>
Signed-off-by: Pop Ioan Daniel <[email protected]>
Signed-off-by: Pop Ioan Daniel <[email protected]>
Signed-off-by: Pop Ioan Daniel <[email protected]>
Signed-off-by: Pop Ioan Daniel <[email protected]>
Hi @dlech. This PR includes changes to the axi_spi_engine IP core that aim to provide FIFO mode support for multiple SDI lines. This means that we have to add extra registers and we also had to move some of the existing ones to get a better usage of address space. Any feedback would be nice. https://github.com/analogdevicesinc/hdl/pull/1490/files#diff-d1274cfe2e206aa66a0ecd3da04b3e62fc5fad9e12029b34b226c6f91454d34d |
Then we will need to bump the version of the IP block to 2.0.0 so that we don't end up with existing drivers trying to poke the wrong registers. (Existing drivers already check for a major version of 1.)
Hmm... what advantage is there to adding more FIFOs vs. putting all data received in a single FIFO? I suppose it makes sense for the PEEK registers, but am not familiar with why those are needed. It isn't something we are using in the Linux kernel driver. For offload support, will there also be 8 different DMA streams? It seems like we would want just one DMA stream where every n words are sent at the same time. Taking a step back from this specific use case, here is a broader view of the needs I have seen in the various chips I have looked at so far. Even if we don't implement all of these use cases right away, I think it will be useful to have them in mind while working on this. Multiple SDO linesWe should also consider multiple SDO lines for DAC chips. Basically everything for multiple SDI lines also applies for multiple SDO lines. I.e, if we end up rearranging registers, we should make sure we reserve space for new SDO registers as well. Data channels vs. dual/quad SPIWe also need to consider how data is distributed on the lines. I've seen two different ways.
So, at the very least, we need to make a distinction between the number of physical SDI lines and the number of channels that can be read at the same time. Full-duplex vs. half-duplex (traditional dual/quad SPI)Some chips, like AD3552R have parallel bidirectional SDIO lines instead of dedicated separate SDI and SDO lines. These act like the conventional dual/quad SPI controllers that are a bit more common. Bit order for split wordsMost chips follow the defacto standards and put the most significant bit on the lowest numbered SDIO line. AD3552R decided to do it in the opposite order, so we also need to take this into consideration as a configurable parameter. Selecting configuration at runtime vs. at compile timeSome chips need to use single SDI/SDO lines for reading/writing registers and then switch to multiple SDI/SDO lines to read/write sample data. As seen in the screenshot above for AD3552R, we may even need to do both in the same SPI message. So we will likely need to modify the SPI engine instructions to add a per transfer selection of how many SDI/SDO lines to use for an individual transfer. Linux kernel considerations
In summary, I think the most import things to consider up front are:
|
In my previous comments, I didn't realize that the problem we are trying to solve is reading/writing data to multiple separate chips at the same time. So, I've done some more research on this and found some interesting "prior art". There are a number of specialized SPI controllers for SPI flash memory that support connecting to multiple flash memory chips in series or in parallel. The parallel case is the most similar to what we are trying to do here. So if we can emulate those controllers, that would be best in terms of coming up with a software interface that works well with other controllers too. One that is well documented is the "Generic QSPI Controller" on Zynq Ultrascale.
It is basically a single SPI controller with two completely separate SPI buses that allow controlling them individually or at the same time. Here is what it make available for configuration (by the way, this is configuration per-transfer).
The key features I see here are:
As a 2nd data point, STM32 has a OCTISPI controller that can be operated in a dual-quad mode similar to this. It also has a single FIFO data register and does 1-byte interleaving/striping of the data (i.e. even bytes go to one chip and odd bytes go to other chip). In summary, this doesn't really change any of my suggestions in the first reply. But it does make it more clear the direction we should be aiming for. |
HDL for PMB00004 board
PR Type
PR Checklist