* [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier
@ 2010-06-24 13:57 Marek Vasut
2010-06-24 13:57 ` [PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine Marek Vasut
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Marek Vasut @ 2010-06-24 13:57 UTC (permalink / raw)
To: linux-arm-kernel
The value should be 24, not 0 in the possibilities array. It was just a silly
mistake.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/pxa3xx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index f544e58..611622a 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -52,7 +52,7 @@
static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
/* crystal frequency to HSIO bus frequency multiplier (HSS) */
-static unsigned char hss_mult[4] = { 8, 12, 16, 0 };
+static unsigned char hss_mult[4] = { 8, 12, 16, 24 };
/*
* Get the clock frequency as reflected by CCSR and the turbo flag.
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine
2010-06-24 13:57 [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier Marek Vasut
@ 2010-06-24 13:57 ` Marek Vasut
2010-06-28 4:38 ` Eric Miao
2010-06-24 13:57 ` [PATCH 3/3] pxa2xx/cpufreq: Fix PCMCIA frequency scaling Marek Vasut
2010-06-28 3:56 ` [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier Eric Miao
2 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2010-06-24 13:57 UTC (permalink / raw)
To: linux-arm-kernel
This patch:
1) Simpifies the DRI recomputation routine by pulling out the common code
2) Fixes a bug in PXA27x DRI recomputation caused by incorrect parenthesis
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/cpufreq-pxa2xx.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 9e4d981..bb5f21e 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
@@ -256,12 +256,13 @@ static void init_sdram_rows(void)
static u32 mdrefr_dri(unsigned int freq)
{
- u32 dri = 0;
+ u32 dri = freq * SDRAM_TREF / sdram_rows;
- if (cpu_is_pxa25x())
- dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
if (cpu_is_pxa27x())
- dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
+ dri -= 31;
+
+ dri /= 32;
+
return dri;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] pxa2xx/cpufreq: Fix PCMCIA frequency scaling
2010-06-24 13:57 [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier Marek Vasut
2010-06-24 13:57 ` [PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine Marek Vasut
@ 2010-06-24 13:57 ` Marek Vasut
2010-06-28 4:53 ` Eric Miao
2010-06-28 3:56 ` [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier Eric Miao
2 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2010-06-24 13:57 UTC (permalink / raw)
To: linux-arm-kernel
The MCxx values must be based off memory clock, not CPU core clock.
This also fixes the bug where on some machines the LCD went crazy while using
PCMCIA.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
drivers/pcmcia/pxa2xx_base.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index df4532e..f370476 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -178,7 +178,6 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
unsigned long val,
struct cpufreq_freqs *freqs)
{
-#warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock"
switch (val) {
case CPUFREQ_PRECHANGE:
if (freqs->new > freqs->old) {
@@ -186,7 +185,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
"pre-updating\n",
freqs->new / 1000, (freqs->new / 100) % 10,
freqs->old / 1000, (freqs->old / 100) % 10);
- pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
+ pxa2xx_pcmcia_set_timing(skt);
}
break;
@@ -196,7 +195,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
"post-updating\n",
freqs->new / 1000, (freqs->new / 100) % 10,
freqs->old / 1000, (freqs->old / 100) % 10);
- pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
+ pxa2xx_pcmcia_set_timing(skt);
}
break;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier
2010-06-24 13:57 [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier Marek Vasut
2010-06-24 13:57 ` [PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine Marek Vasut
2010-06-24 13:57 ` [PATCH 3/3] pxa2xx/cpufreq: Fix PCMCIA frequency scaling Marek Vasut
@ 2010-06-28 3:56 ` Eric Miao
2 siblings, 0 replies; 7+ messages in thread
From: Eric Miao @ 2010-06-28 3:56 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jun 24, 2010 at 9:57 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> The value should be 24, not 0 in the possibilities array. It was just a silly
> mistake.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Applied.
Note, the 312MHz for HSS was not allowed previously until in recent
DM this is enabled, so it's not that "silly" :-)
> ---
> ?arch/arm/mach-pxa/pxa3xx.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
> index f544e58..611622a 100644
> --- a/arch/arm/mach-pxa/pxa3xx.c
> +++ b/arch/arm/mach-pxa/pxa3xx.c
> @@ -52,7 +52,7 @@
> ?static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
>
> ?/* crystal frequency to HSIO bus frequency multiplier (HSS) */
> -static unsigned char hss_mult[4] = { 8, 12, 16, 0 };
> +static unsigned char hss_mult[4] = { 8, 12, 16, 24 };
>
> ?/*
> ?* Get the clock frequency as reflected by CCSR and the turbo flag.
> --
> 1.7.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine
2010-06-24 13:57 ` [PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine Marek Vasut
@ 2010-06-28 4:38 ` Eric Miao
2010-06-28 12:04 ` Marek Vasut
0 siblings, 1 reply; 7+ messages in thread
From: Eric Miao @ 2010-06-28 4:38 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jun 24, 2010 at 9:57 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> This patch:
> 1) Simpifies the DRI recomputation routine by pulling out the common code
> 2) Fixes a bug in PXA27x DRI recomputation caused by incorrect parenthesis
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Good catch, I've modified it a bit so it's more compact and reable below
and I'll apply this to the 'fix' branch.
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 9e4d981..268a9bc 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
@@ -256,13 +256,9 @@ static void init_sdram_rows(void)
static u32 mdrefr_dri(unsigned int freq)
{
- u32 dri = 0;
+ u32 interval = freq * SDRAM_TREF / sdram_rows;
- if (cpu_is_pxa25x())
- dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
- if (cpu_is_pxa27x())
- dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
- return dri;
+ return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32;
}
/* find a valid frequency point */
> ---
> ?arch/arm/mach-pxa/cpufreq-pxa2xx.c | ? ?9 +++++----
> ?1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> index 9e4d981..bb5f21e 100644
> --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> @@ -256,12 +256,13 @@ static void init_sdram_rows(void)
>
> ?static u32 mdrefr_dri(unsigned int freq)
> ?{
> - ? ? ? u32 dri = 0;
> + ? ? ? u32 dri = freq * SDRAM_TREF / sdram_rows;
>
> - ? ? ? if (cpu_is_pxa25x())
> - ? ? ? ? ? ? ? dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
> ? ? ? ?if (cpu_is_pxa27x())
> - ? ? ? ? ? ? ? dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
> + ? ? ? ? ? ? ? dri -= 31;
> +
> + ? ? ? dri /= 32;
> +
> ? ? ? ?return dri;
> ?}
>
> --
> 1.7.1
>
>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] pxa2xx/cpufreq: Fix PCMCIA frequency scaling
2010-06-24 13:57 ` [PATCH 3/3] pxa2xx/cpufreq: Fix PCMCIA frequency scaling Marek Vasut
@ 2010-06-28 4:53 ` Eric Miao
0 siblings, 0 replies; 7+ messages in thread
From: Eric Miao @ 2010-06-28 4:53 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jun 24, 2010 at 9:57 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> The MCxx values must be based off memory clock, not CPU core clock.
>
> This also fixes the bug where on some machines the LCD went crazy while using
> PCMCIA.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
+ Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr>
Applied to 'fix'.
> ---
> ?drivers/pcmcia/pxa2xx_base.c | ? ?5 ++---
> ?1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
> index df4532e..f370476 100644
> --- a/drivers/pcmcia/pxa2xx_base.c
> +++ b/drivers/pcmcia/pxa2xx_base.c
> @@ -178,7 +178,6 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? unsigned long val,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct cpufreq_freqs *freqs)
> ?{
> -#warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock"
> ? ? ? ?switch (val) {
> ? ? ? ?case CPUFREQ_PRECHANGE:
> ? ? ? ? ? ? ? ?if (freqs->new > freqs->old) {
> @@ -186,7 +185,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "pre-updating\n",
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? freqs->new / 1000, (freqs->new / 100) % 10,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? freqs->old / 1000, (freqs->old / 100) % 10);
> - ? ? ? ? ? ? ? ? ? ? ? pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
> + ? ? ? ? ? ? ? ? ? ? ? pxa2xx_pcmcia_set_timing(skt);
> ? ? ? ? ? ? ? ?}
> ? ? ? ? ? ? ? ?break;
>
> @@ -196,7 +195,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "post-updating\n",
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? freqs->new / 1000, (freqs->new / 100) % 10,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? freqs->old / 1000, (freqs->old / 100) % 10);
> - ? ? ? ? ? ? ? ? ? ? ? pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
> + ? ? ? ? ? ? ? ? ? ? ? pxa2xx_pcmcia_set_timing(skt);
> ? ? ? ? ? ? ? ?}
> ? ? ? ? ? ? ? ?break;
> ? ? ? ?}
> --
> 1.7.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine
2010-06-28 4:38 ` Eric Miao
@ 2010-06-28 12:04 ` Marek Vasut
0 siblings, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2010-06-28 12:04 UTC (permalink / raw)
To: linux-arm-kernel
Dne Po 28. ?ervna 2010 06:38:16 Eric Miao napsal(a):
> On Thu, Jun 24, 2010 at 9:57 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > This patch:
> > 1) Simpifies the DRI recomputation routine by pulling out the common code
> > 2) Fixes a bug in PXA27x DRI recomputation caused by incorrect
> > parenthesis
> >
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>
> Good catch, I've modified it a bit so it's more compact and reable below
> and I'll apply this to the 'fix' branch.
Ewww ... I'm kind-of missing the readability now ;-)
But I guess if you look into it for a long enough time, it's ok.
Acked-by: Marek Vasut <marek.vasut@gmail.com>
>
> diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> index 9e4d981..268a9bc 100644
> --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> @@ -256,13 +256,9 @@ static void init_sdram_rows(void)
>
> static u32 mdrefr_dri(unsigned int freq)
> {
> - u32 dri = 0;
> + u32 interval = freq * SDRAM_TREF / sdram_rows;
>
> - if (cpu_is_pxa25x())
> - dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
> - if (cpu_is_pxa27x())
> - dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
> - return dri;
> + return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32;
> }
>
> /* find a valid frequency point */
>
> > ---
> > arch/arm/mach-pxa/cpufreq-pxa2xx.c | 9 +++++----
> > 1 files changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> > b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 9e4d981..bb5f21e 100644
> > --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> > +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> > @@ -256,12 +256,13 @@ static void init_sdram_rows(void)
> >
> > static u32 mdrefr_dri(unsigned int freq)
> > {
> > - u32 dri = 0;
> > + u32 dri = freq * SDRAM_TREF / sdram_rows;
> >
> > - if (cpu_is_pxa25x())
> > - dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
> > if (cpu_is_pxa27x())
> > - dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
> > + dri -= 31;
> > +
> > + dri /= 32;
> > +
> > return dri;
> > }
> >
> > --
> > 1.7.1
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-06-28 12:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-24 13:57 [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier Marek Vasut
2010-06-24 13:57 ` [PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine Marek Vasut
2010-06-28 4:38 ` Eric Miao
2010-06-28 12:04 ` Marek Vasut
2010-06-24 13:57 ` [PATCH 3/3] pxa2xx/cpufreq: Fix PCMCIA frequency scaling Marek Vasut
2010-06-28 4:53 ` Eric Miao
2010-06-28 3:56 ` [PATCH 1/3] pxa3xx: Fix HSIO bus x24 multiplier Eric Miao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).