Skip to content
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

mpfs: Add CoreSPI driver for Polarfire SoC #9439

Merged
merged 5 commits into from May 31, 2023
Merged

Conversation

pussuw
Copy link
Contributor

@pussuw pussuw commented May 31, 2023

Summary

Add driver for CoreSPI https://www.microchip.com/en-us/products/fpgas-and-plds/ip-core-tools/corespi into NuttX. User can instantiate up to 8 instances. Driver assumes the instances live in contiguous memory locations and have contiguous interrupt numbers.

Impact

MPFS only, add new driver

Testing

icicle:nsh

@pussuw pussuw changed the title Mpfs corespi mpfs: Add CoreSPI driver for Polarfire SoC May 31, 2023
arch/risc-v/src/mpfs/hardware/mpfs_corespi.h Outdated Show resolved Hide resolved
arch/risc-v/src/mpfs/hardware/mpfs_corespi.h Outdated Show resolved Hide resolved
arch/risc-v/src/mpfs/mpfs_corespi.c Outdated Show resolved Hide resolved
arch/risc-v/src/mpfs/mpfs_corespi.c Outdated Show resolved Hide resolved
arch/risc-v/src/mpfs/mpfs_corespi.c Outdated Show resolved Hide resolved
arch/risc-v/src/mpfs/mpfs_corespi.c Outdated Show resolved Hide resolved
arch/risc-v/src/mpfs/mpfs_corespi.c Outdated Show resolved Hide resolved
arch/risc-v/src/mpfs/mpfs_corespi.c Show resolved Hide resolved
arch/risc-v/src/mpfs/mpfs_corespi.c Outdated Show resolved Hide resolved
arch/risc-v/src/mpfs/mpfs_corespi.c Show resolved Hide resolved
@pussuw
Copy link
Contributor Author

pussuw commented May 31, 2023

Thanks for looking into this, the style errors are now fixed as well as the modifyreg silliness

pussuw and others added 5 commits May 31, 2023 12:36
Adds a driver for an FPGA fabric / CoreSPI implementation.

Supports multiple instances, assuming they reside in some base address,
offsettable by a constant value.
…STANCES macro

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
The logic for rx_fifo_empty is wrong, needs a loop for the retry to work
Remove unnecessary reading of the status register when loading / unloading
the FIFOs. Reading from the IP block is slow due to BUS synchronization and
this basically makes the SPI busy loop for no reason at all, destroying the
CPU usage.

The overall benefit of these changes is approx. 25%-points, which is a
MASSIVE improvement.
@pussuw
Copy link
Contributor Author

pussuw commented May 31, 2023

The rest of the style errors should now be fixed too

@acassis acassis merged commit 7c2930c into apache:master May 31, 2023
26 checks passed
@pussuw pussuw deleted the mpfs_corespi branch May 31, 2023 23:58
@jerpelea jerpelea added this to To-Add in Release Notes - 12.2.0 Jun 13, 2023
@jerpelea jerpelea moved this from To-Add to In Progress in Release Notes - 12.2.0 Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants