Addressing PCI memory
paubert at iram.es
Wed May 16 03:02:28 EST 2001
On Tue, 15 May 2001, Amelia De Vivo wrote:
> Hi all, I'm trying to write a driver for a 64 bit PCI device. Something like
> this works well under i386 Linux, but it doesn't work at all for Linux
> 2.2.15 by Yellow Dog:
> struct pci_dev *dev = NULL;
> dev = pci_find_device(vendor, device, dev);
> pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &cards.addr0);
First, use the resource in the dev structure, they do not necessarily
correspond to the value read from the base, even on Intel BTW.
cards.addr0 = dev->resources.start
don't even need to mask the address bits...
Report again if the problems persist.
> cards.vaddr = (void *) ioremap((cards.addr0 &
> PCI_BASE_ADDRESS_MEM_MASK), cards.size);
> I have a kernel panic on writeb. Has someone some suggestion?
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc-dev