2007-05-04 22:13:42 +00:00
|
|
|
/*
|
|
|
|
* Broadcom SiliconBackplane chipcommon serial flash interface
|
|
|
|
*
|
2008-01-06 19:28:07 +00:00
|
|
|
* Copyright 2007, Broadcom Corporation
|
2007-05-04 22:13:42 +00:00
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
|
|
|
|
* KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
|
|
|
|
* SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
|
|
* FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
|
|
|
|
*
|
2008-01-06 19:28:07 +00:00
|
|
|
* $Id$
|
2007-05-04 22:13:42 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _sflash_h_
|
|
|
|
#define _sflash_h_
|
|
|
|
|
|
|
|
#include <typedefs.h>
|
|
|
|
#include <sbchipc.h>
|
2008-01-06 19:28:07 +00:00
|
|
|
#include <sbutils.h>
|
2007-05-04 22:13:42 +00:00
|
|
|
|
|
|
|
struct sflash {
|
|
|
|
uint blocksize; /* Block size */
|
|
|
|
uint numblocks; /* Number of blocks */
|
|
|
|
uint32 type; /* Type */
|
|
|
|
uint size; /* Total size in bytes */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Utility functions */
|
2008-01-06 19:28:07 +00:00
|
|
|
extern int sflash_poll(sb_t *sbh, chipcregs_t *cc, uint offset);
|
|
|
|
extern int sflash_read(sb_t *sbh, chipcregs_t *cc,
|
|
|
|
uint offset, uint len, uchar *buf);
|
|
|
|
extern int sflash_write(sb_t *sbh, chipcregs_t *cc,
|
|
|
|
uint offset, uint len, const uchar *buf);
|
|
|
|
extern int sflash_erase(sb_t *sbh, chipcregs_t *cc, uint offset);
|
|
|
|
extern int sflash_commit(sb_t *sbh, chipcregs_t *cc,
|
|
|
|
uint offset, uint len, const uchar *buf);
|
|
|
|
extern struct sflash *sflash_init(sb_t *sbh, chipcregs_t *cc);
|
2007-05-04 22:13:42 +00:00
|
|
|
|
|
|
|
#endif /* _sflash_h_ */
|