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

📄 flcommon.h

📁 H3 M-system NAND flash driver in Linux OS, M-DOC driver
💻 H
📖 第 1 页 / 共 2 页
字号:
/****************************************************************************** *                                                                            * * Project: DOC Driver for Linux 2.4 Block device driver for mDOC H3  family  * * of devices under Linux kernel 2.4.                                         * *                                                                            * *   Version: 1.0                                                             * *   Email questions to: oemsupport@sandisk.com                               * *   Copyright (C) SanDisk IL Ltd. 1995 - 2007                                * *   SanDisk IL Ltd., 7 Atir Yeda Street, Kfar Saba 44425, Israel             * *                                                                            * ****************************************************************************** *                                                                            * * This program is free software; you can redistribute it and/or modify it    * * under the terms of the GNU General Public License as published by the Free * * Software Foundation; either version 2 of the License, or any later version.* * This program is distributed in the hope that it will be useful, but WITHOUT* * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      * * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for  * * more details, which is set forth in the readme.txt file.                   * * You should have received a copy of the GNU General Public License along    * * with this program; if not, write to the Free Software Foundation, Inc., 51 * * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA                    * *                                                                            * * This License does not grant you any right to use the trademarks, service   * * marks or logos of SanDisk IL Ltd. or SanDisk Corporation.                  * * Subject to the foregoing, SanDisk IL Ltd., for itself and on behalf of its * * licensors, hereby reserves all intellectual property rights in the program,* * except for the rights expressly granted in this License.                   * *                                                                            * ******************************************************************************//*
 * $Log:   V:/PVCSDB/DiskOnChip/archives/Testing/TrueFFS 6.3/Drop 2.5/common/flcommon.h-arc  $
 * 
 *    Rev 1.13.1.4   Nov 13 2006 15:13:54   Yaniv.Iarovici
 * Added environment variable - 'FL_DISABLE_MEMCPY'.
 * 
 *    Rev 1.13.1.3   Sep 11 2006 13:45:22   yaniv.iarovici
 * Legal header added
 * 
 *    Rev 1.13.1.2   Aug 22 2006 13:25:12   Yaniv.Iarovici
 * Add 'extern "c"' on 
 * 	- flExit() definition
 * 	- extern FLDword  flBusConfig[FL_SOCKETS]
 * 
 *    Rev 1.13.1.1   Aug 16 2006 08:47:06   Yaniv.Iarovici
 * 1) Add FL_SET_TRANSFER_MODE (value 109) to FLEnvVars enum
 * 2) Encapsulate BDK related defines under '#ifdef BDK_ACCESS'.
 * 
 *    Rev 1.13.1.0   Aug 09 2006 17:36:54   Polina.Marimont
 * initial for DOC Driver 1.0
 */

#ifndef FLCOMMON_H
#define FLCOMMON_H

#include "_common.h"
#include "flsystem.h"
#include "flcustom.h"

/**************************************************************************/
/* Status code for operation:                                             */
/*   A zero value indicates success, other codes are various error codes. */
/*   if IFLITE_ERROR_CODES is defined at flsystem.h, DOS codes will be     */
/*   used instead of legacy TrueFFS codes.                                */
/**************************************************************************/
#ifndef IFLITE_ERROR_CODES
typedef enum {                         
         flOK                      = 0,
         flBadFunction             = 1,
         flFileNotFound            = 2,
         flPathNotFound            = 3,
         flTooManyOpenFiles        = 4,
         flNoWriteAccess           = 5,
         flBadFileHandle           = 6,
         flDriveNotAvailable       = 9,
         flNonFATformat            = 10,
         flFormatNotSupported      = 11,
         flNoMoreFiles             = 18,
         flWriteProtect            = 19,
         flBadDriveHandle          = 20,
         flDriveNotReady           = 21,
         flUnknownCmd              = 22,
         flBadFormat               = 23,
         flBadLength               = 24,
         flDataError               = 25,
         flUnknownMedia            = 26,
         flSectorNotFound          = 27,
         flOutOfPaper              = 28,
         flWriteFault              = 29,
         flReadFault               = 30,
         flGeneralFailure          = 31,
         flDiskChange              = 34,
         flVppFailure              = 50,
         flBadParameter            = 51,
         flNoSpaceInVolume         = 52,
         flInvalidFATchain         = 53,
         flRootDirectoryFull       = 54,
         flNotMounted              = 55,
         flPathIsRootDirectory     = 56,
         flNotADirectory           = 57,
         flDirectoryNotEmpty       = 58,
         flFileIsADirectory        = 59,
         flAdapterNotFound         = 60,
         flFormattingError         = 62,
         flNotEnoughMemory         = 63,
         flVolumeTooSmall          = 64,
         flBufferingError          = 65,
         flFileAlreadyExists       = 80,
         flForceDismount           = 85,
         flIncomplete              = 100,
         flTimedOut                = 101,
         flTooManyComponents       = 102,
         flTooManyDrives           = 103,
         flTooManyBinaryPartitions = 104,
         flPartitionNotFound       = 105,
         flFeatureNotSupported     = 106,
         flWrongVersion            = 107,
         flTooManyBadBlocks        = 108,
         flNotProtected            = 109,
         flUnchangeableProtection  = 110,
         flBadDownload             = 111,
         flBadBBT                  = 112,
         flInterleaveError         = 113,
         flWrongKey                = 114,
         flHWProtection            = 115,
         flLeftForCompetability    = 116,
         flMultiDocContradiction   = 117,
         flCanNotFold              = 118,
         flBadIPLBlock             = 119,
         flIOCommandBlocked        = 120,
         flBadTransaction          = 121,
         flTooManyTransactions     = 122,
         flUnitIsNotErased         = 123,
         flSequenceError           = 124,
         flFIFOTimeOut             = 125,
         flUnitIsBad               = 126,
         flFlashIsVirgin           = 127,
         flQuickMountNotValid      = 128,

         flSuspendModeDetected     = 129,
         flDmaFailed     		   = 130,
		 flSuspendDueToHWFailure   = 131,

         flCannotCreateShortName   = 150,
         flInvalidCharSet	       = 151,
         flOverwriteExistingEntry  = 152,
         flBufferTooShort	       = 153,
         flPathTooLong		       = 154,
         flBadPartitionSize        = 155,
         flTooManyPartitions       = 156,
         flFSO_IDnotFound	       = 157,
         flFSO_IDisBusy	     	   = 158

#else

#include "type.h"

typedef enum {      /* Status code for operation.
                       A zero value indicates success,
                       other codes are the extended
                       DOS codes. */
             flOK                  = ERR_NONE,
             flBadFunction         = ERR_SW_HW,
             flFileNotFound        = ERR_NOTEXISTS,
             flPathNotFound        = ERR_NOTEXISTS,
             flTooManyOpenFiles    = ERR_MAX_FILES,
             flNoWriteAccess       = ERR_WRITE,
             flBadFileHandle       = ERR_NOTOPEN,
             flDriveNotAvailable   = ERR_SW_HW,
             flNonFATformat        = ERR_PARTITION,
             flFormatNotSupported  = ERR_PARTITION,
             flNoMoreFiles         = ERR_NOTEXISTS,
             flWriteProtect        = ERR_WRITE,
             flBadDriveHandle      = ERR_SW_HW,
             flDriveNotReady       = ERR_PARTITION,
             flUnknownCmd          = ERR_PARAM,
             flBadFormat           = ERR_PARTITION,
             flBadLength           = ERR_SW_HW,
             flDataError           = ERR_READ,
             flUnknownMedia        = ERR_PARTITION,
             flSectorNotFound      = ERR_READ,
             flOutOfPaper          = ERR_SW_HW,
             flWriteFault          = ERR_WRITE,
             flReadFault           = ERR_READ,
             flGeneralFailure      = ERR_SW_HW,
             flDiskChange          = ERR_PARTITION,
             flVppFailure          = ERR_WRITE,
             flBadParameter        = ERR_PARAM,
             flNoSpaceInVolume     = ERR_SPACE,
             flInvalidFATchain     = ERR_PARTITION,
             flRootDirectoryFull   = ERR_DIRECTORY,
             flNotMounted          = ERR_PARTITION,
             flPathIsRootDirectory = ERR_DIRECTORY,
             flNotADirectory       = ERR_DIRECTORY,
             flDirectoryNotEmpty   = ERR_NOT_EMPTY,
             flFileIsADirectory    = ERR_DIRECTORY,
             flAdapterNotFound     = ERR_DETECT,
             flFormattingError     = ERR_FORMAT,
             flNotEnoughMemory     = ERR_SW_HW,
             flVolumeTooSmall      = ERR_FORMAT,
             flBufferingError      = ERR_SW_HW,
             flFileAlreadyExists   = ERR_EXISTS,
             flIncomplete          = ERR_DETECT,
             flTimedOut            = ERR_SW_HW,
             flTooManyComponents   = ERR_PARAM
#endif
} FLStatus;


#ifndef FL_DISABLE_OLD_TRUEFFS_TYPES
/**************************************************************************/
/* TrueFFS used to export several basic types. These type were changed in */
/* TrueFFS 6.0 , but to allows old application based on these type to     */
/* function we keep exporting them.                                       */
/**************************************************************************/
typedef unsigned char  byte;        /* 8  bit unsigned variable */
typedef unsigned short word;        /* 16 bit unsigned variable */
typedef unsigned long  dword;       /* 32 bit unsigned variable */

typedef signed char  Sbyte;         /* 8  bit signed variable */
typedef signed short Sword;         /* 16 bit signed variable */
typedef signed long  Sdword;        /* 32 bit signed variable */
#endif /* FL_DISABLE_OLD_TRUEFFS_TYPES */


/**************************************************************************/
/*  Various defines:                                                      */
/*    The following types are used by various TrueFFS packages and        */
/*    also exported as an external API.                                   */
/**************************************************************************/

/* define SectorNo range according to media maximum size */
typedef FLDword SectorNo;
#define    UNASSIGNED_SECTOR 0xffffffffl

/* On / Off definitions of various commands*/
#define FL_ON    1
#define FL_OFF   0

#define DEEP_POWER_DOWN          1 /* must be the same as in blockdev.h */
#define EXIT_DEEP_POWER_DOWN     0 /* must be the same as in blockdev.h */

#define LOCKED_OTP               1

/*Definition of a sector size*/
#define FL_SECTOR_SIZE_BITS 9
#define FL_SECTOR_SIZE        (1 << FL_SECTOR_SIZE_BITS)

/* IPL modes settings*/
#define FL_IPL_MODE_NORMAL          0   /* IPL - Written as usual                     */
#define FL_IPL_DOWNLOAD             1   /* IPL - Force download of new IPL            */
#define FL_DOC_IPL_PAGED_RAM_MODE   4   /* IPL - Written in paged RAM mode.  */
#define FL_IPL_VIRTUAL_RAM_MODE     8   /* IPL - Written in Virtual RAM mode          */
#define FL_IPL_ALERNATE_MAP         16  /* IPL - Written with X-Scale mode enabled    */
#define FL_IPL_128K_WINDOW_MODE     32  /* IPL - Set DOC device to 128K window mode.  */
#define FL_IPL_NO_ADDRESS_SHIFT_MODE 64  /*IPL - Set DOC device in address shift mode. */
#define FL_IPL_SWAP_BYTES_MODE      128 /*IPL - Set DOC device in swap bytes mode. */

/* Bit 3 Virtual/Paged# mode bit                                                */
#define FL_IPL_PAGED_RAM_MODE   0  /* IPL - Written in Paged   RAM mode          */

 /* Bit 15 Write data in buffers */
#define FL_USING_BUFFERS        0x8000  /* IPL - Allow accessing the IPL using buffers */

/*** MTD Special services types foe HW config commands    ***/
#define FL_IRQ_RB_TYPE                  0x0
#define FL_DPD_TYPE                     0x1
#define FL_PAGE_MODE_TYPE               0x2
#define FL_TURBO_MODE_TYPE              0x3 
#define FL_DPS_2_COPIES_TYPE            0x4
#define FL_DMA_TYPE                     0x5
#define FL_NONTURBO_MODE                0
#define FL_TURBO_MODE                   1  
#define FL_DMA_HW_ENABLED               1   
#define FL_DMA_HW_DISABLED              0
#define FL_DMA_REQ_EDGE                 2   
#define FL_DMA_REQ_LEVEL                0
#define FL_NEGATED_1_ASSERTED_0         0   
#define FL_NEGATED_0_ASSERTED_1         4
#define FL_DMA_IRQ_ENABLED              8
#define FL_DMA_IRQ_DISABLED             0  
#define FL_DMA_IRQ_EDGE                 0x10
#define FL_DMA_IRQ_LEVEL                0  
#define FL_IRQ_LEVEL_TYPE               0x0 
#define FL_IRQ_EDGE_TYPE                0x2 
#define FL_INT_RB_DISABLED              0x0 
#define FL_INT_RB_ENABLED               0x1 
#define FL_DPD_DISABLED                 0
#define FL_DPD_EXIT_RISE_EDGE           1
#define FL_DPD_EXIT_FALL_EDGE           2

⌨️ 快捷键说明

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