Skip to content

drivers/eeprom: Set the bus frequency - #17344

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
ajuckler:eeprom_setspeed
Nov 25, 2025
Merged

drivers/eeprom: Set the bus frequency#17344
xiaoxiang781216 merged 1 commit into
apache:masterfrom
ajuckler:eeprom_setspeed

Conversation

@ajuckler

@ajuckler ajuckler commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

Summary

Add EEPIOC_SETSPEED ioctl acting like the MTDIOC_SETSPEED ioctl.
The default frequency is taken from the Kconfig and can be adjusted at runtime using this ioctl.

The SPI timing configuration parameters from mtd/at25ee have also been copied so that they can be applied to eeprom/spi_xx25xx.

Impact

If CONFIG_SPI_DELAY_CONTROL is set, SPI timing parameters will be explicitly set when communicating with the eeprom/spi_xx25xx device.

As long as the new ioctl command is not used, the EEPROM drivers behaviour is unchanged.

Testing

Tested on a custom target (STM32F7-based) with a Rhom BR25G256FVT EEPROM (equivalent to a Microchip 25xx256).

Changes to the i2c_xx24xx driver have been compiled only.

@github-actions github-actions Bot added Area: Documentation Improvements or additions to documentation Area: Drivers Drivers issues Size: M The size of the change in this PR is medium labels Nov 18, 2025

@linguini1 linguini1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please update the impact section, it isn't none if you've changed the driver.

Also, I don't think these changes should be merged until they are tested with an I2C based EEPROM (since you mentioned you only compile tested that). I have a board with one, I can try to test this patch against it in the next few days (unless someone else beats me to it).

Comment thread include/nuttx/eeprom/eeprom.h
Comment thread drivers/eeprom/spi_xx25xx.c
Comment thread Documentation/components/drivers/character/eeprom.rst Outdated
@ajuckler

Copy link
Copy Markdown
Contributor Author

Please update the impact section, it isn't none if you've changed the driver.

Also, I don't think these changes should be merged until they are tested with an I2C based EEPROM (since you mentioned you only compile tested that). I have a board with one, I can try to test this patch against it in the next few days (unless someone else beats me to it).

Updated, I meant "none" in the sense that as long as the ioctl isn't called the behaviour doesn't differ from the current one.

I don't have a I2C EEPROM at hand so any help in testing this bit is definitely welcome.

jerpelea
jerpelea previously approved these changes Nov 19, 2025
Comment thread drivers/eeprom/Kconfig Outdated
Add EEPIOC_SETSPEED ioctl acting like the MTDIOC_SETSPEED ioctl. The
default frequency is settable in the Kconfig.

Add xx25xx SPI delay control configurations.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>

@linguini1 linguini1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Had a chance to test with my I2C-based EEPROM today (24C32FP by ST). Functional to read from as a character device still.

@linguini1
linguini1 requested a review from acassis November 24, 2025 23:23
@ajuckler

Copy link
Copy Markdown
Contributor Author

Had a chance to test with my I2C-based EEPROM today (24C32FP by ST). Functional to read from as a character device still.

Great, thank you very much for testing

@xiaoxiang781216
xiaoxiang781216 merged commit 02db473 into apache:master Nov 25, 2025
41 checks passed
@ajuckler
ajuckler deleted the eeprom_setspeed branch November 25, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Area: Drivers Drivers issues Size: M The size of the change in this PR is medium State: Needs more testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants