• 大小: 602KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: 其他
  • 标签: SJF2440  源码  源代码  

资源简介

SJF2440源码 源代码 (官方发布VC++完整工程源码)用于三星S3C2440A Jtag 升级工具。PC并口下载。 包括SJF2440.exe及其完整源代码工程。 完整包含giveio驱动及其源代码。

资源截图

代码片段和文件信息

/****************************************************************
 NAME: am29f800.c
 DESC: am29lv800 Flash Programming code through 2410 JTAG 
 HISTORY:
 Nov.14.2002:purnnamu: ported for 2410 JTAG version. 
                       It‘s really undesirable source code for me. but...
 ****************************************************************/

#include 
#include 
#include “def.h“

#include “pin2440.h“
#include “Jtag.h“
#include “sjf2440.h“

#include “mem_rdwr.h“

#define TARGET_ADDR_29LV800      0x0  // nGCS0 128MB area

static int AM29F800_ProgFlash(U32 realAddrU16 data);
static void AM29F800_EraseSector(int targetAddr);
static int AM29F800_CheckId(void);
static int BlankCheck(int targetAddrint targetSize);
static int _WAIT(void);

static void InputTargetOffset(void);
static void GetSectorSize(void);


// Because KS32C41000_A1 is connected to AM29LV800_A0
// the addr parameter has to be a WORD address so called in AMD specification.

#define _WR(addrdata)     MRW_Wr16QQ(addr<<1data00x3)
#define _RD(addr)     MRW_Rd16Q(addr<<100x3)
#define _RESET()     _WR(0x00xf0f0)
#define BADDR2WADDR(addr)   (addr>>1)  
    //If you want to access a real address use BADDR2WADDR macro.
    //For example MRW_Wr16Q(BADDR2WADDR(realAddr)data00x3)....

static U32 srcAddress;
static U32 srcOffset;

static U32 targetAddress;
static U32 targetOffset;
static U32 targetSize;

static U32 sectorOffset;
static U32 sectorSize;
static U32 totalSize;

void ProgramAM29F800(void)
{
    int i;

    printf(“\n[AM29F800 Writing Program]\n“);
    printf(“NOTE: AM29LV800BB needs 4 step sequences for 1 half-word data.\n“);
    printf(“      Sothe program time is twice of Starata flash(2 step sequences).\n“);

    MRW_JtagInit();

    printf(“[Check AM29LV800]\n“);
    if(!AM29F800_CheckId())
    {
printf(“ID Check Error!!!\n“);
return;
    }

    targetSize=imageSize;

    srcAddress=(U32)malloc(targetSize+4);
    if(srcAddress==0)return;
    LoadImageFile((U8 *)srcAddresstargetSize);

    srcOffset=0;
    
    targetAddress=TARGET_ADDR_29LV800;
    InputTargetOffset();
    
    totalSize=0;
    sectorOffset=targetOffset;

    printf(“\n“);

    while(totalSize    {
        GetSectorSize(); //sectorSize is updated.

printf(“Erase the sector:0x%x.\n“targetAddress+sectorOffset);
    
AM29F800_EraseSector(targetAddress+sectorOffset);

printf(“Start of the sector data writing.\n“);

for(i=0x0;i {
    AM29F800_ProgFlash(targetAddress+sectorOffset+i*( (U16 *)(srcAddress+srcOffset+i) )  );
    if((i%0x100)==0)printf(“%x “i);
    totalSize+=2;
    if(totalSize>=targetSize)break;
}

printf(“\nEnd of the sector data writing!!!\n\n“);

_RESET();
sectorOffset+=sectorSize;
srcOffset+=sectorSize;
    }

/*
    printf(“\nVerifying Start.\n“);
    for(i=0x0;i    {
if(*( (U16 *)(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        3872  2003-09-16 19:10  2440loader.bin
     目录           0  2003-09-16 19:15  GIVEIO\
     目录           0  2003-09-16 19:15  GIVEIO\Giveio\
     目录           0  2003-09-16 19:15  GIVEIO\Giveio\GIVEIO\
     文件        5754  1996-04-03 21:30  GIVEIO\Giveio\GIVEIO\GIVEIO.C
     目录           0  2003-09-16 15:31  GIVEIO\Giveio\GIVEIO\I386\
     目录           0  2003-09-16 15:31  GIVEIO\Giveio\GIVEIO\I386\FREE\
     文件         267  1994-09-04 08:07  GIVEIO\Giveio\GIVEIO\MAKEFILE
     目录           0  2003-09-16 15:31  GIVEIO\Giveio\GIVEIO\OBJ\
     目录           0  2003-09-16 15:31  GIVEIO\Giveio\GIVEIO\OBJ\I386\
     文件          95  1996-04-03 21:32  GIVEIO\Giveio\GIVEIO\SOURCES
     文件        2441  1996-04-03 22:19  GIVEIO\Giveio\POKEIO.C
     文件         652  1995-09-12 00:10  GIVEIO\Giveio\POKEPROC.C
     文件        4633  1996-04-03 22:26  GIVEIO\Giveio\README.TXT
     目录           0  2003-09-16 19:15  GIVEIO\Giveio\TOTALIO\
     目录           0  2003-09-16 15:31  GIVEIO\Giveio\TOTALIO\I386\
     目录           0  2003-09-16 19:15  GIVEIO\Giveio\TOTALIO\I386\FREE\
     文件        1760  1996-04-03 22:04  GIVEIO\Giveio\TOTALIO\I386\FREE\TOTALIO.SYS
     文件         267  1994-09-04 08:07  GIVEIO\Giveio\TOTALIO\MAKEFILE
     目录           0  2003-09-16 19:15  GIVEIO\Giveio\TOTALIO\OBJ\
     目录           0  2003-09-16 19:15  GIVEIO\Giveio\TOTALIO\OBJ\I386\
     文件        1227  1996-04-03 22:04  GIVEIO\Giveio\TOTALIO\OBJ\I386\TOTALIO.OBJ
     文件         254  1996-04-03 22:01  GIVEIO\Giveio\TOTALIO\OBJ\_objectS.MAC
     文件          97  1996-04-03 22:00  GIVEIO\Giveio\TOTALIO\SOURCES
     文件        4040  1996-04-03 22:03  GIVEIO\Giveio\TOTALIO\TOTALIO.C
     目录           0  2003-09-16 19:15  GIVEIO\Giveio\TSTIO\
     文件        2377  1995-09-11 17:46  GIVEIO\Giveio\TSTIO\TSTIO.C
     文件       33792  1996-04-03 22:00  GIVEIO\Giveio\TSTIO\TSTIO.EXE
     文件       34118  1997-08-07 16:50  GIVEIO\Giveio\TSTIO\TSTIO.OBJ
     文件        1654  2000-05-14 23:23  GIVEIO\giveio.inf
     文件         195  2000-05-16 01:19  GIVEIO\giveio.INI
............此处省略44个文件信息

评论

共有 条评论