libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / include / sflash.h
blob95d1b64bd16accd8a694c18c2b0ee4a44dd3c0f3
1 /*
2 * Broadcom SiliconBackplane chipcommon serial flash interface
4 * Copyright 2006, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
12 * $Id: sflash.h,v 1.1.1.8 2006/02/27 03:43:16 honor Exp $
15 #ifndef _sflash_h_
16 #define _sflash_h_
18 #include <typedefs.h>
19 #include <sbchipc.h>
21 struct sflash {
22 uint blocksize; /* Block size */
23 uint numblocks; /* Number of blocks */
24 uint32 type; /* Type */
25 uint size; /* Total size in bytes */
28 /* Utility functions */
29 extern int sflash_poll(chipcregs_t *cc, uint offset);
30 extern int sflash_read(chipcregs_t *cc, uint offset, uint len, uchar *buf);
31 extern int sflash_write(chipcregs_t *cc, uint offset, uint len, const uchar *buf);
32 extern int sflash_erase(chipcregs_t *cc, uint offset);
33 extern int sflash_commit(chipcregs_t *cc, uint offset, uint len, const uchar *buf);
34 extern struct sflash * sflash_init(chipcregs_t *cc);
36 #endif /* _sflash_h_ */