All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kumar Gala <galak@kernel.crashing.org>
To: "Li Yang-r58472" <LeoLi@freescale.com>
Cc: "Tabi Timur-B04825" <timur@freescale.com>,
	<netdev@vger.kernel.org>, <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa
Date: Thu, 8 Feb 2007 00:53:23 -0600	[thread overview]
Message-ID: <17A046C6-5FD3-46D5-AB96-EAEDF22FA829@kernel.crashing.org> (raw)
In-Reply-To: <989B956029373F45A0B8AF02970818900D4401@zch01exm26.fsl.freescale.net>


On Feb 8, 2007, at 12:48 AM, Li Yang-r58472 wrote:

>> -----Original Message-----
>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>> Sent: Thursday, February 08, 2007 1:58 PM
>> To: Li Yang-r58472
>> Cc: Tabi Timur-B04825; netdev@vger.kernel.org; linuxppc- 
>> dev@ozlabs.org
>> Subject: Re: [PATCH 1/4] ucc_geth: Change private  
>> immrbar_virt_to_phys
> to generic
>> iopa
>>
>>
>> On Feb 7, 2007, at 11:52 PM, Li Yang-r58472 wrote:
>>
>>>> -----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
>>>>
>>>> Kumar Gala wrote:
>>>>
>>>>> If its been mapped with ioremap() you know the physical address
>>> already
>>>>> so why do you need iopa().
>>>>
>>>> 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().
>>>>
>>>> static inline unsigned long immrbar_virt_to_phys(volatile void *
>>> address)
>>>> {
>>>> 	if ( ((u32)address >= (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);
>>>> }
>>>>
>>>> get_qe_base() does a search of the OF tree the first time it's
>>>> called.
>>>>
>>>> Here's the code that calls immrbar_virt_to_phys():
>>>>
>>>> 	out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
>>>> 		 (u32) immrbar_virt_to_phys(ugeth->
>>>> 					    p_tx_bd_ring[i]));
>>>>
>>>>
>>>> Would it be better to replace this code with something like this:
>>>>
>>>> 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.
>>
>> Does MURAM behave differently than normal memory?
>
> 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.

- k

WARNING: multiple messages have this Message-ID (diff)
From: Kumar Gala <galak@kernel.crashing.org>
To: "Li Yang-r58472" <LeoLi@freescale.com>
Cc: netdev@vger.kernel.org, Tabi Timur-B04825 <timur@freescale.com>,
	linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa
Date: Thu, 8 Feb 2007 00:53:23 -0600	[thread overview]
Message-ID: <17A046C6-5FD3-46D5-AB96-EAEDF22FA829@kernel.crashing.org> (raw)
In-Reply-To: <989B956029373F45A0B8AF02970818900D4401@zch01exm26.fsl.freescale.net>


On Feb 8, 2007, at 12:48 AM, Li Yang-r58472 wrote:

>> -----Original Message-----
>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>> Sent: Thursday, February 08, 2007 1:58 PM
>> To: Li Yang-r58472
>> Cc: Tabi Timur-B04825; netdev@vger.kernel.org; linuxppc- 
>> dev@ozlabs.org
>> Subject: Re: [PATCH 1/4] ucc_geth: Change private  
>> immrbar_virt_to_phys
> to generic
>> iopa
>>
>>
>> On Feb 7, 2007, at 11:52 PM, Li Yang-r58472 wrote:
>>
>>>> -----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
>>>>
>>>> Kumar Gala wrote:
>>>>
>>>>> If its been mapped with ioremap() you know the physical address
>>> already
>>>>> so why do you need iopa().
>>>>
>>>> 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().
>>>>
>>>> static inline unsigned long immrbar_virt_to_phys(volatile void *
>>> address)
>>>> {
>>>> 	if ( ((u32)address >= (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);
>>>> }
>>>>
>>>> get_qe_base() does a search of the OF tree the first time it's
>>>> called.
>>>>
>>>> Here's the code that calls immrbar_virt_to_phys():
>>>>
>>>> 	out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
>>>> 		 (u32) immrbar_virt_to_phys(ugeth->
>>>> 					    p_tx_bd_ring[i]));
>>>>
>>>>
>>>> Would it be better to replace this code with something like this:
>>>>
>>>> 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.
>>
>> Does MURAM behave differently than normal memory?
>
> 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.

- k

  reply	other threads:[~2007-02-08  6:54 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-06 11:31 [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa Li Yang
2007-02-06 14:26 ` Kumar Gala
2007-02-06 14:26   ` Kumar Gala
2007-02-07  9:34   ` Li Yang-r58472
2007-02-07  9:34     ` Li Yang-r58472
2007-02-07 16:36     ` Kumar Gala
2007-02-07 16:36       ` Kumar Gala
2007-02-07 16:43   ` Timur Tabi
2007-02-07 16:43     ` Timur Tabi
2007-02-07 16:49     ` Kumar Gala
2007-02-07 16:49       ` Kumar Gala
2007-02-07 17:03       ` Timur Tabi
2007-02-07 17:03         ` Timur Tabi
2007-02-08  5:52         ` Li Yang-r58472
2007-02-08  5:52           ` Li Yang-r58472
2007-02-08  5:57           ` Kumar Gala
2007-02-08  6:48             ` Li Yang-r58472
2007-02-08  6:48               ` Li Yang-r58472
2007-02-08  6:53               ` Kumar Gala [this message]
2007-02-08  6:53                 ` Kumar Gala
2007-02-08  7:06                 ` Li Yang-r58472
2007-02-08  7:06                   ` Li Yang-r58472
2007-02-08  7:16                   ` Kumar Gala
2007-02-08  7:16                     ` Kumar Gala
2007-02-08  7:36                     ` Li Yang-r58472
2007-02-08  7:36                       ` Li Yang-r58472
2007-02-08  7:41                       ` Kumar Gala
2007-02-08  7:41                         ` Kumar Gala
2007-02-08  9:22                         ` Discussion about iopa() Li Yang-r58472
2007-02-08 13:41                           ` Timur Tabi
2007-02-09 17:08                             ` Dan Malek
2007-02-10  2:37                               ` Benjamin Herrenschmidt
2007-02-10 18:04                                 ` Dan Malek
2007-02-10 21:40                                   ` Benjamin Herrenschmidt
2007-02-10 22:27                                     ` Dan Malek
2007-02-10 22:42                                       ` Benjamin Herrenschmidt
2007-02-08 21:26                           ` Benjamin Herrenschmidt
2007-02-09 17:13                             ` Dan Malek
2007-02-09 22:06                               ` Benjamin Herrenschmidt
2007-02-09 22:46                                 ` Kumar Gala
2007-02-09 22:51                                   ` Timur Tabi
2007-02-09 23:06                                     ` Kumar Gala
2007-02-09 23:10                                       ` Timur Tabi
2007-02-09 23:19                                         ` Benjamin Herrenschmidt
2007-02-09 23:22                                         ` Kumar Gala
2007-02-09 23:33                                           ` Timur Tabi
2007-02-09 23:43                                             ` Kumar Gala
2007-02-09 17:06                           ` Dan Malek
2007-02-08 13:35                 ` [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa Timur Tabi
2007-02-08 13:35                   ` Timur Tabi
2007-02-09 17:22                   ` Dan Malek
2007-02-09 17:26                     ` Timur Tabi
2007-02-09 17:26                       ` Timur Tabi
2007-02-08 13:27           ` Timur Tabi
2007-02-07  0:19 ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17A046C6-5FD3-46D5-AB96-EAEDF22FA829@kernel.crashing.org \
    --to=galak@kernel.crashing.org \
    --cc=LeoLi@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=timur@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.