Patchwork [U-Boot,v2,batch,2,17/23] powerpc/85xx: add missing QMAN frequency calculation

login
register
mail settings
Submitter York Sun
Date March 25, 2013, 5:33 p.m.
Message ID <1364232811-30856-17-git-send-email-yorksun@freescale.com>
Download mbox | patch
Permalink /patch/230803/
State Accepted, archived
Delegated to: Andy Fleming
Headers show

Comments

York Sun - March 25, 2013, 5:33 p.m.
From: Shaohui Xie <Shaohui.Xie@freescale.com>

When CONFIG_SYS_FSL_QORIQ_CHASSIS2 is not defined, QMAN frequency will not
be initialized, and QMAN will have a wrong frequency display.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 arch/powerpc/cpu/mpc85xx/speed.c |    4 ++++
 1 file changed, 4 insertions(+)
Andy Fleming - May 7, 2013, 11:04 p.m.
On Mon, Mar 25, 2013 at 12:33 PM, York Sun <yorksun@freescale.com> wrote:

> From: Shaohui Xie <Shaohui.Xie@freescale.com>
>
> When CONFIG_SYS_FSL_QORIQ_CHASSIS2 is not defined, QMAN frequency will not
> be initialized, and QMAN will have a wrong frequency display.
>
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
>  arch/powerpc/cpu/mpc85xx/speed.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/powerpc/cpu/mpc85xx/speed.c
> b/arch/powerpc/cpu/mpc85xx/speed.c
> index 9fc7b54..f00b1ab 100644
> --- a/arch/powerpc/cpu/mpc85xx/speed.c
> +++ b/arch/powerpc/cpu/mpc85xx/speed.c
> @@ -293,6 +293,10 @@ void get_sys_info (sys_info_t * sysInfo)
>  #endif
>  #endif
>
> +#ifdef CONFIG_SYS_DPAA_QBMAN
> +       sysInfo->freqQMAN = sysInfo->freqSystemBus / 2;
> +#endif
> +
>


Can we just move the original copy of the above lines out of the #ifdef? I
don't see any reason to do it the same way in two places.

Andy
York Sun - May 7, 2013, 11:18 p.m.
On 05/07/2013 04:04 PM, Andy Fleming wrote:
> 
> 
> 
> On Mon, Mar 25, 2013 at 12:33 PM, York Sun <yorksun@freescale.com
> <mailto:yorksun@freescale.com>> wrote:
> 
>     From: Shaohui Xie <Shaohui.Xie@freescale.com
>     <mailto:Shaohui.Xie@freescale.com>>
> 
>     When CONFIG_SYS_FSL_QORIQ_CHASSIS2 is not defined, QMAN frequency
>     will not
>     be initialized, and QMAN will have a wrong frequency display.
> 
>     Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com
>     <mailto:Shaohui.Xie@freescale.com>>
>     ---
>      arch/powerpc/cpu/mpc85xx/speed.c |    4 ++++
>      1 file changed, 4 insertions(+)
> 
>     diff --git a/arch/powerpc/cpu/mpc85xx/speed.c
>     b/arch/powerpc/cpu/mpc85xx/speed.c
>     index 9fc7b54..f00b1ab 100644
>     --- a/arch/powerpc/cpu/mpc85xx/speed.c
>     +++ b/arch/powerpc/cpu/mpc85xx/speed.c
>     @@ -293,6 +293,10 @@ void get_sys_info (sys_info_t * sysInfo)
>      #endif
>      #endif
> 
>     +#ifdef CONFIG_SYS_DPAA_QBMAN
>     +       sysInfo->freqQMAN = sysInfo->freqSystemBus / 2;
>     +#endif
>     +
> 
> 
> 
> Can we just move the original copy of the above lines out of the #ifdef?
> I don't see any reason to do it the same way in two places.
> 
>
You mean delete #ifdef? It will have a compiling error, won't it? See
include/e500.h, the freqQMAN is withing #ifdef.

York
Andy Fleming - May 9, 2013, 12:40 a.m.
Ah, ok, makes sense.

On May 7, 2013, at 18:18, "sun york-R58495" <R58495@freescale.com> wrote:

> On 05/07/2013 04:04 PM, Andy Fleming wrote:
>> 
>> 
>> 
>> On Mon, Mar 25, 2013 at 12:33 PM, York Sun <yorksun@freescale.com
>> <mailto:yorksun@freescale.com>> wrote:
>> 
>>    From: Shaohui Xie <Shaohui.Xie@freescale.com
>>    <mailto:Shaohui.Xie@freescale.com>>
>> 
>>    When CONFIG_SYS_FSL_QORIQ_CHASSIS2 is not defined, QMAN frequency
>>    will not
>>    be initialized, and QMAN will have a wrong frequency display.
>> 
>>    Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com
>>    <mailto:Shaohui.Xie@freescale.com>>
>>    ---
>>     arch/powerpc/cpu/mpc85xx/speed.c |    4 ++++
>>     1 file changed, 4 insertions(+)
>> 
>>    diff --git a/arch/powerpc/cpu/mpc85xx/speed.c
>>    b/arch/powerpc/cpu/mpc85xx/speed.c
>>    index 9fc7b54..f00b1ab 100644
>>    --- a/arch/powerpc/cpu/mpc85xx/speed.c
>>    +++ b/arch/powerpc/cpu/mpc85xx/speed.c
>>    @@ -293,6 +293,10 @@ void get_sys_info (sys_info_t * sysInfo)
>>     #endif
>>     #endif
>> 
>>    +#ifdef CONFIG_SYS_DPAA_QBMAN
>>    +       sysInfo->freqQMAN = sysInfo->freqSystemBus / 2;
>>    +#endif
>>    +
>> 
>> 
>> 
>> Can we just move the original copy of the above lines out of the #ifdef?
>> I don't see any reason to do it the same way in two places.
> You mean delete #ifdef? It will have a compiling error, won't it? See
> include/e500.h, the freqQMAN is withing #ifdef.
> 
> York
>

Patch

diff --git a/arch/powerpc/cpu/mpc85xx/speed.c b/arch/powerpc/cpu/mpc85xx/speed.c
index 9fc7b54..f00b1ab 100644
--- a/arch/powerpc/cpu/mpc85xx/speed.c
+++ b/arch/powerpc/cpu/mpc85xx/speed.c
@@ -293,6 +293,10 @@  void get_sys_info (sys_info_t * sysInfo)
 #endif
 #endif
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+	sysInfo->freqQMAN = sysInfo->freqSystemBus / 2;
+#endif
+
 #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */
 
 #else /* CONFIG_FSL_CORENET */