NetBurner 3.1
SSH/SshServerUserKey/src/MX29GL256F.h
1 /* Revision: 2.8.7 */
2 
3 /******************************************************************************
4 * Copyright 1998-2018 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact sales@Netburner.com for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 5405 Morehouse Dr.
23 * San Diego, CA 92121
24 * www.netburner.com
25 ******************************************************************************/
26 
27 /*---------------------------------------------------------------------------------
28  * BLOCKSIZE
29  * This defines the size of the blocks to be used in the file storage area.
30  * This must be an erasable unit of the flash chip. All blocks in the file
31  * storage area must be the same size. This maybe different from the DESCSIZE
32  * where the flash chip has different size erasable units available.
33  *
34  * SECTORSIZE
35  * This defines the sector size. Each block is divided into a number of sectors.
36  * This number is the smallest usable unit in the system and thus represents the
37  * minimum file storage area. For best usage of the flash blocks the sector size
38  * should always be a power of 2. For more information see sector section below.
39  *
40  * SECTORPERBLOCK
41  * This defines the number of sectors in a block. It must always be true that:
42  * SECTORPERBLOCK = BLOCKSIZE/SECTORSIZE
43  *
44  *
45  * The memory map below is for a Mod5234 with a 2MB bottom boot block flash.
46  * This example will allocate 1.5MB for the application space, and 512KB for
47  * the file system. There are a total of 31 64K blocks on the flash chip.
48  *
49  * Macronix MX29GL256F, 256 blocks of 128KB each, Total of 32MBytes
50  *
51  * Address
52  * ----------
53  * ---------------------- C1FFF FFFF (End of flash space)
54  * | File System Data |
55  * | 1MB |
56  * | 128K x 8 Blocks |
57  * |--------------------| C1F0 0000 (Start of File System Data)
58  * | DESC BLOCK 0/1 |
59  * | 128K x 2 Blocks |
60  * |--------------------| C1EC 0000 (Start of File System)
61  * | |
62  * | Application |
63  * | 31.232MB |
64  * | 128K x 244 Blocks |
65  * | |
66  * |--------------------| C004 0000
67  * | 128K User Params |
68  * |--------------------| C002 0000
69  * | 128K System Params |
70  * |--------------------| C000 0000 (Start of Flash space)
71  *
72  *
73  * CHANGES TO COMPCODE FLAGS
74  * In NBEclipse, or your command line makefile, change the following line
75  * so the application will only occupy the specified application space.
76  * The first parameter is the start of application space, and the second
77  * is the address just below the file system space.
78  *
79  * COMPCODEFLAGS = 0xC0040000 0xC1EC0000
80  *
81  * If using NBEclipse:
82  * - Right-click on the project and select "Properties"
83  * - Select "NetBurner" in the left side of the dialog box
84  * - Verify the Platform is set to Mod5234, then check the "Use Custom Platform Settings" checkbox
85  * - Modify the "Compcode Memory Range" to the above values
86  *
87  *
88  * If using NBEclipse, you will also need to tell the linker to include
89  * the c:\nburn\lib\StdFFile.a library. To do this right-click on your
90  * project, select properties, GNU Linker, then add the library.
91  *
92  *-------------------------------------------------------------------------------------------------*/
93 
94 #ifndef _ONCHIPFLASH_H_
95 #define _ONCHIPFLASH_H_
96 
97 #include <file/fsf.h>
98 
99 
100 #define FLASH_NAME "MX29GL256F"
101 
102 #define FS_FLASHBASE (0xC0000000) // Start of Flash memory base address
103 
104 
105 /* WARNING: These settings are for MX29GL256F bottom boot block flash
106  * components used on the Mod54415
107  */
108 #define BLOCKSIZE ( 128*1024 ) // flash physical "sector" size
109 #define SECTORSIZE ( 1*1024 ) // file system sectors per BLOCK
110 #define SECTORPERBLOCK (BLOCKSIZE/SECTORSIZE)
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 ( 32*1024*1024 ) // size of total flash in the system, 32MB
118 #define FS_SIZE ( 1280*1024 ) // amount allocated to file system: 2 Desc. plus 1MB for data (8 x 128k)
119  // note that 1 block of file data will be reserved for the file system
120 #define FIRST_ADDR (FLASH_SIZE - FS_SIZE) // first file system address to use in the flash
121 #define BLOCKSTART 2 // first block where file system data starts
122  // (first 2 blocks are DESCRIPTORS)
123 
124 /*
125  * Descriptor Blocks:
126  * These blocks contain critical information about the file system, block allocation,
127  * wear information and file/directory information. At least two descriptor blocks
128  * must be included in the system, which can be erased independently. An optional
129  * descriptor write cache may be configured which improves the performance of the
130  * file system. Please refer to the EFFS-STD implementation guide for additional
131  * information.
132  */
133 #define DESCSIZE ( 64*1024 ) // size of one descriptor
134 #define DESCBLOCKSTART 0 // position of first descriptor
135 #define DESCBLOCKEND 1 // position of last descriptor
136 #define DESCCACHE 2048
137 
138 extern int fs_phy_OnChipFlash( FS_FLASH *flash );
139 
140 #endif
Embedded Flash File System API - STD.