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

feat(spi_nand_flash): Add SIO (full-duplex) and DIO mode support #476

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RathiSonika
Copy link
Collaborator

@RathiSonika RathiSonika commented Feb 20, 2025

Change description

spi_nand_flash: Added standard (full-duplex), DIO, DOUT spi mode support.
QIO mode support will be added in another PR

@RathiSonika RathiSonika changed the title Feat/nand flash standard spi mode feat(spi_nand_flash): Add SIO (full-duplex) and DIO mode support Feb 20, 2025
@RathiSonika RathiSonika force-pushed the feat/nand_flash_standard_spi_mode branch from b733e37 to ba1fae0 Compare February 20, 2025 10:51
@@ -24,6 +24,7 @@ struct spi_nand_flash_config_t {
spi_device_handle_t device_handle; ///< SPI Device for this nand chip.
uint8_t gc_factor; ///< The gc factor controls the number of blocks to spare block ratio.
///< Lower values will reduce the available space but increase performance
uint8_t flags; ///< set flag with SPI_DEVICE_HALFDUPLEX for half duplex communcation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this can be replaced with an enum (SIO/DIO/DOUT/QIO/QOUT) defined in this component, so that there is less dependency on the way SPI master driver defines its flags.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this flag is not used to define the mode (SIO/DIO/QIO) but rather to indicate half or full duplex in the case of SIO. For other modes, I believe half-duplex is mandatory. As mentioned above, if IO mode will be replaced with enum instead of Kconfig, then we will need io_mode config setting along with this flag.

We could introduce a separate flag or enum for configuring half/full duplex, but that would require the application to ensure synchronisation between the SPI driver and the NAND flash driver. To avoid this complexity, I have used the same flag as in spi_master to inform the NAND flash driver whether communication is full-duplex or half-duplex.
This was my thought behind adding this flag. Please let me know your thoughts.

@RathiSonika RathiSonika force-pushed the feat/nand_flash_standard_spi_mode branch from 19e9346 to 3030c3d Compare February 28, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants