NetBurner 3.1
SSL/VerifyPeerEffs/src/flashChip/AM29LV160B.h
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
5 
6 /*------------------------------------------------------------------------------
7  * EFFS-STD configuration file for Spansion AM29LV160B flash chip. This file is
8  * part of an example that allocates 512kB of flash space to the file system,
9  * and the rest to the application.
10  *
11  * Note: The AM29LV160B is identical to the Spansion S29AL016D.
12  *
13  * To modify the amount of space allocated to the file system:
14  *
15  * 1. Change the definition in this file: #define FS_SIZE ( 1024 * 1024 )
16  * 2. Change the compcode memory address range for the application in your
17  * NBEclipse project settings so that the end of the application space does
18  * not exceed the start of the file system space. See the EFFS Programmer's
19  * Guide for details, and the header comments in main.cpp of this example
20  * on how to make the changes in the NBEclipse project.
21  * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
22  * to your NBEclipse project C/C++ build linker library options. See the header
23  * comments in main.cpp for this example on how to add the library in the
24  * NBEclipse project.
25  *----------------------------------------------------------------------------*
26 
27 #ifndef _ONCHIPFLASH_H_
28 #define _ONCHIPFLASH_H_
29 
30 #include "file/fsf.h"
31 #include "basictypes.h"
32 #include "hal.h"
33 
34 
38 extern int fs_phy_OnChipFlash( FS_FLASH *flash );
39 
40 
41 #define FLASH_NAME "S29AL016/AMDLV160"
42 
43 
47 #define FS_FLASHBASE ( 0xFFC00000 )
48 
49 
109 #define BLOCKSIZE ( 64 * 1024 ) // Use only the 64k sectors
110 #define SECTORSIZE ( 16 * 1024 ) // 4 sectors per block
111 #define SECTORPERBLOCK ( BLOCKSIZE / SECTORSIZE )
112 
113 
114 /*
115  * Specify the total amount of flash memory in the system, and the amount
116  * allocated to be used by the file system (the rest is used by the
117  * application).
118  */
119 #define FLASH_SIZE ( 2 * 1024 * 1024 ) // Size of total flash in the
120  // system, 2MB
121 #define FS_SIZE ( 512 * 1024 ) // Amount allocated to file
122  // system, 512kB
123 //#define FS_SIZE ( 1024 * 1024 ) // Amount allocated to file
124  // system, 1MB
125 #define FIRST_ADDR ( FLASH_SIZE - FS_SIZE ) // First file system address to
126  // use in the flash
127 #define BLOCKSTART ( 2 ) // First block where file system
128  // data starts (first 2
129  // blocks are DESCRIPTORS)
130 
131 
132 /*
133  * Descriptor Blocks:
134  * These blocks contain critical information about the file system, block
135  * allocation, wear information, and file/directory information. At least two
136  * descriptor blocks must be included in the system, which can be erased
137  * independently. An optional descriptor write cache may be configured which
138  * improves the performance of the file system. Please refer to the EFFS-STD
139  * implementation guide for additional information.
140  */
141 #define DESCSIZE ( 8 * 1024 ) // Size of one descriptor
142 #define DESCBLOCKSTART ( 0 ) // Position of first descriptor
143 #define DESCBLOCKEND ( 1 ) // Position of last descriptor
144 #define DESCCACHE ( 2048 )
145 
146 
147 #endif /* _ONCHIPFLASH_H_ */