⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flashfslib.h

📁 这是micrel公司宽带路由ARM9芯片的VXWORKS BSP 源代码
💻 H
字号:
/* flashFsLib.h */

/* Copyright 1984 - 2001 Wind River Systems, Inc. */
/* modification history */
/*-----------------------------------------------------------------------------
28Apr04,pcd  Added to support AMD AM29LV033 flash chip. 
             This code will be used for KS8695 CPU board
-----------------------------------------------------------------------------*/
#ifndef	FLASH_FS_LIB_H
#define	FLASH_FS_LIB_H

#include <config.h>

#include "blkIo.h"

typedef struct		/* FLASH_DEV - FLASH disk device descriptor */
{
    BLK_DEV	flash_blkdev;	    /* generic block device structure */
    UINT32  flash_offset;	    /* offset location of the FLASH disk */
    char    *flash_cache;       /* memory for writing to sectors */
    UINT32	flash_blkOffset;	/* block offset of this device from flash_addr */
} FLASH_DEV;


#define BOOTROM_BASE_FS         "/rfa0"        
#define APPL_BASE_FS            "flash:" 

#ifdef  INCLUDE_NVM_SPACE
#define NVM_BASE_FS             "/rfa2"
#define NUM_RFA_DEVICES         3 
#else
#define NVM_BASE_FS             APPL_BASE_FS
#define NUM_RFA_DEVICES         2 
#endif

#define VX_FILENAME             APPL_BASE_FS "/vxWorks.Z"


/* for AMD AM29LV033 flash */
#define	FLASH_FS_DOS_SECTOR_SIZE	512 

                                                                                                  
/* Boot ROM number of sectors */
#define FLASH_RAW_NUM_SEC		16
#define FLASH_RAW_NUM_BLK		FLASH_RAW_NUM_SEC * (FLASH_BANK_SECTOR_SIZE/FLASH_FS_DOS_SECTOR_SIZE) /* 1M bytes */ 

/* NVM+ number of sectors */
#define FLASH_FS1_NUM_SEC		15
#define FLASH_FS1_NUM_BLK		FLASH_FS1_NUM_SEC * (FLASH_BANK_SECTOR_SIZE/FLASH_FS_DOS_SECTOR_SIZE) /* (1M-64K) bytes */ 

/* Application (vxWorks.Z) number of sectors */
#define FLASH_FS2_NUM_SEC		32
#define FLASH_FS2_NUM_BLK		FLASH_FS2_NUM_SEC * (FLASH_BANK_SECTOR_SIZE/FLASH_FS_DOS_SECTOR_SIZE) /* 2M bytes  */



typedef enum {

    FLASH_FS_SYNC = 0x10000

} FLASH_FS_CUSTOM_IOCTL_DEFINITIONS;

STATUS flashFsLibInit();
STATUS flashFsBlkRead (FLASH_DEV *, int, int, char *);
STATUS flashFsBlkWrite(FLASH_DEV *, int, int, char *);
STATUS flashFsIoctl(BLK_DEV *, int, int);
STATUS flashFsSync();
STATUS flashFsGetPhys(int, int *, int *);

IMPORT int flashDrvLibInit();
IMPORT int flashEraseSector(int);
IMPORT int flashEraseBank();
IMPORT int flashBlkRead(int, char *, unsigned int, unsigned int);
IMPORT int flashBlkWrite(int, char *, unsigned int, unsigned int);
IMPORT int flashDiagnostic();
IMPORT int flashSyncFilesystem();

#endif /* FLASH_FS_LIB_H */


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -