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

📄 docbdk.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/3/bddoc/src/docbdk.h-arc  $
 * 
 *    Rev 1.7   Sep 11 2006 13:45:12   yaniv.iarovici
 * Legal header added
 * 
 *    Rev 1.6   Aug 09 2006 16:52:46   Polina.Marimont
 * initial for DOC Driver 1.0
 * 
 */

/************************************************************************/
/* 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           */
/************************************************************************/

/*****************************************************************************
* File Header                                                                *
* -----------                                                                *
* Name : docbdk.h                                                            *
*                                                                            *
* Description : This file contains the binary partition defintions , data    *
*               structures and function prototypes.                          *
*                                                                            *
* Note : The file exports 2 interfaces each under its own compilation flag:  *
*                                                                            *
*        BDK package - Standalone package that exports routines for binary   *
*                      partitions handling(MTD_STANDALONE compilation flag). *
*        OSAK module - Separated module of the OSAK package that exports a   *
*                      common entry point to the same routines. (BDK_ACCESS  *
*                      compilation flag).                                    *
*                                                                            *
* Warning : Do not use this file with the BDK_ACCESS compilation flag unless *
*           you own the full OSAK package.                                   *
*****************************************************************************/

#ifndef DOCBDK_H
#define DOCBDK_H
/*---------------------------------------------------------------------*/
/* Include the proper header files.                                    */
/*---------------------------------------------------------------------*/

#include "flcommon.h"

#ifndef MTD_STANDALONE
#ifdef BDK_ACCESS
#include "flstruct.h"
#endif /* BDK_ACCESS */
#endif /* MTD_STANDALONE */

/* Use the define bellow to set the size of the page buffer used by the BDK */
#ifndef BDK_SECTORS_PER_PAGE
#define BDK_SECTORS_PER_PAGE		  (8L /* 2KB PAGE */)
#endif /* BDK_SECTORS_PER_PAGE */

#ifndef BDK_SECTORS_PER_WRITE
#define BDK_SECTORS_PER_WRITE        (4L/*Planes*/*BDK_SECTORS_PER_PAGE/*Sectors per page*/*2/*MLC*/)
#endif /* BDK_SECTORS_PER_WRITE */


/* BDK specific flag area */
#define ERASE_BEFORE_WRITE              8
#define BDK_SPARE_BLOCKS_SIGN           "S4BB" /* Must be the same as BINARY_SPARE_BLOCKS_SIGN (FLFORMAT.H) */


/*----------------------------------------------------------------------*/
/*                b d k F i n d D i s k O n C h i p                     */
/*                                                                      */
/* Find and identify DiskOnChip device if installed in the system. The	*/
/*search address are set by the flregisterDOCXXXSOC call in flcustom.c  */
/*file.												                    */
/*                                                                      */
/*                                                                      */
/* Parameters:                                                          */
/*        docAddress        : Pointer to return value of DiskOnChip		*/
/*							 address (if found).		                */
/*        docSize           : Pointer to return value of DiskOnChip		*/
/*							 address window size (if found).            */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success (DiskOnChip found)				*/
/*							otherwise for failure			            */
/*----------------------------------------------------------------------*/
FLStatus bdkFindDiskOnChip       (CardAddress FAR2 *docAddress,
								  FLDword FAR2 *docSize );
/*----------------------------------------------------------------------*/
/*						b d k I n i t				                    */
/*                                                                      */
/* Initialize the BDK SW package. This function is normaly called		*/
/*automatically by the first call to the BDK package functions.			*/
/*                                                                      */
/* Parameters:                                                          */
/*        None.                                                         */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success otherwise for failure          */
/*----------------------------------------------------------------------*/
void     bdkInit( void );

#ifdef FL_EXIT 
/*----------------------------------------------------------------------*/
/*						b d k E X i t				                    */
/*                                                                      */
/* Reset the BDK SW package. This function is normaly called as the last*/
/*reference to the BDK package, providing clean exit and clearing all	*/
/*allocated memory.														*/
/*                                                                      */
/* Parameters:                                                          */
/*        None.                                                         */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success otherwise for failure          */
/*----------------------------------------------------------------------*/
void     bdkExit                 (void);
#endif /* FL_EXIT */

/*----------------------------------------------------------------------*/
/*					b d k S e t B o o t P a r t i t i o n N o	        */
/*                                                                      */
/* Set the current BDK partition in use. The default partition is		*/
/*partition 0. For operation on other partitions, this routine should be*/ 
/*called prior to actual command. The partition set is valid until the  */
/*next time this function is called.									*/
/*                                                                      */
/* Parameters:                                                          */
/*        partitionNo	    : partition number to be access next.       */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success otherwise for failure          */
/*----------------------------------------------------------------------*/
FLStatus bdkSetBootPartitionNo   (FLByte partitionNo);

/*----------------------------------------------------------------------*/
/*				b d k G e t B o o t P a r t i t i o n I n f o	        */
/*                                                                      */
/* Get information regarding the actual size and used size of a binary  */
/*(sub) partition.														*/
/*                                                                      */
/* Parameters:                                                          */
/*        startUnit			: First block containing data (usually 0)   */
/*        partitionSize		: Pointer to output value of full			*/
/*							 sub partition size.				        */
/*        realPartitionSize	: Pointer to return value of used size.     */
/*        unitSize			: Pointer to return value of unit size.     */
/*        signature			: Signature of retrieved sub partition.     */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success otherwise for failure          */
/*----------------------------------------------------------------------*/
FLStatus bdkGetBootPartitionInfo (FLWord startUnit,
                 FLDword FAR2 *partitionSize,
                 FLDword FAR2 *realPartitionSize,
                 FLDword FAR2 *unitSize,
                 FLByte FAR2 *signature);

/*----------------------------------------------------------------------*/
/*					b d k C o p y B o o t A r e a				        */
/*                                                                      */
/* Copy data from binary partition to RAM								*/
/*                                                                      */
/* Parameters:                                                          */
/*        startAddressPtr	: Pointer to start RAM address			    */
/*        wStartUnit		: No' of first block in partition(usualy 0).*/
/*        dwAreaLen			: Length of read area.  			        */
/*        bCheckSumPtr		: Pointer to output chksum calculation.     */
/*        signPtr			: Signature of retrieved sub partition.     */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success otherwise for failure          */
/*----------------------------------------------------------------------*/
FLStatus bdkCopyBootArea         (FLByte FAR1 *startAddressPtr,
								  FLWord wStartUnit,
								  FLDword dwAreaLen,
								  FLByte FAR2 *bCheckSumPtr,
								  FLByte FAR2 *signPtr);

/*----------------------------------------------------------------------*/
/*					b d k C o p y B o o t A r e a I n i t		        */
/*                                                                      */
/* Initialize read process from BDK area. This routine must be called	*/
/*prior to any series of bdkCopyBootAreaBlock calls. The areaLen set by */
/*this routine must be total len of all calls to following				*/
/*bdkCopyBootAreaBlock calls.											*/
/*                                                                      */
/* Parameters:                                                          */
/*        startUnit		    : first unit to read (must contain data).   */
/*        areaLen			: length of bdk are to be read.		        */
/*        signature			: Signature of retrieved sub partition.     */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success otherwise for failure          */
/*----------------------------------------------------------------------*/
FLStatus bdkCopyBootAreaInit     (FLWord startUnit,
                 FLDword areaLen,
                 FLByte FAR2 *signature);

/*----------------------------------------------------------------------*/
/*					b d k C o p y B o o t A r e a B l o c k		        */
/*                                                                      */
/* read the next chunk of data from BDK area. This routine call must	*/
/*follow a call to bdkCopyBootAreaInit and cannot be used without		*/
/*proper init call.														*/
/*                                                                      */
/* Parameters:                                                          */
/*        buf			    : Buffer where to read the data.	        */
/*        bufferLen			: Length of current read buffer.	        */
/*        checkSum		    : Pointer for output ChkSum calculation of	*/
/*							 read data.							        */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success otherwise for failure          */
/*----------------------------------------------------------------------*/
FLStatus bdkCopyBootAreaBlock    (FLByte FAR1 *buf ,
                 FLDword bufferLen,
                 FLByte FAR2 *checkSum);

/*----------------------------------------------------------------------*/
/*					b d k U p d a t e B o o t A r e a I n i t	        */
/*                                                                      */
/* XXXX	*/
/* XXXX	*/
/* XXXX	*/
/*                                                                      */
/* Parameters:                                                          */
/*        xx			    : xxxx								        */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success otherwise for failure          */
/*----------------------------------------------------------------------*/
FLStatus bdkUpdateBootAreaInit   (FLWord  startUnit,
                 FLDword  areaLen,
                 FLByte updateFlag,
                 FLByte FAR2 *signature );

/*----------------------------------------------------------------------*/
/*					x	        */
/*                                                                      */

⌨️ 快捷键说明

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