summaryrefslogtreecommitdiff
path: root/src/jtag
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-03-02 08:39:02 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-03-02 08:39:02 +0000
commit2c5fc392f019e78ae858ffd761bcb859f898ff53 (patch)
tree0432ee4ce828b0b2a84873c092d2ca42a2e0e15b /src/jtag
parent2e21083c19eb6f0336fb4986215ca390f422a8cc (diff)
downloadopenocd+libswd-2c5fc392f019e78ae858ffd761bcb859f898ff53.tar.gz
openocd+libswd-2c5fc392f019e78ae858ffd761bcb859f898ff53.tar.bz2
openocd+libswd-2c5fc392f019e78ae858ffd761bcb859f898ff53.tar.xz
openocd+libswd-2c5fc392f019e78ae858ffd761bcb859f898ff53.zip
Uwe Hermann tightned up comments, etc. to follow OpenOCD policy
git-svn-id: svn://svn.berlios.de/openocd/trunk@431 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag')
-rw-r--r--src/jtag/ft2232.c56
-rw-r--r--src/jtag/gw16012.c2
-rw-r--r--src/jtag/parport.c4
-rw-r--r--src/jtag/presto.c4
-rw-r--r--src/jtag/usbprog.c18
5 files changed, 42 insertions, 42 deletions
diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c
index 1a058675..1ac61abb 100644
--- a/src/jtag/ft2232.c
+++ b/src/jtag/ft2232.c
@@ -513,7 +513,7 @@ void ft2232_add_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size
BUFFER_ADD = TAP_MOVE(cur_state, TAP_SD);
cur_state = TAP_SD;
}
- //DEBUG("added TMS scan (no read)");
+ /* DEBUG("added TMS scan (no read)"); */
}
/* add command for complete bytes */
@@ -524,19 +524,19 @@ void ft2232_add_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size
{
/* Clock Data Bytes In and Out LSB First */
BUFFER_ADD = 0x39;
- //DEBUG("added TDI bytes (io %i)", num_bytes);
+ /* DEBUG("added TDI bytes (io %i)", num_bytes); */
}
else if (type == SCAN_OUT)
{
/* Clock Data Bytes Out on -ve Clock Edge LSB First (no Read) */
BUFFER_ADD = 0x19;
- //DEBUG("added TDI bytes (o)");
+ /* DEBUG("added TDI bytes (o)"); */
}
else if (type == SCAN_IN)
{
/* Clock Data Bytes In on +ve Clock Edge LSB First (no Write) */
BUFFER_ADD = 0x28;
- //DEBUG("added TDI bytes (i %i)", num_bytes);
+ /* DEBUG("added TDI bytes (i %i)", num_bytes); */
}
thisrun_bytes = (num_bytes > 65537) ? 65536 : (num_bytes - 1);
num_bytes -= thisrun_bytes;
@@ -571,19 +571,19 @@ void ft2232_add_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size
{
/* Clock Data Bits In and Out LSB First */
BUFFER_ADD = 0x3b;
- //DEBUG("added TDI bits (io) %i", bits_left - 1);
+ /* DEBUG("added TDI bits (io) %i", bits_left - 1); */
}
else if (type == SCAN_OUT)
{
/* Clock Data Bits Out on -ve Clock Edge LSB First (no Read) */
BUFFER_ADD = 0x1b;
- //DEBUG("added TDI bits (o)");
+ /* DEBUG("added TDI bits (o)"); */
}
else if (type == SCAN_IN)
{
/* Clock Data Bits In on +ve Clock Edge LSB First (no Write) */
BUFFER_ADD = 0x2a;
- //DEBUG("added TDI bits (i %i)", bits_left - 1);
+ /* DEBUG("added TDI bits (i %i)", bits_left - 1); */
}
BUFFER_ADD = bits_left - 2;
if (type != SCAN_IN)
@@ -597,19 +597,19 @@ void ft2232_add_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size
{
/* Clock Data Bits In and Out LSB First */
BUFFER_ADD = 0x3b;
- //DEBUG("added TDI bits (io) %i", bits_left - 1);
+ /* DEBUG("added TDI bits (io) %i", bits_left - 1); */
}
else if (type == SCAN_OUT)
{
/* Clock Data Bits Out on -ve Clock Edge LSB First (no Read) */
BUFFER_ADD = 0x1b;
- //DEBUG("added TDI bits (o)");
+ /* DEBUG("added TDI bits (o)"); */
}
else if (type == SCAN_IN)
{
/* Clock Data Bits In on +ve Clock Edge LSB First (no Write) */
BUFFER_ADD = 0x2a;
- //DEBUG("added TDI bits (i %i)", bits_left - 1);
+ /* DEBUG("added TDI bits (i %i)", bits_left - 1); */
}
BUFFER_ADD = 0x0;
BUFFER_ADD = last_bit;
@@ -621,13 +621,13 @@ void ft2232_add_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size
{
/* Clock Data to TMS/CS Pin with Read */
BUFFER_ADD = 0x6b;
- //DEBUG("added TMS scan (read)");
+ /* DEBUG("added TMS scan (read)"); */
}
else
{
/* Clock Data to TMS/CS Pin (no Read) */
BUFFER_ADD = 0x4b;
- //DEBUG("added TMS scan (no read)");
+ /* DEBUG("added TMS scan (no read)"); */
}
BUFFER_ADD = 0x6;
BUFFER_ADD = TAP_MOVE(cur_state, end_state) | (last_bit << 7);
@@ -682,19 +682,19 @@ int ft2232_large_scan(scan_command_t *cmd, enum scan_type type, u8 *buffer, int
{
/* Clock Data Bytes In and Out LSB First */
BUFFER_ADD = 0x39;
- //DEBUG("added TDI bytes (io %i)", num_bytes);
+ /* DEBUG("added TDI bytes (io %i)", num_bytes); */
}
else if (type == SCAN_OUT)
{
/* Clock Data Bytes Out on -ve Clock Edge LSB First (no Read) */
BUFFER_ADD = 0x19;
- //DEBUG("added TDI bytes (o)");
+ /* DEBUG("added TDI bytes (o)"); */
}
else if (type == SCAN_IN)
{
/* Clock Data Bytes In on +ve Clock Edge LSB First (no Write) */
BUFFER_ADD = 0x28;
- //DEBUG("added TDI bytes (i %i)", num_bytes);
+ /* DEBUG("added TDI bytes (i %i)", num_bytes); */
}
thisrun_bytes = (num_bytes > 65537) ? 65536 : (num_bytes - 1);
thisrun_read = thisrun_bytes;
@@ -751,19 +751,19 @@ int ft2232_large_scan(scan_command_t *cmd, enum scan_type type, u8 *buffer, int
{
/* Clock Data Bits In and Out LSB First */
BUFFER_ADD = 0x3b;
- //DEBUG("added TDI bits (io) %i", bits_left - 1);
+ /* DEBUG("added TDI bits (io) %i", bits_left - 1); */
}
else if (type == SCAN_OUT)
{
/* Clock Data Bits Out on -ve Clock Edge LSB First (no Read) */
BUFFER_ADD = 0x1b;
- //DEBUG("added TDI bits (o)");
+ /* DEBUG("added TDI bits (o)"); */
}
else if (type == SCAN_IN)
{
/* Clock Data Bits In on +ve Clock Edge LSB First (no Write) */
BUFFER_ADD = 0x2a;
- //DEBUG("added TDI bits (i %i)", bits_left - 1);
+ /* DEBUG("added TDI bits (i %i)", bits_left - 1); */
}
BUFFER_ADD = bits_left - 2;
if (type != SCAN_IN)
@@ -779,19 +779,19 @@ int ft2232_large_scan(scan_command_t *cmd, enum scan_type type, u8 *buffer, int
{
/* Clock Data Bits In and Out LSB First */
BUFFER_ADD = 0x3b;
- //DEBUG("added TDI bits (io) %i", bits_left - 1);
+ /* DEBUG("added TDI bits (io) %i", bits_left - 1); */
}
else if (type == SCAN_OUT)
{
/* Clock Data Bits Out on -ve Clock Edge LSB First (no Read) */
BUFFER_ADD = 0x1b;
- //DEBUG("added TDI bits (o)");
+ /* DEBUG("added TDI bits (o)"); */
}
else if (type == SCAN_IN)
{
/* Clock Data Bits In on +ve Clock Edge LSB First (no Write) */
BUFFER_ADD = 0x2a;
- //DEBUG("added TDI bits (i %i)", bits_left - 1);
+ /* DEBUG("added TDI bits (i %i)", bits_left - 1); */
}
BUFFER_ADD = 0x0;
BUFFER_ADD = last_bit;
@@ -803,13 +803,13 @@ int ft2232_large_scan(scan_command_t *cmd, enum scan_type type, u8 *buffer, int
{
/* Clock Data to TMS/CS Pin with Read */
BUFFER_ADD = 0x6b;
- //DEBUG("added TMS scan (read)");
+ /* DEBUG("added TMS scan (read)"); */
}
else
{
/* Clock Data to TMS/CS Pin (no Read) */
BUFFER_ADD = 0x4b;
- //DEBUG("added TMS scan (no read)");
+ /* DEBUG("added TMS scan (no read)"); */
}
BUFFER_ADD = 0x6;
BUFFER_ADD = TAP_MOVE(cur_state, end_state) | (last_bit << 7);
@@ -881,7 +881,7 @@ int ft2232_predict_scan_in(int scan_size, enum scan_type type)
predicted_size += 1;
}
- //DEBUG("scan_size: %i, predicted_size: %i", scan_size, predicted_size);
+ /* DEBUG("scan_size: %i, predicted_size: %i", scan_size, predicted_size); */
return predicted_size;
}
@@ -1198,7 +1198,7 @@ int ft2232_execute_queue()
BUFFER_ADD = 0x0;
cur_state = TAP_RTI;
i -= (i > 7) ? 7 : i;
- //DEBUG("added TMS scan (no read)");
+ /* DEBUG("added TMS scan (no read)"); */
}
if (cmd->cmd.runtest->end_state != -1)
ft2232_end_state(cmd->cmd.runtest->end_state);
@@ -1211,7 +1211,7 @@ int ft2232_execute_queue()
/* TMS data bits */
BUFFER_ADD = TAP_MOVE(cur_state, end_state);
cur_state = end_state;
- //DEBUG("added TMS scan (no read)");
+ /* DEBUG("added TMS scan (no read)"); */
}
require_send = 1;
#ifdef _DEBUG_JTAG_IO_
@@ -1236,7 +1236,7 @@ int ft2232_execute_queue()
BUFFER_ADD = 0x6;
/* TMS data bits */
BUFFER_ADD = TAP_MOVE(cur_state, end_state);
- //DEBUG("added TMS scan (no read)");
+ /* DEBUG("added TMS scan (no read)"); */
cur_state = end_state;
require_send = 1;
#ifdef _DEBUG_JTAG_IO_
@@ -1290,7 +1290,7 @@ int ft2232_execute_queue()
first_unsent = cmd;
}
ft2232_expect_read += ft2232_predict_scan_in(scan_size, type);
- //DEBUG("new read size: %i", ft2232_expect_read);
+ /* DEBUG("new read size: %i", ft2232_expect_read); */
if (cmd->cmd.scan->end_state != -1)
ft2232_end_state(cmd->cmd.scan->end_state);
ft2232_add_scan(cmd->cmd.scan->ir_scan, type, buffer, scan_size);
diff --git a/src/jtag/gw16012.c b/src/jtag/gw16012.c
index c634df31..819cb513 100644
--- a/src/jtag/gw16012.c
+++ b/src/jtag/gw16012.c
@@ -30,7 +30,7 @@
#endif
/* system includes */
-// -ino: 060521-1036
+/* -ino: 060521-1036 */
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <sys/types.h>
diff --git a/src/jtag/parport.c b/src/jtag/parport.c
index 1c37fd8f..811b4bc2 100644
--- a/src/jtag/parport.c
+++ b/src/jtag/parport.c
@@ -27,7 +27,7 @@
#include "bitbang.h"
/* system includes */
-// -ino: 060521-1036
+/* -ino: 060521-1036 */
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <sys/types.h>
@@ -189,7 +189,7 @@ int parport_read(void)
return 0;
}
-static inline void parport_write_data(void)
+static __inline__ void parport_write_data(void)
{
u8 output;
output = dataport_value ^ cable->OUTPUT_INVERT;
diff --git a/src/jtag/presto.c b/src/jtag/presto.c
index 1e21c22b..624f1c7a 100644
--- a/src/jtag/presto.c
+++ b/src/jtag/presto.c
@@ -161,7 +161,7 @@ int presto_write(u8 *buf, int size, u32* bytes_written)
}
else
{
- *bytes_written = retval;
+ *bytes_written = presto->retval; /* FIXME: Correct? */
return ERROR_OK;
}
#endif
@@ -197,7 +197,7 @@ int presto_read(u8* buf, int size, u32* bytes_read)
ERROR("ftdi_read_data: %s", ftdi_get_error_string(&presto->ftdic));
return ERROR_JTAG_DEVICE_ERROR;
}
- *bytes_read += retval;
+ *bytes_read += presto->retval; /* FIXME: Correct? */
}
#endif
diff --git a/src/jtag/usbprog.c b/src/jtag/usbprog.c
index ba43aa4c..d2a734b4 100644
--- a/src/jtag/usbprog.c
+++ b/src/jtag/usbprog.c
@@ -270,13 +270,13 @@ void usbprog_path_move(pathmove_command_t *cmd)
{
if (tap_transitions[cur_state].low == cmd->path[state_count])
{
- //INFO("1");
+ /* INFO("1"); */
usbprog_write(0, 0, 0);
usbprog_write(1, 0, 0);
}
else if (tap_transitions[cur_state].high == cmd->path[state_count])
{
- //INFO("2");
+ /* INFO("2"); */
usbprog_write(0, 1, 0);
usbprog_write(1, 1, 0);
}
@@ -314,7 +314,7 @@ void usbprog_runtest(int num_cycles)
else
{
usbprog_jtag_tms_send(usbprog_jtag_handle);
- //INFO("NUM CYCLES %i",num_cycles);
+ /* INFO("NUM CYCLES %i",num_cycles); */
}
for (i = 0; i < num_cycles; i++)
@@ -340,7 +340,7 @@ void usbprog_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size)
else
usbprog_end_state(TAP_SD);
- //usbprog_jtag_tms_send(usbprog_jtag_handle);
+ /* usbprog_jtag_tms_send(usbprog_jtag_handle); */
usbprog_state_move();
usbprog_end_state(saved_end_state);
@@ -455,7 +455,7 @@ unsigned char usbprog_jtag_message(struct usbprog_jtag *usbprog_jtag, char *msg,
return 1;
if (res == msglen)
{
- //INFO("HALLLLOOO %i",(int)msg[0]);
+ /* INFO("HALLLLOOO %i",(int)msg[0]); */
res = usb_bulk_read(usbprog_jtag->usb_handle, 0x82, msg, 2, 100);
if (res > 0)
return (unsigned char)msg[1];
@@ -508,7 +508,7 @@ void usbprog_jtag_write_and_read(struct usbprog_jtag *usbprog_jtag, char * buffe
if (usb_bulk_write(usbprog_jtag->usb_handle, 3, tmp, 64, 1000) == 64)
{
- //INFO("HALLLLOOO2 %i",(int)tmp[0]);
+ /* INFO("HALLLLOOO2 %i",(int)tmp[0]); */
usleep(1);
int timeout = 0;
while (usb_bulk_read(usbprog_jtag->usb_handle, 0x82, tmp, 64, 1000) < 1)
@@ -556,7 +556,7 @@ void usbprog_jtag_read_tdo(struct usbprog_jtag *usbprog_jtag, char * buffer, int
usb_bulk_write(usbprog_jtag->usb_handle, 3, tmp, 3, 1000);
- //INFO("HALLLLOOO3 %i",(int)tmp[0]);
+ /* INFO("HALLLLOOO3 %i",(int)tmp[0]); */
int timeout = 0;
usleep(1);
while (usb_bulk_read(usbprog_jtag->usb_handle, 0x82, tmp, 64, 10) < 1)
@@ -592,7 +592,7 @@ void usbprog_jtag_write_tdi(struct usbprog_jtag *usbprog_jtag, char * buffer, in
{
send_bits = size;
loops = size/8;
- //if(loops==0)
+ /* if(loops==0) */
loops++;
size = 0;
}
@@ -672,7 +672,7 @@ void usbprog_jtag_tms_collect(char tms_scan)
void usbprog_jtag_tms_send(struct usbprog_jtag *usbprog_jtag)
{
int i;
- //INFO("TMS SEND");
+ /* INFO("TMS SEND"); */
if (tms_chain_index > 0)
{
char tmp[tms_chain_index + 2];