summaryrefslogtreecommitdiff
path: root/src/jtag/presto.c
diff options
context:
space:
mode:
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-08-25 09:59:42 +0000
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-08-25 09:59:42 +0000
commitb930514e2f3e2a83e075e8c19ae0d38bbd2b27dc (patch)
tree8671142f4ebab30173743268470b7d0a06e568a1 /src/jtag/presto.c
parentecfc1e39a2621cf3f2d2c67841cc31cb670326c0 (diff)
downloadopenocd+libswd-b930514e2f3e2a83e075e8c19ae0d38bbd2b27dc.tar.gz
openocd+libswd-b930514e2f3e2a83e075e8c19ae0d38bbd2b27dc.tar.bz2
openocd+libswd-b930514e2f3e2a83e075e8c19ae0d38bbd2b27dc.tar.xz
openocd+libswd-b930514e2f3e2a83e075e8c19ae0d38bbd2b27dc.zip
- added support for setting JTAG frequency on ASIX PRESTO (thanks to Pavel Chromy)
- usbprog update (thanks to Benedikt Sauter) - added embeddedice_send and _handshake functions (thanks to Pavel Chromy) - added support for 4, 8 and 16 bit ports to etb.c git-svn-id: svn://svn.berlios.de/openocd/trunk@203 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag/presto.c')
-rw-r--r--src/jtag/presto.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/jtag/presto.c b/src/jtag/presto.c
index 084ae917..62a9746b 100644
--- a/src/jtag/presto.c
+++ b/src/jtag/presto.c
@@ -656,11 +656,26 @@ int presto_bitq_reset(int trst, int srst)
/* -------------------------------------------------------------------------- */
+char *presto_speed_text[4] =
+{
+ "3 MHz",
+ "1.5 MHz",
+ "750 kHz",
+ "93.75 kHz"
+};
int presto_jtag_speed(int speed)
{
+
+ if ((speed < 0) || (speed > 3))
+ {
+ INFO("valid speed values: 0 (3 MHz), 1 (1.5 MHz), 2 (750 kHz) and 3 (93.75 kHz)");
+ return ERROR_INVALID_ARGUMENTS;
+ }
+
jtag_speed = speed;
- return ERROR_OK;
+ INFO("setting speed to %d, max. TCK freq. is %s", speed, presto_speed_text[speed]);
+ return presto_sendbyte(0xA8 | speed);
}
@@ -704,6 +719,9 @@ int presto_jtag_init(void)
}
INFO("PRESTO open, serial number '%s'", presto->serial);
+ /* use JTAG speed setting from configuration file */
+ presto_jtag_speed(jtag_speed);
+
bitq_interface = &presto_bitq;
return ERROR_OK;
}