免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: superfisha
打印 上一主题 下一主题

再问PCI设备重启的问题,请高人帮忙啊,谢谢! [复制链接]

论坛徽章:
0
11 [报告]
发表于 2010-01-12 09:42 |只看该作者
原帖由 accessory 于 2010-1-12 03:22 发表
"设备主动重启对主机来说是一个热插拨操作吗?"
不一定. 热插拔也是有规范的. 比如先发什么硬件信号,然后发什么等. 如果不按照规范做,主机也无法识别你的设备在干啥.

"看了一下linux内核的代码,里面就多了 ...

呵呵 单位要移植到vxworks,所以linux用不上了。设备上如果跑linux,在pcibios_init里面会初始化下面的BAR 0-5,下面这些偏移的基址都是PCI配置空间的基址,值应该是个mask,应该可以理解为长度。
偏移  值(设备的linux字节序是小端)
0x10 0xffffffff
0x10 0xc
0x14 0xffffffff
0x14 0x0
0x18 0xffffffff
0x18 0xc
0x1c 0xffffffff
0x1c 0x0
0x20 0xffffffff
0x20 0xc
0x24 0xffffffff
0x24 0x0

BAR的定义:Indicates which BAR 0 bits to mask (make non-writable) from host software,
which, in turn, determines the size of the BAR. For example, writing 0xFFF to
the BAR 0 Mask register claims a 4096-byte BAR by masking bits [11:0] of
the BAR from writing by host software.
If BAR 0 is a 64-bit BAR, then the BAR 1 Mask register contains the upper
bits of the BAR 0 Mask. The BAR 0 Mask register is invisible to host software
and not readable from the application.


在主机启动后之后,设备第一次主动重启的时候主机系统会报(其它任意重启都不再报了):
lh kernel: Uhhuh. NMI received for unknown reason 30 on CPU 0.
lh kernel: Do you have a strange power saving mode enabled?
lh kernel: Dazed and confused, but trying to continue

[ 本帖最后由 superfisha 于 2010-1-12 09:57 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP