* [PATCH 1/2] [POWERPC] Add SCC clock support to cpm2_clk_setup()
@ 2007-07-11 13:17 Laurent Pinchart
2007-09-13 13:53 ` Laurent Pinchart
2007-09-14 15:55 ` Laurent Pinchart
0 siblings, 2 replies; 5+ messages in thread
From: Laurent Pinchart @ 2007-07-11 13:17 UTC (permalink / raw)
To: linuxppc-embedded
cpm2_clk_setup() supports setting FCC clocks only, even though the
cpm_clk_target enumeration lists SCC clocks. This patch adds SCC clock
support.
Signed-off-by: Laurent Pinchart <laurent.pinchart@technotrade.biz>
---
arch/powerpc/sysdev/cpm2_common.c | 38 ++++++++++++++++++++++++++++++++++--
1 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/sysdev/cpm2_common.c
b/arch/powerpc/sysdev/cpm2_common.c
index 9244129..459fead 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -138,7 +138,39 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock,
int mode)
cpmux_t *im_cpmux;
u32 *reg;
u32 mask = 7;
- u8 clk_map [24][3] = {
+ u8 clk_map [][3] = {
+ {CPM_CLK_SCC1, CPM_BRG1, 0},
+ {CPM_CLK_SCC1, CPM_BRG2, 1},
+ {CPM_CLK_SCC1, CPM_BRG3, 2},
+ {CPM_CLK_SCC1, CPM_BRG4, 3},
+ {CPM_CLK_SCC1, CPM_CLK5, 4},
+ {CPM_CLK_SCC1, CPM_CLK6, 5},
+ {CPM_CLK_SCC1, CPM_CLK7, 6},
+ {CPM_CLK_SCC1, CPM_CLK8, 7},
+ {CPM_CLK_SCC2, CPM_BRG1, 0},
+ {CPM_CLK_SCC2, CPM_BRG2, 1},
+ {CPM_CLK_SCC2, CPM_BRG3, 2},
+ {CPM_CLK_SCC2, CPM_BRG4, 3},
+ {CPM_CLK_SCC2, CPM_CLK5, 4},
+ {CPM_CLK_SCC2, CPM_CLK6, 5},
+ {CPM_CLK_SCC2, CPM_CLK7, 6},
+ {CPM_CLK_SCC2, CPM_CLK8, 7},
+ {CPM_CLK_SCC3, CPM_BRG1, 0},
+ {CPM_CLK_SCC3, CPM_BRG2, 1},
+ {CPM_CLK_SCC3, CPM_BRG3, 2},
+ {CPM_CLK_SCC3, CPM_BRG4, 3},
+ {CPM_CLK_SCC3, CPM_CLK5, 4},
+ {CPM_CLK_SCC3, CPM_CLK6, 5},
+ {CPM_CLK_SCC3, CPM_CLK7, 6},
+ {CPM_CLK_SCC3, CPM_CLK8, 7},
+ {CPM_CLK_SCC4, CPM_BRG1, 0},
+ {CPM_CLK_SCC4, CPM_BRG2, 1},
+ {CPM_CLK_SCC4, CPM_BRG3, 2},
+ {CPM_CLK_SCC4, CPM_BRG4, 3},
+ {CPM_CLK_SCC4, CPM_CLK5, 4},
+ {CPM_CLK_SCC4, CPM_CLK6, 5},
+ {CPM_CLK_SCC4, CPM_CLK7, 6},
+ {CPM_CLK_SCC4, CPM_CLK8, 7},
{CPM_CLK_FCC1, CPM_BRG5, 0},
{CPM_CLK_FCC1, CPM_BRG6, 1},
{CPM_CLK_FCC1, CPM_BRG7, 2},
@@ -203,13 +235,13 @@ int cpm2_clk_setup(enum cpm_clk_target target, int
clock, int mode)
if (mode == CPM_CLK_RX)
shift +=3;
- for (i=0; i<24; i++) {
+ for (i=0; i<ARRAY_SIZE(clk_map); i++) {
if (clk_map[i][0] == target && clk_map[i][1] == clock) {
bits = clk_map[i][2];
break;
}
}
- if (i == sizeof(clk_map)/3)
+ if (i == ARRAY_SIZE(clk_map))
ret = -EINVAL;
bits <<= shift;
--
1.5.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] [POWERPC] Add SCC clock support to cpm2_clk_setup()
2007-07-11 13:17 [PATCH 1/2] [POWERPC] Add SCC clock support to cpm2_clk_setup() Laurent Pinchart
@ 2007-09-13 13:53 ` Laurent Pinchart
2007-09-13 14:16 ` Kumar Gala
2007-09-14 15:55 ` Laurent Pinchart
1 sibling, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2007-09-13 13:53 UTC (permalink / raw)
To: linuxppc-embedded
On Wednesday 11 July 2007 15:17, Laurent Pinchart wrote:
> cpm2_clk_setup() supports setting FCC clocks only, even though the
> cpm_clk_target enumeration lists SCC clocks. This patch adds SCC clock
> support.
Any chance this patch (and its 2/2 brother) could be committed ?
Best regards,
=2D-=20
Laurent Pinchart
CSE Semaphore Belgium
Chauss=E9e de Bruxelles, 732A
B-1410 Waterloo
Belgium
T +32 (2) 387 42 59
=46 +32 (2) 387 42 75
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] [POWERPC] Add SCC clock support to cpm2_clk_setup()
2007-09-13 13:53 ` Laurent Pinchart
@ 2007-09-13 14:16 ` Kumar Gala
0 siblings, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2007-09-13 14:16 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linuxppc-embedded
On Sep 13, 2007, at 8:53 AM, Laurent Pinchart wrote:
> On Wednesday 11 July 2007 15:17, Laurent Pinchart wrote:
>> cpm2_clk_setup() supports setting FCC clocks only, even though the
>> cpm_clk_target enumeration lists SCC clocks. This patch adds SCC
>> clock
>> support.
>
> Any chance this patch (and its 2/2 brother) could be committed ?
Have you looked at Scott Wood's cleanup patches. They seem to do
some of this.
- k
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] [POWERPC] Add SCC clock support to cpm2_clk_setup()
2007-07-11 13:17 [PATCH 1/2] [POWERPC] Add SCC clock support to cpm2_clk_setup() Laurent Pinchart
2007-09-13 13:53 ` Laurent Pinchart
@ 2007-09-14 15:55 ` Laurent Pinchart
2007-09-14 16:08 ` Scott Wood
1 sibling, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2007-09-14 15:55 UTC (permalink / raw)
To: linuxppc-embedded
> On Sep 13, 2007, at 8:53 AM, Laurent Pinchart wrote:
>> On Wednesday 11 July 2007 15:17, Laurent Pinchart wrote:
>>> cpm2_clk_setup() supports setting FCC clocks only, even though the
>>> cpm_clk_target enumeration lists SCC clocks. This patch adds SCC =20
>>> clock support.
>>
>> Any chance this patch (and its 2/2 brother) could be committed ?
>
> Have you looked at Scott Wood's cleanup patches. They seem to do =20
> some of this.
Where can I find them ? I checked in
git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
and found nothing relevant.
Best regard,
=2D-=20
Laurent Pinchart
CSE Semaphore Belgium
Chauss=E9e de Bruxelles, 732A
B-1410 Waterloo
Belgium
T +32 (2) 387 42 59
=46 +32 (2) 387 42 75
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] [POWERPC] Add SCC clock support to cpm2_clk_setup()
2007-09-14 15:55 ` Laurent Pinchart
@ 2007-09-14 16:08 ` Scott Wood
0 siblings, 0 replies; 5+ messages in thread
From: Scott Wood @ 2007-09-14 16:08 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linuxppc-embedded
On Fri, Sep 14, 2007 at 05:55:45PM +0200, Laurent Pinchart wrote:
> > On Sep 13, 2007, at 8:53 AM, Laurent Pinchart wrote:
> >> On Wednesday 11 July 2007 15:17, Laurent Pinchart wrote:
> >>> cpm2_clk_setup() supports setting FCC clocks only, even though the
> >>> cpm_clk_target enumeration lists SCC clocks. This patch adds SCC
> >>> clock support.
> >>
> >> Any chance this patch (and its 2/2 brother) could be committed ?
> >
> > Have you looked at Scott Wood's cleanup patches. They seem to do
> > some of this.
>
> Where can I find them ? I checked in
>
> git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git
> git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
>
> and found nothing relevant.
Check the linuxppc-dev archives... I should have another respin soon
(hopefully today).
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-09-14 16:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-11 13:17 [PATCH 1/2] [POWERPC] Add SCC clock support to cpm2_clk_setup() Laurent Pinchart
2007-09-13 13:53 ` Laurent Pinchart
2007-09-13 14:16 ` Kumar Gala
2007-09-14 15:55 ` Laurent Pinchart
2007-09-14 16:08 ` Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox