diff options
Diffstat (limited to 'src/pld/ecp5.c')
-rw-r--r-- | src/pld/ecp5.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/pld/ecp5.c b/src/pld/ecp5.c index 024fe2b..f8ba33e 100644 --- a/src/pld/ecp5.c +++ b/src/pld/ecp5.c @@ -276,3 +276,27 @@ int lattice_ecp5_get_facing_read_bits(struct lattice_pld_device *pld_device_info return ERROR_OK; } + +int lattice_ecp5_refresh(struct lattice_pld_device *lattice_device) +{ + struct jtag_tap *tap = lattice_device->tap; + if (!tap) + return ERROR_FAIL; + + int retval = lattice_preload(lattice_device); + if (retval != ERROR_OK) + return retval; + + retval = lattice_set_instr(tap, LSC_REFRESH, TAP_IDLE); + if (retval != ERROR_OK) + return retval; + jtag_add_runtest(2, TAP_IDLE); + jtag_add_sleep(200000); + retval = lattice_set_instr(tap, BYPASS, TAP_IDLE); + if (retval != ERROR_OK) + return retval; + jtag_add_runtest(100, TAP_IDLE); + jtag_add_sleep(1000); + + return jtag_execute_queue(); +} |