uClinux2.6(bf561)的NorFlash驱动实现分析(4) : maps定义
2008-02-21 18:35
429 查看
maps用于定义norflash芯片的具体参数及其读写回调函数。在driver/mtd/maps/ezkit561.c中实现了一个CFI Flash的示例,因为AM29lv320支持CFI接口,所以就直接在此文件的基础上修改。
下面就是map_info这个结构体的定义(include/linux/mtd/map.h):
struct map_info {
char *name;
unsigned long size;
unsigned long phys;
#define NO_XIP (-1UL)
void __iomem *virt;
void *cached;
int bankwidth; /* in octets. This isn't necessarily the width
of actual bus cycles -- it's the repeat interval
in bytes, before you are talking to the first chip again.
*/
#ifdef CONFIG_MTD_COMPLEX_MAPPINGS
map_word (*read)(struct map_info *, unsigned long);
void (*copy_from)(struct map_info *, void *, unsigned long, ssize_t);
void (*write)(struct map_info *, const map_word, unsigned long);
void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t);
/* We can perhaps put in 'point' and 'unpoint' methods, if we really
want to enable XIP for non-linear mappings. Not yet though. */
#endif
/* It's possible for the map driver to use cached memory in its
copy_from implementation (and _only_ with copy_from). However,
when the chip driver knows some flash area has changed contents,
it will signal it to the map driver through this routine to let
the map driver invalidate the corresponding cache as needed.
If there is no cache to care about this can be set to NULL. */
void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
/* set_vpp() must handle being reentered -- enable, enable, disable
must leave it enabled. */
void (*set_vpp)(struct map_info *, int);
unsigned long map_priv_1;
unsigned long map_priv_2;
void *fldrv_priv;
struct mtd_chip_driver *fldrv;
};
在ezkit561.c中将之填充为:
struct map_info ezkit561_map = {
.name = "BF561 EZKIT Map",
.phys = EZKIT561_FLASH_BASE,
.size = EZKIT561_FLASH_SIZE,
.bankwidth = 2, /* 16 bit */
};
相关文章推荐
- uClinux2.6(bf561)的NorFlash驱动实现分析(2): chips和maps
- uClinux2.6(bf561)的NorFlash驱动实现分析(3) : chip_driver注册
- uClinux2.6(bf561)的NorFlash驱动实现分析(5) : 驱动加载
- uClinux 2.6(bf561)中的NorFlash驱动实现分析:全文
- uClinux2.6(bf561)的NorFlash驱动实现分析(6): do_map_probe
- uClinux2.6(bf561)的NorFlash驱动实现分析(7): cfi_probe
- uClinux2.6(bf561)的NorFlash驱动实现分析(8): check_cmd_set
- uClinux2.6(bf561)的NorFlash驱动实现分析(9): 驱动的使用
- uClinux2.6(bf561)的NorFlash驱动实现分析(1): 基本参数
- uclinux2.6(bf561)中的bootmem分析(1):猜测
- uclinux2.6(bf561)中的bootmem分析(3):init_bootmem_node
- uclinux2.6(bf561)中的bootmem分析(4):alloc_bootmem_pages
- uclinux2.6(bf561)中的bootmem分析(2):调用前的参数分析
- 【嵌入式Linux学习七步曲之第五篇 Linux内核及驱动编程】Linux系统调用的实现机制分析
- 面向对象地分析Linux内核设备驱动(1):——Linux内核驱动中面向对象的基本规则和实现方法
- s3c2410触摸屏驱动(2.6内核)分析 -中断下半部
- 基于MTD的NANDFLASH设备驱动底层实现原理分析(一)
- linux2.6的LCD驱动分析
- 翻翻git之---自己定义邮件发送buttonSendButton(流程分析,实现思路能够学习下)
- 基于MTD的NANDFLASH设备驱动底层实现原理分析(三)