NetBurner 3.1
EFFS/Std/Http/src/flashChip/MX29GL256F.h
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
5 
6 /*-------------------------------------------------------------------
7  * EFFS-STD configuration file for Macronix MX29GL256F Flash Chip.
8  * This file is part of an example that allocats 512K of flash space
9  * to the file system, and the rest to the application.
10  *-----------------------------------------------------------------*/
11 
12 #ifndef _ONCHIPFLASH_H_
13 #define _ONCHIPFLASH_H_
14 
15 #include "file/fsf.h"
16 #include "basictypes.h"
17 #include "hal.h"
18 
19 
20 #define FLASH_NAME "MX29GL256"
21 
22 /*functions implemented*/
23 extern int fs_phy_OnChipFlash( FS_FLASH *flash );
24 
25 
26 // Start of Flash memory base address
27 #define FS_FLASHBASE (0xC0000000)
28 
29 /*
30  * BLOCKSIZE
31  * This defines the size of the blocks to be used in the file storage area.
32  * This must be an erasable unit of the flash chip. All blocks in the file
33  * storage area must be the same size. This maybe different from the DESCSIZE
34  * where the flash chip has different size erasable units available.
35  *
36  * SECTORSIZE
37  * This defines the sector size. Each block is divided into a number of sectors.
38  * This number is the smallest usable unit in the system and thus represents the
39  * minimum file storage area. For best usage of the flash blocks the sector size
40  * should always be a power of 2. For more information see sector section below.
41  *
42  * SECTORPERBLOCK
43  * This defines the number of sectors in a block. It must always be true that:
44  * SECTORPERBLOCK = BLOCKSIZE/SECTORSIZE
45  *
46  *
47  * The memory map below is for a Mod5234 with a 2MB bottom boot block flash.
48  * This example will allocate 1.5MB for the application space, and 512KB for
49  * the file system. There are a total of 31 64K blocks on the flash chip.
50  *
51  * Macronix MX29GL256F, 256 blocks of 128KB each, Total of 32MBytes
52  *
53  * Address
54  * ----------
55  * ---------------------- C1FFF FFFF (End of flash space)
56  * | File System Data |
57  * | 1MB |
58  * | 128K x 8 Blocks |
59  * |--------------------| C1F0 0000 (Start of File System Data)
60  * | DESC BLOCK 0/1 |
61  * | 128K x 2 Blocks |
62  * |--------------------| C1EC 0000 (Start of File System)
63  * | |
64  * | Application |
65  * | 31.232MB |
66  * | 128K x 244 Blocks |
67  * | |
68  * |--------------------| C004 0000
69  * | 128K User Params |
70  * |--------------------| C002 0000
71  * | 128K System Params |
72  * |--------------------| C000 0000 (Start of Flash space)
73  *
74  *
75  * CHANGES TO COMPCODE FLAGS
76  * In NBEclipse, or your command line makefile, change the following line
77  * so the application will only occupy the specified application space.
78  * The first parameter is the start of application space, and the second
79  * is the address just below the file system space.
80  *
81  * COMPCODEFLAGS = 0xC0040000 0xC1EC0000
82  *
83  * If using NBEclipse:
84  * - Right-click on the project and select "Properties"
85  * - Select "NetBurner" in the left side of the dialog box
86  * - Verify the Platform is set to Mod5234, then check the "Use Custom Platform Settings" checkbox
87  * - Modify the "Compcode Memory Range" to the above values
88  *
89  *
90  * If using NBEclipse, you will also need to tell the linker to include the
91  * /nburn/platform/<platform>/original/lib/libStdFFile.a library. To do this right-click on your
92  * project, select properties, GNU Linker, then add the library.
93  *
94  */
95 
96 
97 /* WARNING: These settings are for MX29GL256F bottom boot block flash
98  * components used on the Mod54415
99  */
100 #define BLOCKSIZE ( 128*1024 ) // flash physical "sector" size
101 #define SECTORSIZE ( 1*1024 ) // file system sectors per BLOCK
102 #define SECTORPERBLOCK (BLOCKSIZE/SECTORSIZE)
103 
104 /*
105  * Specify the total amount of flash memory in the system, and the amount
106  * allocated to be used by the file system (the rest is used by the
107  * application.
108  */
109 #define FLASH_SIZE ( 32*1024*1024 ) // size of total flash in the system, 32MB
110 #define FS_SIZE ( 1280*1024 ) // amount allocated to file system: 2 Desc. plus 1MB for data (8 x 128k)
111  // note that 1 block of file data will be reserved for the file system
112 #define FIRST_ADDR (FLASH_SIZE - FS_SIZE) // first file system address to use in the flash
113 #define BLOCKSTART 2 // first block where file system data starts
114  // (first 2 blocks are DESCRIPTORS)
115 
116 
117 /*
118  * Descriptor Blocks:
119  * These blocks contain critical information about the file system, block allocation,
120  * wear information and file/directory information. At least two descriptor blocks
121  * must be included in the system, which can be erased independently. An optional
122  * descriptor write cache may be configured which improves the performance of the
123  * file system. Please refer to the EFFS-STD implementation guide for additional
124  * information.
125  */
126 #define DESCSIZE ( 128*1024 ) // size of one descriptor
127 #define DESCBLOCKSTART 0 // position of first descriptor
128 #define DESCBLOCKEND 1 // position of last descriptor
129 #define DESCCACHE 2048
130 
131 #endif /* _ONCHIPFLASH_H_ */
132 
133 
Embedded Flash File System API - STD.
NetBurner Hardware Abstraction Layer (HAL)