All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
@ 2013-05-20 21:44 Sergey Yanovich
  2013-05-21 10:35 ` Marek Vasut
  0 siblings, 1 reply; 15+ messages in thread
From: Sergey Yanovich @ 2013-05-20 21:44 UTC (permalink / raw)
  To: u-boot

PXA270 CPU has turbo mode. The mode is 2.5 times faster than the
default run mode. Activating the mode early significantly speeds
up boot process.

Signed-off-by: Sergey Yanovich <ynvich@gmail.com>
---
 arch/arm/cpu/pxa/pxa2xx.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/pxa/pxa2xx.c b/arch/arm/cpu/pxa/pxa2xx.c
index 09e8177..6c918ac 100644
--- a/arch/arm/cpu/pxa/pxa2xx.c
+++ b/arch/arm/cpu/pxa/pxa2xx.c
@@ -32,6 +32,10 @@
 #include <common.h>
 #include <asm/arch/pxa-regs.h>
 
+#ifndef CONFIG_SYS_CLKCFG
+#define CONFIG_SYS_CLKCFG	0x00000002
+#endif
+
 /* Flush I/D-cache */
 static void cache_flush(void)
 {
@@ -244,7 +248,8 @@ void pxa_clock_setup(void)
 {
 	writel(CONFIG_SYS_CKEN, CKEN);
 	writel(CONFIG_SYS_CCCR, CCCR);
-	asm volatile("mcr	p14, 0, %0, c6, c0, 0" : : "r"(2));
+	asm volatile("mcr	p14, 0, %0, c6, c0, 0" : :
+			"r"(CONFIG_SYS_CLKCFG));
 
 	/* enable the 32Khz oscillator for RTC and PowerManager */
 	writel(OSCC_OON, OSCC);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-20 21:44 [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode Sergey Yanovich
@ 2013-05-21 10:35 ` Marek Vasut
  2013-05-21 10:51   ` Sergey Yanovich
  0 siblings, 1 reply; 15+ messages in thread
From: Marek Vasut @ 2013-05-21 10:35 UTC (permalink / raw)
  To: u-boot

Dear Sergey Yanovich,

> PXA270 CPU has turbo mode. The mode is 2.5 times faster than the
> default run mode. Activating the mode early significantly speeds
> up boot process.
> 
> Signed-off-by: Sergey Yanovich <ynvich@gmail.com>

What's the difference? Where does this macro get used ?

> ---
>  arch/arm/cpu/pxa/pxa2xx.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/pxa/pxa2xx.c b/arch/arm/cpu/pxa/pxa2xx.c
> index 09e8177..6c918ac 100644
> --- a/arch/arm/cpu/pxa/pxa2xx.c
> +++ b/arch/arm/cpu/pxa/pxa2xx.c
> @@ -32,6 +32,10 @@
>  #include <common.h>
>  #include <asm/arch/pxa-regs.h>
> 
> +#ifndef CONFIG_SYS_CLKCFG
> +#define CONFIG_SYS_CLKCFG	0x00000002
> +#endif
> +
>  /* Flush I/D-cache */
>  static void cache_flush(void)
>  {
> @@ -244,7 +248,8 @@ void pxa_clock_setup(void)
>  {
>  	writel(CONFIG_SYS_CKEN, CKEN);
>  	writel(CONFIG_SYS_CCCR, CCCR);
> -	asm volatile("mcr	p14, 0, %0, c6, c0, 0" : : "r"(2));
> +	asm volatile("mcr	p14, 0, %0, c6, c0, 0" : :
> +			"r"(CONFIG_SYS_CLKCFG));
> 
>  	/* enable the 32Khz oscillator for RTC and PowerManager */
>  	writel(OSCC_OON, OSCC);

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 10:35 ` Marek Vasut
@ 2013-05-21 10:51   ` Sergey Yanovich
  2013-05-21 10:55     ` Marek Vasut
  0 siblings, 1 reply; 15+ messages in thread
From: Sergey Yanovich @ 2013-05-21 10:51 UTC (permalink / raw)
  To: u-boot

Dear Marek Vasut,

On Tue, 2013-05-21 at 12:35 +0200, Marek Vasut wrote:
> > PXA270 CPU has turbo mode. The mode is 2.5 times faster than the
> > default run mode. Activating the mode early significantly speeds
> > up boot process.

> What's the difference? Where does this macro get used ?

Difference -- approx. 2.5 times faster system.

