/********************************************************************************** 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(S3C2410_MAX_CELLS -> S3C2410_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 SMDK2410 board. 8. The programming speed is enhanced. **********************************************************************************/ /******************************************* Revision history 2002.06.10:purnnamu:ver 0.1 -first release 2002.06.21:purnnamu:ver 0.11 -trivial display error is fixed. 2002.08.20:purnnamu:ver 0.3 -Strata flash is supported. 2002.08.20:purnnamu:ver 0.4 -AM29LV800BB flash is supported. *******************************************/ #include #include #include #include "def.h" #include "pin2410.h" #include "jtag.h" #include "ppt.h" #include "k9s1208.h" #include "strata32.h" #include "am29f800.h" #include "mem_rdwr.h" FILE *stream; U32 imageSize; char FileName[256]; int bad_check = 0; void OpenImageFile(char *filename); void OpenPpt(void); static void *function[]= { "K9S1208 prog ", "28F128J3A prog ", "AM29LV800 Prog ", "Memory Rd/Wr ", "Exit ", 0 }; static char *next_arg(char **argv,int *i) { if (argv[*i][2]) return argv[*i]+3; (*i)++; if (!argv[*i]) { fprintf(stderr,"argument expected\n"); exit(1); } return argv[*i]; } void main(int argc,char *argv[]) { char num=0; int i; printf("\n"); printf("+--------------------------------------+\n"); printf("| SEC JTAG FLASH(SJF) v 0.4moko2 |\n"); printf("| (S3C2410X & SMDK2410 B/D) |\n"); printf("+--------------------------------------+\n"); //printf("Usage: SJF /f: /d= /b\n"); printf("Usage: SJF -f -d -b\n"); delayLoopCount=100; FileName[0]='\0'; for(i=1;i