NetBurner 3.1
EFFS/Std/Http/src/flashChip/MCF5282Flash.h
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
5 
6 /*------------------------------------------------------------------------------
7  * EFFS-STD configuration file for MOD5282 processor flash memory. This file is part
8  * of an example that allocates 64kB of flash space to the file system, and the
9  * 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 ( 64 * 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 "MCF5282" // Processor name, not module name
40 
41 
45 #define FS_FLASHBASE ( 0xFFC00000 )
46 
47 
103 #define BLOCKSIZE ( 4 * 1024 ) // All sectors are 4KB
104 #define SECTORSIZE ( 512 ) // 8 sectors per block
105 #define SECTORPERBLOCK ( BLOCKSIZE / SECTORSIZE )
106 
107 
108 /*
109  * Specify the total amount of flash memory in the system, and the amount
110  * allocated to be used by the file system (the rest is used by the
111  * application).
112  */
113 #define FLASH_SIZE ( 512 * 1024 ) // Size of total flash in the
114  // system, 512kB
115 #define FS_SIZE ( 64 * 1024 ) // Amount allocated to file
116  // system, 64kB
117 #define FIRST_ADDR ( FLASH_SIZE - FS_SIZE ) // First file system address to
118  // use in the flash
119 #define BLOCKSTART ( 2 ) // First block where file system
120  // data starts (first 2
121  // blocks are DESCRIPTORS)
122 
123 
124 /*
125  * Descriptor Blocks:
126  * These blocks contain critical information about the file system, block
127  * allocation, wear information, and file/directory information. At least two
128  * descriptor blocks must be included in the system, which can be erased
129  * independently. An optional descriptor write cache may be configured which
130  * improves the performance of the file system. Please refer to the EFFS-STD
131  * implementation guide for additional information.
132  */
133 #define DESCSIZE ( 4 * 1024 ) // Size of one descriptor
134 #define DESCBLOCKSTART ( 0 ) // Position of first descriptor
135 #define DESCBLOCKEND ( 1 ) // Position of last descriptor
136 #define DESCCACHE ( 1024 )
137 
138 
139 #endif /* _ONCHIPFLASH_H_ */