Who uses it -- ex. LP-8x4x board, support for which I am trying to merge
in a separate patch. Any PXA27X board can use it.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 10:51   ` Sergey Yanovich
@ 2013-05-21 10:55     ` Marek Vasut
  2013-05-21 11:14       ` Sergey Yanovich
  0 siblings, 1 reply; 15+ messages in thread
From: Marek Vasut @ 2013-05-21 10:55 UTC (permalink / raw)
  To: u-boot

Dear Sergey Yanovich,

> Dear Marek Vasut,
> 
> On Tue, 2013-05-21 at 12:35 +0200, Marek Vasut wrote:
> > > PXA270 CPU has turbo mode. The mode is 2.5 times faster than the
> > > default run mode. Activating the mode early significantly speeds
> > > up boot process.
> > 
> > What's the difference? Where does this macro get used ?
> 
> Difference -- approx. 2.5 times faster system.
> 
> Who uses it -- ex. LP-8x4x board, support for which I am trying to merge
> in a separate patch. Any PXA27X board can use it.

Why don't you enable it globally then ?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 10:55     ` Marek Vasut
@ 2013-05-21 11:14       ` Sergey Yanovich
  2013-05-21 11:22         ` Marek Vasut
  0 siblings, 1 reply; 15+ messages in thread
From: Sergey Yanovich @ 2013-05-21 11:14 UTC (permalink / raw)
  To: u-boot

Dear Marek Vasut,

On Tue, 2013-05-21 at 12:55 +0200, Marek Vasut wrote:
> > Difference -- approx. 2.5 times faster system.
> > 
> > Who uses it -- ex. LP-8x4x board, support for which I am trying to merge
> > in a separate patch. Any PXA27X board can use it.
> 
> Why don't you enable it globally then ?

It increases power consumption proportionally. Not everyone would agree
with this. Especially those with portable devices may rightfully object.

It is up to you to enable it globally. I could alter the patch to switch
turbo mode on by default and provide an option to disable it.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 11:14       ` Sergey Yanovich
@ 2013-05-21 11:22         ` Marek Vasut
  2013-05-21 11:22           ` Marek Vasut
  2013-05-21 11:42           ` Sergey Yanovich
  0 siblings, 2 replies; 15+ messages in thread
From: Marek Vasut @ 2013-05-21 11:22 UTC (permalink / raw)
  To: u-boot

Dear Sergey Yanovich,

> Dear Marek Vasut,
> 
> On Tue, 2013-05-21 at 12:55 +0200, Marek Vasut wrote:
> > > Difference -- approx. 2.5 times faster system.
> > > 
> > > Who uses it -- ex. LP-8x4x board, support for which I am trying to
> > > merge in a separate patch. Any PXA27X board can use it.
> > 
> > Why don't you enable it globally then ?
> 
> It increases power consumption proportionally. Not everyone would agree
> with this. Especially those with portable devices may rightfully object.
> 
> It is up to you to enable it globally. I could alter the patch to switch
> turbo mode on by default and provide an option to disable it.

Actually, I wonder if Linux's cpufreq still does depend on bootloader speed 
settings. Especially the turbo bit. Can you please check that? It'd be 
interesting to know ...

I'd say enable it by default ... I probably have all the PXA devices supported 
in U-Boot and I'm quite sure none of them will mind ;-)

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 11:22         ` Marek Vasut
@ 2013-05-21 11:22           ` Marek Vasut
  2013-05-21 16:23             ` Sergey Yanovich
  2013-05-21 11:42           ` Sergey Yanovich
  1 sibling, 1 reply; 15+ messages in thread
From: Marek Vasut @ 2013-05-21 11:22 UTC (permalink / raw)
  To: u-boot

[..]

> Actually, I wonder if Linux's cpufreq still does depend on bootloader speed
> settings. Especially the turbo bit. Can you please check that? It'd be
> interesting to know ...
> 
> I'd say enable it by default ... I probably have all the PXA devices
> supported in U-Boot and I'm quite sure none of them will mind ;-)

Still, I'm surprised it wasn't enabled. I recall seeing it enabled. Weird ...

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 11:22         ` Marek Vasut
  2013-05-21 11:22           ` Marek Vasut
@ 2013-05-21 11:42           ` Sergey Yanovich
  1 sibling, 0 replies; 15+ messages in thread
From: Sergey Yanovich @ 2013-05-21 11:42 UTC (permalink / raw)
  To: u-boot

PXA270 CPU has turbo mode. The mode is 2.5 times faster than the
default run mode. Activating the mode early significantly speeds
up boot process.

Signed-off-by: Sergey Yanovich <ynvich@gmail.com>

---
Changes for v2:
    - activate turbo mode and fast bus by default
---
 arch/arm/cpu/pxa/pxa2xx.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/pxa/pxa2xx.c b/arch/arm/cpu/pxa/pxa2xx.c
index 09e8177..c874ec0 100644
--- a/arch/arm/cpu/pxa/pxa2xx.c
+++ b/arch/arm/cpu/pxa/pxa2xx.c
@@ -32,6 +32,10 @@
 #include <common.h>
 #include <asm/arch/pxa-regs.h>
 
+#ifndef CONFIG_SYS_CLKCFG
+#define CONFIG_SYS_CLKCFG	0x0000000b
+#endif
+
 /* Flush I/D-cache */
 static void cache_flush(void)
 {
@@ -244,7 +248,8 @@ void pxa_clock_setup(void)
 {
 	writel(CONFIG_SYS_CKEN, CKEN);
 	writel(CONFIG_SYS_CCCR, CCCR);
-	asm volatile("mcr	p14, 0, %0, c6, c0, 0" : : "r"(2));
+	asm volatile("mcr	p14, 0, %0, c6, c0, 0" : :
+			"r"(CONFIG_SYS_CLKCFG));
 
 	/* enable the 32Khz oscillator for RTC and PowerManager */
 	writel(OSCC_OON, OSCC);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 11:22           ` Marek Vasut
@ 2013-05-21 16:23             ` Sergey Yanovich
  2013-05-21 19:25               ` Marek Vasut
  0 siblings, 1 reply; 15+ messages in thread
From: Sergey Yanovich @ 2013-05-21 16:23 UTC (permalink / raw)
  To: u-boot

On Tue, 2013-05-21 at 13:22 +0200, Marek Vasut wrote:
> > Actually, I wonder if Linux's cpufreq still does depend on bootloader speed
> > settings. Especially the turbo bit. Can you please check that? It'd be
> > interesting to know ...
> > 
> > I'd say enable it by default ... I probably have all the PXA devices
> > supported in U-Boot and I'm quite sure none of them will mind ;-)
> 
> Still, I'm surprised it wasn't enabled. I recall seeing it enabled. Weird ...

Yes, you are right. Linux's cpufreq-pxa2xx.c always sets the turbo bit.

However, if CONFIG_CPU_FREQ is not set (my case), bootloader's settings
are used.

I work on a system that has focus on low latency (industrial controller)
rather than battery life (since it has no battery).

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 16:23             ` Sergey Yanovich
@ 2013-05-21 19:25               ` Marek Vasut
  2013-05-21 19:45                 ` Sergey Yanovich
  2013-05-21 19:49                 ` Sergey Yanovich
  0 siblings, 2 replies; 15+ messages in thread
From: Marek Vasut @ 2013-05-21 19:25 UTC (permalink / raw)
  To: u-boot

Dear Sergey Yanovich,

> On Tue, 2013-05-21 at 13:22 +0200, Marek Vasut wrote:
> > > Actually, I wonder if Linux's cpufreq still does depend on bootloader
> > > speed settings. Especially the turbo bit. Can you please check that?
> > > It'd be interesting to know ...
> > > 
> > > I'd say enable it by default ... I probably have all the PXA devices
> > > supported in U-Boot and I'm quite sure none of them will mind ;-)
> > 
> > Still, I'm surprised it wasn't enabled. I recall seeing it enabled. Weird
> > ...
> 
> Yes, you are right. Linux's cpufreq-pxa2xx.c always sets the turbo bit.
> 
> However, if CONFIG_CPU_FREQ is not set (my case), bootloader's settings
> are used.
> 
> I work on a system that has focus on low latency (industrial controller)
> rather than battery life (since it has no battery).

So why not just make this patch into

-(2)
+(0xb)

