Skip to content

drivers: flash: Read/write arbitary commands via ex_op API#98619

Open
utsavm9 wants to merge 1 commit intozephyrproject-rtos:mainfrom
utsavm9:flash_ex_op
Open

drivers: flash: Read/write arbitary commands via ex_op API#98619
utsavm9 wants to merge 1 commit intozephyrproject-rtos:mainfrom
utsavm9:flash_ex_op

Conversation

@utsavm9
Copy link
Contributor

@utsavm9 utsavm9 commented Oct 30, 2025

Some of the drivers in Zephyr are bus-HAL-specific drivers. Example: Zephyr SPI, Zephyr MSPI, NRFX QSPI, STM QSPI. When users want to write flash-part specific driver with the command set of their particular flash part, they should not need to reimplment or copy everything the bus-specific driver is doing. It would be easier for users to compose their flash-vendor specific driver using the bus-specific driver already in tree.

This PR introduces the flash_ex_op API for the above goal. npcx_flash already implements similar function in their vendor extended operations:

FLASH_NPCX_EX_OP_SET_QSPI_OPER,

FLASH_NPCX_EX_OP_GET_QSPI_OPER,

I want this for Flash MSPI driver at least because setting up the MSPI transaction is not trivial, but I believe this extended operation will be relevant for more drivers too. Implementation for Flash MSPI driver to follow after a RFC on this: #98621

Allow users to write flash-vendor-specific drivers with the commands
particular to their flash part using the existing Zephyr flash drivers.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
@utsavm9
Copy link
Contributor Author

utsavm9 commented Oct 30, 2025

Also requesting review from @anangl @swift-tk @rruuaanng because they have been helpful in other similar PRs.

@swift-tk
Copy link
Contributor

swift-tk commented Dec 6, 2025

Not sure this is the right way to do this, the cmds are pretty much SPI specific and they should be either resolved by SFDP or vendor specific quirks in the flash_mspi_nor driver if it is none standard. See #88920

@anangl
Copy link
Member

anangl commented Dec 17, 2025

Not sure this is the right way to do this, the cmds are pretty much SPI specific and they should be either resolved by SFDP or vendor specific quirks in the flash_mspi_nor driver if it is none standard. See #88920

I agree. To me this does not look like a proper solution, more like a hack. What @swift-tk suggests seems more appropriate.

@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment