X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fjtag%2Fzy1000%2Fzy1000.c;h=8f9b774f8c404071719c66d2668a2f6da874f7b0;hp=4dbdef249192d86013d3e6ed204d2adedefff788;hb=95d2a2372421aeddae01f1af51279ab7989e46b5;hpb=6dc2c2ce970863a079f101d84a0c47b37b682c76 diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index 4dbdef2491..8f9b774f8c 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -33,12 +33,9 @@ #define ZYLIN_TIME __TIME__ #define ZYLIN_OPENOCD "$Revision$" #define ZYLIN_OPENOCD_VERSION "Zylin JTAG ZY1000 " ZYLIN_VERSION " " ZYLIN_DATE " " ZYLIN_TIME -const char *zylin_config_dir="/config/settings"; /* low level command set */ -int zy1000_read(void); -static void zy1000_write(int tck, int tms, int tdi); void zy1000_reset(int trst, int srst); @@ -127,22 +124,10 @@ jtag_interface_t zy1000_interface = .srst_asserted = zy1000_srst_asserted, }; -static void zy1000_write(int tck, int tms, int tdi) -{ - -} - -int zy1000_read(void) -{ - return -1; -} - -extern bool readSRST(void); - void zy1000_reset(int trst, int srst) { LOG_DEBUG("zy1000 trst=%d, srst=%d", trst, srst); - if(!srst) + if (!srst) { ZY1000_POKE(ZY1000_JTAG_BASE+0x14, 0x00000001); } @@ -154,7 +139,7 @@ void zy1000_reset(int trst, int srst) ZY1000_POKE(ZY1000_JTAG_BASE+0x10, 0x00000001); } - if(!trst) + if (!trst) { ZY1000_POKE(ZY1000_JTAG_BASE+0x14, 0x00000002); } @@ -203,7 +188,7 @@ void zy1000_reset(int trst, int srst) int zy1000_speed(int speed) { - if(speed == 0) + if (speed == 0) { /*0 means RCLK*/ speed = 0; @@ -212,7 +197,7 @@ int zy1000_speed(int speed) } else { - if(speed > 8190 || speed < 2) + if (speed > 8190 || speed < 2) { LOG_USER("valid ZY1000 jtag_speed=[8190,2]. Divisor is 64MHz / even values between 8190-2, i.e. min 7814Hz, max 32MHz"); return ERROR_INVALID_ARGUMENTS; @@ -425,9 +410,9 @@ static void shiftValueInnerFlip(const tap_state_t state, const tap_state_t endSt } #endif -extern int jtag_check_value(u8 *captured, void *priv); +extern int jtag_check_value(uint8_t *captured, void *priv); -static __inline void scanFields(int num_fields, scan_field_t *fields, tap_state_t shiftState, tap_state_t end_state) +static __inline void scanFields(int num_fields, const scan_field_t *fields, tap_state_t shiftState, tap_state_t end_state) { int i; int j; @@ -437,9 +422,7 @@ static __inline void scanFields(int num_fields, scan_field_t *fields, tap_state_ { cyg_uint32 value; - static u8 *in_buff=NULL; /* pointer to buffer for scanned data */ - static int in_buff_size=0; - u8 *inBuffer=NULL; + uint8_t *inBuffer=NULL; // figure out where to store the input data @@ -478,7 +461,7 @@ static __inline void scanFields(int num_fields, scan_field_t *fields, tap_state_ } } /* mask away unused bits for easier debugging */ - value&=~(((u32)0xffffffff)< 1) - len = 1; - result = strncmp((char *) data, "1", len) == 0; - free(data); - } - free(name); - return result; -} -