usb_jtag.c File Reference

#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include "usb_jtag.h"

Include dependency graph for usb_jtag.c:

Go to the source code of this file.

Functions

unsigned int fJTAG_Data (unsigned int ui_data_out)
unsigned int fJTAG_DBDX (unsigned int ui_data_out)
unsigned int fJTAG_DBDX_TEST (unsigned int ui_data_out)
unsigned int fJTAG_DBTX (unsigned int fast_count, unsigned int *fast_write2_data_input)
unsigned int fJTAG_DBTX_test (unsigned int ui_data_out)
unsigned int fJTAG_FAST_UPLOAD (unsigned int upload_count)
unsigned int fJTAG_FastData (unsigned int ui_data_out)
void fJTAG_Init (void)
unsigned char fJTAG_Instruction (unsigned char uc_data_out)
void fJTAG_unInit (void)
unsigned int fJTAG_UPLOAD (unsigned char *buf, unsigned int upload_count)

Variables

int usb_can_bulk_wr_flag


Function Documentation

unsigned int fJTAG_Data ( unsigned int  ui_data_out  ) 

Definition at line 96 of file usb_jtag.c.

References usb_wr_dr().

Referenced by __jtagreg_syscall1(), __jtagreg_syscall2(), check_ejtag(), feed_acc(), fJTAG_Init(), fMIPS32_EJTAG_Machine(), fMIPS32_ExecuteDebugModule(), fMIPS32_ExitDebugMode(), fMIPS32_Transfer(), force_acc(), get_acc(), get_DR(), get_DR2(), wait_address(), and waitreg().

00097 {
00098         unsigned int  ui_data_in;
00099 
00100         ui_data_in = usb_wr_dr(1,1,ui_data_out);
00101         
00102         return(ui_data_in);
00103 }

Here is the call graph for this function:

unsigned int fJTAG_DBDX ( unsigned int  ui_data_out  ) 

Definition at line 163 of file usb_jtag.c.

References usb_wr_dr().

00164 {
00165         unsigned int  ui_data_in;
00166 
00167         ui_data_in = usb_wr_dr(1,1,ui_data_out);
00168         
00169         return(ui_data_in);
00170 }

Here is the call graph for this function:

unsigned int fJTAG_DBDX_TEST ( unsigned int  ui_data_out  ) 

Definition at line 175 of file usb_jtag.c.

References usb_wr_dr().

00176 {
00177         unsigned int  ui_data_in;
00178 
00179         ui_data_in = usb_wr_dr(1,1,ui_data_out);
00180         
00181         return(ui_data_in);
00182 }

Here is the call graph for this function:

unsigned int fJTAG_DBTX ( unsigned int  fast_count,
unsigned int *  fast_write2_data_input 
)

Definition at line 148 of file usb_jtag.c.

References fast_write2().

00149 {
00150         unsigned int  ui_data_in=0;
00151 
00152         // ui_data_in = usb_wr_dr(1,1,ui_data_out);
00153         //20090628-zgj fast_write2(fast_count,fast_write2_data_input);
00154         fast_write2(fast_count,fast_write2_data_input);
00155         //20090628-normal-lw-240KB/S  fast_write_3(fast_count,fast_write2_data_input);
00156         
00157         return(ui_data_in);
00158 }

Here is the call graph for this function:

unsigned int fJTAG_DBTX_test ( unsigned int  ui_data_out  ) 

Definition at line 136 of file usb_jtag.c.

References usb_wr_dr().

00137 {
00138         unsigned int  ui_data_in=0;
00139 
00140         ui_data_in = usb_wr_dr(1,1,ui_data_out);
00141         //fast_write2(fast_count,fast_write2_data_input);
00142         
00143         return(ui_data_in);
00144 }

Here is the call graph for this function:

unsigned int fJTAG_FAST_UPLOAD ( unsigned int  upload_count  ) 

Definition at line 233 of file usb_jtag.c.

References fast_read().

00234 {
00235         unsigned int  ui_data_in=0;
00236 
00237         // ui_data_in = usb_wr_dr(1,1,ui_data_out);
00238         //20090628-zgj fast_write2(fast_count,fast_write2_data_input);
00239         // usb_wr_upload(upload_count);
00240         fast_read(upload_count);
00241         //20090628-normal-lw-240KB/S  fast_write_3(fast_count,fast_write2_data_input);
00242         
00243         return(ui_data_in);
00244 }

Here is the call graph for this function:

unsigned int fJTAG_FastData ( unsigned int  ui_data_out  ) 

Definition at line 124 of file usb_jtag.c.

