-
Notifications
You must be signed in to change notification settings - Fork 569
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
core: i2c: add i2c master #2026
base: master
Are you sure you want to change the base?
Conversation
b0ca27c
to
447cb6c
Compare
Thanks @maass-hamburg, will try to review soon (but will be in holidays at the end of the week for 2 weeks). @AndrewD might also be interested. |
@maass-hamburg this does sound very interesting: do you have any examples of a gateware driver that uses this core? We have been using the misoc i2c core for a while (recently integrated in litex): it's a step up from bitbank but small and limited, so we will look seriously at your core soon. |
mcp9843.py.txt To add it you just have to add this code:
|
Thanks, that looks like quite a logical interface and the usage pattern is similar to your zephyr driver which is as I expected. I think we will transition our usage to this core. It already exposes capabilities we were thinking about adding to the misoc i2c interface I pushed to litex recently. Do you have any unit tests for the core you can share? |
Unfortunately I haven't wrote any for it yet. |
e68e8a7
to
12b6e9a
Compare
12b6e9a
to
3a6b7b2
Compare
I just had another look at this: the next thing that come to mind is support for IRQ so the a message can be queued without polling for completion. For example IRQ based on tx and rx fifo watermarks similar to spimmap would be one such strategy. See spi_mmap.py#L305-L315 for an implementation. |
@maass-hamburg: sorry for the delay, just to let you know that I'll try to merge it soon, just need to think of the way we integrate it. |
@enjoy-digital what do you think about putting it into its own repo, like LiteSPI? There we could also add some simple i2c drivers for peripherals in logic. |
@maass-hamburg: Thanks, I was also thinking about this and this would also give your more flexibility for the development. I just created https://github.com/litex-hub/litei2c and you should have receive an invitation to maintain it. Feel free to create an initial structure close to LiteSPI and push the core to it. |
05702d8
to
91e1a46
Compare
add litei2c to litex. Signed-off-by: Fin Maaß <[email protected]>
91e1a46
to
e4ad995
Compare
add a i2c master similar to LiteSPI.
This has the big benefit by using crossbar, that the i2c bus can be used at the same time by drivers, that are in logic, and from the CPU.
The driver for zephyr can be found here: zephyrproject-rtos/zephyr#76554