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

📄 device.h

📁 此源码包为intel J3系列NorFlash的驱动程序,支持8位,16位总线宽度
💻 H
字号:
/*************************************************************************
 *** Intel Confidential                                      
 *** Copyright (C) Intel Corporation 2000                 
 *** All Rights Reserved.                                    
 *** --------------------------------------------------------------------
 ***
 *** Project Name: Flash Templates
 ***
 *** Module Name: Device 
 ***
 *** File: Device.H - J3 device specific template C header
 ***
 *** File Revision: $Revision: 6 $, $JustDate:  5/11/00 $, $Author: Kalowry $
 ***
 *** Purpose:
 ***
 ***    The purpose of this file is to establish J3 device specific
 ***    constants used at compile time and runtime.  These constants
 ***    include device layout parameters, command constants and 
 ***    function declaration flags. 
 ***
 *** $NoKeywords: $
 *************************************************************************/

#ifndef __DEVICE_H  /* ensure this file only gets included once */
#define __DEVICE_H

/* 
 * J3 specific constants
 */

/* compile flags:  set 1 flag for each and every template
 * function.  These are used at compile time to identify
 * implementation location (common.c or device.c specific)
 * of each function.
*/

/* set compile flags to identify functions which ARE 
   implemented as device specific (i.e. will use these
   device.c functions for this template ).  Setting these
   constants to TRUE indicates that common template.c
   implementations of these functions will NOT be
   used. */

#define DEVICE_ERASE_ALL_BLOCKS       TRUE
#define DEVICE_ERASE_SUSPEND          TRUE
#define DEVICE_EXTENDED_QUERY         TRUE
#define DEVICE_GET_BLOCK_ADDRESS      TRUE
#define DEVICE_LOCK_BLOCK             TRUE
#define DEVICE_LOCK_PROTECTION        TRUE
#define DEVICE_PAGE_MODE              TRUE
#define DEVICE_PROGRAM_FLASH_BUFFERED TRUE
#define DEVICE_PROGRAM_PROTECTION     TRUE
#define DEVICE_PROGRAM_SUSPEND        TRUE
#define DEVICE_READ_BLOCK_STATUS      TRUE
#define DEVICE_READ_PROTECTION        TRUE
#define DEVICE_RESUME                 TRUE
#define DEVICE_UNLOCK_ALL_BLOCKS      TRUE 

/* set compile flags to identify functions which are NOT 
   implemented as device specific (i.e. will use the 
   common.c functions for these functions */

#define DEVICE_CLEAR_STATUS           FALSE
#define DEVICE_ERASE_BLOCK            FALSE
#define DEVICE_GET_QUERY_ADDRESS      FALSE
#define DEVICE_LOCK_DOWN_BLOCK        FALSE 
#define DEVICE_PROGRAM_FLASH          FALSE
#define DEVICE_QUERY                  FALSE
#define DEVICE_READ_DEVICE_ID         FALSE
#define DEVICE_READF                  FALSE
#define DEVICE_READ_FLASH             FALSE
#define DEVICE_READ_STATUS            FALSE
#define DEVICE_SEC_EXTENDED_QUERY     FALSE
#define DEVICE_UNLOCK_BLOCK           FALSE 
#define DEVICE_WAIT_UNTIL_READY       FALSE
#define DEVICE_WRITEF                 FALSE

/* TRUE means client will implement this function external to the template */
#define CLIENT_GET_FPTR               TRUE 

/* little endian */
#define BIG_ENDIAN_ARCHITECTURE       FALSE

/* set 1 and Only 1 configuration to TRUE */
#define X_8                           FALSE
#define PX_16                         FALSE
#define X_16                          TRUE
#define X_32                          FALSE
#define ILX_32                        FALSE

/* set 1 and only 1 size to TRUE */
#define J3_32_M                       FALSE
#define J3_64_M                       FALSE
#define J3_128_M                      TRUE

/* ERASE_TIMEOUT_CYCLES = # of times to check for status ready after erase
  commands are issued to the device */
#define TMPL_ERASE_TIMEOUT            2000000L  

/* PROGRAM_TIMEOUT_CYCLES = # of times to check for status ready after 
   program commands are issued to the device */
#define TMPL_PROGRAM_TIMEOUT          1000000L

#define TMPL_BLOCKSTAT_UNLOCKED       0x0
#define TMPL_BLOCKSTAT_LOCKED         0x1
#define TMPL_BLOCKSTAT_LOCKEDDOWN     0x3

#define TMPL_PROTECTION_LOCK_LOCATION 0x0

/******************** 32M ********************/
#if J3_32_M
	#define TMPL_TOTAL_NUMBLOCKS      0x20 
	#define TMPL_BLOCK_NUMBYTES       0x20000 
	#define TMPL_TOTAL_SIZE           0x400000 
	#define TMPL_BLOCK_MASK           0xFFFF
#endif /* J3_32_M */

/******************** 64M ********************/
#if J3_64_M
	#define TMPL_TOTAL_NUMBLOCKS      0x40 
	#define TMPL_BLOCK_NUMBYTES       0x20000 
	#define TMPL_TOTAL_SIZE           0x800000 
	#define TMPL_BLOCK_MASK           0xFFFF
#endif /* J3_64_M */

/******************** 128M *******************/
#if J3_128_M
	#define TMPL_TOTAL_NUMBLOCKS      0x80 
	#define TMPL_BLOCK_NUMBYTES       0x20000 
	#define TMPL_TOTAL_SIZE           0x1000000 
	#define TMPL_BLOCK_MASK           0xFFFF
#endif /* J3_128_M */


#if X_8
	#define TMPL_OTP_NUMWORDS         0x9
	#define TMPL_OTP_BASE             0x100 /* address */
	#define TMPL_OTP_PROGRAM          0xC0
	#define TMPL_OTP_READ             0x90
	#define TMPL_OTP_LOCK             0xFD
	#define TMPL_LOCKDOWN_BIT_SET     0x2F
	#define TMPL_LOCK_BIT_SET         0x01  /* 2nd cycle lock bit command */
	#define TMPL_LOCK_BIT_CLEAR       0xD0  /* 2nd cycle lock bit command */
	#define TMPL_BLOCK_SUSPEND        0xB0
	#define TMPL_BLOCK_RESUME         0xD0
#endif


#if X_16
	#define TMPL_OTP_NUMWORDS         0x9
	#define TMPL_OTP_BASE             0x100  /* address */
	#define TMPL_OTP_PROGRAM          0x00C0
	#define TMPL_OTP_READ             0x0090
	#define TMPL_OTP_LOCK             0xFFFD
	#define TMPL_LOCKDOWN_BIT_SET     0x002F
	#define TMPL_LOCK_BIT_SET         0x0001 /* 2nd cycle lock bit command */
	#define TMPL_LOCK_BIT_CLEAR       0x00D0 /* 2nd cycle lock bit command */
	#define TMPL_BLOCK_SUSPEND        0x00B0
	#define TMPL_BLOCK_RESUME         0x00D0
#endif



/********************************************************************
	PRODUCT SPECIFIC DATA DEFINES
********************************************************************/
#if X_8
	#define TMPL_BUFFER_SIZE          0x20         /* bytes */ 
	#define TMPL_WRITE_TO_BUFFER      0xE8
	#define TMPL_SET_READ_CONFIG      0x03
#endif

#if X_16
	#define TMPL_BUFFER_SIZE          0x20         /* bytes */ 
	#define TMPL_WRITE_TO_BUFFER      0x00E8
	#define TMPL_SET_READ_CONFIG      0x0003
#endif



/* defined for all data widths. added to flash base address. contains A16..A1 */
#define TMPL_STD_READ_MODE            0x0000
#define TMPL_PAGE_READ_MODE           0x8000


/*
 * device specific typedefs
 */

/* extended query structure */
typedef struct TMPL_ExtQueryData {
	char   ExtQueryStr[4];        /* 3 bytes + null */
	UINT8  MajorVersionNum;       /* 1 byte */
	UINT8  MinorVersionNum;       /* 1 bytes */
	UINT32 OptionalFeature;       /* 4 bytes */
	UINT8  AfterSuspendFunctions; /* 1 byte */
	UINT16 BlockLockStatus;       /* 2 bytes */
	UINT8  VccOptimum;            /* 1 byte */
	UINT8  VppOptimum;            /* 1 byte */
} TMPL_extquery;


#endif  /* __DEVICE_H */

⌨️ 快捷键说明

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