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

📄 config.h

📁 zlg nand flash 写平衡 在LINUX XIA
💻 H
字号:
/****************************************Copyright (c)****************************************************                               Guangzou ZLG-MCU Development Co.,LTD.**                                      graduate school**                                 http://www.zlgmcu.com****--------------File Info-------------------------------------------------------------------------------** File Name: config.h** Last modified Date:  2004-09-17** Last Version: 1.0** Descriptions: User Configurable File****------------------------------------------------------------------------------------------------------** Created By: Chenmingji** Created date:   2004-09-17** Version: 1.0** Descriptions: First version****------------------------------------------------------------------------------------------------------** Modified by:** Modified date:** Version:** Descriptions:**********************************************************************************************************/#ifndef __CONFIG_H#define __CONFIG_H//This segment should not be modified#ifndef TRUE#define TRUE  1#endif#ifndef FALSE#define FALSE 0#endif#ifndef __KERNEL__    #define __KERNEL__#endif#ifndef MODULE    #define MODULE#endif#include <linux/config.h>#include <linux/module.h>#include <linux/sched.h>#include <linux/kernel.h>       /* printk() *///#include <linux/malloc.h>       /* kmalloc() */#include <linux/slab.h>       /* kmalloc() */#include <linux/fs.h>           /* everything... */#include <linux/errno.h>        /* error codes */#include <linux/timer.h>#include <linux/types.h>        /* size_t */#include <linux/fcntl.h>        /* O_ACCMODE */#include <linux/hdreg.h>        /* HDIO_GETGEO */#include <asm/system.h>         /* cli(), *_flags */#include <linux/blkpg.h>  /* blk_ioctl() */#include <linux/iobuf.h>#include <linux/ioctl.h>#include <asm/uaccess.h>#include <linux/init.h>typedef u8      uint8;          /* defined for unsigned 8-bits integer variable 	 无符号8位整型变量  */typedef s8      int8;           /* defined for signed 8-bits integer variable		 有符号8位整型变量  */typedef u16     uint16;         /* defined for unsigned 16-bits integer variable 	 无符号16位整型变量 */typedef s16     int16;          /* defined for signed 16-bits integer variable 		 有符号16位整型变量 */typedef u32     uint32;         /* defined for unsigned 32-bits integer variable 	 无符号32位整型变量 */typedef s32     int32;          /* defined for signed 32-bits integer variable 		 有符号32位整型变量 */typedef float   fp32;           /* single precision floating point variable (32bits) 单精度浮点数(32位长度) */typedef double  fp64;           /* double precision floating point variable (64bits) 双精度浮点数(64位长度) *//********************************//*Application Program Configurations*//*     应用程序配置             *//********************************///This segment could be modified as needed.//以下根据需要改动#include "k9fxx08.h"#include "ZLG_FFS.h"#define K9F28_CLE   ((volatile uint8 *)0x80D00000)#define K9F28_ALE   ((volatile uint8 *)0x80C80000)#define K9F28_DATA  ((volatile uint8 *)0x80C00000)#define K9FXX_WAIT()#include    "fat.h"#define ZLG_FFS_MAJOR_NR            126#define MAX_DRIVES                  1#ifdef IN_ZLG_FFS_UCLINUX#define DEVICE_NAME "zlg_ffs"               /* name for messaging */#ifndef ZLG_FFS_DEFINE#define ZLG_FFS_DEFINEuint8 FFSbuf[512];#define K9F28_BASE_ADDR             0x40003000K9fXX08Hardware ChipInfo[MAX_DRIVES];FlashDriver FlashDriverInfo[MAX_DRIVES];        void init_flash(void){    void * *vp;        vp = (void *)K9F28_BASE_ADDR;    ChipInfo[0].CLE = K9F28_CLE;    ChipInfo[0].ALE = K9F28_ALE;    ChipInfo[0].Data = K9F28_DATA;    ChipInfo[0].Buf = FFSbuf;    ChipInfo[0].BytsPerSec = 512;    ChipInfo[0].BytsPerSecC = 16;    ChipInfo[0].SecPerBlock = 32;    ChipInfo[0].BlockPerChip = 1024;    ChipInfo[0].DataToK9fxx08 = vp[0];    ChipInfo[0].DataToMCU = vp[0];    FlashDriverInfo[0].BytsPerSec = 512;    FlashDriverInfo[0].SecsPreBlock = 32;    FlashDriverInfo[0].SecPreDisk = 1024 * 32;    FlashDriverInfo[0].BlockPreDisk = 1024;    FlashDriverInfo[0].BufA = FFSbuf;    FlashDriverInfo[0].Index = (void *)ChipInfo;    FlashDriverInfo[0].SectorRead = vp[2];    FlashDriverInfo[0].ExSectorRead = vp[3];    FlashDriverInfo[0].SectorWrite = vp[4];    FlashDriverInfo[0].ExSectorWrite = vp[5];    FlashDriverInfo[0].BlockErase = vp[6];//    FlashDriverInfo[0].SecCopy = vp[8];    FlashDriverInfo[0].BlockCheck = vp[9];    FlashDriverInfo[0].SectorCheck = vp[10];    FlashDriverInfo[0].ExSectorCheck = vp[11];}#endif#endif#define malloc(a)   kmalloc(a, GFP_KERNEL)#define free(a)     kfree(a)#define OS_ENTER_CRITICAL() #define OS_EXIT_CRITICAL()#endif/***********************************************************************************************************                            End Of File********************************************************************************************************/

⌨️ 快捷键说明

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