References usb_wr_dr().

00125 {
00126         unsigned int  ui_data_in;
00127 
00128         ui_data_in = usb_wr_dr(1,1,ui_data_out);
00129         
00130         return(ui_data_in);
00131 }

Here is the call graph for this function:

void fJTAG_Init ( void   ) 

Definition at line 67 of file usb_jtag.c.

References tap_reset(), USB_CAN_BULK_WR_FLAG, usb_can_bulk_wr_flag, USB_FOUND, usb_fx2_reset(), USB_NO_FOUND, and usb_tap_init().

Referenced by fMIPS32_Init().

00068 {
00069         int found_usb = USB_NO_FOUND;
00070         found_usb = usb_tap_init();
00071         if(found_usb == USB_FOUND)
00072         {
00073                 usb_fx2_reset();
00074         }
00075         else
00076         {
00077                 fprintf(stderr,"usb device not found!\n");
00078                 exit(-1);
00079         }
00080         
00081         if(usb_can_bulk_wr_flag == USB_CAN_BULK_WR_FLAG)
00082                 tap_reset();
00083         else
00084         {
00085                 fprintf(stderr,"usb ejtag simulator not BULK read/write!\n");
00086                 exit(-1);
00087         }
00088 }

Here is the call graph for this function:

unsigned char fJTAG_Instruction ( unsigned char  uc_data_out  ) 

Definition at line 110 of file usb_jtag.c.

References usb_wr_ir().

Referenced by __jtagreg_syscall1(), __jtagreg_syscall2(), check_ejtag(), feed_acc(), fJTAG_Init(), fMIPS32_EJTAG_Machine(), fMIPS32_ExecuteDebugModule(), fMIPS32_ExitDebugMode(), fMIPS32_Transfer(), fMIPS32_USB_DownloadModule(), force_acc(), get_acc(), get_DR(), get_DR2(), USB_UPLOAD_FAST(), wait_address(), and waitreg().

00111 {
00112         unsigned char uc_data_in=0;
00113 #if 0
00114         uc_data_in = usb_wr_ir(1,1,uc_data_out);
00115 #else
00116         uc_data_in = usb_wr_ir(0,0,uc_data_out);
00117 #endif
00118         return(uc_data_in);
00119 }

Here is the call graph for this function:

void fJTAG_unInit ( void   ) 

Definition at line 246 of file usb_jtag.c.

References usb_stop().

00247 {
00248         usb_stop();
00249 }

Here is the call graph for this function:

unsigned int fJTAG_UPLOAD ( unsigned char *  buf,
unsigned int  upload_count 
)

Definition at line 188 of file usb_jtag.c.

References usb_wr_upload().

00189 {
00190         unsigned int  ui_data_in=0;
00191 #if 1
00192         unsigned int download_ram_size=0;
00193         unsigned int init_do=0;
00194         time_t time_start;
00195         time_t time_end;
00196         time_t  time_deta=0;
00197         int i=0;
00198 
00199         if(!init_do)
00200         {
00201                 time_start = (time(&time_start))&0xffffffff;
00202                 printf("time_start : %x \n",time_start);
00203                 init_do = 1;
00204                 download_ram_size=0;
00205         }
00206 #endif
00207         // ui_data_in = usb_wr_dr(1,1,ui_data_out);
00208         //20090628-zgj fast_write2(fast_count,fast_write2_data_input);
00209 //      for(i=0 ; i< 0x10000; i++ )
00210         {
00211         //      getchar();
00212         //      getchar();
00213                 printf("======================= %d\n",i);
00214                 usb_wr_upload(buf,upload_count);
00215         }
00216         //20090628-normal-lw-240KB/S  fast_write_3(fast_count,fast_write2_data_input);
00217 
00218 #if 1
00219          download_ram_size = upload_count;
00220                 time_end = (time(&time_end))&0xffffffff;
00221                 printf("=<<<==time_end : %x \n",time_end);
00222                 time_deta= time_end - time_start;
00223                 if(time_deta == 0)
00224                         time_deta++ ;
00225                 printf("=<<<==time : %d, download_size : %x, download rate=%d B/S\n",time_deta,download_ram_size,((download_ram_size/time_deta)));
00226 #endif
00227         return(ui_data_in);
00228 }

Here is the call graph for this function:


Variable Documentation

Definition at line 68 of file usb_ejtag_command.h.

Referenced by fJTAG_Init(), usb_fx2_reset(), and usb_stop().


Generated on Fri Nov 5 07:24:52 2010 for ejtag debug tools for loongson 232 cpu by  doxygen 1.5.6