strata.h

来自「i.mx27 soc for wince 6.0」· C头文件 代码 · 共 130 行

H
130
字号
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on
// your install media.
//
//-----------------------------------------------------------------------------
//
// Copyright (C) 2004,	Motorola Inc. All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Copyright (C) 2004-2006, Freescale Semiconductor, Inc. All Rights Reserved.
// THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
// AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT
//
//------------------------------------------------------------------------------
//
// Header: strata.h
//
// Provides Intel Strata flash specific definitions.
//
//------------------------------------------------------------------------------
#ifndef	__MX27_NORFLASH_STRATA_H__
#define	__MX27_NORFLASH_STRATA_H__

#ifdef __cplusplus
extern "C" {
#endif

//------------------------------------------------------------------------------
// Defines
// Intel's flash manufacturing code
#define INTEL_MFG_ID                         0x0089
#define INTEL_MFG_ID_x16                     INTEL_MFG_ID
#define INTEL_MFG_ID_x16_x2                  ((INTEL_MFG_ID << 16) | INTEL_MFG_ID)

// Maximum dataum for buffer prog
#define INTEL_BUF_PROG_MAX_DATUM			 32

//
// Intel 28F320 flash commands and status definitions.
//
// Commands.
#define READ_IDENT_CMD                       0x0090
#define READ_MFGCODE_ADDR		             0x0
#define READ_DEVCODE_ADDR		             0x1

#define READ_ARRAY_CMD			             0x00FF
#define BYTEWORD_PROGRAM_CMD                 0x0040
#define CLEAR_STATUS_CMD                     0x5050
#define READ_STATUS_CMD			             0x7070
#define BLOCK_LOCK_CMD                       0x0060
#define BLOCK_PROCEED_CMD		             0x00D0
#define BLOCK_SETLOCK_CMD		             0x0001
#define BLOCK_ERASE_CMD			             0x0020
#define BUFFER_WRITE_CMD		             0x00E8

// Status.
#define STATUS_ERROR_LOCKED                  0x0002
#define STATUS_ERROR_VOLTAGE                 0x0008
// Can mean either erase or set lock bit error
#define STATUS_ERROR_SR4                     0x0010
// Can mean either program or clear lock bit error
#define STATUS_ERROR_SR5                     0x0020
#define STATUS_ERROR_COMMAND                 0x0030
#define STATUS_READY_MASK		             0x0080

//------------------------------------------------------------------------------
// Types
#pragma pack(1)
// Intel Primary Vendor-Specific Extended Query 
typedef struct _INTEL_PET_QUERY {
    CHAR ID[3];
    UCHAR VersionMajor;
    UCHAR VersionMinor;
    struct {
        UCHAR ChipEraseSupport:1;
        UCHAR SuspendEraseSupport:1;
        UCHAR suspendProgramSupport:1;
        UCHAR LegacyLockUnlockSupport:1;
        UCHAR QueuedEraseSupport:1;
        UCHAR IndvBlockLockSupport:1;
        UCHAR ProtectionBitsSupport:1;
        UCHAR PageModeReadSupport:1;

        UCHAR SyncReadSupport:1;
        UCHAR Byte2Reserved:7;
        UCHAR Byte3Reserved;
        UCHAR Byte4Reserved;
    } FeatureSupport;
    struct {
        UCHAR ProgAfterSuspendSupport:1;
        UCHAR Reserved:7;
    } AfterSuspendFuncSupport;
    struct {
        UCHAR BSRLockBit:1;
        UCHAR BSRValidBit:1;
        UCHAR Byte1Reserved:6;

        UCHAR Byte2Reserved;
    } BSRMaskSupport;
    UCHAR VccOpt;   // bits 7-4 Volts(BCD), bits 3-0 100 mVolts (BCD)
    UCHAR VppOpt;   // bits 7-4 Volts(Hex), bits 3-0 100 mVolts (BCD)
} INTEL_PET_QUERY_INFO, *PINTEL_PET_QUERY_INFO;
#pragma pack()

//------------------------------------------------------------------------------
// Functions
// Intel Strata flash driver (x16 devices)
void StrataX16_RelocateBegin(void);
BOOL StrataX16_IsFlashSupported(NOR_FLASH_DESC *pFlashDesc);
BOOL StrataX16_Program(NOR_FLASH_DESC *pFlashDesc, ULONG ulStartAddress, UCHAR *pData, ULONG ulSize, BOOL bIgnore0to1);
BOOL StrataX16_EraseSector(NOR_FLASH_DESC *pFlashDesc, ULONG ulSectorAddress);
void StrataX16_RelocateEnd(void);
void StrataX16_Reset(NOR_FLASH_DESC *pFlashDesc);
BOOL StrataX16_LockSector(NOR_FLASH_DESC *pFlashDesc, ULONG ulSectorAddress);
BOOL StrataX16_UnlockSector(NOR_FLASH_DESC *pFlashDesc, ULONG ulSectorAddress);
// Add other supported specific low level flash drivers here

#ifdef __cplusplus
    }
#endif

#endif // __MX27_NORFLASH_STRATA_H__

⌨️ 快捷键说明

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