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

Adds read-only property for the I2C EEPROM Target #75777

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Manu3l0us
Copy link

In case the EEPROM data stored in the buffer shall be not writable from the I2C interface, the read-only property can now be set in the device tree.

@Manu3l0us Manu3l0us force-pushed the read_only_eeprom_target branch 2 times, most recently from 2e4621a to 2abe1e1 Compare July 11, 2024 17:03
Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

Looks good! Now all that's needed is a corresponding test case in tests/drivers/i2c/i2c_target_api/ 👍

@Manu3l0us
Copy link
Author

Looks good! Now all that's needed is a corresponding test case in tests/drivers/i2c/i2c_target_api/ 👍

Good point, I will figure out how and update the PR once done.

@Manu3l0us
Copy link
Author

@henrikbrixandersen I am thinking about adding another EEPROM which is read-only to the device tree overlays within the test project. Also an EEPROM with 16bit addressing should be added to increase test coverage of the existing code which also supports this since a couple of months. I could probably do that at the same time. Does this sound like the right approach to you?

@henrikbrixandersen
Copy link
Member

@henrikbrixandersen I am thinking about adding another EEPROM which is read-only to the device tree overlays within the test project. Also an EEPROM with 16bit addressing should be added to increase test coverage of the existing code which also supports this since a couple of months. I could probably do that at the same time. Does this sound like the right approach to you?

Yes, that sounds good along with some accompanying test cases.

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 Sep 14, 2024
@Manu3l0us
Copy link
Author

I took this up again as I was busy with other stuff during the last months. I tried to run the existing test on a RPi Pico but couldn't get it to work until now. What hardware setup is needed to run those tests?

@Manu3l0us
Copy link
Author

@henrikbrixandersen I finally had the time to write a simple test and I pushed my work in progress. Some questions:

  1. On the i2c_dw based target I'm using here, no NACK is generated and therefore I don't get a non-zero return code. Therefore I currently commented this check out for the test to run. Should I add a platform dependent test condition or how would you handle this?
  2. I added the overlay for the rpi_pico which I currently use and I updated the overlay for it. What is the general expectation when adding test cases? Shall I update the other overlays as well? I don't have the hardware to test any of those boards.

@Manu3l0us Manu3l0us force-pushed the read_only_eeprom_target branch 4 times, most recently from 9816428 to 0db9102 Compare November 14, 2024 15:02
In case the EEPROM data stored in the buffer shall be not writable from the
I2C interface, the read-only property can now be set in the device tree.

Signed-off-by: Manuel Aebischer <[email protected]>
@Manu3l0us Manu3l0us force-pushed the read_only_eeprom_target branch 3 times, most recently from f136954 to 7d2aeea Compare November 14, 2024 15:59
This additional test case verifies that an i2c_eeprom_target, which is
set as read-only in the device tree cannot be written from the I2C bus.

Signed-off-by: Manuel Aebischer <[email protected]>
@Manu3l0us
Copy link
Author

Manu3l0us commented Nov 14, 2024

Okay, I saw that the boards are tested in CI, so I can safely add it to the overlays without breaking the tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree area: EEPROM area: I2C size: XS A PR changing only a single line of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants