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

📄 _docbdk.h

📁 M-System DOC(Disk on a Chip) Flash芯片的诊断工具, 可以从Flash芯片中获取特定的数据信息, 用于判断芯片当前的状态.
💻 H
📖 第 1 页 / 共 2 页
字号:
/***********************************************************************************/
/*                        M-Systems Confidential                                   */
/*           Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2003            */
/*                         All Rights Reserved                                     */
/***********************************************************************************/
/*                            NOTICE OF M-SYSTEMS OEM                              */
/*                           SOFTWARE LICENSE AGREEMENT                            */
/*                                                                                 */
/*      THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE                 */
/*      AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT           */
/*      FOR THE SPECIFIC TERMS AND CONDITIONS OF USE,                              */
/*      OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE:                               */
/*      E-MAIL = info@m-sys.com                                                    */
/***********************************************************************************/

/*
 * $Log:   V:/PVCSDB/DiskOnChip/archives/general storage/TrueFFS/src/include/_docbdk.h-arc  $
 * 
 *    Rev 1.7   Jan 27 2004 08:14:04   oris
 * Changed comments
 * 
 *    Rev 1.6   Jan 14 2004 22:29:34   oris
 * Replaced old (5.x) TrueFFS variable types
 * 
 *    Rev 1.5   Sep 30 2003 17:55:22   oris
 * Added FL prefix to SECTOR_SIZE and SECTOR_SIZE_BITS
 * 
 *    Rev 1.4   Sep 01 2003 19:03:12   oris
 * - removed BLOCK,MBYTE,KBYTE definition.
 * 
 *    Rev 1.3   May 11 2003 08:27:06   OriS
 * Changed REMOVE_ERASE_BDK_IMAGE to BDK_REMOVE_ERASE_BDK_IMAGE
 * Changed REMOVE_CREATE_BDK_IMAGE to BDK_CREATE_ERASE_BDK_IMAGE
 * 
 *    Rev 1.2   May 06 2003 11:52:20   OriS
 * Changed NO_BDK_PARTIAL_PAGE_ACCESS to FL_NO_BDK_PARTIAL_PAGE_ACCESS
 * 
 *    Rev 1.1   Apr 27 2003 09:00:52   Oris
 * Added unused fields to the media header.
 * 
 *    Rev 1.0   Apr 09 2003 12:16:00   OriS
 * Initial revision.
 * 
 */

/************************************************************************/
/* Caution: The BDK_ACCESS compilation flag is for M-SYSTEMS internal   */
/*          use ONLY. This flag is used by M-SYSTEMS drivers and        */
/*          therfore it is SHOULD NOT be used by this package           */
/************************************************************************/

#ifndef _DOCBDK_H
#define _DOCBDK_H

/*---------------------------------------------------------------------
 *
 *       Binary Development Kit Stand Alone Customization Area
 *
 *---------------------------------------------------------------------*/

/*---------------------------------------------------------------------*/
/* Boundries of the memory location to look for the DiskOnChip         */
/*---------------------------------------------------------------------*/

#define DOC_LOW_ADDRESS                 0xC8000L
#define DOC_HIGH_ADDRESS                0xE0000L

/*----------------------- Mtd selection -------------------------------
 *
 * Uncomment the following uneeded MTD or TL to reduce code size.
 *
 *---------------------------------------------------------------------*/

/* MDOC512 DiskOnChip controller */
/* #define NO_OREN_FAMILY_SUPPORT */

/* DiskOnChip based on OREN controller */
/* #define NO_OREN_FAMILY_SUPPORT */

/* DiskOnChip RAM simulator device */
/* #define RAM_MTD_SUPPORT */

/* SAFTL format - Oren based DiskOnChip devices and MDOC512 Plus */
/* #define NO_SAFTL_SUPPORT */



/*---------------------------------------------------------------------
 *
 *     End of Binary Development Kit Stand Alone Customization Area
 *
 *---------------------------------------------------------------------*/

/*---------------------------------------------------------------------*/
/* general constant                                                    */
/*---------------------------------------------------------------------*/

#define BDK_MIN(a,b)   ((a) < (b) ? (a) : (b))

/*---------------------------------------------------------------------*/
/* The maximum number of binary partitions                             */
/*---------------------------------------------------------------------*/

#ifndef BINARY_PARTITIONS
#define BINARY_PARTITIONS  3 * SOCKETS /* for backwards compatibility */
#endif

/*---------------------------------------------------------------------*/
/* The maximum number of floors allowed for binary partition           */
/*---------------------------------------------------------------------*/

#define FL_MAX_NO_OF_FLOORS          4


/*-------------------------- BDK Global Status Values --------------------*/
#define BDK_S_INIT          0    /* uninitialized binary partition record */
#define BDK_S_DOC_FOUND     0x01 /* DiskOnChip device was found           */
#define BDK_S_HEADER_FOUND  0X04 /* Partition information was found       */
#define BDK_S_INFO_FOUND    0x08 /* Sub partition information was found   */
/*------------------------------------------------------------------------*/

/*-------------------------- BDK General Constants --------------------*/
#define BDK_PAGE_MASK                (BDK_PAGE_SIZE-1)
#define BDK_NO_OF_SECTORS_PER_PAGE   (BDK_PAGE_SIZE>>FL_SECTOR_SIZE_BITS)

#define SIGNATURE_LEN                   8
#define SIGNATURE_NUM                   3
#define ANAND_LEN                       5
#define BDK_INVALID_VOLUME_HANDLE       0xff
#define BDK_HEADERS_SPACING             4
#define BDK_NO_OF_MEDIA_HEADERS         2
/*------------------------------------------------------------------------*/

/*-------------------------- SAFTL Volume Flags Constants ----------------*/
#define BDK_SAFTL_BINARY                0x02000000L
#define BDK_SAFTL_ADVANCED_MATCHING     0x00100000L
#define BDK_SAFTL_REL_PARTITION         0x00200000L
#define BDK_SAFTL_FAST_PARTITION        0x00400000L
#define BDK_SAFTL_NO_MATCHING           0x00800000L
/*------------------------------------------------------------------------*/

#if defined(BDK_ACCESS) || defined(MTD_STANDALONE)

/*------------------------------------------------------------------------*/
/* Global binary partition data structures                                */
/*------------------------------------------------------------------------*/

typedef struct { 
   FLByte  signBuffer[SIGNATURE_LEN*(MAX_NUMBER_OF_PLANES+1)];  /* signature of binary sub partition  */
#ifndef FL_NO_BDK_PARTIAL_PAGE_ACCESS
   FLByte  readBuffer[FL_SECTOR_SIZE];
#endif /* FL_NO_BDK_PARTIAL_PAGE_ACCESS */
#ifndef FL_READ_ONLY
#ifndef FL_NO_BDK_PARTIAL_PAGE_ACCESS
   FLByte  userCacheData[BDK_PAGE_SIZE];
   FLWord  userCacheLength;   
#endif /* FL_NO_BDK_PARTIAL_PAGE_ACCESS */   
   CardAddress curUpdateImageAddress; /* current address to write to         */
   FLDword curUpdateImageSector;  /* current sector to write to              */
   FLDword actualUpdateLen;       /* length needed to be write               */
   FLWord  curUpdateImageBlock;   /* current block number to write to        */
   FLByte  updateImageFlag;/* BDK_COMPLETE_IMAGE_UPDATE \ ERASE_BEFORE_WRITE */
#endif /* FL_READ_ONLY */
#ifdef HW_PROTECTION
   FLByte  protectionArea;        /* protection area no protecting the volume */
   FLWord  protectionType;        /* PROTECTABLE , CHANGEABLE_PROTECTION      */
#endif /* HW_PROTECTION */
   FLByte  bdkGlobalStatus;       /* BDK global status variable         */
   FLWord  startPartitionBlock, endPartitionBlock; /* partition boundries     */
   FLWord  startImageBlock, endImageBlock;         /* sub partition boundries */
   FLWord  curReadImageBlock;   /* current block number to read from        */
   FLDword  curReadImageSector; /* current block number to read from        */
   FLWord  blockPerFloor;       /* Blocks per floor                         */
   FLWord  bdkSavedStartUnit;   /* Last Start Unit used for get info        */
   FLDword bootImageSize;       /* available sub binary partition size      */
   FLDword realBootImageSize;   /* size used by an image on the sub partition */
   FLDword actualReadLen;       /* length needed to be read                 */
   FLDword bdkDocWindow;        /* DiskOnChip window start address          */
   CardAddress curReadOffset;   /* current address to read from             */
   FLByte  sectorsInUnitBits;   /* number of sectors in unit shift          */
   FLDword sectorsInUnitMask;   /* Mask for the number of sector in a unit  */
   FLDword erasableBlockBits;   /* number of bits used to represen a block  */
   FLDword MTDFlags;            /* Partition MTD flags                      */
   FLFlash * flash;             /* flash record representing the media      */
   FLWord firstUsableBlock[FL_MAX_NO_OF_FLOORS];
} BDKVol;

⌨️ 快捷键说明

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