开发环境:
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
20.1 -- Nor flash 驱动(开发步骤)
最新推荐文章于 2021-01-28 21:57:40 发布