Minix I2C Drivers for the BeagleBone Black - Report 2

This is Report #2. I plan to post these every Sunday. They will give a rundown of what I’ve done during the week, list any problems I had, and what I plan to do the following week. I’ll be posting the reports both to the beagle-gsoc Google Group and to my blog.

Completed this week:

  • Rebased against mainline Minix.
  • Collaborated with mentors and other developers on a design document.
  • Finished the i2c bus read function.
  • Developed the i2c bus write function.
  • Implemented the NetBSD/OpenBSD i2c /dev interface.
  • Imported i2cscan from NetBSD into the my source tree.
  • Started working on a CAT24C256 EEPROM test program that uses the /dev interface.
  • Put an EEPROM on a bread board and started testing some of the i2c buses on the BBB. See my blog post for details.

Issues / Concerns / Challenges:

  • I spent several hours trying to get the i2cscan program from NetBSD working right. It turns out the i2c controllers on the am335x and dm37xx don’t support i2cscan’s method of probing devices on the bus in most address ranges. For most ranges of slave addresses, i2cscan attempts 0 byte writes (i.e. quick writes). The i2c controllers on the am335x and dm37xx treat a 0 count as 65536. The end result is that only a few i2c devices are detected by i2cscan. It can detect a few devices in some slave address ranges because it attempts a 1 byte read in those ranges. To get around this issue, I will be adding a command line option (’-r’) to scan all slave address ranges via the one byte read method. This ‘-r’ option would work the same as the ‘-r’ option that the i2cdetect program from i2c-tools provides.

Plan for next week:

  • Enhance usr.sbin/i2cscan to support scanning using only the 1 byte read method (i.e. make it work similar to i2cdetect -r). Submit patches upstream to NetBSD.

  • Finish developing the test program. It’s basically going to write to specific locations in the EEPROM and read back what it wrote.

  • More Testing. Use the EEPROM test program on the various i2c buses on the BeagleBone Black and BeagleBoard-xM. Fix any bugs.

  • Define the interface for accessing the i2c bus from other drivers, document on the Minix wiki (or at least write the documentation so it can be posted to the wiki later).

  • Implement a way for drivers to “claim” devices on the bus so that user programs and unrelated drivers don’t interfere with the device.

  • Start work on an eeprom driver.