pxa3xx: Fix HSIO bus x24 multiplier
Subsystems (4)
PATCH 1/3 pxa3xx: Fix HSIO bus x24 multiplier
The value should be 24, not 0 in the possibilities array. It was just a silly mistake.
--- arch/arm/mach-pxa/pxa3xx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-pxa/pxa3xx.c +1 -1
@@ -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.
Signature · 1 line
1.7.1
PATCH 2/3 pxa2xx/cpufreq: Simplify DRI recomputation routine
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
--- arch/arm/mach-pxa/cpufreq-pxa2xx.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/mach-pxa/cpufreq-pxa2xx.c +5 -4
@@ -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; }
Signature · 1 line
1.7.1
PATCH 3/3 pxa2xx/cpufreq: Fix PCMCIA frequency scaling
In reply to Marek VasutThe 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.
--- drivers/pcmcia/pxa2xx_base.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/pcmcia/pxa2xx_base.c +2 -3
@@ -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 ; }
Signature · 1 line
1.7.1
Eric Miao
AppliedPATCH 1/3 pxa3xx: Fix HSIO bus x24 multiplier
In reply to Marek VasutQuoted 4 lines · Marek Vasut
The value should be 24, not 0 in the possibilities array. It was just a silly mistake.
Signed-off-by Marek Vasut <[email protected]>
Applied.
Note, the 312MHz for HSS was not allowed previously until in recent DM this is enabled, so it's not that "silly" :-)
Quoted 21 lines
---
?arch/arm/mach-pxa/pxa3xx.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/mach-pxa/pxa3xx.c +0
-0@@ -52,7 +52,7 @@ ?static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };?/* crystal frequency to HSIO bus frequency multiplier (HSS) */
arch/arm/mach-pxa/pxa3xx.c +1
-1-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
PATCH 2/3 pxa2xx/cpufreq: Simplify DRI recomputation routine
In reply to Marek VasutQuoted 5 lines · Marek Vasut
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 parenthesisSigned-off-by Marek Vasut <[email protected]>
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.
(quoted diff) +0 -0
b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 9e4d981..268a9bc 100644
arch/arm/mach-pxa/cpufreq-pxa2xx.c +2 -6
@@ -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 */
Quoted 30 lines
---
?arch/arm/mach-pxa/cpufreq-pxa2xx.c | ? ?9 +++++---- ?1 files changed, 5 insertions(+), 4 deletions(-)arch/arm/mach-pxa/cpufreq-pxa2xx.c +5
-5@@ -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
Eric Miao
AppliedPATCH 3/3 pxa2xx/cpufreq: Fix PCMCIA frequency scaling
In reply to Marek VasutQuoted 6 lines · Marek Vasut
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 <[email protected]>
+ Reviewed-by: Robert Jarzmik <[email protected]>
Applied to 'fix'.
Quoted 38 lines
---
?drivers/pcmcia/pxa2xx_base.c | ? ?5 ++---
?1 files changed, 2 insertions(+), 3 deletions(-)drivers/pcmcia/pxa2xx_base.c +0
-1@@ -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) {drivers/pcmcia/pxa2xx_base.c +2
-3@@ -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
PATCH 2/3 pxa2xx/cpufreq: Simplify DRI recomputation routine
In reply to Eric MiaoDne Po 28. ?ervna 2010 06:38:16 Eric Miao napsal(a):
Quoted 10 lines · Marek Vasut
Quoted 6 lines
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 parenthesisSigned-off-by Marek Vasut <[email protected]>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.
Quoted 51 lines
arch/arm/mach-pxa/cpufreq-pxa2xx.c +2
-6@@ -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 */ Quoted 29 lines
--- arch/arm/mach-pxa/cpufreq-pxa2xx.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/arch/arm/mach-pxa/cpufreq-pxa2xx.cindex 9e4d981..bb5f21e 100644arch/arm/mach-pxa/cpufreq-pxa2xx.c +5
-5@@ -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