Skip to content

{bp-19177} stm32h5/qspi, drivers/mtd/gd25: add QSPIMEM_QUADDATA flag and GD25 QSPI support#19276

Merged
xiaoxiang781216 merged 2 commits into
apache:releases/13.0from
jerpelea:bp-19177
Jul 3, 2026
Merged

{bp-19177} stm32h5/qspi, drivers/mtd/gd25: add QSPIMEM_QUADDATA flag and GD25 QSPI support#19276
xiaoxiang781216 merged 2 commits into
apache:releases/13.0from
jerpelea:bp-19177

Conversation

@jerpelea

@jerpelea jerpelea commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

include/nuttx/spi/qspi.h currently has QSPIMEM_QUADIO for 1-4-4 transfers (address and data both on quad lines) but no way to express 1-1-4 (single-line address, quad-width data only). Several NOR flash devices use this mode for page program commands.

This adds QSPIMEM_QUADDATA (bit 1) and QSPIMEM_ISQUADDATA() to fill that gap, and extends the STM32H5 QSPI driver to set CCR_DMODE_QUAD when either QUADIO or QUADDATA is set. The address-mode selection block is unchanged, so QUADDATA keeps addrmode at single-line.

The GD25 MTD driver is updated as the first user, gaining a CONFIG_GD25_QSPI build option that switches it from SPI to QuadSPI. When enabled, gd25_initialize() accepts a qspi_dev_s pointer and a bool unprotect. Both 3- and 4-byte address modes are supported, and the existing SPI path is fully preserved when CONFIG_GD25_QSPI=n.

Impact

RELEASE

Testing

CI

@github-actions github-actions Bot added Arch: arm Issues related to ARM (32-bit) architecture Area: Drivers Drivers issues Size: M The size of the change in this PR is medium labels Jul 2, 2026
Add QSPIMEM_QUADDATA to the QSPI memory flags. This flag selects quad
data width while keeping the address phase on a single line (1-1-4),
which QSPIMEM_QUADIO cannot express (it forces quad on both address and
data phases). Update stm32_qspi_memory() to honour the new flag by
setting CCR_DMODE_QUAD without touching the address mode.

Signed-off-by: Sammy Tran <sammytran@geotab.com>
Add QSPI mode to the GD25 MTD driver alongside the existing SPI path.
When CONFIG_GD25_QSPI is selected, sector erase, chip erase, byte read,
page write, and byte write all use the QSPI command/memory interfaces
instead of SPI. Reads use the quad I/O fast-read command (1-4-4) and
writes use the quad page-program command (1-1-4) via QSPIMEM_QUADDATA.
A new Kconfig option enables the QE bit in SR2 at initialisation so the
quad I/O pins are active.

Signed-off-by: Sammy Tran <sammytran@geotab.com>
@xiaoxiang781216 xiaoxiang781216 merged commit 961fd8f into apache:releases/13.0 Jul 3, 2026
24 of 41 checks passed
@jerpelea jerpelea deleted the bp-19177 branch July 3, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Area: Drivers Drivers issues Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants