versadac  1
versadac - Scalable Recorder Firmware
flashInfo.h
1 /*******************************************************************************
2 FILE : flashInfo.h
3 SYSTEM : Gnu C C++ for ARM under vxWorks
4 DESCRIPTION : Flash file system information
5 *******************************************************************************/
6 #ifndef _FLASH_INFO_H
7 #define _FLASH_INFO_H
8 
9 #include <stdio.h>
10 #include "stdtypes.h"
11 #include "bspFlash.h"
12 #include "prjParams.h"
13 
14 #ifdef __cplusplus
15 extern "C"
16 {
17 #endif
18 
19 /* The startup drive is the only one the bootrom build is ever aware of. The
20  remaining drives are entirely the prerogative of the application. So will probably
21  have to move the startup drive to the BSP later TBD (kw)
22  */
23 #define STARTUP_VOLNAME "/startup"
24 #define STARTUP_ROOTDIR "/"
25 
26 #define SYSTEM_VOLNAME "/system"
27 #define SYSTEM_ROOTDIR "/"
28 
29 #define HISTORY_VOLNAME "/history"
30 #define HISTORY_ROOTDIR "/"
31 #define HISTORY_DIAGS_PATH SYSTEM_VOLNAME
32 
33 #ifdef INCLUDE_OLD_T2750_BOARD_FLASH_SUPPORT
34 /* use smaller drive sizes for the T2750 boards with 32MB flash */
35 #define STARTUP_SIZE 0x00A00000 /* 10.0MB */
36 #define SYSTEM_SIZE 0x00200000 /* 2.0MB */
37 #define HISTORY_SIZE 0x01000000 /* 16.0MB */
38 #else
39 /* Flash totals 128Mb, 2.5 Mb reserved for bootrom leaves ~125Mb */
40 #define STARTUP_SIZE 0x01000000 /* 16.0MB */
41 #define SYSTEM_SIZE 0x00600000 /* 6.0MB */
42 #define HISTORY_SIZE 0x06100000 /* 97.0 MB */
43 #endif
44 
45 typedef enum
46 {
47  STARTUP_DRIVE = 0, /* MUST ALWAYS be = 0, as this is presumed in BSP code. */
48  SYSTEM_DRIVE,
49  HISTORY_DRIVE,
50  NUM_OF_NANO_DRIVES
51 
52 } BspAppFlashPartitions;
53 
54 #ifdef INCLUDE_EUROTHERM_HFFS
55 extern int hffsFormatReqd;
56 extern void hffsInstall();
57 #endif
58 
59 extern STATUS writeBootrom(char * z_bootromFile, UINT8 *z_macAddr);
60 extern int getFlashDriveNumFromPath( const char * path );
61 extern const char * getFlashVolName (int drive);
62 extern int getFlashVolNum (int drive);
63 extern const char * getFlashVolRootDir (int drive);
64 extern void listFlashDriveInfo (int drive, void *log );
65 extern BOOL listFlashDir (const char *dirPath,
66  void *log,
67  unsigned long *pRtnSize,
68  unsigned long *pRtnFiles,
69  unsigned long *pRtnDirs,
70  BOOL subdirs );
71 
72 /* flags alerting of flash corruption */
73 extern uint8 g_systemPartitionCorrupt;
74 extern uint8 g_historyPartitionCorrupt;
75 extern unsigned long listFFSProperties( BspFlashPartition partition, FILE * log );
76 extern void formatFlashDrive(int drive);
77 extern void mountFlashDrive(int drive);
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif /* _FLASH_INFO_H */