NetBurner 3.1
SSL/HttpsUploadCert/src/flashChip/AT49BV163D.h
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
5 
6 /*------------------------------------------------------------------------------
7  * EFFS-STD configuration file for Atmel AT49BV163D 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  * 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 "basictypes.h"
29 #include "hal.h"
30 #include "file/fsf.h"
31 
32 
36 extern int fs_phy_OnChipFlash( FS_FLASH *flash );
37 
38 
39 #define FLASH_NAME "AT49BV163"
40 
41 
45 #define FS_FLASHBASE ( 0xFFC00000 )
46 
47 
107 #define BLOCKSIZE ( 64 * 1024 ) // Use only the 64k sectors
108 #define SECTORSIZE ( 16 * 1024 ) // 4 sectors per block
109 #define SECTORPERBLOCK ( BLOCKSIZE / SECTORSIZE )
110 
111 
112 /*
113  * Specify the total amount of flash memory in the system, and the amount
114  * allocated to be used by the file system (the rest is used by the
115  * application).
116  */
117 #define FLASH_SIZE ( 2 * 1024 * 1024 ) // Size of total flash in the
118  // system, 2MB
119 #define FS_SIZE ( 512 * 1024 ) // Amount allocated to file
120  // system, 512kB
121 #define FIRST_ADDR ( FLASH_SIZE - FS_SIZE ) // First file system address to
122  // use in the flash
123 #define BLOCKSTART ( 2 ) // First block where file system
124  // data starts (first 2
125  // blocks are DESCRIPTORS)
126 
127 
128 /*
129  * Descriptor Blocks:
130  * These blocks contain critical information about the file system, block
131  * allocation, wear information, and file/directory information. At least two
132  * descriptor blocks must be included in the system, which can be erased
133  * independently. An optional descriptor write cache may be configured which
134  * improves the performance of the file system. Please refer to the EFFS-STD
135  * implementation guide for additional information.
136  */
137 #define DESCSIZE ( 8 * 1024 ) // Size of one descriptor
138 #define DESCBLOCKSTART ( 0 ) // Position of first descriptor
139 #define DESCBLOCKEND ( 1 ) // Position of last descriptor
140 #define DESCCACHE ( 2048 )
141 
142 
143 #endif /* _ONCHIPFLASH_H_ */