H3

DOC開機流程
DOC有開機功能所以位於系統0x00000000

bootloader

  1. init uart
  2. init sdram
  3. jump to IPL code
  4. IPL code load xboot to sdram
DOC有幾個主要的檔案 flcustom.h 及 flsystem.h
這是可以客制化定義參數的檔案
如BDTL, binary partition 最大的number
Disk partition cache size ....
主要turn 參數的檔案都在這裡~



function

* format
1. IPL //系統一開機所跑的code
2. binary
3. BDTL//會經過Tffs lib 的check, 以確保在nand flash 裡的資料完整可執行, 原廠建議用此格式存放Image

* read
1. IPL flReadIPL
2. binary bdkReadBlock
3. BDTL flAbsRead
* write
1. IPL flWriteIPL
2. binary bdkWriteBlock
3. BDTL flAbsWrite


TFFSSDK_FORMAT
{
FormatParams3 fp;//format 的基本參數
BinaryPartitionFormatParams3 *bdkp;//point to binary partition params
BDTLPartitionFormatParams3 *bdtlp;//point to BDTL partition params
LogicalPartitionParams lp;//
FATFormatParams ff;//places FAT foramt on a sepcific logical partition

fp.noOfBinaryPartitions=uDocBinNum;
fp.binaryPartitionInfo=bdkp;
fp.noOfBDTLPartitions=uDocBDTLNum;
fp.BDTLPartitionInfo=bdtlp;

ioreq.irHandle=0;
ioreq.irData=&fp; //把指定的資訊給irData
ioreq.irFlags = TL_NORMAL_FORMAT;
status=flFlashFormat(&ioreq);//處理format

ioreq.irHandle=(i<<4 br="" create="" fat="" ioreq.ircount="1;" ioreq.irdata="&ff;" ioreq.irflags="0;" ioreq.irhandle="(i<<4);" logical="" lp.length="upBDTLPartitionsSize[i];" partation="" partition="" partitions="" status="flFormatFS(&ioreq);//format">}

在讀寫doc的流程為~
1. mount
2. 處理(read,write)
3. dismount

ex:
TFFSSDK_BDTLWrite
{
IOreq ioreq;
ioreq.irHandle=0(uPartitionNum<<4 br="">irdata="NULL;"
status=" flAbsMountVolume(&ioreq);


/* Get the number of available sectors on the partition */
status = flSectorsInVolume(&ioreq);//取得整個partation有多少sectors
fillSectors = ioreq.irLength;
ioreq.irSectorCount=128; // move 128 sector to SDRAM per time, 一個sectore 512bytes
block=128*FL_SECTOR_SIZE;

for(......){
status=flAbsWrite(&ioreq);
}

status=flDismountVolume(&ioreq);
return status;
}

最後 開機要在wince下認得 可儲存的partition
要在platform.reg 下 設定
Registry entry for device 0 partition 5: HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS5

Comments