- 论坛徽章:
- 0
|
原帖由 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 编辑 ] |
|