Re: [PATCH] Add cpufreq driver for Momentum Maple boards

2011-06-17 Thread Dave Jones
On Fri, Jun 17, 2011 at 03:12:56PM +0400, Dmitry Eremin-Solenikov wrote:
 > What about drivers/cpufreq/powerpc, or it's an unnecessary?

We haven't done it so far for x86 & arm, so for now at least, just keeping
them in drivers/cpufreq/ should be sufficient.

 > Should I resumbit it, or there will be massive arch/powerpc ->
 > drivers/cpufreq move?

Good question. I haven't heard anything from any of the PPC maintainers
on this subject, but I'll be happy to help out where I can if they
decide to follow suit with x86/arm.

Dave

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cpufreq driver for Momentum Maple boards

2011-06-17 Thread Arnd Bergmann
On Friday 17 June 2011 13:12:56 Dmitry Eremin-Solenikov wrote:
> > I think new cpufreq drivers should live in drivers/cpufreq, not in arch/.
> > We've
> > started moving other drivers away from arch/x86 and arch/arm already.
> 
> What about drivers/cpufreq/powerpc, or it's an unnecessary?

drivers/cpufreq is fine by itself, unless Dave has some preference.

> Should I resumbit it, or there will be massive arch/powerpc ->
> drivers/cpufreq move?

My recommendation would be to submit the new driver for drivers/cpufreq
directly and let Ben take care of the others at a convenient time.

Arnd
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cpufreq driver for Momentum Maple boards

2011-06-17 Thread Dmitry Eremin-Solenikov
Hello,

On 6/17/11, Arnd Bergmann  wrote:
> On Friday 17 June 2011 10:49:16 Dmitry Eremin-Solenikov wrote:
>> Add simple cpufreq driver for Maple-based boards (ppc970fx evaluation
>> kit and others). Driver is based on a cpufreq driver for 64-bit powermac
>> boxes with all pmac-dependant features removed and simple cleanup
>> applied.
>>
>> Signed-off-by: Dmitry Eremin-Solenikov 
>> ---
>>  arch/powerpc/kernel/misc_64.S  |4 +-
>>  arch/powerpc/platforms/Kconfig |8 +
>>  arch/powerpc/platforms/maple/Makefile  |1 +
>>  arch/powerpc/platforms/maple/cpufreq.c |  317
>> 
>>  4 files changed, 328 insertions(+), 2 deletions(-)
>>  create mode 100644 arch/powerpc/platforms/maple/cpufreq.c
>>
>
>
> I think new cpufreq drivers should live in drivers/cpufreq, not in arch/.
> We've
> started moving other drivers away from arch/x86 and arch/arm already.

What about drivers/cpufreq/powerpc, or it's an unnecessary?

Should I resumbit it, or there will be massive arch/powerpc ->
drivers/cpufreq move?

-- 
With best wishes
Dmitry
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cpufreq driver for Momentum Maple boards

2011-06-17 Thread Arnd Bergmann
On Friday 17 June 2011 10:49:16 Dmitry Eremin-Solenikov wrote:
> Add simple cpufreq driver for Maple-based boards (ppc970fx evaluation
> kit and others). Driver is based on a cpufreq driver for 64-bit powermac
> boxes with all pmac-dependant features removed and simple cleanup
> applied.
> 
> Signed-off-by: Dmitry Eremin-Solenikov 
> ---
>  arch/powerpc/kernel/misc_64.S  |4 +-
>  arch/powerpc/platforms/Kconfig |8 +
>  arch/powerpc/platforms/maple/Makefile  |1 +
>  arch/powerpc/platforms/maple/cpufreq.c |  317 
> 
>  4 files changed, 328 insertions(+), 2 deletions(-)
>  create mode 100644 arch/powerpc/platforms/maple/cpufreq.c
> 


I think new cpufreq drivers should live in drivers/cpufreq, not in arch/. We've
started moving other drivers away from arch/x86 and arch/arm already.

The code itself looks good.

Arnd
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cpufreq driver for Momentum Maple boards

2011-06-16 Thread Benjamin Herrenschmidt
On Sat, 2011-05-21 at 14:28 +0400, Dmitry Eremin-Solenikov wrote:
> Add simple cpufreq driver for Maple-based boards (ppc970fx evaluation
> kit and others). Driver is based on a cpufreq driver for 64-bit powermac
> boxes with all pmac-dependant features removed and simple cleanup
> applied.

No special comment other than please replace all the g5_* with maple_
for consistency.

Cheers,
Ben.

