www.pudn.com > SJF2443.zip > sjf2443.c


/**********************************************************************************  
 The SJF2443 is based on SJF2440, which was written by Inwook Kong(purnnamu).   
 The main difference between SJF2443 and SJF2443 is BSC(Boundary Scan Cell)Index. 
 Refer to S3C2443_jtag_buf.bsd file. 
 Thanks to Inwook Kong.  
  
 Revision history 
 2003.09.16: ver 0.1 (Y.H.Lee) S3C2440X 
 2006.09.11: ver 0.2 (Junon.Jeon) 
  - SEC JTAG FLASH Program for S3C2443X & SMDK2443 B/D. 
  - K9S1208, AMD 29LV800BB and E28F128 StrataFlash programming is supported. 
  - SJF2443 is derived from following SJF2440(SJF)... 
**********************************************************************************/  
    
/**********************************************************************************  
 The SJF is written by analyzing ezTAG program, which was written by Jaewook Cheong, 
 SEC S/W Centor.  
 Special thanks to Jaewook Cheong and Dale Roberts(the author of GIVEIO.sys) 
 
 In SJF, the following feature is updated from ezTAG 
 
 1. The structure of JTAG functions is changed for speed-up. 
 2. The indexs of the pins become coherent with the BSDL file. 
 3. SAMPLE/PRELOAD is used for initializing outCellValue[]. 
 4. The array size error is fixed(S3C2443_MAX_CELLS -> S3C2443_MAX_CELL_INDEX+2) 
 5. The array was not followed by '\0', which is fixed. 
 6. JTAG_ID reading error is fixed. 
 7. Support K9S1208 SMD card for the SMDK2443 board. 
 8. The programming speed is enhanced. 
 **********************************************************************************/ 
 
 
#include  
#include  
#include  
#include "..\include\def.h" 
#include "..\include\pin2443.h" 
#include "..\include\jtag.h" 
#include "..\include\ppt.h" 
#include "..\include\k9s1208.h" 
#include "..\include\k9f1g08.h" 
#include "..\include\k9g8g08.h" 
#include "..\include\strata32.h" 
#include "..\include\am29f800.h" 
#include "..\include\mem_rdwr.h" 
 
FILE *stream; 
U32 imageSize; 
 
char srcFileName[256]; 
void OpenImageFile(char *filename); 
void OpenPpt(void); 
 
void ErrorBanner(void); 
 
static void *function[]= 
{ 
    "K9S1208 prog    ", 
	"K9F1G08 prog	 ", 
	"K9G8G08 prog	 ", 
    "28F128J3A prog  ", 
    "AM29LV800 Prog  ", 
    "Memory Rd/Wr    ", 
    "Exit            ", 
    0 
}; 
 
void main(int argc,char *argv[]) 
{ 
    char num=0; 
    int i; 
    	 
    printf("\n"); 
    printf("+------------------------------------+\n"); 
    printf("|     SEC JTAG FLASH(SJF) v 0.1      |\n"); 
    printf("|     (S3C2443X & SMDK2443 B/D)      |\n"); 
    printf("+------------------------------------+\n"); 
    printf("Usage : SJF2443 /f: /d=\n"); 
 
    delayLoopCount=100; 
    srcFileName[0]='\0'; 
 
    for(i=1;i