Line 1... |
Line 1... |
/*!
|
/*!
|
Firmware / Bitstream loader for the ZTEX Firmware Kit
|
Firmware / Bitstream loader for the ZTEX Firmware Kit
|
Copyright (C) 2008-2009 ZTEX e.K.
|
Copyright (C) 2009-2010 ZTEX e.K.
|
http://www.ztex.de
|
http://www.ztex.de
|
|
|
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
it under the terms of the GNU General Public License version 3 as
|
it under the terms of the GNU General Public License version 3 as
|
published by the Free Software Foundation.
|
published by the Free Software Foundation.
|
Line 44... |
Line 44... |
" -w Enable certain workaraounds\n"+
|
" -w Enable certain workaraounds\n"+
|
" -h This help \n\n"+
|
" -h This help \n\n"+
|
"Ordered parameters:\n"+
|
"Ordered parameters:\n"+
|
" -i Info\n"+
|
" -i Info\n"+
|
" -ii Info + capabilities\n"+
|
" -ii Info + capabilities\n"+
|
|
" -if Read FPGA state\n"+
|
" -ru Reset EZ-USB Microcontroller\n"+
|
" -ru Reset EZ-USB Microcontroller\n"+
|
" -uu <ihx file> Upload EZ-USB Firmware\n"+
|
" -uu <ihx file> Upload EZ-USB Firmware\n"+
|
" -rf Reset FPGA\n"+
|
" -rf Reset FPGA\n"+
|
" -uf <bitstream> Upload <bitstream>\n"+
|
" -uf <bitstream> Upload <bitstream>\n"+
|
" -re Reset EEPROM Firmware\n"+
|
" -re Reset EEPROM Firmware\n"+
|
Line 57... |
Line 58... |
|
|
|
|
// process global parameters
|
// process global parameters
|
try {
|
try {
|
|
|
int usbVendorId = -1;
|
int usbVendorId = ZtexDevice1.ztexVendorId;
|
int usbProductId = -1;
|
int usbProductId = -1;
|
boolean cypress = false;
|
boolean cypress = false;
|
int devNum = 0;
|
int devNum = 0;
|
boolean forceUpload = false;
|
boolean forceUpload = false;
|
boolean printBus = false;
|
boolean printBus = false;
|
Line 94... |
Line 95... |
System.err.println(helpMsg);
|
System.err.println(helpMsg);
|
System.exit(1);
|
System.exit(1);
|
}
|
}
|
}
|
}
|
else if ( args[i].equals("-vc") ) {
|
else if ( args[i].equals("-vc") ) {
|
usbVendorId = 0x4b4;
|
usbVendorId = ZtexDevice1.cypressVendorId;
|
usbProductId = 0x8613;
|
usbProductId = ZtexDevice1.cypressProductId;
|
}
|
}
|
else if ( args[i].equals("-f") ) {
|
else if ( args[i].equals("-f") ) {
|
forceUpload = true;
|
forceUpload = true;
|
}
|
}
|
else if ( args[i].equals("-p") ) {
|
else if ( args[i].equals("-p") ) {
|
Line 123... |
Line 124... |
}
|
}
|
else if ( args[i].equals("-h") ) {
|
else if ( args[i].equals("-h") ) {
|
System.err.println(helpMsg);
|
System.err.println(helpMsg);
|
System.exit(0);
|
System.exit(0);
|
}
|
}
|
else if ( args[i].equals("-i") || args[i].equals("-ii") || args[i].equals("-ru") || args[i].equals("-rf") || args[i].equals("-re") || args[i].equals("-rm") ) {
|
else if ( args[i].equals("-i") || args[i].equals("-ii") || args[i].equals("-if") || args[i].equals("-ru") || args[i].equals("-rf") || args[i].equals("-re") || args[i].equals("-rm") ) {
|
}
|
}
|
else if ( args[i].equals("-uu") || args[i].equals("-uf") || args[i].equals("-ue") || args[i].equals("-um") ) {
|
else if ( args[i].equals("-uu") || args[i].equals("-uf") || args[i].equals("-ue") || args[i].equals("-um") ) {
|
i+=1;
|
i+=1;
|
}
|
}
|
else {
|
else {
|
Line 161... |
Line 162... |
}
|
}
|
else {
|
else {
|
System.out.println( " Capabilities:\n "+str);
|
System.out.println( " Capabilities:\n "+str);
|
}
|
}
|
}
|
}
|
|
if ( args[i].equals("-if") ) {
|
|
ztex.printFpgaState();
|
|
}
|
else if ( args[i].equals("-ru") ) {
|
else if ( args[i].equals("-ru") ) {
|
ztex.resetEzUsb();
|
ztex.resetEzUsb();
|
}
|
}
|
else if ( args[i].equals("-uu") ) {
|
else if ( args[i].equals("-uu") ) {
|
i++;
|
i++;
|