This program has been superceded by bbl (BalloonBinaryLoader). This page is now merely here as archival documentation.
This script automates the process of programming the CPLD, boot loader, kernel image and root filesystem into a Balloon board. For more information about the process, see BalloonSoftwareLoading. It is a simple bash scriptalthough it's got quite long as functions get added.
The script is available here.
It takes a whole load of command line options:
- --noaudiooff: skip balloon-audio-off --nocpld: skip CPLD programming --nojflash: skip mini-bootldr jflashing --nobootldr: skip bootldr upload --nokernel: skip kernel upload --noroot: skip root fs upload --noprompt: don't prompt the user to hit a key --usebootimage: use a boot yaffs image instead of kernel file --erasenand: erase the NAND flash before programming boot and root --getmachineid: get the machine id from /proc/machineid --noscroll: don't output HTML/Javascript to make browser scroll
--commanddirectory <command directory>: set the directory to look for binaries in (Jflash-balloon, playxsvf)
--imagesdirectory <file directory>: location of boot loader, kernel and root image files
--smallbootloaderfile <small boot loader file name>: name of boot loader to program by Jflash (usually bootldr.small)
--bootloaderfile <boot loader file name>: name of the real boot loader (usually bootldr.fast)
--bootimagefile <boot image file name>: name of the kernel image
--rootimagefile <root image file name>: name of the root filesystem YAFFS image
--cplddirectory <cpld file directory>: directory containing CPLD XSVF file
--cpldfile <cpld file name>: name of XSVF file to program into the CPLD
--uploadfile <source file> <destination file>: upload another arbitrary file, for example /etc/ipkg.conf
--serialport <serial port name>: device name of serial port, for example /dev/ttyS0
--jflashbaseaddr <jflash port base address>: base address of parallel port for jflash dongle
--cpldbaseaddr <cpld port base address>: base address of parallel port for CPLD dongle
Requirements
This script needs the following bits of supporting software to be on your system:
- sz for the serial transfers.
- chat for dealing with the serial conversation
It also needs these local commands (if the relevant options are used)
playxsvf for uploading the cpld code
balloon-audio-off for turning off the audio whilst uploading the CPLD
jflash for flashing the small bootloader
It has probably only been tested with bash, rather than more primitive shells.
Operation
Fillballoon supports two jtag dongles on different addresses - one for CPLD programming, and one for Jflash programming, because there are separate JTAG chains for the CPLD and the CPU. Thus for production efficiency fitting a second parallel port makes sense. For lower volume you can use a simple printer switch box, and for really low volume (about 2 boards
you can plug them in and out.
As you can see from the options you can specify directories for the various files to upload, and for the local commands. If you put the command in 'bin' and the files in 'imagefiles' then the default script will work if you just set $BALLOONBASE near the top of the script.
The script can record the unique ID of each card as they are programmed (useful for production).
It can be run via a web interface as a cgi-script, and has the facility to emit a bit of javascript to scroll the display back down to the bottom, which is handy - turn this off if not using it this way (--noscroll), as it just clutters up the screen.
Examples
Here is a typical command line for updating a working 2.05g balloon to updated bootloader, kernel and rootfs, located in the current directory.
fillballoon6.sh --noaudiooff --noscroll --nocpld --nojflash --bootloaderfile bootldr.fast --bootimagefile zImage --rootimagefile balloon-guralp.yaffs.gz --imagesdirectory .
This uses the same filenames as given on ShippedImages. It assumes hardware without the audio fitted, and the use of just a single parallel port.
fillballoon6.sh --usebootimage --erasenand --noscroll --commanddirectory bin --imagesdirectory prodimgs/20040422 --smallbootloaderfile bootldr.small --bootloaderfile bootldr.fast --bootimagefile boot-2.4.yaffs.gz --rootimagefile skinny.yaffs.gz --cplddirectory cpld_xcr3128/20040427 --cpldfile 20040427_dual_chip_compatible.xsvf --jflashbaseaddr b800 --cpldbaseaddr 378 --noprompt
Will:
program the CPLD with cpld_xcr3128/20040427/20040427_dual_chip_compatible.xsvf using the CPLD dongle at parallel port 0x378
program the boot loader with prodimgs/20040422/bootldr.small using the Jflash dongle at parallel port 0xb800
- reset the Balloon board
program the boot loader with prodimgs/20040422/bootldr.fast
- erase the NAND flash (boot and root partitions)
program the boot partition with prodimgs/20040422/boot-2.4.yaffs.gz
program the root partition with prodimgs/20040422/skinny.yaffs.gz
fillballoon6.sh --usebootimage --erasenand --noscroll --commanddirectory bin --imagesdirectory prodimgs/20040422 --nocpld --nojflash --bootloaderfile bootldr.fast --bootimagefile boot-2.4.yaffs.gz --rootimagefile skinny.yaffs.gz --noprompt
Will:
program the boot loader with prodimgs/20040422/bootldr.fast
- erase the NAND flash (boot and root partitions )
program the boot partition with prodimgs/20040422/boot-2.4.yaffs.gz
program the root partition with prodimgs/20040422/skinny.yaffs.gz