Global: added option to select/deselect all cables, added variables ENABLE_xxx to enable corresponding cables. Some vendor drivers needs to to be disabled accordlingly

This commit is contained in:
Gwenhael Goavec-Merou
2025-12-26 09:17:06 +01:00
parent a81067bf63
commit 6bac72cd68
7 changed files with 530 additions and 150 deletions
+9
View File
@@ -47,11 +47,16 @@ CologneChip::CologneChip(Jtag* jtag, const std::string &filename,
} else if (cable_name == "gatemate_pgm") {
ftdi_board_name = "gatemate_pgm_spi";
} else if (cable_name == "dirtyJtag") {
#ifdef ENABLE_DIRTYJTAG
_dirtyjtag = reinterpret_cast<DirtyJtag *>(_jtag->_jtag);
_rstn_pin = (1 << 6);
_done_pin = 0;
_fail_pin = 0;
_oen_pin = 0;
#else
std::cerr << "Jtag: support for dirtyJtag cable was not enabled at compile time" << std::endl;
throw std::exception();
#endif
}
if (ftdi_board_name != "") {
@@ -90,10 +95,12 @@ void CologneChip::reset()
_ftdi_jtag->gpio_clear(_rstn_pin | _oen_pin);
usleep(SLEEP_US);
_ftdi_jtag->gpio_set(_rstn_pin);
#ifdef ENABLE_DIRTYJTAG
} else if (_dirtyjtag) {
_dirtyjtag->gpio_clear(_rstn_pin);
_dirtyjtag->gpio_set(_rstn_pin);
usleep(SLEEP_US);
#endif
}
}
@@ -142,10 +149,12 @@ bool CologneChip::prepare_flash_access()
/* enable output and disable reset */
_ftdi_jtag->gpio_clear(_oen_pin);
_ftdi_jtag->gpio_set(_rstn_pin);
#ifdef ENABLE_DIRTYJTAG
} else if (_dirtyjtag) {
_dirtyjtag->gpio_clear(_rstn_pin);
_dirtyjtag->gpio_set(_rstn_pin);
usleep(SLEEP_US);
#endif
}
return true;