BeagleBoard.org GSoC 2013 : Minix I2C Drivers for the BeagleBone Black
Saturday 2 January 2016
MINIXCon 2016 Announcement
Just a quick note to let you know that I will be giving a talk titled Device Driver Development Demystified at MINIXCon 2016.
Tuesday 16 September 2014
Minix 3.3.0 Released
Today, Minix 3.3.0 was released. The Google Summer of Code work I did, developing i2c related drivers for the Beagle hardware, made it into that release. Check out the release information here.
Saturday 18 January 2014
Mentor giving 'MINIX3 on ARM' talk at FOSDEM
Just a quick post to let you know that my primary Google Summer of Code mentor from 2013, Kees Jongenburger, will be giving a talk at FOSDEM 2014 titled "MINIX3 on ARM". If you're going to be at FOSDEM, I highly recommend checking it out.
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:
Code merged into mainline Minix:
- Drivers for AM335X Peripherals: i2c, rtc, gpio, padconf.
- Power Management Drivers: TPS65217, TPS65950.
- Environmental Sensor Drivers: SHT21, BMP085, TSL2550.
- Miscellaneous Drivers: CAT24C256, TDA19988.
- Features: rebooting, power-off, EDID reading.
- Userland: /dev/i2c and i2cscan (from NetBSD), eepromread.
- Expansion Boards: Weather Cape.
- Cool Demo: weatherstation web app.
- Netbooting Minix on ARM
- The I2C protocol
- I2C Subsystem Internals
- I2C Device Driver Programming
- EDID Reading Internals
- The RTC protocol
- Supporting BeagleBone Capes
- BeagleBone Weather Cape
- Unofficial Minix/arm Test Plan
- Project Videos: Final Summary, Intro Video.
- Demos: PMIC Power-Off, RTC, weatherstation, gpio.
- Misc: gource visualization of commits.
- Reports: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13.
- Minix/arm Tutorials: BeagleBone Black (1,2,3), BeagleBoard-xM, Linaro QEMU, netbooting, file transfer with zmodem, debugging with openocd.
- Misc Tutorials: i2c-tools on Angstrom, FreeBSD on BeagleBone Black.
- Finish porting the frame buffer driver to AM335X.
- Support for the 4D 4.3 LCD CAPE.
- Support for HDMI output.
- pkgsrc for Minix/arm.
- Helping test release candidates.
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.
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:
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.
- 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.
- 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).
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:
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.
- 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.
- Get the Minix fb driver working with the 4D 4.3 LCD CAPE
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.
Subscribe to:
Posts (Atom)