RE: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa
From: Li Yang-r58472 <hidden>
Date: 2007-02-08 05:51:23
Also in:
netdev
-----Original Message----- From: Timur Tabi [mailto:timur@freescale.com] Sent: Thursday, February 08, 2007 1:03 AM To: Kumar Gala Cc: Li Yang-r58472; netdev@vger.kernel.org; linuxppc-dev@ozlabs.org Subject: Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys
to generic
iopa =20 Kumar Gala wrote: =20quoted
If its been mapped with ioremap() you know the physical address
already
quoted
so why do you need iopa().=20 That's what the original function immrbar_virt_to_phys() does. We're
trying to
get rid of it, because we thought is redundant with iopa(). =20 static inline unsigned long immrbar_virt_to_phys(volatile void *
address)
{
if ( ((u32)address >=3D (u32)qe_immr) &&
((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)))
return (unsigned long)(address - (u32)qe_immr + (u32)get_qe_base()); return (unsigned long)virt_to_phys(address); } =20 get_qe_base() does a search of the OF tree the first time it's called. =20 Here's the code that calls immrbar_virt_to_phys(): =20 out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base, (u32) immrbar_virt_to_phys(ugeth-> p_tx_bd_ring[i])); =20 =20 Would it be better to replace this code with something like this: =20 out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base, get_qe_base() + ((void *) ugeth->p_tx_bd_ring[i] - (void *)
qe_immr)); No, we don't know if the BD ring is in MURAM or main memory as it is configurable. iopa() is best choice to handle both case, IMHO. - Leo