⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flcustom.h

📁 M-System DOC(Disk on a Chip) Flash芯片的诊断工具, 可以从Flash芯片中获取特定的数据信息, 用于判断芯片当前的状态.
💻 H
字号:
/************************************************************************/
/*                                                                      */
/*              FAT-FTL Lite Software Development Kit                   */
/*              Copyright (C) M-Systems Ltd. 1995-2003                  */
/*                                                                      */
/************************************************************************/


#ifndef FLCUSTOM_H
#define FLCUSTOM_H



/* Defines the package to be compiled.
 *
 * Normally the TrueFFS SDK is compiled, but if you want to compile only the 
 * BDK, uncomment the defintion bellow.
 *
 * Note: The BDK requires the MTDSA.H and MTDSA.C files.
 */

/* #define MTD_STANDALONE */


/* Used internally by the utility engine */
#define _OSAK60


/* Debug print level */
#define  ACTIVE_DEBUG_ZONE FLZONE_FULL /* FLZONE_NONE */


/* Driver & TrueFFS (OSAK) Version numbers */
#ifdef _OSAK60
#define driverVersion   "OS Less 6.2.1.0"
#define OSAKVersion     "6.2.1.0"
#else	/* _OSAK60 */
#define driverVersion   "5.1.4"
#define OSAKVersion     "5.1.4"
#endif	/* _OSAK60 */


/*
 *
 *              Varios Limits Customization
 *              ---------------------------
 */

/* Number of sockets
 *
 * Defines the maximum number of physical drives supported.
 *
 * The actual number of sockets depends on which socket controllers are
 * actually registered and the number of sockets in the system.
 */

#define SOCKETS 4



/* Number of volumes
 *
 * Defines the maximum number of logical drives supported.
 *
 * The actual number of drives depends on which socket controllers are
 * actually registered, the amount of devices in the system and the
 * TL format of each device.
 */

#define VOLUMES  (4 * SOCKETS)



 /* Number of Binary partitions on the DiskOnChip.
 *
 * Defines Maximum Number of Binary partitions on the DiskOnChip.
 *
 * The actual number of partitions depends on the format placed
 * on each device.
 */

#define BINARY_PARTITIONS (3 * SOCKETS)



/* Maximum MTD's and Translation Layers
 *
 * Define here the maximum number of Memory Technology Drivers (MTD) and
 * Translation Layers (TL) that may be installed. Note that the actual
 * number installed is determined by which components are installed in
 * 'flRegisterComponents' (flcustom.c).
 */

#ifdef _OSAK60
#define FL_MTDS    2       /* Up to 2 MTD's */
#define FL_TLS     1       /* Up to 2 Translation Layers */
#else	/* _OSAK60 */
#define FL_MTDS    2       /* Up to 2 MTD's */
#define FL_TLS     2       /* Up to 2 Translation Layers */
#endif	/* _OSAK60 */


/*
 *
 *              FAT-Lite File System Customization
 *              ----------------------------------
 */


/* Number of open files
 *
 * Defines the maximum number of files that can be open at a time.
 */

#define FL_FILES   0


#if FL_FILES > 0

/* Sub-directories
 *
 * Uncomment the following line if you need support for sub-directories
 * using the FAT-FLITE file system.
 */

#define SUB_DIRECTORY



/* Rename file
 *
 * Uncomment the following line if you need to rename files with
 * flRenameFile.
 */

#define RENAME_FILE



/* Split / join file
 *
 * Uncomment the following line if you need to split or join files with
 * flSplitFile and flJoinFile.
 */

#define SPLIT_JOIN_FILE 



/* Parse path function
 *
 * Uncomment the following line if you need to parse DOS-like path names
 * with flParsePath.
 */

#define PARSE_PATH

#endif /* FILES > 0 */



/* 12-bit FAT support
 *
 * Comment the following line if you do not need support for DOS media with
 * 12-bit FAT (typically media of 8 MBytes or less).
 */

#define FAT_12BIT



/*
 *
 *              Features Customization
 *              ----------------------
 */

