/***********************************************************************
* $Workfile: sdk7a404_strataflash.h $
* $Revision: 1.1 $
* $Author: WellsK $
* $Date: Sep 08 2003 09:55:32 $
*
* Project: StrataFlash structure, definitions, and functions
*
* Description:
* This file contains structures, defines, and function prototypes
* used to program StrataFlash devices on the SDK7A404 boards.
*
* Revision History:
* $Log: //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/csps/lh7a404/bsps/sdk7a404/include/sdk7a404_strataflash.h-arc $
*
* Rev 1.1 Sep 08 2003 09:55:32 WellsK
* Corrected multiple file inclusion defines.
*
* Rev 1.0 Sep 04 2003 15:51:34 WellsK
* Initial revision.
*
*
***********************************************************************
* SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
* OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
* AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES,
* SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
*
* SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY
* FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A
* SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
* FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
*
* COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
* CAMAS, WA
**********************************************************************/
#ifndef SDK7A404_STRATAFLASH_H
#define SDK7A404_STRATAFLASH_H
#include "abl_types.h"
/* Detect the number of CFI devices and the configuration */
BOOL_32 cfi_detect(volatile UNS_32 *addr);
/* Return the (combined) device size in bytes */
UNS_32 cfi_getdevsize(void);
/* Clear a block lock */
void cfi_clear_block_lock(UNS_32 block);
/* Set a block lock */
void cfi_set_block_lock(UNS_32 block);
/* Returns the total number of blocks in FLASH */
UNS_32 cfi_get_block_count(void);
/* Returns the starting address of the block */
UNS_32 cfi_get_block_address(UNS_32 block);
/* Returns the size of the block */
UNS_32 cfi_get_block_size(UNS_32 block);
/* Returns the size of the write buffer */
UNS_32 cfi_get_wb_size(void);
/* Returns the block number for the passed address */
UNS_32 cfi_get_block_from_address(UNS_32 *addr);
/* Erases a block of FLASH */
void cfi_erase_block(UNS_32 block);
/* Erases the entire FLASH device */
void cfi_erase_device(void);
/* Write a single value (32-bits) to the FLASH devices */
void cfi_writeword(volatile UNS_32 *addr,
UNS_32 val);
/* Return FLASH devices to normal mode */
void cfi_exitprog_mode(volatile UNS_32 *addr);
/* Write data to FLASH (using buffer) */
INT_32 cfi_write_to_buffer(UNS_32 *src,
volatile UNS_32 *dest,
INT_32 words);
#endif /* SDK7A404_STRATAFLASH_H */