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

kasli_i2c: fix EEPROM access issue in DRTIO networks #2692

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

Conversation

fsagbuya
Copy link
Contributor

@fsagbuya fsagbuya commented Mar 4, 2025

ARTIQ Pull Request

Description of Changes

Fix DRTIO EEPROM access for Urukul:

  • Add destination parameter to KasliEEPROM to encode DRTIO destination
  • Leverage existing remote I2C functionality to access satellite EEPROMs

Test results:
Before:

Writing test values...
Master writing:
305419896
Satellite writing:
-2023406815
Reading values after write:
Master:
-2023406815
Satellite:
-2023406815

After:

Writing test values...
Master writing:
305419896
Satellite writing:
-2023406815
Reading values after write:
Master:
305419896
Satellite:
-2023406815

Related Issue

Closes #2687

Type of Changes

Type
🐛 Bug fix

Steps (Choose relevant, delete irrelevant before submitting)

All Pull Requests

  • Use correct spelling and grammar.
  • Update RELEASE_NOTES.rst if there are noteworthy changes, especially if there are changes to existing APIs.
  • Close/update issues.
  • Check the copyright situation of your changes and sign off your patches (git commit --signoff, see copyright).

Code Changes

  • Run flake8 to check code style (follow PEP-8 style). flake8 has issues with parsing Migen/gateware code, ignore as necessary.
  • Test your changes or have someone test them. Mention what was tested and how.
  • Add and check docstrings and comments
  • Check, test, and update the unittests in /artiq/test/ or gateware simulations in /artiq/gateware/test

Git Logistics

  • Split your contribution into logically separate changes (git rebase --interactive). Merge/squash/fixup commits that just fix or amend previous commits. Remove unintended changes & cleanup. See tutorial.
  • Write short & meaningful commit messages. Review each commit for messages (git show). Format:
    topic: description. < 50 characters total.
    
    Longer description. < 70 characters per line
    

Licensing

See copyright & licensing for more info.
ARTIQ files that do not contain a license header are copyrighted by M-Labs Limited and are licensed under LGPLv3+.

@fsagbuya fsagbuya changed the title kasli_i2c: fix EEPROM aliasing issue in DRTIO networks kasli_i2c: fix EEPROM access issue in DRTIO networks Mar 4, 2025
Comment on lines 31 to 32
self.sw0 = dmgr.get(sw0_device)
self.sw1 = dmgr.get(sw1_device)
Copy link
Member

Choose a reason for hiding this comment

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

Looks dodgy.

Comment on lines +39 to +47
# Skip master-side switch operations for satellite EEPROMs
if (self.busno >> 16) == 0:
mask = 1 << self.port
if self.port < 8:
self.sw0.set(self.port)
self.sw1.unset()
else:
self.sw0.unset()
self.sw1.set(self.port - 8)
Copy link
Member

Choose a reason for hiding this comment

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

How does this work?!
The switches obviously need to be set on the satellites instead.

Copy link
Contributor Author

@fsagbuya fsagbuya Mar 11, 2025

Choose a reason for hiding this comment

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

From what I understand, this still works upon testing because remote_i2c automatically sets the switches based on the destination parameter, unlike local_i2c which needs to be set manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Urukul EEPROM DRTIO access
2 participants