Sunday, 22 September 2013

Final Report

This will be my last report as Google Summer of Code is officially wrapping up at noon tomorrow. The report will give a rundown of everything I've done during the summer and list my future plans.

Code merged into mainline Minix:
Documentation:
Videos:
Blog Highlights:
Future (Post-GSoC) Plans:
  • Finish porting the frame buffer driver to AM335X.
  • pkgsrc for Minix/arm.
  • Helping test release candidates.
I really enjoyed my work this summer. The project wouldn't have been nearly as successful as it turned out to be if it weren't for the following people and organizations: BeagleBoard.org, Minix, Google, Jason Kridner, Kees Jongenburger, Frans Meulenbroeks, Ben Gras, David van Moolenbroek, and Lionel Sambuc.

Thursday, 19 September 2013

Project Results Video Posted

I just uploaded a YouTube video summarizing the results of my project. The video is embedded below and also viewable at the following URL: http://youtu.be/dxjaFsWYkAM

Wednesday, 18 September 2013

Soft Pencils Down

This past Monday marked the "Soft Pencils Down" date for Google Summer of Code. This week is "a week to scrub code, write tests, improve documentation, etc.", so that's what I've been doing.

Today I committed 4 patches to mainline Minix: tda19988: add missing blockdriver_announce() call, bmp085: remove duplicate code, libi2cdriver: add functions for IC register access, i2c: increase read/write timeout. They're mostly clean-up and refactoring. The net result is 390 fewer lines of code and improved reliability.

This week I wrote and executed a test plan for everything I've developed this summer (and more!). It can be found here, on the Minix wiki. Later today I'll be reviewing all of the other documentation I wrote this summer to ensure that it's complete, accurate, and up to date. Following that, I'll be working on a final summary video and a final report.

Sunday, 15 September 2013

Report 13 (September 9 - September 15)

This is Report #13. 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
  • Continued working on porting the frame buffer driver to the AM335X. It can turn on the display and back-light and do the initialization steps, but currently it's only displaying 1 non-black pixel. More debugging work remains.
Issues / Concerns / Challenges:
  • The frame buffer driver is more challenging than I first thought. Additionally, the test program which draws raccoons on the frame buffer doesn't support 24-bit color which is needed for the LCD I'm testing with. Since there is only 1 week left and it's supposed to be for clean-up/documentation, I'm deferring the rest of the work on the frame buffer driver until after the clean-up / documentation is done.
Plan for next week:
  • Code clean-up. Think about what can be improved and do it.
    • libi2cdriver: Add common reg_read()/reg_write() functions for accessing registers on ICs.
    • TDA19988: Add a call to blockdriver_announce().
  • Review and test all code. Make sure everything still works as expected.
  • Go over documentation. Make sure it's up to date, accurate, and complete.
  • Create a final summary video for the project.
  • Revisit the frame buffer driver.

Tuesday, 10 September 2013

Building a custom FreeBSD SD card image for the BeagleBone

In an effort to figure out the clocking for the LCD controller on the AM335X, I built a custom FreeBSD SD card image for the BeagleBone. I thought I'd share the steps I used to build the image as it isn't totally trivial. Though, the crochet-freebsd scripts really do help a lot.

The best host for cross building a FreeBSD image is FreeBSD. Since my main box runs Gentoo Linux, I decided to setup a FreeBSD virtual machine under QEMU with the latest version of FreeBSD. Here are the steps to fetch the ISO, create a disk image for the virtual machine, and run the installer:

wget -O freebsd.iso ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.2/FreeBSD-9.2-RC3-i386-disc1.iso

qemu-img create freebsd.img 32G


qemu-kvm -localtime -net user -net nic -m 2048 -cdrom freebsd.iso \
    -hda freebsd.img -boot d


There isn't a whole lot to configure during the installation. The defaults should be fine. I chose the sshd option as it allowed me to easily transfer the image off of the VM later on. Once the installation of FreeBSD is complete, you can start QEMU with this command:

qemu-kvm -rtc base=utc -net user,hostfwd=tcp::2222-:22 \
    -net nic -m 2048 -hda freebsd.img


Log in to the virtual machine and install the dependencies (subversion, git, bash, gmake, and gsed). Then use subversion to checkout the latest sources. Finally build an ARM cross compiler:

pkg_add -r subversion git bash gmake gsed

rm -rf /usr/src && svn co http://svn.freebsd.org/base/head /usr/src


cd /usr/src && make XDEV=arm XDEV_ARCH=armv6 xdev


The next step is to get a copy of crochet-freebsd and u-boot.

cd ~ && git clone git://github.com/kientzle/crochet-freebsd.git

cd crochet-freebsd && ftp ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2


tar xf u-boot-2013.04.tar.bz2


Finally, run the crochet.sh script to build the image.

sh crochet.sh -b BeagleBone

The build will take a while, especially in a VM. When it's done, there will be an SD card image under the work directory. Insert an SD card and be sure to unmount any partitions that were auto-mounted. On my Linux host, I ran these two commands to fetch the image off of the VM and write it to the SD card.

scp -P 2222 root@localhost:/root/crochet-freebsd/work/*.img .

dd if=FreeBSD-armv6-BEAGLEBONE.img of=/dev/sdb bs=1M oflag=direct





That's it. Just put the card into the BeagleBone and apply power. It should boot up to a login prompt. At the prompt you can log in as root (no password).

Sunday, 8 September 2013

Report 12 (September 2 - September 8)

This is Report #12. 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.
  • Finished porting the GPIO driver to the AM335X (demo video).
  • Code merged into mainline Minix this week:
  • Continued working on porting the fb driver to the AM335X.
Issues / Concerns / Challenges:
  • Figuring out all of the clocking for the AM335X LCDC peripheral has been very challenging, especially determining the relationship between the functional clock, module clock, Display PLL, and pixel clock and their respective divisors and multipliers. There is a BSD licensed LCDC driver in FreeBSD that I may either re-use or add some debugging output to which would enable me to see all of the various clock values and multipliers/divisors in a working configuration.
Plan for next week:

Wednesday, 4 September 2013

Support for AM335X GPIO merged in mainline Minix

The changes to Minix's GPIO library that I've been working on were merged today (commit). The changes enable the use of GPIO on the BeagleBone and BeagleBone Black through the gpio file system which is sort of similar to the gpio-sysfs interface on Linux. I posted a demo video of the code in action earlier this week.

Monday, 2 September 2013

BeagleBone Black GPIO Demo Video Posted

I just uploaded a YouTube video showing off the Minix GPIO driver I ported to the AM335X. The video is embedded below and also viewable at the following URL: http://youtu.be/Me5AUs-uMbM


Sunday, 1 September 2013

Report 11 (August 26 - September 1)

This is Report #11. 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:
 Issues / Concerns / Challenges:
  • With the gpio driver, I'm running into the limit of allowed interrupts per driver. Specifying the 6 dm37xx interrupt numbers and 8 am335x interrupt numbers in the system configuration file puts it over the limit of 8. The likely fix is to increase the per driver interrupt limit, but I'm still exploring other possible solutions.
Plan for next week:
  • Finish testing the gpio driver, resolve interrupt limit mentioned above, and submit to mainline Minix.
  • Continue working on the frame buffer driver.