Boot the Zipit Z2 from a USB drive

In June, I posted about the “bleeding edge” version of openwrt-zipit and a new u-boot. There was just a brief mention that USB host support was built into it and I never got around to testing it until yesterday. It is pretty easy to setup and requires a USB host cable or my breakout board. The following should get you going.

A small patch is required to the kernel to enable host mode at boot which is already pushed to my kernel source and the openwrt-pxa-target repos. Additionally, the compiled bleeding edge repo has this builtin. The new magic kernel parameter to enable host mode at boot is pxa27x_udc.host_portmode_init=1.

You will need to upgrade to the latest u-boot binary if you haven’t already, and use this u-boot environement:

dd if=openwrt-pxa-zipitz2-u-boot.bin of=/dev/mtdblock0
dd if=u-boot.env of=/dev/mtdblock1

The new environment boot command checks for a bootable SD card first, then bootable USB (device 0 partition 1) and then boots from internal flash. Put the latest bleeding edge rootfs on your USB drive of choice. Then put the kernel at /boot/uImage on the USB drive. Lastly, put the USB enabled uboot.script at /boot/uboot.script.

If you are using my breakout, you need to have the Zipit plugged in and the USB Power Jumper set for DC_IN. Alternatively, you can force the regulator to be always on by soldering a jumper wire from the Enable resistor to the input power capacitor, and set the USB Power Jumper to REG5V as shown in the image below. This allows you to boot from USB while on battery power. Keep in mind the regulator won’t power a USB hard drive, but you could have the hard drive externally powered.

u-boot bootcmd:

if mmc rescan && ext2load mmc 0 0xa0000000 boot/uboot.script ; then source 0xa0000000; elif usb start && ext2load usb 0:1 0xa0000000 boot/uboot.script; then source 0xa0000000; else bootm 0x50000; fi;

u-boot.script.usb source:

if ext2load usb 0:1 0xa0000000 /boot/uImage ; then
    setenv bootargs console=tty0 console=ttyS2,115200 fbcon=rotate:3 pxa2xx-cpufreq.pxa27x_maxfreq=520 pxamci.ignore_crc_errors=1 pxa27x_udc.host_portmode_init=1 rootwait root=/dev/sda1 init=/etc/preinit
    bootm 0xa0000000;

Archives By Month