@@ -181,10 +181,67 @@ Only A32/A24/D32/CSR address modifiers are supported.
@item @code{xwb_gpio_port} @tab @code{0x13000} @tab @code{general-cores} @tab GPIO port for accessing FMC1/2 presence lines.
@end multitable
@macro regsection{name}
@section \name\
@end macro
@page
@chapter Flashing the SVEC
@section Application FPGA Flash programming through VME
The SVEC Application FPGA can be programmed with the @code{svec-flasher} tool, located in @code{software/vme-flasher} subdirectory of the SVEC project repository. It requires a @code{.bin} format bitstream, that can be generated by Xilinx ISE by selecting ``Generate binary configuration file'' in @i{Generate Programming File} options.
The flasher requires the slot number as the first argument and the file with the bitstream as the second, just like in the example below:
Programming the Application FPGA flash with bitstream /lib/firmware/fmc/svec-golden.bin.
Programming page 7651/7651.
Verification...
Programming page 0/0.
Verification...
Programming OK.
@end smallexample
@b{Note 1:} Before programming the flash, please unload the SVEC kernel driver:
@smallexample
# rmmod svec
@end smallexample
@b{Note 2:} The flasher must be run as root.
@b{Note 3:} The card must be rebooted for the new bitstream to start working.
@section Updating the bootloader
Certain older SVEC cards have been shipped with the first version of the bootloader that does not support booting the AFPGA from the Flash memory. In order to use from the VME Flasher, an update is necessary. The procedure goes as follows:
@itemize
@item Download the updated bootloader @code{svec-bootloader-v2.mcs} from @uref{http://www.ohwr.org/projects/svec/files}.
@item Connect Xilinx JTAG programmer to the JTAG connector of the card to be updated.
@item Launch ISE iMPACT.
@item Double-Click ``Boundary Scan'' in the left pane (``iMPACT flows'').
@item Open the right-click menu in the main work area and select ``Initialize chain'' or press Ctrl+I.
@item Right click on the ``SPI/BPI ?'' box above the ``xc6slx9'' FPGA and select ``Add SPI/BPI Flash''.
@item Pick the @code{svec-bootloader-v2.mcs} file.
@item Select flash type: SPI PROM, M25P128, data width: 1.
@item Right click on the ``FLASH'' chip above the ``xc6slx9'' and select ``Program''. Select the ``Verify'' option and click OK.
@item If everything went fine, ``Programming succeeded'' message will appear.
@item Reboot the VME crate to use the new bootloader.
@end itemize
@b{Note:} Updating the bootloader does not require updating the drivers, as it is backwards-compatible.
@section Application FPGA Flash programming through JTAG
This method of programming may be useful during factory JTAG programming of SVECs, when both the bootloader and the application bitstream need to be loaded simultaneously. It requires a special flash image that contains both the bootloader and application bitstreams along with some SDB filesystem structures that allow the bootloader to correctly load the AFPGA file.
Preparing the flash image is straightforward:
@itemize
@item Copy your AFPGA bitstream (@code{.bin} format) to @code{software/sdb-flasher/fs/afpga.bin}.
@item Run the script: @code{software/sdb-flasher/build.sh}. The script will produce the file called @code{image.mcs}.
@item Program the Flash (@code{image.mcs}) via iMPACT, using the procedure described in the previous section.