📄 _docbdk.h
字号:
/*------------------------------------------------------------------------*/
/* Extern variables for low level operations. */
/*------------------------------------------------------------------------*/
extern BDKVol* flBdkVol;
typedef struct {
LEulong bootRecordId[2]; /* "CNAND" */
LEulong noOfBootImageBlocks; /* number of good blocks in the boot image area */
LEulong noOfBinaryPartitions; /* number of binary partitions */
LEulong noOfBDTLPartitions; /* number of BDTL partitions */
LEulong blockMultiplierBits; /* number of bits used to represent the
times a flash erasable block fits inside
an INFTL erasable unit. */
LEulong formatFlags; /* SAFTL_QUICK_MOUNT */
LEulong osakVersion; /* version of osak used to format the media */
LEulong percentUsed;
LEulong headerUnits; /* Number of units reserved in the begining */
/* of each floor for the media header */
LEulong floorNo; /* Number of current floor */
LEulong unused1;
LEulong unused2;
LEulong unused3;
LEulong unused4;
} BootRecord;
/*------------------------------------------------------------------------*/
/* Diffrent records used by the media header */
/*------------------------------------------------------------------------*/
typedef struct {
LEulong totalGoodUnits; /* Total good unit (sum of the next 4 fields) */
LEulong virtualUnits; /* Virtual unit size exported by the TL */
LEulong transferUnits; /* Number of good units found in BB percentage */
LEulong spareUnits; /* Number of spare units requested by the user */
LEulong quickMountUnits; /* Number of good units used by the quick mount */
LEulong firstUnit; /* First unit of the partition */
LEulong lastUnit; /* Last unit of the partition */
LEulong firstQuickMountUnit; /* First unit used for the quick mount data */
LEulong flags; /* See list above "Partition flags" */
LEulong protectionArea; /* Number of the partitions protection area */
LEulong unused1;
LEulong unused2;
LEulong unused3;
LEulong unused4;
} VolumeRecord;
/************************ Function Prototype Begin ************************/
#ifdef MTD_STANDALONE
/*************************/
/* BDK specific routines */
/*************************/
#ifdef EXIT
void bdkExit (void);
#endif /* EXIT */
FLStatus bdkSetBootPartitionNo (FLByte partitionNo);
FLStatus bdkFindDiskOnChip (CardAddress FAR2 *docAddress,
FLDword FAR2 *docSize );
FLStatus bdkCheckSignOffset (FLByte FAR2 *signPtr );
FLStatus bdkPowerDownMode (FLWord wState);
FLStatus bdkCopyBootArea (FLByte FAR1 *startAddressPtr,
FLWord wStartUnit,
FLDword dwAreaLen,
FLByte FAR2 *bCheckSumPtr,
FLByte FAR2 *signPtr);
/**************************************************/
/* common functions which are exported by the BDK */
/**************************************************/
FLStatus bdkGetBootPartitionInfo (FLWord startUnit,
FLDword FAR2 *partitionSize,
FLDword FAR2 *realPartitionSize,
FLDword FAR2 *unitSize,
FLByte FAR2 *signature);
FLStatus bdkCopyBootAreaInit (FLWord startUnit,
FLDword areaLen,
FLByte FAR2 *signature);
FLStatus bdkCopyBootAreaBlock (FLByte FAR1 *buf ,
FLDword bufferLen,
FLByte FAR2 *checkSum);
#ifdef BDK_IMAGE_TO_FILE
FLStatus bdkCopyBootAreaFile ( FLSByte FAR2 *fname,
FLWord startUnit,
FLDword areaLen,
FLByte FAR2 *checkSum,
FLByte FAR2 *signature );
#endif /* BDK_IMAGE_TO_FILE */
#ifndef FL_READ_ONLY
FLStatus bdkUpdateBootAreaInit (FLWord startUnit,
FLDword areaLen,
FLByte updateFlag,
FLByte FAR2 *signature );
FLStatus bdkUpdateBootAreaBlock (FLByte FAR1 *buf ,
FLDword bufferLen );
#ifndef BDK_REMOVE_ERASE_BDK_IMAGE
FLStatus bdkEraseBootArea (FLWord startUnit,
FLWord noOfBlocks,
FLByte FAR2 * signature);
#endif /* BDK_REMOVE_ERASE_BDK_IMAGE */
#ifndef BDK_REMOVE_CREATE_BDK_IMAGE
FLStatus bdkCreateBootArea (FLWord noOfBlocks,
FLByte FAR2 * oldSign,
FLByte FAR2 * newSign);
#endif /* BDK_REMOVE_CREATE_BDK_IMAGE */
#ifdef BDK_IMAGE_TO_FILE
FLStatus bdkUpdateBootAreaFile(FLSByte FAR2 *fname, FLWord startUnit,
FLDword areaLen, FLByte FAR2 *signature);
#endif /* BDK_IMAGE_TO_FILE */
#endif /* FL_READ_ONLY */
#ifdef HW_OTP
FLStatus bdkGetUniqueID(FLByte FAR1* buf);
FLStatus bdkReadOtp(FLWord offset,FLByte FAR1 * buffer,FLWord length);
FLStatus bdkGetOtpSize(FLDword FAR2* sectionSize, FLDword FAR2* usedSize,
FLWord FAR2* locked);
#ifndef FL_READ_ONLY
FLStatus bdkWriteAndLockOtp(const FLByte FAR1 * buffer,FLWord length);
#endif /* FL_READ_ONLY */
#endif /* HW_OTP */
#ifdef HW_PROTECTION
FLStatus bdkGetProtectionType (FLWord * protectionType);
FLStatus bdkInsertKey (FLByte FAR1* key);
FLStatus bdkRemoveKey (void);
FLStatus bdkStickyLock (void);
#ifndef FL_READ_ONLY
FLStatus bdkSetProtectionType (FLWord newType);
FLStatus bdkLockEnable (FLByte enable);
FLStatus bdkChangeKey (FLByte FAR1* key);
#ifndef NO_IPL_CODE
FLStatus bdkWriteIPL (FLByte FAR1 * buf , FLDword bufLen , FLWord flags);
#endif /* NO_IPL_CODE */
#endif /* FL_READ_ONLY */
#endif /* HW_PROTECTION */
#else /* MTD_STANDALONE */
extern FLStatus bdkCall(FLFunctionNo functionNo,
IOreq FAR2 *ioreq, FLFlash* flash);
#endif /* MTD_STANDALONE */
/********************/
/* common functions */
/********************/
void bdkInit( void );
/************************ Function Prototype End **************************/
#endif /* BDK_ACCESS || MTD_STANDALONE */
#endif /* _DOCBDK_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -