/* $Id: xflash_properties.h,v 1.4 2002/03/09 00:14:46 moleres Exp $ */
/******************************************************************************
*
*       XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"
*       AS A COURTESY TO YOU, SOLELY FOR USE IN DEVELOPING PROGRAMS AND
*       SOLUTIONS FOR XILINX DEVICES.  BY PROVIDING THIS DESIGN, CODE,
*       OR INFORMATION AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE,
*       APPLICATION OR STANDARD, XILINX IS MAKING NO REPRESENTATION
*       THAT THIS IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,
*       AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE
*       FOR YOUR IMPLEMENTATION.  XILINX EXPRESSLY DISCLAIMS ANY
*       WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE
*       IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR
*       REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF
*       INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
*       FOR A PARTICULAR PURPOSE.
*
*       (c) Copyright 2002 Xilinx Inc.
*       All rights reserved.
*
******************************************************************************/
/*****************************************************************************/
/**
*
* @file xflash_properties.h
*
* This is a helper component for XFlash. It contains various datum
* common to flash devices most of which can be derived from the CFI query.
*
* @note
*
* There is no implementation file with this component.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver   Who  Date     Changes
* ----- ---- -------- -----------------------------------------------
* 1.00a rmm  07/16/01 First release
* </pre>
*
***************************************************************************/

#ifndef XFLASH_PROPERTIES_H /* prevent circular inclusions */
#define XFLASH_PROPERTIES_H /* by using protection macros */

/***************************** Include Files *********************************/
#include "xbasic_types.h"
#include "xstatus.h"

/************************** Constant Definitions *****************************/


/**************************** Type Definitions *******************************/

/**
 * Flash timing
 */
typedef struct
{
    Xuint16 WriteSingle_Us;         /**< Time to program a single word unit
                                       Units are in microseconds */
    Xuint16 WriteBuffer_Us;         /**< Time to program the contents of the
                                       write buffer. Units are in microseconds
                                       If the part does not support write
                                       buffers, then this value should be
                                       zero */
    Xuint16 EraseBlock_Ms;          /**< Time to erase a single block
                                       Units are in milliseconds */
    Xuint16 EraseChip_Ms;           /**< Time to perform a chip erase
                                       Units are in milliseconds */
} XFlashTiming;

/**
 * Flash identification
 */
typedef struct
{
    Xuint8  ManufacturerID;         /**< Manufacturer of parts */
    Xuint8  DeviceID;               /**< Part number of manufacturer */
    Xuint16 CommandSet;             /**< Command algorithm used by part. Choices
                                       are defined in XFL_CMDSET constants */
} XFlashPartID;

/**
 * Programming parameters
 */
typedef struct
{
    Xuint32 WriteBufferSize;         /**< Number of bytes that can be programmed
                                        at once */
    Xuint32 WriteBufferAlignmentMask;/**< Alignment of the write buffer */
    Xuint32 EraseQueueSize;          /**< Number of erase blocks that can be
                                        queued up at once */
} XFlashProgCap;


/**
 * Consolidated parameters
 */
typedef struct
{
    XFlashPartID  PartID;            /**< Uniquely identifies the part */
    XFlashTiming  TimeTypical;       /**< Typical timing data */
    XFlashTiming  TimeMax;           /**< Worst case timing data */
    XFlashProgCap ProgCap;           /**< Programming capabilities */
} XFlashProperties;

/************************** Function Prototypes ******************************/

#endif            /* end of protection macro */