/* 
 * Remove all flash write functionalities ons from the source. 
 */

#define FL_READ_ONLY



/* Formatting
 *
 * Uncomment the following line if you need to format the media.
 */

/* #define FORMAT_VOLUME */

#ifdef FORMAT_VOLUME

/* Number of sectors per FAT cluster
 *
 * Define the minimum cluster size in sectors for the FAT competable format.
 */

#define MIN_CLUSTER_SIZE   4

#endif /* FORMAT_VOLUME */



/* Placing EXB files
 *
 * Uncomment the following line if you need to place M-Systems firmware
 * (DOCxx.EXB file) on the media. The file will install itself as a
 * BIOS extension driver, hooking INT13h to emulate a HD.
 */

#ifndef _OSAK60
/* #define WRITE_EXB_IMAGE */
#endif /* _OSAK60 */



/* Defragmentation
 *
 * Uncomment the following line if you need to defragment with
 * flDefragmentVolume.
 */

/* #define DEFRAGMENT_VOLUME */



/* Absolute read & write
 *
 * Uncomment the following line if you want to be able to read & write
 * sectors by absolute sector number (i.e. without regard to files and
 * directories).
 */

#define ABS_READ_WRITE



/* Environment Variables
 *
 * Enable environment variables control of the TrueFFS features.
 *
 */

#define ENVIRONMENT_VARS



/* IO Controll Interface
 *
 * Support standard IOCTL interface.
 *
 */

/* #define IOCTL_INTERFACE */



 /* Binary Partition
 *
 * Enables access to the Binary partition.
 *
 */

#define BDK_ACCESS

#ifdef BDK_ACCESS

/* Remove Binary partition erase API */

#define BDK_REMOVE_ERASE_BDK_IMAGE

/* Remove Binary partition create API */

#define BDK_REMOVE_CREATE_BDK_IMAGE

/* Compile the Binary partition read and write to file example code 
 * 
 * This compilation flag is relevant only for the BDK package.
 */

/* #define BDK_IMAGE_TO_FILE */

/* Compiles the code that calculates the checksum in the read routines.
 *
 * This compilation flag is relevant only for the BDK package.
 */

/* #define BDK_CHECK_SUM */

#endif /* BDK_ACCESS */



/* H/W OTP
 *
 * Enable H/W One Time Programing capability including unique ID/
 *
 */

#define HW_OTP 



/* H/W Protection
 *
 * Enable H/W protection of the device.
 *
 */

#define HW_PROTECTION



/* Application exit
 *
 * If the FLite application ever exits, it needs to call flEXit before
 * exiting. Uncomment the following line to enable this.
 */

#define EXIT



/* Disk partition cache
 *
 * Enable Block Device Translation Layer cache.
 *
 * Turning on this option improves performance but requires additional
 * RAM resources.
 *
 * The NAND Flash Translation Layer (NFTL , INFTL and SAFTL) are specifications
 * for storing data on the DiskOnChip in a way that enables accessing the
 * DiskOnChip as a Virtual Block Device. If this option is on, then the BDTL 
 * keeps in RAM a table that saves some of the flash accesses.
 * Whenever it is needed to change table entry, the BDTL updates it in the
 * RAM table and on the DiskOnChip. If the TL has to read table entry, then you
 * can save time on reading sector from DiskOnChip.
 *
 * Note that in SAFTL you can specifiy the size of the cache, therfore this
 * flag toggels between 2 default cache configurations (fully cached media 
 * and 64 cached unit). This flag is ignore when using static allocation.
 */

/* #define FL_TL_CACHE */



/* S/W Write protection
 *
 * Enable S/W write protection of the device.
 *
 */

/* #define WRITE_PROTECTION */

/* Definitions required for write protection. */

#ifdef WRITE_PROTECTION
#define ABS_READ_WRITE
#define SCRAMBLE_KEY_1  647777603l
#define SCRAMBLE_KEY_2  232324057l
#endif



/* Protection agains power failures / Read after write
 *
 * Compiles the code for dealing with partially written pages caused by power
 * failures. The actual mode of operation is controlled by an environment
 * variable FL_VERIFY_WRITE_BDTL. When ENVIRONMENT_VARS is undefined this 
 * compilation flag will result in read after every write.
 */

