multiboot.py
============

The multiboot.py script can be used to upload a firmware to the CONV-TTL-BLO
flash chip for MultiBoot. It imports the ../ei2c/ei2c.py module for the Telnet
accesses to the I2C bus and defines functions for accessing the SPI flash
via the wb_xil_multiboot module on the FPGA.

You will need a raw bitstream file to write to the flash chip. This bitstream
file can have any extension, as long as the data in it is binary. One noteworthy
thing is that the binary file(s) should be inside a folder called `bin/' under
the same folder as the script. The script checks this folder for binaries, lists
them and then based on the user's selection of the binary file, it reads the
file as a binary file, parses it in 256-byte chunks and writes these chunks to
the flash chip via the FPGA.

To run it:

%> ./multiboot.py
Crate IP or hostname: <give IP or hostname of crate with CONV-TTL-BLO>
ELMA crate IP or hostname : <give crate username for Telnet login>
ELMA crate user name      : <give user name for Telnet login>
ELMA crate password       : <give password for Telnet login>
Slot no.: <give slot number of CONV-TTL-BLO card here>
Read config reg? (y/n) <'y' to read configuration registers>
Read first page? (y/n) <'y' to read the first page from the MultiBoot address
                        you will give later>
Write to flash?  (y/n) <'y' to write bitstream data>
Are you sure?    (y/n) <asks you twice, since writing takes realy long>

<listing the files from the `bin/' folder:>
Which gateware would you like to program?
0 -> conv_ttl_blo-v3.0.bin
Enter your choice : 0
Selected gateware: conv_ttl_blo-v3.0.bin
Is this okay?   (y/n) y

Issue IPROG?     (y/n)
Multiboot bitstream address(hex): 0x<hex bitstream address, nominally "170000">

The tool will now start sending your bitstream, outputting its progress and the
page address it is currently writing to. Go grab a coffee, since this will take
at least 11 mins, maybe even more if your network connection is not that good, or
you're using Windows.

mass-multiboot.py
=================

Use the FPGA MultiBoot logic to update the gateware on multiple boards in one crate.
The update can only be done one card per crate and one crate at a time.

For details on how to use it, run the help on it:

%> ./mass-multiboot.py --help
