drivers: flash: Read/write arbitary commands via ex_op API#98619
drivers: flash: Read/write arbitary commands via ex_op API#98619utsavm9 wants to merge 1 commit intozephyrproject-rtos:mainfrom
Conversation
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>
|
Also requesting review from @anangl @swift-tk @rruuaanng because they have been helpful in other similar PRs. |
|
|
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. |
|
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. |



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_opAPI for the above goal. npcx_flash already implements similar function in their vendor extended operations:zephyr/include/zephyr/drivers/flash/npcx_flash_api_ex.h
Line 57 in 0f5e03f
zephyr/include/zephyr/drivers/flash/npcx_flash_api_ex.h
Line 66 in 0f5e03f
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