Minix I2C Drivers for the BeagleBone Black - Report 1

This is the first of many weekly reports. 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.

As this is my first report, I’m including links to all of the project resources:

Completed this week:

  • Rebased the skeleton code I had developed when writing my GSoC application.

  • Extracted the clock configuration code from libgpio and put it into it’s own library, libclkconf. Merged.

  • Used libclkconf to configure the clocks for i2c. I2C_REV is now readable on all buses on the BeagleBone Black and BeagleBoard-xM.

  • Wrote code to configure the pins with libpadconf. Need to finish more of the driver to completely test this.

  • Removed duplicate code in libpadconf. Merged.

  • Implemented the i2c initialization procedure described in the TRM.

  • Began work on a read function. It isn’t complete yet, but it can read the magic number and board name from the on board EEPROM on the BeagleBone Black. Screenshot.

  • Setup netbooting and figured out how to transfer files with ZMODEM. This will improve my productivity a lot. Documented procedure on the project blog (netboot, serial transfer) and Minix wiki (netboot, serial transfer).

  • Received a BeagleBoard-xM from TI. Thanks TI! Tried it out and made a blog post about running Minix on the BeagleBoard-xM. Will use it for developing/testing Minix i2c support for the dm37xx.

  • Received a Welcome Package from Google. Thanks Google!

Issues / Concerns / Challenges:

  • The files for the stage 1 bootloader and u-boot are downloaded from the Minix website when doing a fresh build of an SD card image. Once this week, the website was down for a few minutes and I couldn’t do a build. To prevent this from happening again, I setup a local mirror on my computer.
  • Writing 2GB SD card images to the uSD card is time consuming. It takes about 7 minutes with my class 4 card. I’d prefer a much faster write, compile, test cycle. To overcome this issue, I setup a netboot environment and will use zmodem to transfer my changes (usually just 1 file).

Plan for next week:

  • Clean up and finish the read function. Get it working on the BeagleBoard-xM as well.
  • Implement the write function.
  • Put some EEPROMs on a bread board and test reading and writing data on all of the buses to confirm proper pin configuration and test read/write functions.
  • As time permits, begin implementing the /dev interface.

Hi Thomas,

Good progress! And good documentation!
Actually I am wondering if this project is not too small to keep you busy all summer.
I will try to reproduce your work later this week (time permitting)

Best regards, Frans

2013/6/23 Thomas Cort <linuxgeek@gmail.com>

Hi Frans,

Actually I am wondering if this project is not too small to keep you busy
all summer.

While I am ahead of my original timeline by a little, I think I will
be able to find enough to do :slight_smile: The timeline I originally submitted
with my GSoC application didn't include some things that we've
discussed since then. It didn't include time for supporting the
Weather Cape which will require implementing drivers for each of the
i2c sensor ICs and making some sort of data logger demo, it didn't
include time for implementing support for the BeagleBoard-xM in
addition to the BBB (the I2C registers for the dm37xx are slightly
different from the am335x), nor did it include time for implementing
the Linux /dev interface in addition to the NetBSD /dev interface. The
other items on my deliverables list, driver for the power management
IC (TPS65217C) and configuring the framebuffer with EDID information,
could be extended in the event that I have time left over. For
example, I could enhance Minix to make use of the new functionality
provided by the PMIC driver. If, after all of that and any other I2C
stuff I forgot to mention above, I still need something to do, there
is no shortage of Minix BBB drivers to work on. IIRC, Minix still
needs BBB drivers for ethernet, usb, spi, pwm, can, and more.

Cheers,
Thomas