20.1 -- Nor flash 驱动(开发步骤)

开发环境:

1. 开发主机: Ubuntu 9.10
2. 交叉编译器: gcc version 3.4.5
3. 开发板: JZ2440-V3

背景: Nor驱动开发,测试.

1. 重启开发板(从nand启动).

2. 编写驱动程序nor_drv.c.

3. 编译驱动模块.
# make

4. 复制驱动模块到NFS文件系统.
# cp nor_drv.ko /work/nfs_root/first_fs

5. 配置内核,将内核自带的Nor驱动编译为模块[M].
# make menuconfig
  -> Device Drivers
    -> Memory Technology Device (MTD) support
      -> Mapping drivers for chip access
        <M> CFI Flash device in physical memory map
          (0x0) Physical start address of flash mapping
          (0x200000) Physical length of flash mapping
          (2)   Bank width in octets

6. 编译驱动模块.
# make modules

7. 复制内核自带的Nor驱动模块到NFS文件系统.
# cp drivers/mtd/maps/physmap.ko /work/nfs_root/first_fs

8. 开发板启动开关拨至nor.

9. 装载内核自带的Nor驱动模块.
# ls /dev/mtd* -la

# insmod physmap.ko
physmap platform flash device: 00200000 at 00000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
number of CFI chips: 1
cfi_cmdset_00
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值