jtag: constify driver arrays

Change-Id: I81574fa8ca3cc748526dc61b75a2c75d6335ef04
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2294
Tested-by: jenkins
This commit is contained in:
Spencer Oliver 2014-09-11 22:09:36 +01:00
parent 36bc83b174
commit b675edcc95
11 changed files with 24 additions and 24 deletions

View File

@ -31,7 +31,7 @@
#include "aice_usb.h" #include "aice_usb.h"
#define AICE_KHZ_TO_SPEED_MAP_SIZE 16 #define AICE_KHZ_TO_SPEED_MAP_SIZE 16
static int aice_khz_to_speed_map[AICE_KHZ_TO_SPEED_MAP_SIZE] = { static const int aice_khz_to_speed_map[AICE_KHZ_TO_SPEED_MAP_SIZE] = {
30000, 30000,
15000, 15000,
7500, 7500,

View File

@ -22,9 +22,9 @@
struct aice_interface_param_s { struct aice_interface_param_s {
/** */ /** */
char *device_desc; const char *device_desc;
/** */ /** */
char *serial; const char *serial;
/** */ /** */
uint16_t vid; uint16_t vid;
/** */ /** */

View File

@ -106,9 +106,9 @@ enum aice_command_mode {
struct aice_port_param_s { struct aice_port_param_s {
/** */ /** */
char *device_desc; const char *device_desc;
/** */ /** */
char *serial; const char *serial;
/** */ /** */
uint16_t vid; uint16_t vid;
/** */ /** */
@ -225,7 +225,7 @@ struct aice_port_api_s {
/** */ /** */
struct aice_port { struct aice_port {
/** */ /** */
char *name; const char *name;
/** */ /** */
int type; int type;
/** */ /** */

View File

@ -124,7 +124,7 @@ static const int data_mode = IEEE1284_MODE_EPP | IEEE1284_DATA;
* 4: Shift-IR * 4: Shift-IR
* 5: Pause-IR * 5: Pause-IR
*/ */
static uint8_t amt_jtagaccel_tap_move[6][6][2] = { static const uint8_t amt_jtagaccel_tap_move[6][6][2] = {
/* RESET IDLE DRSHIFT DRPAUSE IRSHIFT IRPAUSE */ /* RESET IDLE DRSHIFT DRPAUSE IRSHIFT IRPAUSE */
{ {0x1f, 0x00}, {0x0f, 0x00}, {0x05, 0x00}, {0x0a, 0x00}, {0x06, 0x00}, {0x96, 0x00} }, /* RESET */ { {0x1f, 0x00}, {0x0f, 0x00}, {0x05, 0x00}, {0x0a, 0x00}, {0x06, 0x00}, {0x96, 0x00} }, /* RESET */
{ {0x1f, 0x00}, {0x00, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x0b, 0x00} }, /* IDLE */ { {0x1f, 0x00}, {0x00, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x0b, 0x00} }, /* IDLE */

View File

@ -79,7 +79,7 @@
#define P31 (1 << 31) #define P31 (1 << 31)
struct device_t { struct device_t {
char *name; const char *name;
int TDO_PIO; /* PIO holding TDO */ int TDO_PIO; /* PIO holding TDO */
uint32_t TDO_MASK; /* TDO bitmask */ uint32_t TDO_MASK; /* TDO bitmask */
int TRST_PIO; /* PIO holding TRST */ int TRST_PIO; /* PIO holding TRST */
@ -94,7 +94,7 @@ struct device_t {
uint32_t SRST_MASK; /* SRST bitmask */ uint32_t SRST_MASK; /* SRST bitmask */
}; };
static struct device_t devices[] = { static const struct device_t devices[] = {
{ "rea_ecr", PIOD, P27, PIOA, NC, PIOD, P23, PIOD, P24, PIOD, P26, PIOC, P5 }, { "rea_ecr", PIOD, P27, PIOA, NC, PIOD, P23, PIOD, P24, PIOD, P26, PIOC, P5 },
{ .name = NULL }, { .name = NULL },
}; };
@ -104,7 +104,7 @@ static char *at91rm9200_device;
/* interface variables /* interface variables
*/ */
static struct device_t *device; static const struct device_t *device;
static int dev_mem_fd; static int dev_mem_fd;
static void *sys_controller; static void *sys_controller;
static uint32_t *pio_base; static uint32_t *pio_base;
@ -196,7 +196,7 @@ struct jtag_interface at91rm9200_interface = {
static int at91rm9200_init(void) static int at91rm9200_init(void)
{ {
struct device_t *cur_device; const struct device_t *cur_device;
cur_device = devices; cur_device = devices;

View File

@ -137,7 +137,7 @@ static bool swd_mode;
/* CMSIS-DAP Vendor Commands /* CMSIS-DAP Vendor Commands
* None as yet... */ * None as yet... */
static char *info_caps_str[] = { static const char * const info_caps_str[] = {
"SWD Supported", "SWD Supported",
"JTAG Supported" "JTAG Supported"
}; };

View File

@ -164,7 +164,7 @@ static uint16_t ft2232_vid[MAX_USB_IDS + 1] = { 0x0403, 0 };
static uint16_t ft2232_pid[MAX_USB_IDS + 1] = { 0x6010, 0 }; static uint16_t ft2232_pid[MAX_USB_IDS + 1] = { 0x6010, 0 };
struct ft2232_layout { struct ft2232_layout {
char *name; const char *name;
int (*init)(void); int (*init)(void);
void (*reset)(int trst, int srst); void (*reset)(int trst, int srst);
void (*blink)(void); void (*blink)(void);

View File

@ -41,7 +41,7 @@
#define OPENDOUS_MAX_VIDS_PIDS 4 #define OPENDOUS_MAX_VIDS_PIDS 4
/* define some probes with similar interface */ /* define some probes with similar interface */
struct opendous_probe { struct opendous_probe {
char *name; const char *name;
uint16_t VID[OPENDOUS_MAX_VIDS_PIDS]; uint16_t VID[OPENDOUS_MAX_VIDS_PIDS];
uint16_t PID[OPENDOUS_MAX_VIDS_PIDS]; uint16_t PID[OPENDOUS_MAX_VIDS_PIDS];
uint8_t READ_EP; uint8_t READ_EP;
@ -50,7 +50,7 @@ struct opendous_probe {
int BUFFERSIZE; int BUFFERSIZE;
}; };
static struct opendous_probe opendous_probes[] = { static const struct opendous_probe opendous_probes[] = {
{"usbprog-jtag", {0x1781, 0}, {0x0C63, 0}, 0x82, 0x02, 0x00, 510 }, {"usbprog-jtag", {0x1781, 0}, {0x0C63, 0}, 0x82, 0x02, 0x00, 510 },
{"opendous", {0x1781, 0x03EB, 0}, {0xC0C0, 0x204F, 0}, 0x81, 0x02, 0x00, 360 }, {"opendous", {0x1781, 0x03EB, 0}, {0xC0C0, 0x204F, 0}, 0x81, 0x02, 0x00, 360 },
{"usbvlab", {0x16C0, 0}, {0x05DC, 0}, 0x81, 0x02, 0x01, 360 }, {"usbvlab", {0x16C0, 0}, {0x05DC, 0}, 0x81, 0x02, 0x01, 360 },
@ -109,7 +109,7 @@ static struct pending_scan_result *pending_scan_results_buffer;
#define FUNC_READ_DATA 0x51 #define FUNC_READ_DATA 0x51
static char *opendous_type; static char *opendous_type;
static struct opendous_probe *opendous_probe; static const struct opendous_probe *opendous_probe;
/* External interface functions */ /* External interface functions */
static int opendous_execute_queue(void); static int opendous_execute_queue(void);
@ -321,7 +321,7 @@ static int opendous_execute_queue(void)
static int opendous_init(void) static int opendous_init(void)
{ {
int check_cnt; int check_cnt;
struct opendous_probe *cur_opendous_probe; const struct opendous_probe *cur_opendous_probe;
cur_opendous_probe = opendous_probes; cur_opendous_probe = opendous_probes;

View File

@ -60,7 +60,7 @@
/* parallel port cable description /* parallel port cable description
*/ */
struct cable { struct cable {
char *name; const char *name;
uint8_t TDO_MASK; /* status port bit containing current TDO value */ uint8_t TDO_MASK; /* status port bit containing current TDO value */
uint8_t TRST_MASK; /* data port bit for TRST */ uint8_t TRST_MASK; /* data port bit for TRST */
uint8_t TMS_MASK; /* data port bit for TMS */ uint8_t TMS_MASK; /* data port bit for TMS */
@ -74,7 +74,7 @@ struct cable {
uint8_t LED_MASK; /* data port bit for LED */ uint8_t LED_MASK; /* data port bit for LED */
}; };
static struct cable cables[] = { static const struct cable cables[] = {
/* name tdo trst tms tck tdi srst o_inv i_inv init exit led */ /* name tdo trst tms tck tdi srst o_inv i_inv init exit led */
{ "wiggler", 0x80, 0x10, 0x02, 0x04, 0x08, 0x01, 0x01, 0x80, 0x80, 0x80, 0x00 }, { "wiggler", 0x80, 0x10, 0x02, 0x04, 0x08, 0x01, 0x01, 0x80, 0x80, 0x80, 0x00 },
{ "wiggler2", 0x80, 0x10, 0x02, 0x04, 0x08, 0x01, 0x01, 0x80, 0x80, 0x00, 0x20 }, { "wiggler2", 0x80, 0x10, 0x02, 0x04, 0x08, 0x01, 0x01, 0x80, 0x80, 0x00, 0x20 },
@ -108,7 +108,7 @@ static int wait_states;
/* interface variables /* interface variables
*/ */
static struct cable *cable; static const struct cable *cable;
static uint8_t dataport_value; static uint8_t dataport_value;
#if PARPORT_USE_PPDEV == 1 #if PARPORT_USE_PPDEV == 1
@ -262,7 +262,7 @@ static struct bitbang_interface parport_bitbang = {
static int parport_init(void) static int parport_init(void)
{ {
struct cable *cur_cable; const struct cable *cur_cable;
#if PARPORT_USE_PPDEV == 1 #if PARPORT_USE_PPDEV == 1
char buffer[256]; char buffer[256];
#endif #endif

View File

@ -33,9 +33,9 @@ extern const char *hl_transports[];
struct hl_interface_param_s { struct hl_interface_param_s {
/** */ /** */
char *device_desc; const char *device_desc;
/** */ /** */
char *serial; const char *serial;
/** */ /** */
uint16_t vid; uint16_t vid;
/** */ /** */

View File

@ -198,7 +198,7 @@ static inline tap_state_t jtag_debug_state_machine(const void *tms_buf,
*/ */
struct jtag_interface { struct jtag_interface {
/** The name of the JTAG interface driver. */ /** The name of the JTAG interface driver. */
char *name; const char * const name;
/** /**
* Bit vector listing capabilities exposed by this driver. * Bit vector listing capabilities exposed by this driver.