NetBurner 3.1
_common/EFFS/STD/src/flashChip/S29GL032.h
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
5 
6 /*------------------------------------------------------------------------------
7  * EFFS-STD configuration file for Spansion S29GL032A 4MByte flash chip. This file is
8  * part of an example that allocates 1MB of flash space to the file system,
9  * and the rest to the application.
10  *
11  * To modify the amount of space allocated to the file system:
12  *
13  * 1. Change the definition in this file: #define FS_SIZE ( 1024 * 1024 )
14  * 2. Change the compcode memory address range for the application in your
15  * NBEclipse project settings so that the end of the application space does
16  * not exceed the start of the file system space. See the EFFS Programmer's
17  * Guide for details, and the header comments in main.cpp of this example
18  * on how to make the changes in the NBEclipse project.
19  * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
20  * to your NBEclipse project C/C++ build linker library options. See the header
21  * comments in main.cpp for this example on how to add the library in the
22  * NBEclipse project.
23  *----------------------------------------------------------------------------*/
24 
25 #ifndef _ONCHIPFLASH_H_
26 #define _ONCHIPFLASH_H_
27 
28 #include "file/fsf.h"
29 #include "basictypes.h"
30 #include "hal.h"
31 
32 #define FLASH_NAME "S29GL032A"
33 
34 extern int fs_phy_OnChipFlash( FS_FLASH *flash );
35 
36 
37 /* Start of flash memory base address */
38 #define FS_FLASHBASE ( 0xFF800000 )
39 
40 
97 #define BLOCKSIZE ( 64 * 1024 ) // Use only the 64k sectors
98 #define SECTORSIZE ( 16 * 1024 ) // 4 sectors per block
99 #define SECTORPERBLOCK ( BLOCKSIZE / SECTORSIZE )
100 
101 
102 /*
103  * Specify the total amount of flash memory in the system, and the amount
104  * allocated to be used by the file system (the rest is used by the
105  * application).
106  */
107 #define FLASH_SIZE ( 4 * 1024 * 1024 ) // Size of total flash in the system, 4MB
108 #define FS_SIZE ( 1024 * 1024 ) // Amount allocated to file system, 1MB
109 #define FIRST_ADDR ( FLASH_SIZE - FS_SIZE ) // First file system address to use in the flash
110 #define BLOCKSTART ( 2 ) // First block where file system data starts (first 2 blocks are DESCRIPTORS)
111 
112 
113 /*
114  * Descriptor Blocks:
115  * These blocks contain critical information about the file system, block
116  * allocation, wear information, and file/directory information. At least two
117  * descriptor blocks must be included in the system, which can be erased
118  * independently. An optional descriptor write cache may be configured which
119  * improves the performance of the file system. Please refer to the EFFS-STD
120  * implementation guide for additional information.
121  */
122 #define DESCSIZE ( 8 * 1024 ) // Size of one descriptor
123 #define DESCBLOCKSTART ( 0 ) // Position of first descriptor
124 #define DESCBLOCKEND ( 1 ) // Position of last descriptor
125 #define DESCCACHE ( 2048 )
126 
127 
128 #endif /* _ONCHIPFLASH_H_ */
Embedded Flash File System API - STD.
NetBurner Hardware Abstraction Layer (HAL)