summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-06-04 17:09:10 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-06-04 17:09:10 +0000
commit24092a51720789c200c83f3a3867a4e02861661c (patch)
tree087b33f84a07e0e1484005d2152cf2201f06848c /src
parent9f8d50bf81f3628b3ff3b57438eeb26faa535221 (diff)
downloadopenocd_libswd-24092a51720789c200c83f3a3867a4e02861661c.tar.gz
openocd_libswd-24092a51720789c200c83f3a3867a4e02861661c.tar.bz2
openocd_libswd-24092a51720789c200c83f3a3867a4e02861661c.tar.xz
openocd_libswd-24092a51720789c200c83f3a3867a4e02861661c.zip
Pavel Chromy: TCK returns to zero before state of reset line is changed.
git-svn-id: svn://svn.berlios.de/openocd/trunk@703 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/jtag/presto.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/jtag/presto.c b/src/jtag/presto.c
index c031d94b..3fd0ee12 100644
--- a/src/jtag/presto.c
+++ b/src/jtag/presto.c
@@ -573,10 +573,10 @@ int presto_bitq_out(int tms, int tdi, int tdo_req)
if (presto->jtag_tck == 0)
{
- presto_sendbyte(0xA4);
- presto->jtag_tck = 1;
+ presto_sendbyte(0xA4); /* jtag activity */
+ presto->jtag_tck = 1; /* clock remains high after the function returns */
+ /* do just a single tick first, accelerated shifting needs TCK=1 */
}
-
else if (!tdo_req && tms == presto->jtag_tms)
{
if (presto->jtag_tdi_count == 0)
@@ -617,7 +617,7 @@ int presto_bitq_out(int tms, int tdi, int tdo_req)
}
if (tdo_req)
- presto_sendbyte(0xD4 | cmdparam);
+ presto_sendbyte(0xD4|cmdparam);
else
presto_sendbyte(0xC4|cmdparam);
@@ -634,8 +634,11 @@ int presto_bitq_flush(void)
presto->jtag_tdi_count = 0;
}
- presto_sendbyte(0xCA);
- presto->jtag_tck = 0;
+ if (presto->jtag_tck == 1)
+ {
+ presto_sendbyte(0xCA);
+ presto->jtag_tck = 0;
+ }
presto_sendbyte(0xA0);
@@ -664,6 +667,12 @@ int presto_bitq_sleep(unsigned long us)
{
long waits;
+ if (presto->jtag_tck == 1)
+ {
+ presto_sendbyte(0xCA);
+ presto->jtag_tck = 0;
+ }
+
if (us > 100000)
{
presto_bitq_flush();
@@ -683,6 +692,12 @@ int presto_bitq_reset(int trst, int srst)
{
unsigned char cmd;
+ if (presto->jtag_tck == 1)
+ {
+ presto_sendbyte(0xCA);
+ presto->jtag_tck = 0;
+ }
+
cmd = 0xE8;
if (presto->jtag_tms)
cmd |= 0x04;