instead of adding new (and undocumented ...) macro?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 19:25               ` Marek Vasut
@ 2013-05-21 19:45                 ` Sergey Yanovich
  2013-05-21 19:49                 ` Sergey Yanovich
  1 sibling, 0 replies; 15+ messages in thread
From: Sergey Yanovich @ 2013-05-21 19:45 UTC (permalink / raw)
  To: u-boot

Dear Marek Vasut,

On Tue, 2013-05-21 at 21:25 +0200,  wrote:
> So why not just make this patch into
> 
> -(2)
> +(0xb)
> 
> instead of adding new (and undocumented ...) macro?

Point taken. Looks like I am too careful in this case.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 19:25               ` Marek Vasut
  2013-05-21 19:45                 ` Sergey Yanovich
@ 2013-05-21 19:49                 ` Sergey Yanovich
  2013-05-21 19:58                   ` Marek Vasut
  1 sibling, 1 reply; 15+ messages in thread
From: Sergey Yanovich @ 2013-05-21 19:49 UTC (permalink / raw)
  To: u-boot

PXA270 CPU has turbo mode. The mode is 2.5 times faster than the
default run mode. Activating the mode early significantly speeds
up boot process.

Signed-off-by: Sergey Yanovich <ynvich@gmail.com>

---
Changes for v3:
    - make the change unconditional

Changes for v2:
    - activate turbo mode and fast bus by default
---
 arch/arm/cpu/pxa/pxa2xx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/pxa/pxa2xx.c b/arch/arm/cpu/pxa/pxa2xx.c
index 09e8177..67a2ce1 100644
--- a/arch/arm/cpu/pxa/pxa2xx.c
+++ b/arch/arm/cpu/pxa/pxa2xx.c
@@ -244,7 +244,7 @@ void pxa_clock_setup(void)
 {
 	writel(CONFIG_SYS_CKEN, CKEN);
 	writel(CONFIG_SYS_CCCR, CCCR);
-	asm volatile("mcr	p14, 0, %0, c6, c0, 0" : : "r"(2));
+	asm volatile("mcr	p14, 0, %0, c6, c0, 0" : : "r"(0x0b));
 
 	/* enable the 32Khz oscillator for RTC and PowerManager */
 	writel(OSCC_OON, OSCC);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 19:49                 ` Sergey Yanovich
@ 2013-05-21 19:58                   ` Marek Vasut
  2013-05-21 20:00                     ` Sergey Yanovich
  0 siblings, 1 reply; 15+ messages in thread
From: Marek Vasut @ 2013-05-21 19:58 UTC (permalink / raw)
  To: u-boot

Dear Sergey Yanovich,

> PXA270 CPU has turbo mode. The mode is 2.5 times faster than the
> default run mode. Activating the mode early significantly speeds
> up boot process.
> 
> Signed-off-by: Sergey Yanovich <ynvich@gmail.com>

OK, applied. Thanks

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 19:58                   ` Marek Vasut
@ 2013-05-21 20:00                     ` Sergey Yanovich
  2013-05-21 20:09                       ` Marek Vasut
  0 siblings, 1 reply; 15+ messages in thread
From: Sergey Yanovich @ 2013-05-21 20:00 UTC (permalink / raw)
  To: u-boot

Dear Marek Vasut,

On Tue, 2013-05-21 at 21:58 +0200, Marek Vasut wrote:
> OK, applied. Thanks

Thanks for your time, too.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode
  2013-05-21 20:00                     ` Sergey Yanovich
@ 2013-05-21 20:09                       ` Marek Vasut
  0 siblings, 0 replies; 15+ messages in thread
From: Marek Vasut @ 2013-05-21 20:09 UTC (permalink / raw)
  To: u-boot

Dear Sergey Yanovich,

> Dear Marek Vasut,
> 
> On Tue, 2013-05-21 at 21:58 +0200, Marek Vasut wrote:
> > OK, applied. Thanks
> 
> Thanks for your time, too.

hey, thanks for the patch ;-)

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-05-21 20:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-20 21:44 [U-Boot] [PATCH] arm: pxa: config option for PXA270 turbo mode Sergey Yanovich
2013-05-21 10:35 ` Marek Vasut
2013-05-21 10:51   ` Sergey Yanovich
2013-05-21 10:55     ` Marek Vasut
2013-05-21 11:14       ` Sergey Yanovich
2013-05-21 11:22         ` Marek Vasut
2013-05-21 11:22           ` Marek Vasut
2013-05-21 16:23             ` Sergey Yanovich
2013-05-21 19:25               ` Marek Vasut
2013-05-21 19:45                 ` Sergey Yanovich
2013-05-21 19:49                 ` Sergey Yanovich
2013-05-21 19:58                   ` Marek Vasut
2013-05-21 20:00                     ` Sergey Yanovich
2013-05-21 20:09                       ` Marek Vasut
2013-05-21 11:42           ` Sergey Yanovich

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.