minskey guo wrote:
> Christian Kaiser 写道:
>> Garrett D'Amore wrote:
>>
>>> Christian Kaiser wrote:
>>>
>>>> Hi all,
>>>>
>>>> I am currently porting a driver from Linux to Solaris.
>>>>
>>>> The BAR description in the PCI config space looks like this:
>>>>
>>>> BAR0, Offset 0x10, Value 0xcbdc0000
>>>> BAR1, Offset 0x14, Value 0x00000000
>>>> BAR2, Offset 0x18, Value 0xc4000000
>>>> BAR3, Offset 0x1c, Value 0xc0000000
>>>> BAR4, Offset 0x20, Value 0xbc000000
>>>> BAR5, Offset 0x24, Value 0xb8000000
>>>>
>>>> ddi_dev_nregs returns 6 register sets what is correct but for
>>>> ddi_dev_regsize I don't get the zero size value for BAR1 (which
>>>> would be correct) but the size of BAR2. I get an error running
>>>> ddi_dev_regsize with rnumber=6. It seems that Solaris renumbers the
>>>> register sets in my special case where one BAR1 value is 0x0 and the
>>>> size is 0. The same applies to ddi_regs_map_setup.
>>>>
>>>> Is my assumption concerning the renumbering correct? Isn't that
>>>> confusing?
>>>>
>>>> Regards,
>>>> Christian
>>>>
>>>>
>>> For PCI devices, the starting index is 1, not 0. (0 is reserved to
>>> indicate PCI configuration space.)
>>>
>>
>> And I am aware of this.
>>
>>
>>> I don't know why with rnumber 6 you get an error -- that's
>>> surprising. I'd have expected rnumber 6 to return the settings for
>>> BAR5 above.
>>>
>>
>> OK, let me clarify this:
>>
>> BAR layout
>> ==========
>>
>> BAR 0 Offset 0x10 Value 0xcbdc0000 Size 256K
>> BAR 1 Offset 0x14 Value 0x00000000 Size 0
>> BAR 2 Offset 0x18 Value 0xc4000000 Size 64M
>> BAR 3 Offset 0x1c Value 0xc0000000 Size 64M
>> BAR 4 Offset 0x20 Value 0xbc000000 Size 64M
>> BAR 5 Offset 0x24 Value 0xb8000000 Size 64M
>>
>> Using ddi_dev_regsize()
>> =======================
>>
>> rnumber=1 Size 256K
>> rnumber=2 Size 64M
>> rnumber=3 Size 64M
>> rnumber=4 Size 64M
>> rnumber=5 Size 64M
>> rnumber=6 n/a (error)
>>
>> Do you understand now what I meant by "renumbering"?
>>
>>
>
> It's weird. Is it possible that this hardware supports 64bit addressing.
> What's the exact value if you do pci read from BAR0 ? Are the bit2:1
> of BAR0 10B ? Or can you post the prtconf -vp for your device ?
>
The spec says: "32-bit or 64-bit BARs supported" and you can see that
all offsets (see above) of the BARs are 64bit.
OK... I dont't understand this at all. I did a 32-bit read on all BARs.
Maybe you can explain me this?
0x10 0xc8300000
0x12 0xbeefc830
0x14 0x0
0x16 0x0
0x18 0xd8000000
0x20 0xd0000000
0x22 0xbeefd000
0x24 0xcc000000
0x26 0xcc00
However, this is what I get from prtconf -vp
Node 0x000020
assigned-addresses:
82050010.00000000.c8300000.00000000.00040000.82050018.00000000.d8000000.00000000.04000000.8205001c.00000000.d4000000.00000000.04000000.82050020.00000000.d0000000.00000000.04000000.82050024.00000000.cc000000.00000000.04000000
reg:
00050000.00000000.00000000.00000000.00000000.02050010.00000000.00000000.00000000.00040000.02050018.00000000.00000000.00000000.04000000.0205001c.00000000.00000000.00000000.04000000.02050020.00000000.00000000.00000000.04000000.02050024.00000000.00000000.00000000.04000000
compatible: 'pciex9902,101.2' + 'pciex9902,101' +
'pciexclass,068000' + 'pciexclass,0680' + 'pci9902,101.2' +
'pci9902,101' + 'pciclass,068000' + 'pciclass,0680'
model: 'Bridge device'
power-consumption: 00000001.00000001
devsel-speed: 00000000
interrupts: 00000001
unit-address: '0'
class-code: 00068000
revision-id: 00000002
vendor-id: 00009902
device-id: 00000101
pcie-capid-pointer: 00000060
pcie-capid-reg: 00000001
name: 'pci9902,101'
Christian
--
Christian Kaiser, Software Engineer, Dolphin Interconnect Solutions
http//www.dolphinics.com
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code