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:
2026-05-24 11:39:14 +02:00
parent 4ee1c2b631
commit 3aad5e2308
4 changed files with 31 additions and 3 deletions

View File

@@ -1863,6 +1863,20 @@ static int cmd_open_probe(script_ctx *ctx, char *line)
ctx->script_printf(ctx, MSG_INFO_0, "Applied probe profile '%s'.\n", profile);
}
// Driver-neutral JTAG clock: if JTAG_TCK_FREQ_KHZ is set, feed it to
// the Viveris FTDI driver's own variable (it reads only PROBE_FTDI_*;
// our Digilent driver reads the neutral name directly). Harmless for
// the other drivers, which keep their defaults.
{
int tck_khz = jtagcore_getEnvVarValue(jc, "JTAG_TCK_FREQ_KHZ");
if (tck_khz > 0)
{
char tck_str[24];
snprintf(tck_str, sizeof(tck_str), "%d", tck_khz);
setEnvVarDat((envvar_entry *)ctx->env, "PROBE_FTDI_TCK_FREQ_KHZ", tck_str);
}
}
ret = jtagcore_select_and_open_probe(jc, id);
if (ret != JTAG_CORE_NO_ERROR)
{