/* #define VERIFY_WRITE */



/* Verify entire volume
 *
 * Compile the flVerifyVolume routine - this routine scans the entire disk
 * partition for power failures symptoms and correct them.
 *
 */

/* #define VERIFY_VOLUME */



/* Disable the automatic argument check
 *
 * You can remove code and even slightly improve the overall performance by
 * allowing TrueFFS to skip its internal argument check by defining
 *
 */

/* #define FL_SKIP_ARGS_CHECK */



/* Compile the extended Disk information routine
 *
 * TrueFFS 6.0 and up provide an extended information routine for internal
 * M-Systems utilities named flGetExtendedDiskInfo(). 
 * To compile its code define
 */

#define FL_EXTENDED_DISK_INFO 



/*
 * Removes the code used for writing and reading the IPL code.
 *
 */

#define NO_IPL_CODE



/*
 *  Removes the inquire capability code.
 *
 */

#define NO_INQUIRE_CAPABILITIES



/*
 *  Removes read Bad Block Table code. 
 *
 */

/* #define NO_READ_BBT_CODE */



/* Remove code used for binary partition partial page access
 *
 * Due to flash limitations, the binary partition requires special handling 
 * to access (read and write) partial pages. When set this compilation flag
 * will remove the binary partition code and RAM buffers that handle partial
 * page access.
 */

#define FL_NO_BDK_PARTIAL_PAGE_ACCESS



/* Allow TrueFFS to search for a DiskOnChip on address 0.
 *
 * For backwards compatibility reasons, TrueFFS does not allow DiskOnChip to
 * reside at address 0. If this address is given to the TrueFFS DiskOnChip 
 * search routines, it will use the legacy BIOS extension address space.
 * To enable address 0 support, uncomment the definition bellow.
 */

#define FL_ADD_ADDRESS_0_SUPPORT



/*
 *
 *              Static Allocation Defenitions
 *              -----------------------------
 *
 * These defines are used for the static memory allocation configuration
 * of the driver. If your TrueFFS based application or driver are using
 * dynamic allocation you should not customize any of the definitions bellow
 */

/* Maximum supported medium size.
 *
 * Define here the largest Flash medium size (in MBytes) you want supported.
 * This define also sets the size of the TrueFFS variable used for storeing the
 * number of sectors in the meida. Therefore this variable should be larger 
 * then 32.
 *
 */

#define FL_ASSUMED_MAX_VOLUME_MBYTES       128L

/* NAND minimal flash block */
#define FL_ASSUMED_MIN_UNIT_SIZE           0x10000L         /* Minimal unit size */ 

/* NAND maximum number of sectors per block
 * Usually this value is equal to FL_ASSUMED_MIN_UNIT_SIZE divided by 512,
 * but if you need to support several DiskOnChip devices then while 
 * FL_ASSUMED_MIN_UNIT_SIZE indicates the smalles unit size, this value
 * indicates the largest number of sectors that can be fitted into a unit
 */
#define FL_ASSUMED_MAX_SECTORS_PER_UNIT    (FL_ASSUMED_MIN_UNIT_SIZE>>9) /* Divided by 512 bytes */

/* The number of cached units (only for SAFTL)
 *
 * This value is ignored if both dynaimc allocation (FL_MALLOC) and 
 * environment variables are enabled (ENVIRONMENT_VARS). If either modes
 * is disabled this flag will set the cache size.
 */

/* #define FL_NUMBER_OF_CACHED_UNITS 0x40L */



/* Fixed or removable media
 *
 * If your Flash media is fixed, uncomment the following line.
 */

#define FIXED_MEDIA


/*
 * Compile the code for the mount progress call back
 *
 */
#define FL_REPORT_MOUNT_PROGRESS



/* #define FL_PUTIMAGE */
/* #define FL_PUTIMAGE_PARALLEL */
/* #define FL_DIMAGE */


#endif /* FLCUSTOM_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -