📄 fdi_type.h
字号:
* This is where include files used through out IFDI are placed.
*/
/*
* ### Customer Platform/OS Definitions:
* ############################################################################
*/
#include <stddef.h>
#include "nucleus.h" /* added by jjs */
#include "sysapi.h" /* added by jjs */
#include "fdi_cust.h"
/*
* ### Basic Data Type Definitions:
* ############################################################################
*/
/*
* These are what are used to create standard data types. If these are
* defined elsewhere, the three typedefs below can be removed. When doing
* so, is is imperative that the replacement definitions provide storage
* of the same number of bits and same sign as the definitions below.
*/
/*
* The following macro, BWD_TYPES, should initialy be undefined
* for stand alone FDI and customer use if BYTE, WORD, and DWORD
* are not already defined in the customer application code.
*/
#ifndef BWD_TYPES
typedef bool BOOL;
typedef unsigned char BYTE; /* 8 bits wide, unsigned */
typedef unsigned short int WORD; /* 16 bits wide, unsigned */
typedef unsigned long DWORD; /* 32 bits wide, unsigned */
#ifndef offsetof
#define offsetof(type, member) ((unsigned int)&((type *)0)->member)
#endif
#endif /* BWD_TYPES */
/*
* The following macro, PTR_TYPES, should initialy be undefined
* for stand alone FDI and customer use if VOID_PTR,
* BYTE_PTR, DWORD_PTR, BYTE_BITMASK, and VOID_PTR_PTR
* are not already defined in the customer application code.
*/
#ifndef PTR_TYPES
typedef void * VOID_PTR;
/* typedef BYTE * BYTE_PTR; */ /* commented by jjs - nucleus.h has defined it */
typedef WORD * WORD_PTR;
typedef DWORD * DWORD_PTR;
typedef BYTE BYTE_BITMASK; /* 8 bits wide mask */
typedef VOID_PTR * VOID_PTR_PTR;
#endif /* PTR_TYPES */
#ifndef TRUE
#define TRUE 1
#endif /* !TRUE */
#ifndef FALSE
#define FALSE 0
#endif /* !FALSE */
#ifndef NULL
#define NULL ((void *)0)
#endif /* !NULL */
/*
* ### Platform configuration section:
* ############################################################################
*/
/*
* FLASH_DATA_WIDTH is equal to the width of the data bus to flash. For a
* 16-bit data bus, typedef a WORD to FLASH_DATA_WIDTH. For a 32-bit data
* bus, typedef a DWORD to FLASH_DATA_WIDTH.
*/
typedef WORD FLASH_DATA_WIDTH;
/*
* If two flash components comprise the width of the data bus, set the
* following option to TRUE; otherwise, the option should be set to FALSE.
*/
#define FLASH_PAIRED FALSE
#ifndef FLASH_START_ADDRESS
/* Set this address to be the appropriate address for the part being used */
#define FLASH_START_ADDRESS 0x07000000 /*0x08000000*//*Modified by jjs from 0x08000000 to HWD_FLASH_BASE_ADDRESS*/
#endif /* !FLASH_START_ADDRESS */
/*
* ### FDI Feature Switches section:
* ############################################################################
*/
#define DIRECT_ACCESS_VOLUME FALSE /* Enable this for DAV capability */
#if (DIRECT_ACCESS_VOLUME == TRUE) /* Select the DAV blocks. Must be
* outside the range specified for
* FDI data types
* (i.e. NUM_BOOT_BLOCKS,
* NUM_DATA_BLOCKS). */
#define DAV_START_ADDRESS 0x8010000 /* address at which the Direct Access
* Volume begins */
#define DAV_BLOCKCOUNT 15 /* number of code storage blocks */
#define DAV_BLOCK_SIZE 0x10000 /* number of bytes in each block of
* the direct access volume. */
#define DAV_NUM_CLASS_FILES 254
#endif /* DIRECT_ACCESS_VOLUME */
#define FILE_MANAGER TRUE /*FALSE*//* Modified by jjs from FALSE to TRUE*//* Enable this for FM support */
#if (FILE_MANAGER == TRUE)
#define NUM_FILES 64 /* Supported number of files. Must be
* greater than 0 and less than
* 65,535. */
#define NUM_OPEN_FILES 16 /* Number of simultaneous open files
* supported. Must be greater than
* 0 and less than or equal to
* NUM_FILES. */
#define FILE_SUPPORT_INFO_TYPE 12 /* File info structure's FDI type */
#define FILE_SUPPORT_DATA_TYPE 13 /* Raw data's FDI type */
#define FILE_NAME_SIZE 64 /* Maximum length of filename */
#endif /* FILE_MANAGER */
#define INCLUDE_FORMAT TRUE /* True includes format code, false
* excludes */
#define CONSISTENT_ACCESS_TIME FALSE /* Enable this for Consistent Access Time
Support*/
/*
* This define includes the capability to have data that fragments and is
* tracked by sequence tables if set to TRUE. Taking this option out prevents
* the fragmentation of data, saves 10-12 KB of ROM, and prevents any attempts
* to fragment data by returning an error code
*/
#define INCLUDE_FRAGMENTED_DATA TRUE
#define DATA_STREAM FALSE /* Set to TRUE if need to maintain a
* data rate otherwise set to FALSE */
#define FDI_NONE 0
#define SINGLE_PR 1
#define NUM_USER_PR_REGISTERS 17 /* number of user protection
* registers in the flash part
* There are 17 user protection
* registers in Trumbull. */
#define ENABLE_PR FDI_NONE /* SINGLE_PR *//* Modified by jjs from SINGLE_PR to FDI_NONE */ /* number of user protection
* number of user protection
* registers in the flash part */
/*
* To enable protection register support, the absolute starting address of
* the parameter partition must be supplied. If a parameter partition is
* not present on the flash component(s), the starting address of flash
* must be specified.
*/
#define PARAMETER_PARTITION_START_ADDRESS FLASH_START_ADDRESS
#define BLOCK_LOCK_SUPPORT TRUE /* Turn on flex locking capability */
#define ENABLE_NONFDI_BLOCKLOCKING TRUE
#define ENABLE_FDI_BLOCKLOCKING TRUE
#define PACKET_DATA FALSE
#if 0
#if (INCLUDE_FRAGMENTED_DATA == TRUE)
#define PACKET_DATA TRUE
#endif /* INCLUDE_FRAGMENTED_DATA */
#endif
#define PARAM_CHECK TRUE
/* When setting PARTITONS to SINGLE, FDI will treat the NUM_DATA_BLOCKS blocks
* as one partition, interrupt polling or DIH is needed.
* DUAL, will not use interrupt polling or DIH.
* MULTI is essentially the same as dual but this option can be used when the
* Flash part supports read while write(RWW).
*/
#define SINGLE 1
#define DUAL 2
#define MULTI 3
#define PARTITIONS SINGLE /* Set to SINGLE/DUAL/MULTI when
* using Intel SINGLE/DUAL/MULTI
* Partition architecture components
* respectively. */
#define FREE_SPACE_FUNCTIONS TRUE /* Turn on/off free space function */
/* To disable the Data Volume expansion feature, set ADD_BLOCK to FALSE. To
* add blocks before the Data Volume, set ADD_BLOCK to BEFORE. To add blocks
* after the Data Volume, set ADD_BLOCK to AFTER.
*/
#define BEFORE 1 /* Add Blocks before existing data
* blocks */
#define AFTER 2 /* Add Blocks after existing data
* blocks */
#define ADD_BLOCK FALSE /* Turn on/off Add block feature */
/*
* ### FDI configuration section:
* ############################################################################
*/
#define FDV_START_ADDRESS (0x07300000)
/*0x8100000*//*Modified by jjs from 0x8100000 to HWD_FLASH_BASE_ADDRESS + 0x0380000*/
/* address at which the Data Volume
* begins. */
#define FDV_BLOCKCOUNT 15 /* 16 */ /* Modified by jjs from 16 to 3, this value must be >= 2, one for spare block, others for data storage. */ /* number of data storage blocks */
#define FDV_BLOCK_SIZE 0x10000 /* number of bytes in each block of
* the data volume. */
#define UNIT_GRANULARITY 128 /* minimum unit size in bytes */
#define FDI_QUEUE_SIZE 8192 /* bytes of memory used by queue */
#define FDI_QUEUE_START 0 /* does not require changing */
#define MAX_NUM_UNITS_PER_FRAG 4 /* maximum number of UNIT_GRANULARITY
* before data is broken up into
* smaller fragments */
#define MIN_INSTANCES 3 /* min number in multi-instance unit,
* used to calculate the unit size */
#define BUFFER_SIZE 0 /* size of internal flash buffer */
#define RELOCATE_CODE TRUE /*FALSE*//*Modified by jjs from FALSE to TRUE*/ /* to have FDI relocate the low-level
* functions, set to TRUE. to have
* the boot loader or application
* relocate the low-level functions,
* set to FALSE. */
#if (RELOCATE_CODE == TRUE)
#define FDI_RAM_START 0x00000000 /* RAM address where low-lvl funcs
* will be copied. If 0, the start
* address will be automatically
* determined. If non-zero the
* non-zero value is assumed to be
* the start address. */
#endif /* RELOCATE_CODE */
#define SYSTEM_THRESHOLD FDI_THRESHOLD /* This defines the free space
* limit before reclaim is requested*/
#define RECL_PRIORITY 117 /* 190 *//*Modified by jjs from 190 to 117 */ /* OS priority of reclaim task */
#define RECL_STACK_SIZE 2000 /* stack size of reclaim task */
#define BKGD_PRIORITY 116 /* 180 *//*Modified by jjs from 180 to 116 */ /* OS priority of background task */
#define BKGD_STACK_SIZE 3000 /* stack size of background task */
#define NUM_TYPE0_PARMS 600
#define NUM_TYPE1_PARMS 100
#define NUM_TYPE2_PARMS 21
#define NUM_TYPE3_PARMS 22
#define NUM_TYPE4_PARMS 23
#define NUM_TYPE5_PARMS 24
#define NUM_TYPE6_PARMS 25
#define NUM_TYPE7_PARMS 26
#define NUM_TYPE8_PARMS 27
#define NUM_TYPE9_PARMS 28
#define NUM_TYPE10_PARMS 29
#define NUM_TYPE11_PARMS 30
#define NUM_TYPE12_PARMS 31
#define NUM_TYPE13_PARMS 32
/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -