📄 flcustom.h
字号:
#ifndef FLCUSTOM_H#define FLCUSTOM_H#include "tffs.h"/* -------------------- *//* Driver customization *//* -------------------- */#define TFFS_DRV_VER 47/* Forces the device into the deep power down mode after every driver operation */#define TFFS_POWER_DOWN/* memory range in which driver will search for the device(defaults for fl_winl and fl_winh parameters)and size of iomem window */#ifdef TFFS_USE_AMD_ISA /* AMD ISA *//* Enable using of AMD flash on ISA board and set ISA address */# define FL_AMD_ISA_SOCKET 0xd4000 /* for tffs 5.x AMD */# define TFFS_PHYS_ADDR_LOW 0xd0000L /* for tffs 5.x AMD */# define TFFS_PHYS_ADDR_HIGH 0xd0000L /* for tffs 5.x AMD */# define TFFS_IOMEM_WINDOW_SIZE 0x4000L /* for tffs 5.x AMD */#elif defined(TFFS_USE_AMD_PCI) /* AMD PCI */# ifdef TFFS_AU1500# define TFFS_PHYS_ADDR_LOW 0x1E000000L /* for Au1500 */# define TFFS_PHYS_ADDR_HIGH 0x1E000000L /* for Au1500 */# define TFFS_IOMEM_WINDOW_SIZE 0x800000L /* for Au1500 */# else# define TFFS_PHYS_ADDR_LOW 0xd0000000L /* for tffs 5.x AMD */# define TFFS_PHYS_ADDR_HIGH 0xd0000000L /* for tffs 5.x AMD */# define TFFS_IOMEM_WINDOW_SIZE 0x4000000L /* for tffs 5.x AMD */# endif#elif defined(TFFS_COTULLA) /* DOC XScale */# define TFFS_PHYS_ADDR_LOW 0x14000000L# define TFFS_PHYS_ADDR_HIGH 0x14000000L# define TFFS_IOMEM_WINDOW_SIZE 0x8000 /* double shift window */#elif defined(TFFS_PCx86) /* DOC x386 */# define TFFS_PHYS_ADDR_LOW 0xc8000L# define TFFS_PHYS_ADDR_HIGH 0xDF000L# define TFFS_IOMEM_WINDOW_SIZE 0x2000 /* no shift window */#else# define TFFS_PHYS_ADDR_LOW 0xc8000L# define TFFS_PHYS_ADDR_HIGH 0xDF000L# define TFFS_IOMEM_WINDOW_SIZE 0x8000 /* double shift window */#endif/* driver layer debug messages *//* #define DRIVER_DEBUG *//* enable TFFS debug messages and fl_debug insmod argument */#define TFFS_MESSAGES_ENABLED/* enable statistic ioctls *//* #define DRIVER_STATISTIC *//* print debug messages from access routines *//* #define ACCESS_ROUTINES_DEBUG *//* Compile with RedHat's kernel 2.4.x extension *//* #define REDHAT_KERNEL_EXTENSION *//* defult for fl_debug parameter: 0 - no messages, 1 - errors, 2 - warnings, 3 - flow */#define FL_DEBUG_DEF 0/* Environment Variables * * Enable environment variables control of the TrueFFS features. * */#define ENVIRONMENT_VARS#ifdef ENVIRONMENT_VARS/* default values of enviroment variables *//* Defines the type of access used by the access layer when accessing the device memory window */#ifdef TFFS_PCx86# define FL_DOC_8BIT_ACCESS_DEF 0#else# define FL_DOC_8BIT_ACCESS_DEF 1#endif# define FL_MTD_BUS_ACCESS_TYPE_DEF 7 /* FL_BUS_HAS_8BIT_ACCESS|FL_BUS_HAS_16BIT_ACCESS|FL_BUS_HAS_32BIT_ACCESS|FL_NO_ADDR_SHIFT) *//* Skips the time spent in waiting for the flash ready signal before returning to the user */# define FL_DO_NOT_WAIT_FOR_READY_DEF 0/* Sets the number of sectors verified per folding operation */# define FL_SECTORS_VERIFIED_PER_FOLDING_DEF 64/* Enabling this option improves performance, but requires additional RAM resources */# define FL_TL_CACHE_ENABLED_DEF 1/* When set to 1 no write or erase operations can be performed. When set to 3 no read/write/erase operations are allowed. */# define FL_SUSPEND_MODE_DEF 0# define FL_IS_RAM_CHECK_DEF 0 /* for tffs 5.x */#endif /* ENVIRONMENT_VARS */#define TFFS_RAHEAD_DEF 0#define TFFS_HARDSECT_DEF 0#define TFFS_PRIO_DEF 0/* allow using of unformatted DOC *//* #define TFFS_ALLOW_UNFORMATTED */#if (TFFS_SVER<60000)# define TFFS_SUPPORTED_DEVICE "MDOCP DOC2000"#else# define TFFS_SUPPORTED_DEVICE "G3 P3 OREN"#endif/* ------------------ *//* TFFS customization *//* ------------------ *//* DiskOnChip bus configuration. *//* #define DOC_ACCESS_TYPE 16 */ /* for TFFS 5.x *//* 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. */#if defined(TFFS_USE_AMD_PCI) || defined(TFFS_USE_AMD_ISA)# define SOCKETS 1#else# define SOCKETS 8#endif/* 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)/* IO Controll Interface * * Support standard IOCTL interface. * */#define IOCTL_INTERFACE/* Low level operations * * Uncomment the following line if you want to do low level operations * (i.e. read from a physical address, write to a physical address, * erase a unit according to its physical unit number, OTP and unique ID * operations. */#ifdef IOCTL_INTERFACE# define FL_LOW_LEVEL#endif/* 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. */#if defined(IOCTL_INTERFACE) && (TFFS_SVER<60000)# define WRITE_EXB_IMAGE /* for TFFS 5.x only */#endif/* Formatting * * Uncomment the following line if you need to format the media. */#ifdef IOCTL_INTERFACE# define FORMAT_VOLUME/* Number of sectors per FAT cluster * * Define the minimum cluster size in sectors. */# define MIN_CLUSTER_SIZE 4#endif/* Defragmentation * * Uncomment the following line if you need to defragment with * flDefragmentVolume. */#ifdef IOCTL_INTERFACE# define DEFRAGMENT_VOLUME#endif/* 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 /* for TFFS 6.x */#define MAX_VOLUME_MBYTES 1024L /* for TFFS 5.x *//* Assumed card parameters. * * This issue is relevant only if you are not defining any dynamic allocation * routines in flsystem.h. * * The following are assumptions about parameters of the Flash media. * They affect the size of the heap buffer allocated for the translation * layer. *//* 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 *//* NAND flash */#define ASSUMED_NFTL_UNIT_SIZE 0x2000l /* NAND *//* NOR flash */#define ASSUMED_FTL_UNIT_SIZE 0x20000l /* Intel interleave-2 (NOR) */#define ASSUMED_VM_LIMIT 0x10000l /* limit at 64 KB *//* 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 *//* Application exit * * If the FLite application ever exits, it needs to call flEXit before * exiting. Uncomment the following line to enable this. */#define EXIT /* * * Socket Hardware Customization * ----------------------------- *//* Fixed or removable media * * If your Flash media is fixed, uncomment the following line. */#define FIXED_MEDIA/* Interval timer * * The following defines a timer polling interval in milliseconds. If the * value is 0, an interval timer is not installed. * * If you select an interval timer, you should provide an implementation * for 'flInstallTimer' defined in flsysfun.h. * * An interval timer is not a must, but it is recommended. The following * will occur if an interval timer is absent: * * - Card changes can be recognized only if socket hardware detects them. * - The Vpp delayed turn-off procedure is not applied. This may downgrade * write performance significantly if the Vpp switching time is slow. * - The watchdog timer that guards against certain operations being stuck * indefinitely will not be active. *//* Polling interval in millisec. If 0, no polling is done */#define POLLING_INTERVAL 0/* 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). */#define FL_MTDS 2 #define MTDS 2 /* Up to 2 MTD's */#if (TFFS_SVER<60000)#define TLS 2 /* Up to 2 Translation Layers */#else#define FL_TLS 1 /* Up to 1 Translation Layers */#endif/* 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 NFTL_CACHE /* for tffs 5.x */#define FL_TL_CACHE /* for tffs 6.x *//* S/W Write protection * * Enable S/W write protection of the device. * */#ifdef IOCTL_INTERFACE# define WRITE_PROTECTION# ifdef WRITE_PROTECTION# define SCRAMBLE_KEY_1 647777603l# define SCRAMBLE_KEY_2 232324057l# endif#endif/* H/W OTP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -