- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have instantiated 7 i2c controllers in our FPGA.
I modified the busses/i2c-oc.c code to handle 7 of these instead of just 2. Basically, I just copied the two instances provided and changed their numbering so that it was 2, 3, 4, 5, and 6 in addition to 0 and 1. I also created new device file entries with "mknod /dev/i2c-N c 89 N". Basically, the driver successfully detects and adds the adapters during kernel boot. However, when it comes time to open the device files, it complains that it either "cannot create", or that there's "No such device". It clearly is not a device file issue. I've put some printk's throughout the driver and found that when it enters "i2c_get_adapter(), it has issues. Inside i2c_get_adapter(), it goes through each of the adapters in a list and tries to match it with the requested number "adapter->nr". It is failing here. printk's inside the i2c_add_adapter() function prove that they are getting added correctly. Why would they get messed up? Basically, ports 2-5 have an "adapter-nr" equalling 0. Port 6 is even more strange, but I'm thinking that once I've figured out ports 2-5, that port 6 might be OK, or at least I'll know where to look. Has anyone tried getting more than 2 i2c devices working using the Microtronix port for the OpenCores I2C controller? Has anyone had any issues related to this? I have a feeling that it is some simple dumb thing that I've forgotten to do, but I've spent several days now without any luck. Any help would be greatly appreciated. Thanks.Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not sure what root file system you are using. If you happen to use romfs, I would recommend to create the device nodes as /dev/i2c/N instead of /dev/i2c-N. Somehow the latter are not correctly generated for romfs because of the character '-'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are using jffs2 for our filesystem.
As it turns out, I had a problem with one of my entries for the last instance. It was erroneously overwriting the 2nd instance, during the part where it adds the adapter to the linked list. This caused the wierd behavior. After fixing this problem, everything worked. We have 7 working i2c ports!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you post what you have done?
Wich file's doe you mod? and what? I am very intrested. And maybe others?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page