Re: multi-domain PCI and sysfs

Matthew Wilcox
2004-09-08T11:38:20Z

On Wed, Sep 08, 2004 at 01:11:36PM +0200, Geert Uytterhoeven wrote:
> On ia32, you access PCI I/O space (`I/O ports') using IN/OUT instructions.
> On non-ia32, you access PCI I/O space by accessing a special region of the CPU
> address space.

That's one way of doing it, sure ... ;-)

With HP's Dino PCI controller, you generate I/O cycles on the PCI bus by
writing the address to the DINO_PCI_ADDR register, then reading or writing
the DINO_IO_DATA register.

> You access PCI memory space by accessing a special region of the CPU
> address space on all platforms I'm aware of.

The PPC64 iSeries port seems to do a hypervisor call for readb() et al.
Nasty stuff.

> On ia32, it starts at CPU address
> zero, and there's no offset between CPU physical addresses and PCI bus
> addresses. On other platforms, there may be offsets.

It can even depend on machine model ... only some ia64 platforms have
different bus view and physical view (see Documentation/IO-mapping.txt)

> For access to PCI config space, there are even more possibilities. On ia32
> it's usually done using indirect access to PCI I/O space 0xcf8 etc. On other
> platforms it's usually done by accessing a special region of the CPU address
> space. Or in a different way ;-)

We have four options on i386 -- direct1, direct2, bios and mmconfig.
Other platforms ... well, get even weirder. Magic registers, firmware
calls, memory mapped. It's all been done.

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain