efinix: support using JTAG interfaces
This commit is contained in:
parent
ec82dd6467
commit
87b17ed9bf
|
|
@ -25,3 +25,27 @@ or, for xyloni board
|
||||||
|
|
||||||
Since openFPGALoader access the flash directly in SPI mode the ``-b fireant``, ``-b xyloni_spi`` is required (no
|
Since openFPGALoader access the flash directly in SPI mode the ``-b fireant``, ``-b xyloni_spi`` is required (no
|
||||||
autodetection possible).
|
autodetection possible).
|
||||||
|
|
||||||
|
Trion and Titanium JTAG usage
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
*openFPGALoader* supports loading to RAM and SPI Flash with JTAG
|
||||||
|
|
||||||
|
Tested with J-Link BASE
|
||||||
|
|
||||||
|
bin file load
|
||||||
|
-------------
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
openFPGALoader --cable jlink_base -m /somewhere/project/outflow/*.bin
|
||||||
|
|
||||||
|
hex file flash
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Example for ti60f225.
|
||||||
|
NOTE: JTAG chains with more than one device (eg --index-chain) are currently not supported for writing to SPI flash
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
openFPGALoader --cable jlink_base --fpga-part ti60f225 -f /somewhere/project/outflow/*.hex
|
||||||
|
|
@ -88,7 +88,7 @@ Efinix::Efinix(Jtag* jtag, const std::string &filename,
|
||||||
} else if (board_name == "titanium_ti60_f225_jtag") {
|
} else if (board_name == "titanium_ti60_f225_jtag") {
|
||||||
spi_board_name = "titanium_ti60_f225";
|
spi_board_name = "titanium_ti60_f225";
|
||||||
} else {
|
} else {
|
||||||
printInfo("Using efinix JTAG interface (no GPIO)");
|
init_common(prg_type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,8 +116,10 @@ Efinix::Efinix(Jtag* jtag, const std::string &filename,
|
||||||
|
|
||||||
void Efinix::init_common(const Device::prog_type_t &prg_type)
|
void Efinix::init_common(const Device::prog_type_t &prg_type)
|
||||||
{
|
{
|
||||||
_spi->gpio_set_input(_done_pin);
|
if (_spi) {
|
||||||
_spi->gpio_set_output(_rst_pin | _oe_pin);
|
_spi->gpio_set_input(_done_pin);
|
||||||
|
_spi->gpio_set_output(_rst_pin | _oe_pin);
|
||||||
|
}
|
||||||
|
|
||||||
switch (prg_type) {
|
switch (prg_type) {
|
||||||
case Device::WR_FLASH:
|
case Device::WR_FLASH:
|
||||||
|
|
@ -142,8 +144,10 @@ Efinix::~Efinix()
|
||||||
|
|
||||||
void Efinix::reset()
|
void Efinix::reset()
|
||||||
{
|
{
|
||||||
if (!_spi) // not supported
|
if (!_spi) {
|
||||||
|
printError("jtag: reset not supported");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
uint32_t timeout = 1000;
|
uint32_t timeout = 1000;
|
||||||
_spi->gpio_clear(_rst_pin | _oe_pin);
|
_spi->gpio_clear(_rst_pin | _oe_pin);
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
|
|
@ -218,6 +222,11 @@ void Efinix::program(unsigned int offset, bool unprotect_flash)
|
||||||
|
|
||||||
bool Efinix::dumpFlash(uint32_t base_addr, uint32_t len)
|
bool Efinix::dumpFlash(uint32_t base_addr, uint32_t len)
|
||||||
{
|
{
|
||||||
|
if (!_spi) {
|
||||||
|
printError("jtag: dumpFlash not supported");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t timeout = 1000;
|
uint32_t timeout = 1000;
|
||||||
_spi->gpio_clear(_rst_pin);
|
_spi->gpio_clear(_rst_pin);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue