Update: RE: G4 + Linux + PCI device + x86 driver = 0

David Edelsohn dje at watson.ibm.com
Sat Dec 4 11:50:05 EST 1999


>>>>> "David W Patmore" writes:

avid> 1.  I had to enable memory writes (PCI_COMMAND_MEMORY), which was somehow
David> handled automataically on x86, but not here.
David> {
David> pci_read_config_word( pDev, PCI_COMMAND, &value );
David> value |= PCI_COMMAND_MEMORY;
David> pci_write_config_word( pDev, PCI_COMMAND, value );
David> }
David> For good measure, I also set PCI_COMMAND_MASTER, though I also call
David> pci_set_master(), which covers the issue.

	It is up to the device driver or the card to set all of these bits
if necessary.

David> 2.  I had to byte-swap all pointers that I supply to my device.  For
David> portability, I made a set of macros, "SYS_TO_LE() and LE_TO_SYS(), etc. so
David> that both endian architectures could work out.

	Linux already provides macros like le16_to_cpu(), etc. for this. 

David

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list