[juliantec_list] Re: 请问如何读取Intel flash 的Protection Register?

  • From: "Yihe Chen" <yihect@xxxxxxxxxxxxxx>
  • To: "houchenda2006" <houchenda2006@xxxxxxx>, "linux-kernel-driver" <linux-kernel-driver@xxxxxxxxxxxxxx>
  • Date: Mon, 22 Aug 2011 17:19:17 +0800

是要自己写读flash的驱动,还是用MTD,
CFI的接口?网上说读nor flash 不用
写驱动,直接读就可以。


像这种数据在应用层的话,就是打开文件
用 read 或者 ioctl 就可以。至于使用
ioctl 的什么命令,你可以去hacking内核
的相关代码。具体的目录在:

.../drivers/mtd/

Well, 经过几个小时的代码hacking,终于
发现可以使用两个IOCTL 来解决这个问题,
分成两个步骤:

a,先用 OTPGETREGIONINFO 做参数调用
  ioctl 取得保护寄存器相关的信息;
b,然后使用 read 去读出来寄存器的值。

你可以看看 .../drivers/mtd/mtdchar.c
中 mtd_read, mtd_ioctl 两函数中相关
的代码。


看了几天网上的资料,以前没接触过底层,
现在思路比较混乱,不知道该怎么做。





Learning, Just As Your Favourite Thing!

Maillist, See http://www.juliantec.info/mlist/mail-lists.html
JulBlog, See http://www.juliantec.info/julblog/summary.php
JulWiki, See http://www.juliantec.info/wiki/


Other related posts: