Skip to contentSkip to conversation

Difference between ioremap() and phy_to_virt() Kernel function

DISCUSSION Misbah khan 2 participants 4 messages Oct 22, 2007 – Oct 23, 2007

lore
Share & tools
lore
#0 lore raw

Hi all

Could you Please let me know what is the difference between ioremap() and phy_to_virt() function being provided by the Kernel.

--Misbah

Signature · 2 lines
View this message in context: http://www.nabble.com/Difference-between-ioremap%28%29-and-phy_to_virt%28%29-Kernel-function-tf4669833.html#a13339930
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
#1 lore raw
Quoted 2 lines · Misbah khan

Could you Please let me know what is the difference between ioremap() and phy_to_virt() function being provided by the Kernel.

ioremap gives you a new mapping for I/O addresses that you can access with functions like in_be32 and the like.

phy_to_virt() is rarely used at all, it only serves to convert a physical address for main memory (RAM) into the address used inside of the kernel.

	Arnd <><
#2 lore raw

Thanks Arnd

But i wish to know that could i use phy_to_virt() function in place io ioremap() ????? And could you give me an example where we could use phy_to_virt(). ioremap() implementation i have already done.

---Misbah

Quoted 18 lines · Arnd Bergmann
Quoted 2 lines · Misbah khan

Could you Please let me know what is the difference between ioremap() and phy_to_virt() function being provided by the Kernel.

ioremap gives you a new mapping for I/O addresses that you can access with functions like in_be32 and the like.

phy_to_virt() is rarely used at all, it only serves to convert a physical address for main memory (RAM) into the address used inside of the kernel.

	Arnd <><

_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Signature · 2 lines
View this message in context: http://www.nabble.com/Difference-between-ioremap%28%29-and-phy_to_virt%28%29-Kernel-function-tf4669833.html#a13357088
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
#3 lore raw
Quoted 2 lines · Misbah khan

But i wish to know that could i use phy_to_virt() function in place io ioremap() ?????

Sorry to disappoint you there, but you can't.

Quoted 1 line

And could you give me an example where we could use phy_to_virt().

Not really, I can't think of any correct use of phys_to_virt on powerpc.

	Arnd <><