From 7cddeb0af20049fc891ed726885aebceeb1e22b7 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Mon, 6 Aug 2018 17:31:36 +0200 Subject: [PATCH] swd: remove unused API frequency() The specific SWD API to change/query the adapter speed is never called because the equivalent JTAG API is used in place of it. In the restructure of struct jtag_interface, the JTAG API is promoted as global adapter API, thus a specific SWD one is not anymore required. Change-Id: I1e810d255b4dfcd5791b4fac8ae1260c31a057fd Signed-off-by: Antonio Borneo Reviewed-on: http://openocd.zylin.com/4891 Tested-by: jenkins Reviewed-by: Tomas Vanek --- src/jtag/drivers/cmsis_dap_usb.c | 10 ---------- src/jtag/drivers/ftdi.c | 9 --------- src/jtag/drivers/jlink.c | 9 --------- src/jtag/drivers/vsllink.c | 1 - src/jtag/drivers/xds110.c | 8 -------- src/jtag/swd.h | 18 ------------------ 6 files changed, 55 deletions(-) diff --git a/src/jtag/drivers/cmsis_dap_usb.c b/src/jtag/drivers/cmsis_dap_usb.c index 5c7cde46e3..d52d698a43 100644 --- a/src/jtag/drivers/cmsis_dap_usb.c +++ b/src/jtag/drivers/cmsis_dap_usb.c @@ -1653,15 +1653,6 @@ static int cmsis_dap_khz(int khz, int *jtag_speed) return ERROR_OK; } -static int_least32_t cmsis_dap_swd_frequency(int_least32_t hz) -{ - if (hz > 0) - cmsis_dap_speed(hz / 1000); - - return hz; -} - - COMMAND_HANDLER(cmsis_dap_handle_info_command) { if (cmsis_dap_get_version_info() == ERROR_OK) @@ -1790,7 +1781,6 @@ static const struct command_registration cmsis_dap_command_handlers[] = { static const struct swd_driver cmsis_dap_swd_driver = { .init = cmsis_dap_swd_init, - .frequency = cmsis_dap_swd_frequency, .switch_seq = cmsis_dap_swd_switch_seq, .read_reg = cmsis_dap_swd_read_reg, .write_reg = cmsis_dap_swd_write_reg, diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index 60387a98f9..5cd44a9d17 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -1203,14 +1203,6 @@ static void ftdi_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_delay_cl ftdi_swd_queue_cmd(cmd, NULL, value, ap_delay_clk); } -static int_least32_t ftdi_swd_frequency(int_least32_t hz) -{ - if (hz > 0) - freq = mpsse_set_frequency(mpsse_ctx, hz); - - return freq; -} - static int ftdi_swd_switch_seq(enum swd_special_seq seq) { switch (seq) { @@ -1239,7 +1231,6 @@ static int ftdi_swd_switch_seq(enum swd_special_seq seq) static const struct swd_driver ftdi_swd = { .init = ftdi_swd_init, - .frequency = ftdi_swd_frequency, .switch_seq = ftdi_swd_switch_seq, .read_reg = ftdi_swd_read_reg, .write_reg = ftdi_swd_write_reg, diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index dd074937c9..09b3a858bc 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -1929,14 +1929,6 @@ static void jlink_swd_read_reg(uint8_t cmd, uint32_t *value, uint32_t ap_delay_c jlink_swd_queue_cmd(cmd, value, 0, ap_delay_clk); } -static int_least32_t jlink_swd_frequency(int_least32_t hz) -{ - if (hz > 0) - jlink_speed(hz / 1000); - - return hz; -} - /***************************************************************************/ /* J-Link tap functions */ @@ -2212,7 +2204,6 @@ static void jlink_swd_queue_cmd(uint8_t cmd, uint32_t *dst, uint32_t data, uint3 static const struct swd_driver jlink_swd = { .init = &jlink_swd_init, - .frequency = &jlink_swd_frequency, .switch_seq = &jlink_swd_switch_seq, .read_reg = &jlink_swd_read_reg, .write_reg = &jlink_swd_write_reg, diff --git a/src/jtag/drivers/vsllink.c b/src/jtag/drivers/vsllink.c index 501322bba6..4907ef0e2e 100644 --- a/src/jtag/drivers/vsllink.c +++ b/src/jtag/drivers/vsllink.c @@ -956,7 +956,6 @@ static const char * const vsllink_transports[] = {"jtag", "swd", NULL}; static const struct swd_driver vsllink_swd_driver = { .init = vsllink_swd_init, - .frequency = vsllink_swd_frequency, .switch_seq = vsllink_swd_switch_seq, .read_reg = vsllink_swd_read_reg, .write_reg = vsllink_swd_write_reg, diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c index 20b817879d..f25023ba76 100644 --- a/src/jtag/drivers/xds110.c +++ b/src/jtag/drivers/xds110.c @@ -1925,13 +1925,6 @@ static int xds110_khz(int khz, int *jtag_speed) return ERROR_OK; } -static int_least32_t xds110_swd_frequency(int_least32_t hz) -{ - if (hz > 0) - xds110_speed(hz / 1000); - return hz; -} - COMMAND_HANDLER(xds110_handle_info_command) { xds110_show_info(); @@ -2032,7 +2025,6 @@ static const struct command_registration xds110_command_handlers[] = { static const struct swd_driver xds110_swd_driver = { .init = xds110_swd_init, - .frequency = xds110_swd_frequency, .switch_seq = xds110_swd_switch_seq, .read_reg = xds110_swd_read_reg, .write_reg = xds110_swd_write_reg, diff --git a/src/jtag/swd.h b/src/jtag/swd.h index 3ff4de0bdb..0b32105a27 100644 --- a/src/jtag/swd.h +++ b/src/jtag/swd.h @@ -232,24 +232,6 @@ struct swd_driver { */ int (*init)(void); - /** - * Set the SWCLK frequency of the SWD link. - * - * The driver should round the desired value, downwards if possible, to - * the nearest supported frequency. A negative value should be ignored - * and can be used to query the current setting. If the driver does not - * support a variable frequency a fixed, nominal, value should be - * returned. - * - * If the frequency is increased, it must not apply before the currently - * queued transactions are executed. If the frequency is lowered, it may - * apply immediately. - * - * @param hz The desired frequency in Hz. - * @return The actual resulting frequency after rounding. - */ - int_least32_t (*frequency)(int_least32_t hz); - /** * Queue a special SWDIO sequence. * -- 2.30.2