> Signed-off-by: Dmitry Eremin-Solenikov 
> ---
>  arch/powerpc/kernel/misc_64.S  |4 +-
>  arch/powerpc/platforms/Kconfig |8 +
>  arch/powerpc/platforms/maple/Makefile  |1 +
>  arch/powerpc/platforms/maple/cpufreq.c |  317 
> 
>  4 files changed, 328 insertions(+), 2 deletions(-)
>  create mode 100644 arch/powerpc/platforms/maple/cpufreq.c
> 
> diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
> index 206a321..c442aae 100644
> --- a/arch/powerpc/kernel/misc_64.S
> +++ b/arch/powerpc/kernel/misc_64.S
> @@ -339,7 +339,7 @@ _GLOBAL(real_205_writeb)
>  #endif /* CONFIG_PPC_PASEMI */
>  
> 
> -#ifdef CONFIG_CPU_FREQ_PMAC64
> +#if defined(CONFIG_CPU_FREQ_PMAC64) || defined(CONFIG_CPU_FREQ_MAPLE)
>  /*
>   * SCOM access functions for 970 (FX only for now)
>   *
> @@ -408,7 +408,7 @@ _GLOBAL(scom970_write)
>   /* restore interrupts */
>   mtmsrd  r5,1
>   blr
> -#endif /* CONFIG_CPU_FREQ_PMAC64 */
> +#endif /* CONFIG_CPU_FREQ_PMAC64 || CONFIG_CPU_FREQ_MAPLE */
>  
> 
>  /*
> diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
> index f7b0772..4c5eb5b 100644
> --- a/arch/powerpc/platforms/Kconfig
> +++ b/arch/powerpc/platforms/Kconfig
> @@ -187,6 +187,14 @@ config PPC_PASEMI_CPUFREQ
> This adds the support for frequency switching on PA Semi
> PWRficient processors.
>  
> +config CPU_FREQ_MAPLE
> + bool "Support for Maple 970FX Evaluation Board"
> + depends on PPC_MAPLE
> + select CPU_FREQ_TABLE
> + help
> +   This adds support for frequency switching on Maple 970FX
> +   Evaluation Board and compatible boards (IBM JS2x blades).
> +
>  endmenu
>  
>  config PPC601_SYNC_FIX
> diff --git a/arch/powerpc/platforms/maple/Makefile 
> b/arch/powerpc/platforms/maple/Makefile
> index 1be1a99..0b3e3e3 100644
> --- a/arch/powerpc/platforms/maple/Makefile
> +++ b/arch/powerpc/platforms/maple/Makefile
> @@ -1 +1,2 @@
>  obj-y+= setup.o pci.o time.o
> +obj-$(CONFIG_CPU_FREQ_MAPLE) += cpufreq.o
> diff --git a/arch/powerpc/platforms/maple/cpufreq.c 
> b/arch/powerpc/platforms/maple/cpufreq.c
> new file mode 100644
> index 000..854adfa
> --- /dev/null
> +++ b/arch/powerpc/platforms/maple/cpufreq.c
> @@ -0,0 +1,317 @@
> +/*
> + *  Copyright (C) 2011 Dmitry Eremin-Solenikov
> + *  Copyright (C) 2002 - 2005 Benjamin Herrenschmidt 
> 
> + *  and   Markus Demleitner 
> 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This driver adds basic cpufreq support for SMU & 970FX based G5 Macs,
> + * that is iMac G5 and latest single CPU desktop.
> + */
> +
> +#undef DEBUG
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define DBG(fmt...) pr_debug(fmt)
> +
> +/* see 970FX user manual */
> +
> +#define SCOM_PCR 0x0aa001/* PCR scom addr */
> +
> +#define PCR_HILO_SELECT  0x8000U /* 1 = PCR, 0 = PCRH */
> +#define PCR_SPEED_FULL   0xU /* 1:1 speed value */
> +#define PCR_SPEED_HALF   0x0002U /* 1:2 speed value */
> +#define PCR_SPEED_QUARTER0x0004U /* 1:4 speed value */
> +#define PCR_SPEED_MASK   0x000eU /* speed mask */
> +#define PCR_SPEED_SHIFT  17
> +#define PCR_FREQ_REQ_VALID   0x0001U /* freq request valid */
> +#define PCR_VOLT_REQ_VALID   0x8000U /* volt request valid */
> +#define PCR_TARGET_TIME_MASK 0x6000U /* target time */
> +#define PCR_STATLAT_MASK 0x1f00U /* STATLAT value */
> +#define PCR_SNOOPLAT_MASK0x00f0U /* SNOOPLAT value */
> +#define PCR_SNOOPACC_MASK0x000fU /* SNOOPACC value */
> +
> +#define SCOM_PSR 0x408001/* PSR scom addr */
> +/* warning: PSR is a 64 bits register */
> +#define PSR_CMD_RECEIVED 0x2000U   /* command received */
> +#define PSR_CMD_COMPLETED0x1000U   /* command completed */
> +#define PSR_CUR_SPEED_MASK   0x0300U   /* current speed */
> +#define PSR_CUR_SPEED_SHIFT  (56)
> +
> +/*
> + * The G5 only supports two frequencies (Quarter speed is not supported)
> + */
> +#define CPUFREQ_HIGH  0
> +#define CPUFREQ_LOW   1
> 

Re: [PATCH] Add cpufreq driver for Momentum Maple boards

