Messages in this thread | | | Date | Wed, 03 Nov 1999 09:42:53 -0500 | From | Jeff Garzik <> | Subject | Re: Specifying properly the PCI driver model on all linux architectur es, (ioremap(), bus_to_virt() ...) |
| |
Adrian Cox wrote: > > Jeff Garzik wrote: > [ snip ] > > Bret Indrelee wrote: > > > [ snip ] > > > Actually, my understanding is that the base_address[] is assigned in the PCI > > > configuration. The configuration registers are programmed with the PCI > > > physical address, and the base_address[] is set to the system physical > > > address (which may be different.) > > > > base_address[] is a bus address > > But with multiple PCI buses, the base_address cannot be a simple bus > address, because the PCI bus number must be coded in there. For example, > on alpha the PCI_HANDLE from include/asm-alpha/pci.h is or'ed into the > base_address. > > As far as I can tell, the base_address[] is always correct for ioremap.
Right. For multiple buses you probably have to consider this a "cookie" rather than a real address as well
> But are the following two tricks valid: > > 1) Using the contents of base_address[] as an offset when mmapping > /dev/mem from userspace? > > 2) Using the contents of base_address[] as a target address for peer to > peer DMA on PCI?
Probably should get addresses from the PCI registers instead, unless there is a portable macro which extracts the bus-specific address from the bus address cookie
- 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.tux.org/lkml/
| |