📄 flcustom.h
字号:
/******************************************************************************/
/* */
/* Copyright (C), 1995-2006, msystems Ltd. All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions are */
/* met: */
/* 1. Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* 2. Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* 3. Neither the name of msystems nor the names of its contributors may be */
/* used to endorse or promote products derived from this software without */
/* specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED */
/* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR */
/* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/******************************************************************************/
/*
* $Log: V:/PVCSDB/DiskOnChip/archives/DocDriver/TrueFFS BD/examples/lowlevel/flcustom.h-arc $
*
* Rev 1.4 Sep 11 2006 13:42:40 yaniv.iarovici
* Legal Header added
*
* Rev 1.3 Sep 03 2006 14:54:32 Yaniv.Iarovici
* 1. Removed '#define FL_REPORT_MOUNT_PROGRESS'.
* 2. Added '#define DOCH_CHECK_CHIP_ID' as default for all examples.
*
* Rev 1.2 Aug 22 2006 13:20:46 Yaniv.Iarovici
* 1) DOCH_32K_SLIDING_WINDOW removed
* 2) Put 'FL_BINARY_PARTITIONS' definition under 'BDK_ACCESS'
* 3) Remove some BDK related definitions
* 4) Remove definition of 'FL_NEVER_RECOVER_FROM_RST'
*
* Rev 1.1 Aug 16 2006 09:01:14 Yaniv.Iarovici
* Set max number of partitions (FL_VOLUMES) to 14 per socket
*
* Rev 1.0 Aug 09 2006 17:49:32 Polina.Marimont
* Initial revision.
*/
#ifndef BDCUSTOM_H
#define BDCUSTOM_H
/************************************************************************/
/************************************************************************/
/** **/
/** G E N E R A L P A C K A G E - C U S T O M I Z A T I O N S **/
/** **/
/************************************************************************/
/************************************************************************/
#define MDOC_ACCESS_NOR /* NOR access to mDOC H3 */
/*#define MDOC_ACCESS_SPI*/ /* SPI access to mDOC H3 */
/*#define DOCH_FILE_SIMULATION*/ /* simulate mDOC H3 in file */
#ifdef DOCH_FILE_SIMULATION
#define DEF_DOCH_DEV_SIMULATE SIMULATOR_RAMMTD_TYPE /* 1Gb mDOC H3 */
#define DEF_DOCH_SIMULATE_FILE_NAME NULL /* use default filename */
#define DOCH_MEMMAP_FILE /*must be defined to use simulation in file */
#endif /*DOCH_FILE_SIMULATION*/
/* when simulator or SPI access layer used - access done by functions (not by macros) since that */
/* DOCH_USE_FUNC MUST be defined */
#if defined(MDOC_ACCESS_SPI) || defined(DOCH_FILE_SIMULATION)
#define DOCH_USE_FUNC
#endif /*MDOC_ACCESS_SPI or DOCH_FILE_SIMULATION defined*/
/* Driver & TrueFFS Version numbers (Previously named OSAK)
*
* The string must not be greater than 10 characters.
*
* Note: Other then being returned by the the flVolumeInfo() routine this
* value has no actual affect on the TrueFFS software.
*/
#define driverVersion "OS Less"
#define OSAKVersion "1.0.0"
/************************************************************************/
/************************************************************************/
/** **/
/** L I M I T S - C U S T O M I Z A T I O N S **/
/** **/
/************************************************************************/
/************************************************************************/
/* Number of sockets
*
* Defines the maximum number of supported physical DiskOnChip devices.
*
* The actual number of sockets depends on which socket controllers are
* actually registered and the number of physical devices in the system.
*/
#define FL_SOCKETS 1
/* Number of volumes
*
* Defines the maximum number of supported Disk (BDTL) partitions.
*
* The actual number of drives depends on which socket controllers are
* actually registered, the amount of devices in the system and the
* flash format placed on each device.
*/
#define FL_VOLUMES (14 * FL_SOCKETS)
#ifdef BDK_ACCESS
/* Number of Binary partitions on the DiskOnChip.
*
* Defines Maximum Number of supported Binary partitions.
*
* The actual number of partitions depends on the flash format placed
* on each device.
*/
#define FL_BINARY_PARTITIONS (3 * FL_SOCKETS)
#endif /*BDK_ACCESS*/
/* TrueFFS Heap size.
*
* TrueFFS uses the FL_MALLOC and FL_FREE routines to allocate the memory it
* requires. However if your native system does not have standard libraries,
* for dynamic memory allocation you can use the TreuFFS implementation for
* those routines called flMalloc and flFree.
*
* In such case you will need to define at compile time the heap size for
* those routines using the following macro.
*/
/* #define FL_TRUEFFS_HEAP_SIZE 300000 */
/* TrueFFS Heap pointer.
*
* The TrueFFS implementation of FL_MALLOC and FL_FREE routines allocates it's
* heap as single large static array.
*
* It is also possible to specifically tell TrueFFS your preferred heap
* location assuming that you are familiar with the physical memory of your
* platform.
*/
/* #define FL_TRUEFFS_HEAP_POINTER 0x80000000 */
/************************************************************************/
/************************************************************************/
/** **/
/** F E A T U R E S IN / OUT - C U S T O M I Z A T I O N S **/
/** **/
/************************************************************************/
/************************************************************************/
/*
* Remove all flash write functionalities from the code.
*
* When this option is selected, only API functions that do not involve write
* operations to the media can be called.
*
* This option can be used to create read-only applications with low RAM/ROM
* requirements.
*/
/* #define FL_READ_ONLY */
/* Flash Formatting (Block device format)
*
* Uncomment the following line if you need to prepare a virgin DiskOnChip
* for work or in case you want to re-partition your existing device.
*
* This routine compiles the following 3 API routines:
* flFlashFormat(), flEraseBD() and flUnformat()
*/
#ifndef FL_READ_ONLY
#define FL_FORMAT_VOLUME
#endif
/* Partitioning to logical partitions (writing MBR)
*
* This routine is necessary if your OS does not provide FDISK-like utility.
*
* Please note that in DiskOnChip devices it is preferred to use the BDTL
* partitions mechanism, as it provides better security and better performance.
*
* This compilation flag compiles the flCreateLogicalPartitions() routine.
*/
/* #define FL_CREATE_LOGICAL */
/* Reports the location of a specific logical partition.
*
* This API is only necessary if you want to use Abs Block I/O
* (which addresses whole BDTL partition).
* File access routine and Log Block I/O routines
* address specific logical partitions automatically.
*
* This compilation flag compiles the flFindLogicalPartition() routine.
*/
/* #define FL_FIND_LOGICAL */
/* Places file system format.
*
* Includes the routine for placing the FAT file system format on
* a specific logical partition.
*
* Please note that this routine calculates the optimal file system format
* parameters for your specific flash device in terms of cluster size, and
* FAT table location. These settings may have drastic impact on the device
* performance.
*
* This compilation flag compiles the flFormatFS() routine.
*/
/* #define FL_LOGICAL_FORMAT_VOLUME */
/* #define FL_SUPPORT_FAT32_FORMAT */
/* 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 FL_ABS_READ_WRITE
/* Environment Variables
*
* Enable environment variables control of the TrueFFS features.
*
*/
#define FL_ENVIRONMENT_VARS
/* IO Control Interface
*
* Support standard IOCTL interface. Used only by some block device drivers.
*
*/
/* #define FL_IOCTL_INTERFACE */
/* Binary Partition
*
* Enables Binary partition manipulation.
*
*/
/* #define BDK_ACCESS */
/* H/W OTP
*
* Enable H/W One Time Programming capability including the unique ID feature.
*
*/
/* #define HW_OTP */
/* H/W Protection
*
* Enable H/W protection of the device.
*
*/
/* #define HW_PROTECTION */
/* Compile the code for reading after write
*
* Compiles the code and buffers for reading after every write operation
* This mode is used for debugging when you are still debugging the platform's
* H/W.
*/
/* #define FL_VERIFY_WRITE */
/* Verify entire volume
*
* Compile the flVerifyVolume() routine - this routine scans the entire disk
* partition for power failures symptoms and correct them while initializing
* the TL cache.
*
*/
/* #define VERIFY_VOLUME */
/* Application exit
*
* If the TrueFFS application ever exits, it needs to call flEXit before
* exiting. Uncomment the following line to enable this.
*/
#define FL_EXIT
/* 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 area.
*
*/
#define NO_IPL_CODE
/* 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 */
/* Fixed or removable media
*
* TrueFFS was originally designed for removable flash media.
*
* To remove the code dealing with the media removal simply uncomment
*/
#define FL_FIXED_MEDIA
/* Compile the auto DPD code
*
* TrueFFS supports a mode, where TrueFFS automatically enters and exit DPD
* after every operation.
*
* The compilation bellow compiles that code. Note that it's operation is
* also under the affect of the dedicated environment variable.
*/
#define FL_BD_AUTO_DPD_MODE
/*
* Define CHECK_POWER_ON_EVERY_COMMAND, when power state should be checked after every command
* mDOC H3 device only
*/
/* #define CHECK_POWER_ON_EVERY_COMMAND */
#endif /* BDCUSTOM_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -