support for mini2440 emulator

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@336 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
qiuyiuestc 2010-01-25 16:44:49 +00:00
parent 45a9c5f258
commit 9fb4908710
12 changed files with 42 additions and 79 deletions

View File

@ -76,7 +76,7 @@ void rt_init_thread_entry(void* parameter)
#ifdef RT_USING_RTGUI #ifdef RT_USING_RTGUI
{ {
rt_hw_key_init(); //rt_hw_key_init();
} }
#endif #endif

View File

@ -88,7 +88,7 @@ void rt_hw_uart_init(void)
GPHUP |= 0xF; GPHUP |= 0xF;
/* FIFO enable, Tx/Rx FIFO clear */ /* FIFO enable, Tx/Rx FIFO clear */
uart0.uart_device->ufcon = 0x1; uart0.uart_device->ufcon = 0x0;
/* disable the flow control */ /* disable the flow control */
uart0.uart_device->umcon = 0x0; uart0.uart_device->umcon = 0x0;
/* Normal,No parity,1 stop,8 bit */ /* Normal,No parity,1 stop,8 bit */

View File

@ -13,7 +13,13 @@
Target (RT-Thread Debug), 0x0004 // Tools: 'ARM-ADS' Target (RT-Thread Debug), 0x0004 // Tools: 'ARM-ADS'
ExtF <E:\Projects\opensvn\rt-thread\google\bsp\mini2440\startup.c> 118,127,0,{ 44,0,0,0,2,0,0,0,3,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,44,0,0,0,58,0,0,0,113,2,0,0,32,1,0,0 } ExtF <E:\SVN-Google-Source\bsp\mini2440\application.c> 49,56,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,22,0,0,0,29,0,0,0,188,2,0,0,7,1,0,0 }
ExtF <E:\SVN-Google-Source\filesystem\dfs\filesystems\efsl\src\fs\vfat\fs.c> 47,54,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,66,0,0,0,87,0,0,0,236,2,0,0,66,1,0,0 }
ExtF <E:\SVN-Google-Source\bsp\mini2440\sdcard.c> 602,602,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,0,0,0,0,0,0,0,0,57,3,0,0,190,0,0,0 }
ExtF <E:\SVN-Google-Source\libcpu\arm\s3c24x0\start_rvds.s> 844,848,0,{ 44,0,0,0,2,0,0,0,3,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,66,0,0,0,87,0,0,0,201,2,0,0,128,1,0,0 }
ExtF <E:\SVN-Google-Source\bsp\mini2440\startup.c> 124,135,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,88,0,0,0,116,0,0,0,223,2,0,0,157,1,0,0 }
ExtF <E:\SVN-Google-Source\src\kservice.h> 80,84,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,44,0,0,0,58,0,0,0,179,2,0,0,82,1,0,0 }
ExtF <E:\SVN-Google-Source\src\idle.c> 56,66,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,44,0,0,0,58,0,0,0,179,2,0,0,82,1,0,0 }
TARGOPT 1, (RT-Thread Debug) TARGOPT 1, (RT-Thread Debug)
ADSCLK=12000000 ADSCLK=12000000
@ -25,15 +31,15 @@ TARGOPT 1, (RT-Thread Debug)
OPTXL 1,1,1,1,1,1,1,0,0 OPTXL 1,1,1,1,1,1,1,0,0
OPTFL 1,0,1 OPTFL 1,0,1
OPTAX 255 OPTAX 255
OPTBL 0,(User's Manual)<DATASHTS\SAMSUNG\S3C2410_UM.PDF> OPTBL 0,(User's Manual)<DATASHTS\SAMSUNG\S3C2440_UM.PDF>
OPTDL (SARM.DLL)()(DARMSS9.DLL)(-pS3C2410A)(SARM.DLL)()(TARMSS9.DLL)(-pS3C2410A) OPTDL (SARM.DLL)()(DARMSS9.DLL)(-pS3C2440A)(SARM.DLL)()(TARMSS9.DLL)(-pS3C2440A)
OPTDBG 47614,6,()()()()()()()()()(.\Ext_RAM.ini) (Segger\JLTAgdi.dll)()()() OPTDBG 47614,6,()()()()()()()()()(.\Ext_RAM.ini) (Segger\JLTAgdi.dll)()()()
OPTKEY 0,(DLGTARM)((113=-1,-1,-1,-1,0)(100=90,124,666,445,0)(102=-1,-1,-1,-1,0)(103=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)(108=-1,-1,-1,-1,0)(109=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(112=-1,-1,-1,-1,0)) OPTKEY 0,(DLGTARM)((113=-1,-1,-1,-1,0)(100=90,124,666,445,0)(102=-1,-1,-1,-1,0)(103=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)(108=-1,-1,-1,-1,0)(109=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(112=-1,-1,-1,-1,0))
OPTKEY 0,(JLTAgdi)(-O1070 -J1 -Y1000 -Z1 -FO7 -FD40000000 -FC800 -FN0) OPTKEY 0,(JLTAgdi)(-O1070 -J1 -Y800 -Z4 -FO7 -FD30000000 -FC8000 -FN1 -FF0S3C2440_NAND_SP -FS030000000 -FL08000000)
OPTKEY 0,(JLTDLG)() OPTKEY 0,(JLTDLG)()
OPTKEY 0,(DLGDARM)((113=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(102=-1,-1,-1,-1,0)(103=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)(108=-1,-1,-1,-1,0)(109=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(112=-1,-1,-1,-1,0)) OPTKEY 0,(DLGDARM)((113=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(102=-1,-1,-1,-1,0)(103=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)(108=-1,-1,-1,-1,0)(109=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(112=-1,-1,-1,-1,0))
OPTKEY 0,(ARMDBGFLAGS)(-T5F) OPTKEY 0,(ARMDBGFLAGS)(-T5F)
OPTMM 1,2,(0) OPTMM 1,2,(0x3020000)
OPTDF 0x86 OPTDF 0x86
OPTLE <> OPTLE <>
OPTLC <> OPTLC <>

View File

@ -7,14 +7,14 @@ Target (RT-Thread Debug), 0x0004 // Tools: 'ARM-ADS'
Options 1,0,0 // Target 'RT-Thread Debug' Options 1,0,0 // Target 'RT-Thread Debug'
Device (S3C2410A) Device (S3C2440A)
Vendor (Samsung) Vendor (Samsung)
Cpu (IRAM(0x40000000-0x40001FFF) CLOCK(12000000) CPUTYPE(ARM920T)) Cpu (IRAM(0x40000000-0x40000FFF) CLOCK(12000000) CPUTYPE(ARM920T))
FlashUt () FlashUt ()
StupF ("STARTUP\Samsung\S3C2410A.s" ("Samsung S3C2410A Startup Code")) StupF ("STARTUP\Samsung\S3C2440.s" ("Samsung S3C2440 Startup Code"))
FlashDR () FlashDR (UL2ARM(-UV2077N9E -O40 -S0 -C0 -N00("ARM920T Core") -D00(0032409D) -L00(4) -FO7 -FD40000000 -FC1000 -FN1 -FF0S3C2440_NAND_SP -FS030000000 -FL07FFC000))
DevID (4252) DevID (4277)
Rgf (S3C2410A.H) Rgf (S3C2440.H)
Mem () Mem ()
C () C ()
A () A ()
@ -55,10 +55,10 @@ Options 1,0,0 // Target 'RT-Thread Debug'
RVDEV () RVDEV ()
ADSTFLGA { 0,8,64,0,96,0,64,64,0,0,0,0,0,0,0,0,0,0,0,0 }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'RT-Thread Debug'
ADSLDMC () ADSLDMC ()
ADSLDIF () ADSLDIF ()
ADSLDDW () ADSLDDW ()
OPTDL (SARM.DLL)()(DARMSS9.DLL)(-pS3C2410A)(SARM.DLL)()(TARMSS9.DLL)(-pS3C2410A) OPTDL (SARM.DLL)()(DARMSS9.DLL)(-pS3C2440A)(SARM.DLL)()(TARMSS9.DLL)(-pS3C2440A)
OPTDBG 47614,6,()()()()()()()()()(.\Ext_RAM.ini) (Segger\JLTAgdi.dll)()()() OPTDBG 47614,6,()()()()()()()()()(.\Ext_RAM.ini) (Segger\JLTAgdi.dll)()()()
FLASH1 { 1,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0 } FLASH1 { 1,0,0,0,1,0,0,0,4,16,0,0,0,0,0,0,0,0,0,0 }
FLASH2 () FLASH2 (Segger\JLTAgdi.dll)
FLASH3 ("" ()) FLASH3 ("" ())
FLASH4 () FLASH4 ()
EndOpt EndOpt

View File

@ -100,7 +100,7 @@ static int sd_data_end(void)
finish=SDIDSTA; finish=SDIDSTA;
while( !( ((finish&0x10)==0x10) | ((finish&0x20)==0x20) )) while( !( ((finish&0x10)==0x10) | ((finish&0x20)==0x20) ))
{ rt_kprintf("data end\n"); {
finish=SDIDSTA; finish=SDIDSTA;
} }
@ -139,7 +139,10 @@ static int sd_cmd55(void)
SDICCON = (0x1 << 9) | (0x1 << 8) | 0x77; SDICCON = (0x1 << 9) | (0x1 << 8) | 0x77;
if(sd_cmd_end(55, 1) == RT_ERROR) if(sd_cmd_end(55, 1) == RT_ERROR)
{
rt_kprintf("CMD55 error\n");
return RT_ERROR; return RT_ERROR;
}
SDICSTA=0xa00; SDICSTA=0xa00;
return RT_EOK; return RT_EOK;
@ -197,34 +200,6 @@ static void sd_setbus(void)
SDICSTA=0xa00; /* Clear cmd_end(with rsp) */ SDICSTA=0xa00; /* Clear cmd_end(with rsp) */
} }
/**
* This function will set a hook function, which will be invoked when a memory
* block is allocated from heap memory.
*
* @param hook the hook function
*/
int sd_mmc_ocr(void)
{
int i;
/* Negotiate operating condition for MMC, it makes card ready state */
for(i=0; i<100; i++)
{
SDICARG = 0xff8000;
SDICCON = (0x1<<9)|(0x1<<8)|0x41;
/* Check end of CMD1 */
if((sd_cmd_end(1, 1) == RT_EOK) && (SDIRSP0>>16)==0x80ff)
{
SDICSTA=0xa00;
return RT_EOK;
}
}
SDICSTA=0xa00;
return RT_ERROR;
}
/** /**
* This function will set a hook function, which will be invoked when a memory * This function will set a hook function, which will be invoked when a memory
* block is allocated from heap memory. * block is allocated from heap memory.
@ -271,7 +246,7 @@ rt_uint8_t sd_init(void)
/* Important notice for MMC test condition */ /* Important notice for MMC test condition */
/* Cmd & Data lines must be enabled by pull up resister */ /* Cmd & Data lines must be enabled by pull up resister */
SDIPRE = PCLK/(INICLK)-1; SDIPRE = PCLK/(INICLK)-1;
SDICON = (1<<4) | 1; // Type B, clk enable SDICON = (0<<4) | 1; // Type A, clk enable
SDIFSTA = SDIFSTA | (1<<16); SDIFSTA = SDIFSTA | (1<<16);
SDIBSIZE = 0x200; /* 512byte per one block */ SDIBSIZE = 0x200; /* 512byte per one block */
SDIDTIMER=0x7fffff; /* timeout count */ SDIDTIMER=0x7fffff; /* timeout count */
@ -280,13 +255,6 @@ rt_uint8_t sd_init(void)
for(i=0; i<0x1000; i++); for(i=0; i<0x1000; i++);
sd_cmd0(); sd_cmd0();
/* Check MMC card OCR */
if(sd_mmc_ocr() == RT_EOK)
{
rt_kprintf("In MMC ready\n");
goto RECMD2;
}
rt_kprintf("MMC check end!!\n");
/* Check SD card OCR */ /* Check SD card OCR */
if(sd_ocr() == RT_EOK) if(sd_ocr() == RT_EOK)
@ -362,19 +330,7 @@ RERDCMD:
status = SDIFSTA; status = SDIFSTA;
if((status & 0x1000) == 0x1000) if((status & 0x1000) == 0x1000)
{ {
#if 1
register rt_uint32_t value;
value = SDIDAT;
/* swap 4 bytes */
buf[0] = (value >> 24) & 0xff;
buf[1] = (value >> 16) & 0xff;
buf[2] = (value >> 8) & 0xff;
buf[3] = value & 0xff;
#else
*(rt_uint32_t *)buf = SDIDAT; *(rt_uint32_t *)buf = SDIDAT;
#endif
rd_cnt++; rd_cnt++;
buf += 4; buf += 4;
} }

View File

@ -103,7 +103,7 @@ void report_touch_input(int updown)
emouse.button |= RTGUI_MOUSE_BUTTON_LEFT; emouse.button |= RTGUI_MOUSE_BUTTON_LEFT;
rtgui_server_post_event((&emouse.parent), sizeof(emouse)); //rtgui_server_post_event((&emouse.parent), sizeof(emouse));
} }
#endif #endif

View File

@ -65,12 +65,13 @@ esint16 un_link(FileSystem *fs,euint8* filename)
firstCluster <<= 16; firstCluster <<= 16;
firstCluster += ex_getb16(buf+loc.Offset*32+26); firstCluster += ex_getb16(buf+loc.Offset*32+26);
attr = ex_getb16(buf+loc.Offset*32+11); attr = ex_getb16(buf+loc.Offset*32+11);
part_relSect(fs->part,buf);
if(attr == ATTR_DIRECTORY) if(attr == ATTR_DIRECTORY)
{ {
dlist = (DirList *)rt_malloc(sizeof(DirList)); dlist = (DirList *)rt_malloc(sizeof(DirList));
if(dlist == RT_NULL) if(dlist == RT_NULL)
{ {
part_relSect(fs->part,buf);
dfs_log(DFS_DEBUG_INFO, ("Memory alloc failed")); dfs_log(DFS_DEBUG_INFO, ("Memory alloc failed"));
return -DFS_STATUS_ENOMEM; return -DFS_STATUS_ENOMEM;
@ -92,8 +93,6 @@ esint16 un_link(FileSystem *fs,euint8* filename)
/* '.' and '..' */ /* '.' and '..' */
if(dlist->currentEntry.FileName[0] == '.') continue; if(dlist->currentEntry.FileName[0] == '.') continue;
part_relSect(fs->part,buf);
dfs_log(DFS_DEBUG_INFO, ("Directory not empty")); dfs_log(DFS_DEBUG_INFO, ("Directory not empty"));
return -DFS_STATUS_ENOTEMPTY; return -DFS_STATUS_ENOTEMPTY;
} }
@ -102,6 +101,7 @@ esint16 un_link(FileSystem *fs,euint8* filename)
} }
} }
buf = part_getSect(fs->part,loc.Sector,IOM_MODE_READWRITE);
memClr(buf+(loc.Offset*32),32); memClr(buf+(loc.Offset*32),32);
part_relSect(fs->part,buf); part_relSect(fs->part,buf);
cache.DiscCluster = cache.LastCluster = cache.Linear = cache.LogicCluster = 0; cache.DiscCluster = cache.LastCluster = cache.Linear = cache.LogicCluster = 0;

BIN
tools/SDCARD.zip Normal file

Binary file not shown.

BIN
tools/SDL.dll Normal file

Binary file not shown.

BIN
tools/libz-1.dll Normal file

Binary file not shown.

BIN
tools/qemu-system-arm.exe Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
qemu-system-arm.exe -M mini2440 -kernel ..\bsp\mini2440\rtthread-mini2440.axf -show-cursor -serial telnet:127.0.0.1:1200,server -net nic -net tap,ifname=virtual -sd SDCARD