USB Gadget is a kernel driver that allows the use of a USB device controller in an embedded system to talk with a host. The Zipit 2 does not have USB Gadget enabled in its kernel, so we cannot use the USB device port that is brought out to its expansion port. However, with a new kernel it is possible to use it. Some kernel developers, located here, have written a driver to take advantage of the PXA27x’s USB Device Controller. The original driver was for 2.6.22 kernel while the Zipit’s kernel is 2.6.21.1. After downloading the most recent git kernel source and diff’ing it with a plain 2.6.22 vanilla kernel, we were able to get a patch. With a few modifications made to the patch to work with 2.6.21.1 (changing CKEN_USB to CKEN11_USB in three places), we now have a patch that will patch the 2.6.21.1 kernel (this patch was used first before using the Zipit specific patch). After building the patched kernel, the serial port is used to allow testing of the kernel via blob the bootloader. Results have been promising as shown here.
- Checkout the misc module from cvs (More Info)
- Patch vanilla 2.6.21.1 kernel by running ‘patch -p1 < ../PATH_TO/pxa27x-udc.patch’ from within kernel source tree
- Do not worry about offset warnings
- Patch kernel now with Zipit specific patch by running ‘patch -p2 < ../linux-2.6.21.1_to_zipit2-1.0.patch’
- Run ‘make menuconfig’ and you can now add USB gadget support.
- You will need to create an initramfs and change the path to the initramfs directory under General Setup of the kernel config (absolute path required).
- Setup the serial interface and use blob to download and boot the new kernel