jtag: driver-neutral JTAG_TCK_FREQ_KHZ clock (phase A)
One clock knob across probes instead of per-driver names: - jtag_open mirrors JTAG_TCK_FREQ_KHZ into PROBE_FTDI_TCK_FREQ_KHZ for the Viveris FTDI driver (read-only at init); unset leaves the existing value untouched - the Digilent driver reads JTAG_TCK_FREQ_KHZ directly instead of hardcoding 4 MHz (falls back to 4 MHz when unset) - documented in probes.yaml; CLAUDE.md design note marks phase A done FTDI path validated on the IGLOO2/FlashPro (250 kHz, mirror confirmed); Digilent path not hardware-tested. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "jtag_core/jtag_core.h"
|
||||
#include "jtag_core/dbg_logs.h"
|
||||
#include "config/bs_defines.h"
|
||||
#include "script/env.h"
|
||||
|
||||
#include "drivers/drv_loader.h"
|
||||
|
||||
@@ -209,11 +210,17 @@ static int drv_Digilent_Detect(jtag_core *jc)
|
||||
|
||||
static int drv_Digilent_Init(jtag_core *jc, int sub_drv, char *params)
|
||||
{
|
||||
DJ_DWORD frq_req = 4000000; /* 4 MHz — safe and fast enough for IDCODE/IR */
|
||||
DJ_DWORD frq_req;
|
||||
DJ_DWORD frq_set = 0;
|
||||
int tck_khz;
|
||||
|
||||
(void)params;
|
||||
|
||||
/* Driver-neutral JTAG clock (JTAG_TCK_FREQ_KHZ, kHz). Unset/<=0 keeps
|
||||
* the 4 MHz default — safe and fast enough for IDCODE/IR. */
|
||||
tck_khz = jtagcore_getEnvVarValue(jc, "JTAG_TCK_FREQ_KHZ");
|
||||
frq_req = (tck_khz > 0) ? (DJ_DWORD)tck_khz * 1000u : 4000000u;
|
||||
|
||||
/* Lazy enumeration: jtag_open can be called without going
|
||||
* through jtag_probes first, so make sure Detect ran. */
|
||||
if (g_dj_num_probes == 0) {
|
||||
|
||||
Reference in New Issue
Block a user