Linux 下 Nand Flash 驱动主要数据结构说明
s3c2410 专有数据结构
- s3c2410_nand_set
struct s3c2410_nand_set {
int nr_chips; /* 芯片的数目 */
int nr_partitions; /* 分区的数目 */
char *name; /* 集合名称 */
int nr_map; /* 可选, 底层逻辑到物理的芯片数目 */ struct mtd_partition partitions; /* 分区列表 */
};
- s3c2410_platform_and
struct s3c2410_platform_nand {
/* timing information for controller, all times in nanoseconds */
int tacls; /* 从 CLE/ALE 有效到 nWE/nOE 的时间 */ int twrph0; /* nWE/nOE 的有效时间 */
int twrph1; /* 从释放 CLE/ALE 到 nWE/nOE 不活动的时间 */
int nr_sets; /* 集合数目 */
struct s3c2410_nand_set sets; /* 集合列表 */
/* 根据芯片编号选择有效集合 */
void (*select_chip)(struct s3c2410_nand_set , int chip);
};
- s3c2410_nand_mtd 在 drivers/mtd/nand/s3c2410.c 中, struct s3c2410_nand_mtd {
struct mtd_info mtd; /* MTD 信息 */
struct nand_chip chip; /* nand flash 芯片信息 */ struct s3c2410_nand_set set; /* nand flash 集合 */ struct s3c2410_nand_info *info; /* nand flash 信息 */ int scan_res;
};
- s3c2410_nand_info
struct s3c2410_nand_info {
/* mtd info */
struct nand_hw_control controller; /* 硬件控制器 */ struct s3c2410_nand_mtd *mtds; /* MTD 设备表 */ struct s3c2410_platform_nand platform; /* Nand 设备的平台 */
|
/* device info */ |
|
|
struct device |
*device; |
/* 设备指针 */ |
|
struct resource |
*area; |
/* 资源指针 */ |
|
struct clk |
*clk; |
/* Nand Flash 时钟 */ |
|
void iomem int |
*regs; mtd_count; |
/* 寄存器基地址(map 后的逻辑地址) */ /* MTD 的数目 */ |
|
unsigned char |
is_s3c2440; |
|
|
}; |
|
|
|
- struct clk 在 arch/arm/machs3c2410/clock.h 中 struct clk {
struct list_head list; /* clock 列表结点 */ struct module *owner; /* 所属模块 */ struct clk *parent; /* 父结点 */
const char *name; /* 名称 */
int id; /* 编号 */
atomic_t used; /* 使用者计数 */ unsigned long rate; /* 时钟速率 */ unsigned long ctrlbit; /* 控制位 */
int (*enable)(struct clk *, int enable); /* Clock 打开方法 */
};
相关文章
- Linux Deepin 12.06安装过程演示
- 【Linux驱动】linux内核模块简介
- linux下64位汇编的系统调用(1)
- [Linux] linux文件系统学习
- linux驱动开发--内核链表
- Linux C 字符串输出函数 puts()、fputs()、printf() 详解
- linux - mysql - 卸载:卸载系统自带的mysql
- [Linux]linux下取消用户名和密码直接登录
- linux分享二:Linux如何修改字符集
- linux平台总线驱动设备模型之点亮LED
- Linux平台总线驱动设备模型
- 一文掌握 Linux 性能分析之内存篇
- Linux基础之windows linux双系统
- Linux基础之linux服务器服务器间拷贝文件
- shell 是可以直接操作Linux内核的,这是一个非常重要的工具,一定要掌握,
- Linux - 文本格式转换
- L75.linux命令每日一练 -- 第11章 Linux系统管理命令 -- lsof和uptime
- L63.linux命令每日一练 -- 第九章 Linux进程管理命令 -- runlevel、init和service
- L52.linux命令每日一练 -- 第八章 Linux磁盘与文件系统管理命令 -- resize2fs和fsck
- Linux系统shell脚本之打印系统的IP信息
- 嵌入式Linux,4G模组驱动,移远EC20、EC25使用随笔-内核kernel
- macos linux vim Tab 修改为4个空格
- 基于Linux系统的病毒
- 【Deepin 20系统】Linux系统安装RTX 2070的NVIDIA卡驱动
- 【Linux】手把手教你在CentOS上使用docker 安装MySQL8.0
- 【Linux进阶篇】日志系统