Addressing PCI memory
Takashi Oe
toe at unlserve.unl.edu
Wed May 16 02:58:58 EST 2001
On Tue, 15 May 2001 18:34:50 +0200, 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[0].addr0);
> cards[0].vaddr = (void *) ioremap((cards[0].addr0 &
> PCI_BASE_ADDRESS_MEM_MASK), cards[0].size);
> writeb('A',(cards[0].vaddr)+0x1000);
>
> I have a kernel panic on writeb. Has someone some suggestion?
Is PCI_COMMAND_MEMORY enabled on the device? On Apple machines,
it's usually not enabled by default. For 2.2.15, you'd need to
manually enable it. [grep PCI_COMMAND_MEMORY for more info.]
Takashi Oe
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc-dev
mailing list