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

📄 defs.h

📁 H3 M-system NAND flash driver in Linux OS, M-DOC driver
💻 H
字号:
/****************************************************************************** *                                                                            * * 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/DocDriver/TrueFFS BD/src/defs.h-arc  $
 * 
 *    Rev 1.3   Oct 09 2006 14:05:18   yaniv.iarovici
 * Removed legacy devices related code and definitions
 * 
 *    Rev 1.2   Sep 11 2006 13:45:12   yaniv.iarovici
 * Legal header added
 * 
 *    Rev 1.1   Aug 22 2006 13:22:40   Yaniv.Iarovici
 * 1) Remove decleration fo 'void flInitGlobalVars(void)'
 * 2) Add 'extern "c"' on:
 * 	- flIdentifyFlash() external definition
 * 	- flHandleConversionTable[] external definition
 * 	- _flInit() definition
 * 
 *    Rev 1.0   Aug 08 2006 15:47:24   Polina.Marimont
 * Initial revision.
 */

#ifndef _DEFS_H
#define _DEFS_H


/*=============================================================*/
/* from flsocket.h */
#include "flbuffer.h"

#define ATTRIBUTE_SPACE_MAPPED   0x8000
#define UNDEFINED_MAPPING        0x7fff


typedef enum {PowerOff, PowerGoingOff, PowerOn} PowerState;

extern FLByte noOfSockets;    /* No. of drives actually registered */

typedef struct tSocket FLSocket;
/*=============================================================*/

/*=============================================================*/
/* from _flsoc.h */
struct tSocket {
  unsigned        volNo;         /* Volume no. of socket */

  PowerState      DPDState;      /* Actual DPD state */
#ifdef FL_VERIFY_WRITE
  FLByte          verifyWrite;   /* VerifyWrite mode                               */
#endif /* FL_VERIFY_WRITE */
  FLBoolean       remapped;      /* set to TRUE whenever the socket window is moved */

  void            (*powerOnCallback)(void *flash); /* Notification routine for Vcc on */
  void *          flash;         /* Flash object for callback */

  struct {                       /* Window state                     */
    unsigned int  baseAddress;   /* Physical base as a 4K page       */
    unsigned int  currentPage;   /* Our current window page mapping  */
    void FAR0 *   base;          /* Pointer to window base           */
    FLSDword      size;          /* Window size (must by power of 2) */
    unsigned      speed;         /* in nsec.                         */
    unsigned      busWidth;      /* 8 or 16 bits                     */
  } window;
  FLBoolean (*cardDetected)(FLSocket * pVol);
  void (*VccOn)(FLSocket * pVol);
  void (*VccOff)(FLSocket * pVol);
  FLStatus (*initSocket)(FLSocket * pVol);
  void (*setWindow)(FLSocket * pVol);
  void (*setMappingContext)(FLSocket * pVol, unsigned page);
  FLBoolean (*getAndClearCardChangeIndicator)(FLSocket * pVol);
  FLBoolean (*writeProtected)(FLSocket * pVol);
  void (*updateSocketParams)(FLSocket * pVol, void FAR1 *params);
#ifdef FL_EXIT
  void (*freeSocket)(FLSocket * pVol);
#endif
};


/* See interface documentation of functions in socket.c */

extern FLStatus updateSocketParameters(FLSocket *, void FAR1 *);


extern FLSocket* flSocketOf(unsigned volNo);


/*=============================================================*/

/*=============================================================*/
/* from flflash.h */

/* Some useful types for mapped Flash locations */

typedef volatile FLByte FAR0 * FlashPTR;
typedef volatile unsigned short int FAR0 * FlashWPTR;
typedef volatile FLDword FAR0 * FlashDPTR;
typedef FLWord FlashType;        /* JEDEC id */
typedef volatile FLByte FAR0* NDOC2window;

typedef FLByte Reg8bitType;
typedef FLWord Reg16bitType;


/* Media types */
#define H3_TYPE                   15

/* protection specific defintions */
#define PROTECTION_KEY_LENGTH    8 /* Size of protection key in bytes    */  
#define DEFAULT_KEY              "00000000"

/* IPL modes */
#define FL_IPL_MODE_SA          2  /* Not used any more, done automatically by */
#define FL_IPL_MODE_XSCALE      4  /* Not used any more, done automatically by */

#define FL_IPL_READ_FROM_START   0
#define FL_IPL_DOWNLOAD_AND_READ 1


/* Bit 5 Quad Redundency of IPL mode                                               */
#define FL_IPL_PAGE_QUAD_RED	32


/*************************************/
/* DMA type flags - FL_DMA_CONFIG    */
/*************************************/

/* Note: DMA_Params_S is defined in flsystyp.h */
#define DMA_OPEN_CHANNEL               0
#define DMA_CONFIG_TRANSACTION         1
#define DMA_FREE_CHANNEL               2    
#define DMA_WAIT_FOR_TRANSACTION_END   3



/****************************/
/*   Special services API   */
/****************************/


/* Flash array identification structure */
typedef struct tFlash FLFlash;                /* Forward definition */

/*=============================================================*/


/*=============================================================*/
/* from _flflash.h */

struct tFlash {
  FLBoolean		wasIdentified;
  FlashType		type;                   
  FlashType		subType;
  FLByte		mediaType;              
  FLDword		busAccessType;            
  FLByte      if_cfg;  
  FLByte      bBusType;          
  FLWord      flags;             
  void *    mtdVars;             
  FLSocket * socket;             
  NDOC2window win;               
  void (*setPowerOnCallback)(FLFlash *);
  FLStatus (*flashRead)(FLFlash *);
  FLStatus (*setCallBack)(FLFlash *);
  FLStatus (*dismount)(FLFlash *);
  FLStatus (*prepareForPowerChanges) (FLFlash *,FLByte) ;
  FLStatus (*clearCallBack)(FLFlash *);
  FLStatus (*enterDeepPowerDownMode)(FLFlash *,FLWord state);

#ifndef FL_NO_USE_FUNC
  FLMemWindowSize FAR1* memWindowSize; /* Doc memory window size          */
  FLMemRead       FAR1* memRead;       /* Doc memory read routine         */
  FLMemWrite      FAR1* memWrite;      /* Doc memory write routine        */
  FLMemSet        FAR1* memSet;        /* Doc memory set routine          */
  FLMemRead8bit   FAR1* memRead8bit;   /* Doc memory 8 bit read routine   */
  FLMemWrite8bit  FAR1* memWrite8bit;  /* Doc memory 8 bit write routine  */
  FLMemRead16bit  FAR1* memRead16bit;  /* Doc memory 16 bit read routine  */
  FLMemWrite16bit FAR1* memWrite16bit; /* Doc memory 16 bit write routine */
  FLMemSetGetMode FAR1* memSetGetMode; /* Interleave change event -       */
                                       /* call back to plant new routines */
#endif /* FL_NO_USE_FUNC */
};

#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */

extern TFFS_DLL_API FLFlash * NAMING_CONVENTION flFlashOf(FLByte volNo);

#ifdef __cplusplus
}
#endif /* __cplusplus */

/*=============================================================*/


/*=============================================================*/
/*=== from nandefs.h */

/*=============================================================*/

#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
FLStatus _flInit(void);
void flInitGlobalVars(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */


#endif /*_DEFS_H*/


⌨️ 快捷键说明

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