-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: spi: Added ZynqMP Generic Quad SPI driver #88466
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
base: main
Are you sure you want to change the base?
drivers: spi: Added ZynqMP Generic Quad SPI driver #88466
Conversation
Ping.. any feedback? |
Ping, needs review |
Hello @robhancocksed I ran Ztest suite and sample tests for flash devices with the patch series. The tests passed on QEMU but are failing on the actual hardware. regards, |
@AmitMahapatra , note that if you are testing on boards with certain Micron flash devices, such as ZCU102, you will need the patches from #88467 since those devices require the flag status register to be read after each program operation, otherwise they get into a state where all following reads return zeros. You will also need the appropriate flags in DT to enable that usage. These are the DT entries I have at the board level which are working for me on ZCU102 with those patches in place:
|
return -ENOTSUP; | ||
} | ||
|
||
if ((spi_cfg->operation & SPI_LINES_MASK) == SPI_LINES_OCTAL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can skip dual and octal too, there is nothing in the SPI API to enable the proper use of dual/quad/octal. (there was a plan to do so years ago...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does have support for basic dual/quad reads/writes which might be useful for some use cases. However, as you noted the SPI API would probably need more fine-grained control to be usable for QSPI flash in those modes, for example..
9c34a65
to
19591cc
Compare
Rebased to main, and added a fix for the shared-data-bus DT parameter not taking effect properly. |
drivers/spi/spi_xlnx_zynqmp_gqspi.c
Outdated
if (spi_cfg->operation & SPI_MODE_CPOL) { | ||
data->spi_cfg |= GQSPI_CFG_CLK_PH_MASK; | ||
} else { | ||
data->spi_cfg &= ~GQSPI_CFG_CLK_PH_MASK; | ||
} | ||
|
||
if (spi_cfg->operation & SPI_MODE_CPHA) { | ||
data->spi_cfg |= GQSPI_CFG_CLK_POL_MASK; | ||
} else { | ||
data->spi_cfg &= ~GQSPI_CFG_CLK_POL_MASK; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
POL and PH swapped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, fixed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new Generic Quad SPI (GQSPI) driver for the Xilinx ZynqMP platform along with the necessary device tree bindings and configuration updates for both hardware and emulated environments.
- Added a dts binding file for the ZynqMP QSPI interface.
- Updated device tree source (DTS) files to integrate the new QSPI node configurations for both ARM and QEMU boards.
- Added Kconfig and CMakeLists entries to enable building the new driver.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
dts/bindings/spi/xlnx,zynqmp-qspi-1.0.yaml | New binding file defining properties for the ZynqMP QSPI driver. |
dts/arm/xilinx/zynqmp.dtsi | Added QSPI node configuration for integration with the DT. |
drivers/spi/Kconfig.xlnx_zynqmp_gqspi | New Kconfig file for enabling the ZynqMP GQSPI driver. |
drivers/spi/Kconfig | Updated to source the new Kconfig file. |
drivers/spi/CMakeLists.txt | Added driver source file for the ZynqMP GQSPI driver. |
boards/qemu/cortex_r5/qemu_cortex_r5.dts | Enabled QSPI and updated flash definitions for the QEMU board. |
boards/qemu/cortex_r5/Kconfig.defconfig | Added default configuration for SPI NOR SFDP selection. |
19591cc
to
181c42c
Compare
Add a driver for the Generic Quad SPI hardware that is part of the Xilinx MPSoC. This is mostly commonly used with QSPI flash devices which are also used for initial image loading, but can also be used with other SPI devices. Signed-off-by: Robert Hancock <[email protected]>
Added device tree entries for the QSPI device and the flash devices which are present behind it on this emulated board. Signed-off-by: Robert Hancock <[email protected]>
Currently ZynqMP board setups do not appear to be using the flash0 node which is used for running in XIP mode from QSPI flash storage. Mark this node as disabled to avoid tripping up the drivers.flash.common.disable_spi_nor tests, which would otherwise try to build with FLASH enabled and SPI_NOR disabled. Signed-off-by: Robert Hancock <[email protected]>
9768032
to
c876ea7
Compare
|
Add a driver for the Generic Quad SPI hardware that is part of the Xilinx MPSoC. This is mostly commonly used with QSPI flash devices which are also used for initial image loading, but can also be used with other SPI devices.
Also added corresponding settings for the QSPI device and emulated flash devices for the QEMU Cortex-R5 board.