Re: 64 bit PCI and Linux

Martin Mares (mj@ucw.cz)
Mon, 24 Aug 1998 00:06:52 +0200


Hello,

> I am currently writing some code that is intended to support the
> SYMBIOS 53C896 64 bit PCI SCSI controller.
> As you know, 64 bit PCI devices may use 64 bit address registers.
>
> This PCI device is using the following ones:
>
> - Register 10-13h
> Base Address Register Zero (I/O)
> - Register 14-1Bh (64 bit)
> Base Address Register One (MMIO)
> - Register 1C-23h (64 bit)
> Base Address Register Two (RAM 8k)
>
> If I assume (probably wrongly) that each architecture provides a set
> of PCI BIOS compatible services, I can easily deal with address registers

All architectures do support PCI BIOS compatible services, but you
should not use them for reading of base addresses and IRQs since some
architectures (e.g. UltraSPARC) remap them to locations not representable
in the configuration registers (32-bit IRQ numbers and 64-bit base
addresses).

> for the SYM53C896 (even on a 32 bit PCI BUS where such a chip may be
> installed). But, AFAIK, linux-2.1 uses a new interface for PCI
> configuration accesses that is neither PCI BIOS - like, nor compatible.
>
> I have some questions:
>
> 1 - Which is the right kernel interface to use for 64 bit PCI and how must
> I use it for accessing the address registers of this PCI device.

Just use the base addresses stored in struct pci_dev and never read
the real address registers yourself.

> 2 - How much ready for 64 bit bit devices is Linux ?

I've never tested the Linux PCI code with real 64 bit devices, but it should
be able to handle them correctly:

- On 32-bit machines it's just able to read the 64 bit address and
throws out the device if it's been configured by the BIOS to use
addresses outside the 32 bit range the machine can handle.

- On 64-bit machines it fetches the whole address and the corresponding
pci_dev struct fields are large enough to hold it. Anyway, I'm not sure
all architectures are able to assign addresses to 64-bit devices
correctly.

Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"Every program in development at MIT expands until it can read mail."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html