Discussion about iopa()
LeoLi at freescale.com
Thu Feb 8 20:22:10 EST 2007
> >>>>> MURAM is a mmio region so it don't share the characteristic of
> > main
> >>>>> memory that phy_addr = virt_addr - PAGE_OFFSET. While they can
> >>>>> both be
> >>>>> mapped through page table using iopa().
> >>>> Right, so when do you know if you'll be using MURAM or normal
> >>>> memory? Why not just keep around a token that is the physical
> >>>> address at the point you make the decision of MURAM vs normal
> > memory.
> >>> Yes, that can be a way. But as the virt to phy mapping is only
> >>> once, it's nothing bad to do it this way.
> >> The problem as I stated before with using iopa() is that its not
> >> supported across platforms.
> > Yes, it is only for PPC32. But we don't have another API to do
> > it. How
> > about make it more generic to add PPC64 version?
> Why do you need another API to do this, you already have the
> information you want, its just a matter of you keeping track of it.
Do you think we should remove iopa?
The information is often not so obvious. The most case of using iopa is
that we allocate memory from MURAM using rheap, and then get the
physical address of it. We can calculate phy_addr by using: virt_addr
- virt_muram_base + phy_muram_base, but it is not as straightforward as
just using the page table, let alone we need to keep track of
virt_muram_base and phy_muram_base.
More information about the Linuxppc-dev