2011-06-04 Thread Dmitry Eremin-Solenikov
On 6/4/11, Benjamin Herrenschmidt  wrote:
> On Sat, 2011-06-04 at 13:00 +0400, Dmitry Eremin-Solenikov wrote:
>> On 5/30/11, Dmitry Eremin-Solenikov  wrote:
>> > Hello,
>> >
>> > On 5/21/11, Dmitry Eremin-Solenikov  wrote:
>> >> Add simple cpufreq driver for Maple-based boards (ppc970fx evaluation
>> >> kit and others). Driver is based on a cpufreq driver for 64-bit
>> >> powermac
>> >> boxes with all pmac-dependant features removed and simple cleanup
>> >> applied.
>> >>
>> >> Signed-off-by: Dmitry Eremin-Solenikov 
>> >> ---
>> >>  arch/powerpc/kernel/misc_64.S  |4 +-
>> >>  arch/powerpc/platforms/Kconfig |8 +
>> >>  arch/powerpc/platforms/maple/Makefile  |1 +
>> >>  arch/powerpc/platforms/maple/cpufreq.c |  317
>> >> 
>> >>  4 files changed, 328 insertions(+), 2 deletions(-)
>> >>  create mode 100644 arch/powerpc/platforms/maple/cpufreq.c
>> >
>> > What about this patch?
>>
>> Pinging again. Any problems/comments/objections to this patch?
>
> Well, obviously nobody had time to review it yet

I'm just a bit impatient. It has been already two weeks...

-- 
With best wishes
Dmitry
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cpufreq driver for Momentum Maple boards

2011-06-04 Thread Benjamin Herrenschmidt
On Sat, 2011-06-04 at 13:00 +0400, Dmitry Eremin-Solenikov wrote:
> On 5/30/11, Dmitry Eremin-Solenikov  wrote:
> > Hello,
> >
> > On 5/21/11, Dmitry Eremin-Solenikov  wrote:
> >> Add simple cpufreq driver for Maple-based boards (ppc970fx evaluation
> >> kit and others). Driver is based on a cpufreq driver for 64-bit powermac
> >> boxes with all pmac-dependant features removed and simple cleanup
> >> applied.
> >>
> >> Signed-off-by: Dmitry Eremin-Solenikov 
> >> ---
> >>  arch/powerpc/kernel/misc_64.S  |4 +-
> >>  arch/powerpc/platforms/Kconfig |8 +
> >>  arch/powerpc/platforms/maple/Makefile  |1 +
> >>  arch/powerpc/platforms/maple/cpufreq.c |  317
> >> 
> >>  4 files changed, 328 insertions(+), 2 deletions(-)
> >>  create mode 100644 arch/powerpc/platforms/maple/cpufreq.c
> >
> > What about this patch?
> 
> Pinging again. Any problems/comments/objections to this patch?

Well, obviously nobody had time to review it yet

Cheers,
Ben.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cpufreq driver for Momentum Maple boards

2011-06-04 Thread Dmitry Eremin-Solenikov
On 5/30/11, Dmitry Eremin-Solenikov  wrote:
> Hello,
>
> On 5/21/11, Dmitry Eremin-Solenikov  wrote:
>> Add simple cpufreq driver for Maple-based boards (ppc970fx evaluation
>> kit and others). Driver is based on a cpufreq driver for 64-bit powermac
>> boxes with all pmac-dependant features removed and simple cleanup
>> applied.
>>
>> Signed-off-by: Dmitry Eremin-Solenikov 
>> ---
>>  arch/powerpc/kernel/misc_64.S  |4 +-
>>  arch/powerpc/platforms/Kconfig |8 +
>>  arch/powerpc/platforms/maple/Makefile  |1 +
>>  arch/powerpc/platforms/maple/cpufreq.c |  317
>> 
>>  4 files changed, 328 insertions(+), 2 deletions(-)
>>  create mode 100644 arch/powerpc/platforms/maple/cpufreq.c
>
> What about this patch?

Pinging again. Any problems/comments/objections to this patch?

-- 
With best wishes
Dmitry
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cpufreq driver for Momentum Maple boards

2011-05-30 Thread Dmitry Eremin-Solenikov
Hello,

On 5/21/11, Dmitry Eremin-Solenikov  wrote:
> Add simple cpufreq driver for Maple-based boards (ppc970fx evaluation
> kit and others). Driver is based on a cpufreq driver for 64-bit powermac
> boxes with all pmac-dependant features removed and simple cleanup
> applied.
>
> Signed-off-by: Dmitry Eremin-Solenikov 
> ---
>  arch/powerpc/kernel/misc_64.S  |4 +-
>  arch/powerpc/platforms/Kconfig |8 +
>  arch/powerpc/platforms/maple/Makefile  |1 +
>  arch/powerpc/platforms/maple/cpufreq.c |  317
> 
>  4 files changed, 328 insertions(+), 2 deletions(-)
>  create mode 100644 arch/powerpc/platforms/maple/cpufreq.c

What about this patch?

-- 
With best wishes
Dmitry
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev