mirror of
https://github.com/trabucayre/openFPGALoader.git
synced 2026-08-31 10:16:11 +02:00
altera,intel: adding an option to bypass spiOverJtag automatic bitstream selection by providing the bitstream file path
This commit is contained in:
+16
-10
@@ -26,12 +26,13 @@
|
||||
|
||||
Altera::Altera(Jtag *jtag, const std::string &filename,
|
||||
const std::string &file_type, Device::prog_type_t prg_type,
|
||||
const std::string &device_package, bool verify, int8_t verbose,
|
||||
const std::string &device_package,
|
||||
const std::string &spiOverJtagPath, bool verify, int8_t verbose,
|
||||
bool skip_load_bridge, bool skip_reset):
|
||||
Device(jtag, filename, file_type, verify, verbose),
|
||||
SPIInterface(filename, verbose, 256, verify, skip_load_bridge,
|
||||
skip_reset),
|
||||
_device_package(device_package),
|
||||
_device_package(device_package), _spiOverJtagPath(spiOverJtagPath),
|
||||
_vir_addr(0x1000), _vir_length(14)
|
||||
{
|
||||
if (prg_type == Device::RD_FLASH) {
|
||||
@@ -171,18 +172,23 @@ bool Altera::prepare_flash_access()
|
||||
|
||||
bool Altera::load_bridge()
|
||||
{
|
||||
if (_device_package.empty()) {
|
||||
printError("Can't program SPI flash: missing device-package information");
|
||||
return false;
|
||||
}
|
||||
std::string bitname;
|
||||
if (!_spiOverJtagPath.empty()) {
|
||||
bitname = _spiOverJtagPath;
|
||||
} else {
|
||||
if (_device_package.empty()) {
|
||||
printError("Can't program SPI flash: missing device-package information");
|
||||
return false;
|
||||
}
|
||||
|
||||
// DATA_DIR is defined at compile time.
|
||||
std::string bitname = DATA_DIR "/openFPGALoader/spiOverJtag_";
|
||||
// DATA_DIR is defined at compile time.
|
||||
bitname = DATA_DIR "/openFPGALoader/spiOverJtag_";
|
||||
#ifdef HAS_ZLIB
|
||||
bitname += _device_package + ".rbf.gz";
|
||||
bitname += _device_package + ".rbf.gz";
|
||||
#else
|
||||
bitname += _device_package + ".rbf";
|
||||
bitname += _device_package + ".rbf";
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined (_WIN64) || defined (_WIN32)
|
||||
/* Convert relative path embedded at compile time to an absolute path */
|
||||
|
||||
Reference in New Issue
Block a user