aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-21 05:29:23 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-21 05:29:23 +0000
commitd2d75efb3929b0067f7dcb6f9973ec8c47948135 (patch)
treeaad5fcb1f187a39c40824f14314b196f1416d5b0
parent81f9e0a0bce7a3446949d9280208a6f9e9b13bcf (diff)
Zach Welch <zw@superlucidity.net> use static keyword in jtag layer and drivers
git-svn-id: svn://svn.berlios.de/openocd/trunk@1479 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/jtag/amt_jtagaccel.c55
-rw-r--r--src/jtag/arm-jtag-ew.c106
-rw-r--r--src/jtag/at91rm9200.c32
-rw-r--r--src/jtag/bitbang.c13
-rw-r--r--src/jtag/bitq.c6
-rw-r--r--src/jtag/dummy.c34
-rw-r--r--src/jtag/ep93xx.c30
-rw-r--r--src/jtag/ft2232.c160
-rw-r--r--src/jtag/gw16012.c44
-rw-r--r--src/jtag/jlink.c122
-rw-r--r--src/jtag/jtag.c76
-rw-r--r--src/jtag/parport.c54
-rw-r--r--src/jtag/presto.c84
-rw-r--r--src/jtag/usbprog.c121
-rw-r--r--src/jtag/vsllink.c138
15 files changed, 545 insertions, 530 deletions
diff --git a/src/jtag/amt_jtagaccel.c b/src/jtag/amt_jtagaccel.c
index 5e0ec492..2db90935 100644
--- a/src/jtag/amt_jtagaccel.c
+++ b/src/jtag/amt_jtagaccel.c
@@ -56,7 +56,7 @@
#include "log.h"
/* configuration */
-u16 amt_jtagaccel_port;
+static u16 amt_jtagaccel_port;
/* interface variables
*/
@@ -68,27 +68,32 @@ static int rtck_enabled = 0;
#if PARPORT_USE_PPDEV == 1
static int device_handle;
-int addr_mode = IEEE1284_MODE_EPP | IEEE1284_ADDR ;
-int data_mode = IEEE1284_MODE_EPP | IEEE1284_DATA ;
+
+static int addr_mode = IEEE1284_MODE_EPP | IEEE1284_ADDR ;
#define AMT_AW(val) do { ioctl(device_handle, PPSETMODE, &addr_mode); write(device_handle, &val, 1); } while (0)
#define AMT_AR(val) do { ioctl(device_handle, PPSETMODE, &addr_mode); read(device_handle, &val, 1); } while (0)
+
+static int data_mode = IEEE1284_MODE_EPP | IEEE1284_DATA ;
#define AMT_DW(val) do { ioctl(device_handle, PPSETMODE, &data_mode); write(device_handle, &val, 1); } while (0)
#define AMT_DR(val) do { ioctl(device_handle, PPSETMODE, &data_mode); read(device_handle, &val, 1); } while (0)
+
#else
+
#define AMT_AW(val) do { outb(val, amt_jtagaccel_port + 3); } while (0)
#define AMT_AR(val) do { val = inb(amt_jtagaccel_port + 3); } while (0)
#define AMT_DW(val) do { outb(val, amt_jtagaccel_port + 4); } while (0)
#define AMT_DR(val) do { val = inb(amt_jtagaccel_port + 4); } while (0)
-#endif
-int amt_jtagaccel_execute_queue(void);
-int amt_jtagaccel_register_commands(struct command_context_s *cmd_ctx);
-int amt_jtagaccel_speed(int speed);
-int amt_jtagaccel_init(void);
-int amt_jtagaccel_quit(void);
+#endif // PARPORT_USE_PPDEV
+
+static int amt_jtagaccel_execute_queue(void);
+static int amt_jtagaccel_register_commands(struct command_context_s *cmd_ctx);
+static int amt_jtagaccel_speed(int speed);
+static int amt_jtagaccel_init(void);
+static int amt_jtagaccel_quit(void);
-int amt_jtagaccel_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int amt_jtagaccel_handle_rtck_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+static int amt_jtagaccel_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+static int amt_jtagaccel_handle_rtck_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
/* tap_move[i][j]: tap movement command to go from state i to state j
* 0: Test-Logic-Reset
@@ -98,7 +103,7 @@ int amt_jtagaccel_handle_rtck_command(struct command_context_s *cmd_ctx, char *c
* 4: Shift-IR
* 5: Pause-IR
*/
-u8 amt_jtagaccel_tap_move[6][6][2] =
+static u8 amt_jtagaccel_tap_move[6][6][2] =
{
/* RESET IDLE DRSHIFT DRPAUSE IRSHIFT IRPAUSE */
{{0x1f, 0x00}, {0x0f, 0x00}, {0x8a, 0x04}, {0x0a, 0x00}, {0x06, 0x00}, {0x96, 0x00}}, /* RESET */
@@ -122,7 +127,7 @@ jtag_interface_t amt_jtagaccel_interface =
.quit = amt_jtagaccel_quit,
};
-int amt_jtagaccel_register_commands(struct command_context_s *cmd_ctx)
+static int amt_jtagaccel_register_commands(struct command_context_s *cmd_ctx)
{
register_command(cmd_ctx, NULL, "parport_port", amt_jtagaccel_handle_parport_port_command,
COMMAND_CONFIG, NULL);
@@ -132,7 +137,7 @@ int amt_jtagaccel_register_commands(struct command_context_s *cmd_ctx)
return ERROR_OK;
}
-void amt_jtagaccel_reset(int trst, int srst)
+static void amt_jtagaccel_reset(int trst, int srst)
{
if (trst == 1)
aw_control_rst |= 0x4;
@@ -147,7 +152,7 @@ void amt_jtagaccel_reset(int trst, int srst)
AMT_AW(aw_control_rst);
}
-int amt_jtagaccel_speed(int speed)
+static int amt_jtagaccel_speed(int speed)
{
aw_control_baudrate &= 0xf0;
aw_control_baudrate |= speed & 0x0f;
@@ -156,7 +161,7 @@ int amt_jtagaccel_speed(int speed)
return ERROR_OK;
}
-void amt_jtagaccel_end_state(tap_state_t state)
+static void amt_jtagaccel_end_state(tap_state_t state)
{
if (tap_is_state_stable(state))
tap_set_end_state(state);
@@ -167,7 +172,7 @@ void amt_jtagaccel_end_state(tap_state_t state)
}
}
-void amt_wait_scan_busy(void)
+static void amt_wait_scan_busy(void)
{
int timeout = 4096;
u8 ar_status;
@@ -183,7 +188,7 @@ void amt_wait_scan_busy(void)
}
}
-void amt_jtagaccel_state_move(void)
+static void amt_jtagaccel_state_move(void)
{
u8 aw_scan_tms_5;
u8 tms_scan[2];
@@ -210,7 +215,7 @@ void amt_jtagaccel_state_move(void)
tap_set_state(end_state);
}
-void amt_jtagaccel_runtest(int num_cycles)
+static void amt_jtagaccel_runtest(int num_cycles)
{
int i = 0;
u8 aw_scan_tms_5;
@@ -243,7 +248,7 @@ void amt_jtagaccel_runtest(int num_cycles)
amt_jtagaccel_state_move();
}
-void amt_jtagaccel_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size)
+static void amt_jtagaccel_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size)
{
int bits_left = scan_size;
int bit_count = 0;
@@ -325,7 +330,7 @@ void amt_jtagaccel_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_s
tap_set_state(tap_get_end_state());
}
-int amt_jtagaccel_execute_queue(void)
+static int amt_jtagaccel_execute_queue(void)
{
jtag_command_t *cmd = jtag_command_queue; /* currently processed command */
int scan_size;
@@ -431,7 +436,7 @@ int amt_jtagaccel_get_giveio_access(void)
}
#endif
-int amt_jtagaccel_init(void)
+static int amt_jtagaccel_init(void)
{
#if PARPORT_USE_PPDEV == 1
char buffer[256];
@@ -536,13 +541,13 @@ int amt_jtagaccel_init(void)
return ERROR_OK;
}
-int amt_jtagaccel_quit(void)
+static int amt_jtagaccel_quit(void)
{
return ERROR_OK;
}
-int amt_jtagaccel_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int amt_jtagaccel_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc == 0)
return ERROR_OK;
@@ -554,7 +559,7 @@ int amt_jtagaccel_handle_parport_port_command(struct command_context_s *cmd_ctx,
return ERROR_OK;
}
-int amt_jtagaccel_handle_rtck_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int amt_jtagaccel_handle_rtck_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc == 0)
{
diff --git a/src/jtag/arm-jtag-ew.c b/src/jtag/arm-jtag-ew.c
index 6e95611b..fa2df65a 100644
--- a/src/jtag/arm-jtag-ew.c
+++ b/src/jtag/arm-jtag-ew.c
@@ -77,32 +77,32 @@ static u8 usb_in_buffer[ARMJTAGEW_IN_BUFFER_SIZE];
static u8 usb_out_buffer[ARMJTAGEW_OUT_BUFFER_SIZE];
/* External interface functions */
-int armjtagew_execute_queue(void);
-int armjtagew_speed(int speed);
-int armjtagew_khz(int khz, int *jtag_speed);
-int armjtagew_register_commands(struct command_context_s *cmd_ctx);
-int armjtagew_init(void);
-int armjtagew_quit(void);
+static int armjtagew_execute_queue(void);
+static int armjtagew_speed(int speed);
+static int armjtagew_khz(int khz, int *jtag_speed);
+static int armjtagew_register_commands(struct command_context_s *cmd_ctx);
+static int armjtagew_init(void);
+static int armjtagew_quit(void);
/* CLI command handler functions */
-int armjtagew_handle_armjtagew_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+static int armjtagew_handle_armjtagew_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
/* Queue command functions */
-void armjtagew_end_state(tap_state_t state);
-void armjtagew_state_move(void);
-void armjtagew_path_move(int num_states, tap_state_t *path);
-void armjtagew_runtest(int num_cycles);
-void armjtagew_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size, scan_command_t *command);
-void armjtagew_reset(int trst, int srst);
-void armjtagew_simple_command(u8 command);
-int armjtagew_get_status(void);
+static void armjtagew_end_state(tap_state_t state);
+static void armjtagew_state_move(void);
+static void armjtagew_path_move(int num_states, tap_state_t *path);
+static void armjtagew_runtest(int num_cycles);
+static void armjtagew_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size, scan_command_t *command);
+static void armjtagew_reset(int trst, int srst);
+//static void armjtagew_simple_command(u8 command);
+static int armjtagew_get_status(void);
/* tap buffer functions */
-void armjtagew_tap_init(void);
-int armjtagew_tap_execute(void);
-void armjtagew_tap_ensure_space(int scans, int bits);
-void armjtagew_tap_append_step(int tms, int tdi);
-void armjtagew_tap_append_scan(int length, u8 *buffer, scan_command_t *command);
+static void armjtagew_tap_init(void);
+static int armjtagew_tap_execute(void);
+static void armjtagew_tap_ensure_space(int scans, int bits);
+static void armjtagew_tap_append_step(int tms, int tdi);
+static void armjtagew_tap_append_scan(int length, u8 *buffer, scan_command_t *command);
/* ARM-JTAG-EW lowlevel functions */
typedef struct armjtagew_jtag
@@ -110,20 +110,20 @@ typedef struct armjtagew_jtag
struct usb_dev_handle* usb_handle;
} armjtagew_jtag_t;
-armjtagew_jtag_t *armjtagew_usb_open(void);
-void armjtagew_usb_close(armjtagew_jtag_t *armjtagew_jtag);
-int armjtagew_usb_message(armjtagew_jtag_t *armjtagew_jtag, int out_length, int in_length);
-int armjtagew_usb_write(armjtagew_jtag_t *armjtagew_jtag, int out_length);
-int armjtagew_usb_read(armjtagew_jtag_t *armjtagew_jtag, int exp_in_length);
+static armjtagew_jtag_t *armjtagew_usb_open(void);
+static void armjtagew_usb_close(armjtagew_jtag_t *armjtagew_jtag);
+static int armjtagew_usb_message(armjtagew_jtag_t *armjtagew_jtag, int out_length, int in_length);
+static int armjtagew_usb_write(armjtagew_jtag_t *armjtagew_jtag, int out_length);
+static int armjtagew_usb_read(armjtagew_jtag_t *armjtagew_jtag, int exp_in_length);
/* helper functions */
-int armjtagew_get_version_info(void);
+static int armjtagew_get_version_info(void);
#ifdef _DEBUG_USB_COMMS_
-void armjtagew_debug_buffer(u8 *buffer, int length);
+static void armjtagew_debug_buffer(u8 *buffer, int length);
#endif
-armjtagew_jtag_t* armjtagew_jtag_handle;
+static armjtagew_jtag_t* armjtagew_jtag_handle;
@@ -142,7 +142,7 @@ jtag_interface_t armjtagew_interface =
};
-int armjtagew_execute_queue(void)
+static int armjtagew_execute_queue(void)
{
jtag_command_t *cmd = jtag_command_queue;
int scan_size;
@@ -239,7 +239,7 @@ int armjtagew_execute_queue(void)
/* Sets speed in kHz. */
-int armjtagew_speed(int speed)
+static int armjtagew_speed(int speed)
{
int result;
int speed_real;
@@ -273,21 +273,21 @@ int armjtagew_speed(int speed)
}
-int armjtagew_khz(int khz, int *jtag_speed)
+static int armjtagew_khz(int khz, int *jtag_speed)
{
*jtag_speed = khz;
return ERROR_OK;
}
-int armjtagew_register_commands(struct command_context_s *cmd_ctx)
+static int armjtagew_register_commands(struct command_context_s *cmd_ctx)
{
register_command(cmd_ctx, NULL, "armjtagew_info", armjtagew_handle_armjtagew_info_command, COMMAND_EXEC,
"query armjtagew info");
return ERROR_OK;
}
-int armjtagew_init(void)
+static int armjtagew_init(void)
{
int check_cnt;
@@ -325,7 +325,7 @@ int armjtagew_init(void)
return ERROR_OK;
}
-int armjtagew_quit(void)
+static int armjtagew_quit(void)
{
armjtagew_usb_close(armjtagew_jtag_handle);
return ERROR_OK;
@@ -334,7 +334,7 @@ int armjtagew_quit(void)
/***************************************************************************/
/* Queue command implementations */
-void armjtagew_end_state(tap_state_t state)
+static void armjtagew_end_state(tap_state_t state)
{
if (tap_is_state_stable(state))
{
@@ -348,7 +348,7 @@ void armjtagew_end_state(tap_state_t state)
}
/* Goes to the end state. */
-void armjtagew_state_move(void)
+static void armjtagew_state_move(void)
{
int i;
int tms = 0;
@@ -363,7 +363,7 @@ void armjtagew_state_move(void)
tap_set_state(tap_get_end_state());
}
-void armjtagew_path_move(int num_states, tap_state_t *path)
+static void armjtagew_path_move(int num_states, tap_state_t *path)
{
int i;
@@ -394,7 +394,7 @@ void armjtagew_path_move(int num_states, tap_state_t *path)
tap_set_end_state(tap_get_state());
}
-void armjtagew_runtest(int num_cycles)
+static void armjtagew_runtest(int num_cycles)
{
int i;
@@ -421,7 +421,7 @@ void armjtagew_runtest(int num_cycles)
}
}
-void armjtagew_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size, scan_command_t *command)
+static void armjtagew_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size, scan_command_t *command)
{
tap_state_t saved_end_state;
@@ -449,7 +449,7 @@ void armjtagew_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size,
}
}
-void armjtagew_reset(int trst, int srst)
+static void armjtagew_reset(int trst, int srst)
{
const u8 trst_mask = (1u<<5);
const u8 srst_mask = (1u<<6);
@@ -498,7 +498,7 @@ void armjtagew_reset(int trst, int srst)
}
-int armjtagew_get_status(void)
+static int armjtagew_get_status(void)
{
int result;
@@ -530,7 +530,7 @@ int armjtagew_get_status(void)
return ERROR_OK;
}
-int armjtagew_get_version_info(void)
+static int armjtagew_get_version_info(void)
{
int result;
char sn[16];
@@ -559,7 +559,7 @@ int armjtagew_get_version_info(void)
return ERROR_OK;
}
-int armjtagew_handle_armjtagew_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int armjtagew_handle_armjtagew_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (armjtagew_get_version_info() == ERROR_OK)
{
@@ -596,13 +596,13 @@ static pending_scan_result_t pending_scan_results_buffer[MAX_PENDING_SCAN_RESULT
static int last_tms;
-void armjtagew_tap_init(void)
+static void armjtagew_tap_init(void)
{
tap_length = 0;
pending_scan_results_length = 0;
}
-void armjtagew_tap_ensure_space(int scans, int bits)
+static void armjtagew_tap_ensure_space(int scans, int bits)
{
int available_scans = MAX_PENDING_SCAN_RESULTS - pending_scan_results_length;
int available_bits = ARMJTAGEW_TAP_BUFFER_SIZE * 8 - tap_length;
@@ -613,7 +613,7 @@ void armjtagew_tap_ensure_space(int scans, int bits)
}
}
-void armjtagew_tap_append_step(int tms, int tdi)
+static void armjtagew_tap_append_step(int tms, int tdi)
{
last_tms = tms;
int index = tap_length / 8;
@@ -668,7 +668,7 @@ void armjtagew_tap_append_scan(int length, u8 *buffer, scan_command_t *command)
/* Pad and send a tap sequence to the device, and receive the answer.
* For the purpose of padding we assume that we are in idle or pause state. */
-int armjtagew_tap_execute(void)
+static int armjtagew_tap_execute(void)
{
int byte_length;
int tms_offset;
@@ -764,7 +764,7 @@ int armjtagew_tap_execute(void)
/*****************************************************************************/
/* JLink USB low-level functions */
-armjtagew_jtag_t* armjtagew_usb_open()
+static armjtagew_jtag_t* armjtagew_usb_open()
{
struct usb_bus *busses;
struct usb_bus *bus;
@@ -812,14 +812,14 @@ armjtagew_jtag_t* armjtagew_usb_open()
return NULL;
}
-void armjtagew_usb_close(armjtagew_jtag_t *armjtagew_jtag)
+static void armjtagew_usb_close(armjtagew_jtag_t *armjtagew_jtag)
{
usb_close(armjtagew_jtag->usb_handle);
free(armjtagew_jtag);
}
/* Send a message and receive the reply. */
-int armjtagew_usb_message(armjtagew_jtag_t *armjtagew_jtag, int out_length, int in_length)
+static int armjtagew_usb_message(armjtagew_jtag_t *armjtagew_jtag, int out_length, int in_length)
{
int result;
@@ -842,7 +842,7 @@ int armjtagew_usb_message(armjtagew_jtag_t *armjtagew_jtag, int out_length, int
}
/* Write data from out_buffer to USB. */
-int armjtagew_usb_write(armjtagew_jtag_t *armjtagew_jtag, int out_length)
+static int armjtagew_usb_write(armjtagew_jtag_t *armjtagew_jtag, int out_length)
{
int result;
@@ -864,7 +864,7 @@ int armjtagew_usb_write(armjtagew_jtag_t *armjtagew_jtag, int out_length)
}
/* Read data from USB into in_buffer. */
-int armjtagew_usb_read(armjtagew_jtag_t *armjtagew_jtag, int exp_in_length)
+static int armjtagew_usb_read(armjtagew_jtag_t *armjtagew_jtag, int exp_in_length)
{
int result = usb_bulk_read(armjtagew_jtag->usb_handle, ARMJTAGEW_EPT_BULK_IN, \
(char*)usb_in_buffer, exp_in_length, ARMJTAGEW_USB_TIMEOUT);
@@ -881,7 +881,7 @@ int armjtagew_usb_read(armjtagew_jtag_t *armjtagew_jtag, int exp_in_length)
#ifdef _DEBUG_USB_COMMS_
#define BYTES_PER_LINE 16
-void armjtagew_debug_buffer(u8 *buffer, int length)
+static void armjtagew_debug_buffer(u8 *buffer, int length)
{
char line[81];
char s[4];
diff --git a/src/jtag/at91rm9200.c b/src/jtag/at91rm9200.c
index dce7c7cd..ce28bb53 100644
--- a/src/jtag/at91rm9200.c
+++ b/src/jtag/at91rm9200.c
@@ -119,14 +119,14 @@ static u32* pio_base;
/* low level command set
*/
-int at91rm9200_read(void);
-void at91rm9200_write(int tck, int tms, int tdi);
-void at91rm9200_reset(int trst, int srst);
+static int at91rm9200_read(void);
+static void at91rm9200_write(int tck, int tms, int tdi);
+static void at91rm9200_reset(int trst, int srst);
-int at91rm9200_speed(int speed);
-int at91rm9200_register_commands(struct command_context_s *cmd_ctx);
-int at91rm9200_init(void);
-int at91rm9200_quit(void);
+static int at91rm9200_speed(int speed);
+static int at91rm9200_register_commands(struct command_context_s *cmd_ctx);
+static int at91rm9200_init(void);
+static int at91rm9200_quit(void);
jtag_interface_t at91rm9200_interface =
{
@@ -140,7 +140,7 @@ jtag_interface_t at91rm9200_interface =
.quit = at91rm9200_quit,
};
-bitbang_interface_t at91rm9200_bitbang =
+static bitbang_interface_t at91rm9200_bitbang =
{
.read = at91rm9200_read,
.write = at91rm9200_write,
@@ -148,12 +148,12 @@ bitbang_interface_t at91rm9200_bitbang =
.blink = 0
};
-int at91rm9200_read(void)
+static int at91rm9200_read(void)
{
return (pio_base[device->TDO_PIO + PIO_PDSR] & device->TDO_MASK) != 0;
}
-void at91rm9200_write(int tck, int tms, int tdi)
+static void at91rm9200_write(int tck, int tms, int tdi)
{
if (tck)
pio_base[device->TCK_PIO + PIO_SODR] = device->TCK_MASK;
@@ -172,7 +172,7 @@ void at91rm9200_write(int tck, int tms, int tdi)
}
/* (1) assert or (0) deassert reset lines */
-void at91rm9200_reset(int trst, int srst)
+static void at91rm9200_reset(int trst, int srst)
{
if (trst == 0)
pio_base[device->TRST_PIO + PIO_SODR] = device->TRST_MASK;
@@ -185,13 +185,13 @@ void at91rm9200_reset(int trst, int srst)
pio_base[device->SRST_PIO + PIO_CODR] = device->SRST_MASK;
}
-int at91rm9200_speed(int speed)
+static int at91rm9200_speed(int speed)
{
return ERROR_OK;
}
-int at91rm9200_handle_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int at91rm9200_handle_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc == 0)
return ERROR_OK;
@@ -206,14 +206,14 @@ int at91rm9200_handle_device_command(struct command_context_s *cmd_ctx, char *cm
return ERROR_OK;
}
-int at91rm9200_register_commands(struct command_context_s *cmd_ctx)
+static int at91rm9200_register_commands(struct command_context_s *cmd_ctx)
{
register_command(cmd_ctx, NULL, "at91rm9200_device", at91rm9200_handle_device_command,
COMMAND_CONFIG, NULL);
return ERROR_OK;
}
-int at91rm9200_init(void)
+static int at91rm9200_init(void)
{
struct device_t *cur_device;
@@ -284,7 +284,7 @@ int at91rm9200_init(void)
return ERROR_OK;
}
-int at91rm9200_quit(void)
+static int at91rm9200_quit(void)
{
return ERROR_OK;
diff --git a/src/jtag/bitbang.c b/src/jtag/bitbang.c
index 44e88986..fe5f86c4 100644
--- a/src/jtag/bitbang.c
+++ b/src/jtag/bitbang.c
@@ -71,12 +71,9 @@ bitbang_interface_t *bitbang_interface;
*/
#define CLOCK_IDLE() 0
-int bitbang_execute_queue(void);
-
/* The bitbang driver leaves the TCK 0 when in idle */
-
-void bitbang_end_state(tap_state_t state)
+static void bitbang_end_state(tap_state_t state)
{
if (tap_is_state_stable(state))
tap_set_end_state(state);
@@ -87,7 +84,7 @@ void bitbang_end_state(tap_state_t state)
}
}
-void bitbang_state_move(void)
+static void bitbang_state_move(void)
{
int i=0, tms=0;
u8 tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
@@ -103,7 +100,7 @@ void bitbang_state_move(void)
tap_set_state(tap_get_end_state());
}
-void bitbang_path_move(pathmove_command_t *cmd)
+static void bitbang_path_move(pathmove_command_t *cmd)
{
int num_states = cmd->num_states;
int state_count;
@@ -139,7 +136,7 @@ void bitbang_path_move(pathmove_command_t *cmd)
tap_set_end_state(tap_get_state());
}
-void bitbang_runtest(int num_cycles)
+static void bitbang_runtest(int num_cycles)
{
int i;
@@ -182,7 +179,7 @@ static void bitbang_stableclocks(int num_cycles)
-void bitbang_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size)
+static void bitbang_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size)
{
tap_state_t saved_end_state = tap_get_end_state();
int bit_cnt;
diff --git a/src/jtag/bitq.c b/src/jtag/bitq.c
index 5f9227ee..6d47c48b 100644
--- a/src/jtag/bitq.c
+++ b/src/jtag/bitq.c
@@ -36,10 +36,10 @@
bitq_interface_t* bitq_interface; /* low level bit queue interface */
-bitq_state_t bitq_in_state; /* state of input queue */
+static bitq_state_t bitq_in_state; /* state of input queue */
-u8* bitq_in_buffer; /* buffer dynamically reallocated as needed */
-int bitq_in_bufsize = 32; /* min. buffer size */
+static u8* bitq_in_buffer; /* buffer dynamically reallocated as needed */
+static int bitq_in_bufsize = 32; /* min. buffer size */
/*
* input queue processing does not use jtag_read_buffer() to avoid unnecessary overhead
diff --git a/src/jtag/dummy.c b/src/jtag/dummy.c
index 7228ab5a..49161a60 100644
--- a/src/jtag/dummy.c
+++ b/src/jtag/dummy.c
@@ -37,10 +37,10 @@ static int clock_count; /* count clocks in any stable state, only stable
static u32 dummy_data;
-int dummy_speed(int speed);
-int dummy_register_commands(struct command_context_s *cmd_ctx);
-int dummy_init(void);
-int dummy_quit(void);
+static int dummy_speed(int speed);
+static int dummy_register_commands(struct command_context_s *cmd_ctx);
+static int dummy_init(void);
+static int dummy_quit(void);
static int dummy_khz(int khz, int *jtag_speed);
static int dummy_speed_div(int speed, int *khz);
@@ -63,12 +63,12 @@ jtag_interface_t dummy_interface =
.quit = dummy_quit,
};
-int dummy_read(void);
-void dummy_write(int tck, int tms, int tdi);
-void dummy_reset(int trst, int srst);
-void dummy_led(int on);
+static int dummy_read(void);
+static void dummy_write(int tck, int tms, int tdi);
+static void dummy_reset(int trst, int srst);
+static void dummy_led(int on);
-bitbang_interface_t dummy_bitbang =
+static bitbang_interface_t dummy_bitbang =
{
.read = dummy_read,
.write = dummy_write,
@@ -76,7 +76,7 @@ bitbang_interface_t dummy_bitbang =
.blink = dummy_led
};
-int dummy_read(void)
+static int dummy_read(void)
{
int data = 1 & dummy_data;
dummy_data = (dummy_data >> 1) | (1<<31);
@@ -84,7 +84,7 @@ int dummy_read(void)
}
-void dummy_write(int tck, int tms, int tdi)
+static void dummy_write(int tck, int tms, int tdi)
{
/* TAP standard: "state transitions occur on rising edge of clock" */
if( tck != dummy_clock )
@@ -121,7 +121,7 @@ void dummy_write(int tck, int tms, int tdi)
}
}
-void dummy_reset(int trst, int srst)
+static void dummy_reset(int trst, int srst)
{
dummy_clock = 0;
@@ -158,29 +158,29 @@ static int dummy_speed_div(int speed, int *khz)
return ERROR_OK;
}
-int dummy_speed(int speed)
+static int dummy_speed(int speed)
{
return ERROR_OK;
}
-int dummy_register_commands(struct command_context_s *cmd_ctx)
+static int dummy_register_commands(struct command_context_s *cmd_ctx)
{
return ERROR_OK;
}
-int dummy_init(void)
+static int dummy_init(void)
{
bitbang_interface = &dummy_bitbang;
return ERROR_OK;
}
-int dummy_quit(void)
+static int dummy_quit(void)
{
return ERROR_OK;
}
-void dummy_led(int on)
+static void dummy_led(int on)
{
}
diff --git a/src/jtag/ep93xx.c b/src/jtag/ep93xx.c
index 03a391a0..d79a0d67 100644
--- a/src/jtag/ep93xx.c
+++ b/src/jtag/ep93xx.c
@@ -50,14 +50,14 @@ static volatile u8 *gpio_data_direction_register;
/* low level command set
*/
-int ep93xx_read(void);
-void ep93xx_write(int tck, int tms, int tdi);
-void ep93xx_reset(int trst, int srst);
+static int ep93xx_read(void);
+static void ep93xx_write(int tck, int tms, int tdi);
+static void ep93xx_reset(int trst, int srst);
-int ep93xx_speed(int speed);
-int ep93xx_register_commands(struct command_context_s *cmd_ctx);
-int ep93xx_init(void);
-int ep93xx_quit(void);
+static int ep93xx_speed(int speed);
+static int ep93xx_register_commands(struct command_context_s *cmd_ctx);
+static int ep93xx_init(void);
+static int ep93xx_quit(void);
struct timespec ep93xx_zzzz;
@@ -73,7 +73,7 @@ jtag_interface_t ep93xx_interface =
.quit = ep93xx_quit,
};
-bitbang_interface_t ep93xx_bitbang =
+static bitbang_interface_t ep93xx_bitbang =
{
.read = ep93xx_read,
.write = ep93xx_write,
@@ -81,12 +81,12 @@ bitbang_interface_t ep93xx_bitbang =
.blink = 0,
};
-int ep93xx_read(void)
+static int ep93xx_read(void)
{
return !!(*gpio_data_register & TDO_BIT);
}
-void ep93xx_write(int tck, int tms, int tdi)
+static void ep93xx_write(int tck, int tms, int tdi)
{
if (tck)
output_value |= TCK_BIT;
@@ -108,7 +108,7 @@ void ep93xx_write(int tck, int tms, int tdi)
}
/* (1) assert or (0) deassert reset lines */
-void ep93xx_reset(int trst, int srst)
+static void ep93xx_reset(int trst, int srst)
{
if (trst == 0)
output_value |= TRST_BIT;
@@ -124,13 +124,13 @@ void ep93xx_reset(int trst, int srst)
nanosleep(&ep93xx_zzzz, NULL);
}
-int ep93xx_speed(int speed)
+static int ep93xx_speed(int speed)
{
return ERROR_OK;
}
-int ep93xx_register_commands(struct command_context_s *cmd_ctx)
+static int ep93xx_register_commands(struct command_context_s *cmd_ctx)
{
return ERROR_OK;
@@ -157,7 +157,7 @@ static int set_gonk_mode(void)
return ERROR_OK;
}
-int ep93xx_init(void)
+static int ep93xx_init(void)
{
int ret;
@@ -231,7 +231,7 @@ int ep93xx_init(void)
return ERROR_OK;
}
-int ep93xx_quit(void)
+static int ep93xx_quit(void)
{
return ERROR_OK;
diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c
index f4c3e4b5..48c10355 100644
--- a/src/jtag/ft2232.c
+++ b/src/jtag/ft2232.c
@@ -70,20 +70,20 @@
#define _DEBUG_USB_COMMS_
#endif
-int ft2232_execute_queue(void);
+static int ft2232_execute_queue(void);
-int ft2232_speed(int speed);
-int ft2232_speed_div(int speed, int* khz);
-int ft2232_khz(int khz, int* jtag_speed);
-int ft2232_register_commands(struct command_context_s* cmd_ctx);
-int ft2232_init(void);
-int ft2232_quit(void);
+static int ft2232_speed(int speed);
+static int ft2232_speed_div(int speed, int* khz);
+static int ft2232_khz(int khz, int* jtag_speed);
+static int ft2232_register_commands(struct command_context_s* cmd_ctx);
+static int ft2232_init(void);
+static int ft2232_quit(void);
-int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
+static int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
+static int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
+static int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
+static int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
+static int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
/**
@@ -97,11 +97,11 @@ int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd,
static int ft2232_stableclocks(int num_cycles, jtag_command_t* cmd);
-char * ft2232_device_desc_A = NULL;
-char* ft2232_device_desc = NULL;
-char* ft2232_serial = NULL;
-char* ft2232_layout = NULL;
-unsigned char ft2232_latency = 2;
+static char * ft2232_device_desc_A = NULL;
+static char* ft2232_device_desc = NULL;
+static char* ft2232_serial = NULL;
+static char* ft2232_layout = NULL;
+static unsigned char ft2232_latency = 2;
#define MAX_USB_IDS 8
/* vid = pid = 0 marks the end of the list */
@@ -117,31 +117,31 @@ typedef struct ft2232_layout_s
} ft2232_layout_t;
/* init procedures for supported layouts */
-int usbjtag_init(void);
-int jtagkey_init(void);
-int olimex_jtag_init(void);
-int flyswatter_init(void);
-int turtle_init(void);
-int comstick_init(void);
-int stm32stick_init(void);
-int axm0432_jtag_init(void);
-int sheevaplug_init(void);
+static int usbjtag_init(void);
+static int jtagkey_init(void);
+static int olimex_jtag_init(void);
+static int flyswatter_init(void);
+static int turtle_init(void);
+static int comstick_init(void);
+static int stm32stick_init(void);
+static int axm0432_jtag_init(void);
+static int sheevaplug_init(void);
/* reset procedures for supported layouts */
-void usbjtag_reset(int trst, int srst);
-void jtagkey_reset(int trst, int srst);
-void olimex_jtag_reset(int trst, int srst);
-void flyswatter_reset(int trst, int srst);
-void turtle_reset(int trst, int srst);
-void comstick_reset(int trst, int srst);
-void stm32stick_reset(int trst, int srst);
-void axm0432_jtag_reset(int trst, int srst);
-void sheevaplug_reset(int trst, int srst);
+static void usbjtag_reset(int trst, int srst);
+static void jtagkey_reset(int trst, int srst);
+static void olimex_jtag_reset(int trst, int srst);
+static void flyswatter_reset(int trst, int srst);
+static void turtle_reset(int trst, int srst);
+static void comstick_reset(int trst, int srst);
+static void stm32stick_reset(int trst, int srst);
+static void axm0432_jtag_reset(int trst, int srst);
+static void sheevaplug_reset(int trst, int srst);
/* blink procedures for layouts that support a blinking led */
-void olimex_jtag_blink(void);
-void flyswatter_jtag_blink(void);
-void turtle_jtag_blink(void);
+static void olimex_jtag_blink(void);
+static void flyswatter_jtag_blink(void);
+static void turtle_jtag_blink(void);