RE: virtual / physical address translation

"Timothy Legge" <[email protected]> Fri, 16 Sep 2005 09:02:19 -0300
Newsgroups gmane.network.etherboot.devel
Message-ID <[email protected]>
> I want to access a PCI device through its memory space. I 
> have the physical addresses from the device's BARs. How can I 
> post memory write commands to the device?
> How do I convert from physical to virtual addresses and the 
> virtual to physical addresses?
> Thanks

Take a look at any of the recent pci drivers that use the pci BAR to
obtain the device address such as:

e1000.c
forcedeth.c
ns83820.c
r8169.c
tg3.c

The device address reported by the device is the physical and in read
and writes you can use that address as the io address.  The only place
converting from physical to virtual addresses come in is in attempting
to assign a memory addess to cars capable to DMA.  In that case you can
also revied the drivers above specifically in the init_rings buffers
addresses are assigned to the card.

TIm

**********************************************************************
This E-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary, confidential and exempt fromdisclosure. If you are not the intended recipient, you are notified thatany dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender and erase this E-mail message immediately. 

Le present message electronique (y compris les pieces qui y sont annexees, le cas echeant) s'addresse au destinataire indique et peut contenir des renseignements de caractere prive ou confidentiel. Si vous n'etes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire. Si ce message vous a ete transmis par erreur, veuillez en informer l'expediteur et le  supprimer immediatement.



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php