* [PATCH] ssb-chipcommon: Add function to get processor clock
@ 2007-07-31 22:11 Michael Buesch
2007-08-01 22:06 ` Andrew Morton
0 siblings, 1 reply; 6+ messages in thread
From: Michael Buesch @ 2007-07-31 22:11 UTC (permalink / raw)
To: Andrew Morton, John Linville
Cc: linux-wireless, Aurelien Jarno, Felix Fietkau
From: Aurelien Jarno <aurelien@aurel32.net>
The patch below (against 2.6.23-rc1-mm1) adds a new function to get the
processor clock. It originally comes from the OpenWrt patches.
Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
--- a/drivers/ssb/driver_chipcommon.c 2007-07-14 21:05:44.000000000 +0200
+++ b/drivers/ssb/driver_chipcommon.c 2007-07-14 21:22:04.000000000 +0200
@@ -264,6 +264,30 @@
ssb_chipco_set_clockmode(cc, SSB_CLKMODE_FAST);
}
+/* Get the processor clock */
+void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,
+ u32 *plltype, u32 *n, u32 *m)
+{
+ *n = chipco_read32(cc, SSB_CHIPCO_CLOCK_N);
+ *plltype = (cc->capabilities & SSB_CHIPCO_CAP_PLLT);
+ switch (*plltype) {
+ case SSB_PLLTYPE_2:
+ case SSB_PLLTYPE_4:
+ case SSB_PLLTYPE_6:
+ case SSB_PLLTYPE_7:
+ *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_MIPS);
+ break;
+ case SSB_PLLTYPE_3:
+ /* 5350 uses m2 to control mips */
+ *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_M2);
+ break;
+ default:
+ *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_SB);
+ break;
+ }
+}
+
+/* Get the bus clock */
void ssb_chipco_get_clockcontrol(struct ssb_chipcommon *cc,
u32 *plltype, u32 *n, u32 *m)
{
--- a/include/linux/ssb/ssb_driver_chipcommon.h 2007-07-14 21:05:44.000000000 +0200
+++ b/include/linux/ssb/ssb_driver_chipcommon.h 2007-07-14 21:17:28.000000000 +0200
@@ -364,6 +364,8 @@
extern void ssb_chipco_suspend(struct ssb_chipcommon *cc, pm_message_t state);
extern void ssb_chipco_resume(struct ssb_chipcommon *cc);
+extern void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,
+ u32 *plltype, u32 *n, u32 *m);
extern void ssb_chipco_get_clockcontrol(struct ssb_chipcommon *cc,
u32 *plltype, u32 *n, u32 *m);
extern void ssb_chipco_timing_init(struct ssb_chipcommon *cc,
--
Greetings Michael.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ssb-chipcommon: Add function to get processor clock
2007-07-31 22:11 [PATCH] ssb-chipcommon: Add function to get processor clock Michael Buesch
@ 2007-08-01 22:06 ` Andrew Morton
2007-08-01 22:09 ` Michael Buesch
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2007-08-01 22:06 UTC (permalink / raw)
To: Michael Buesch
Cc: John Linville, linux-wireless, Aurelien Jarno, Felix Fietkau
On Wed, 1 Aug 2007 00:11:56 +0200
Michael Buesch <mb@bu3sch.de> wrote:
> From: Aurelien Jarno <aurelien@aurel32.net>
>
> The patch below (against 2.6.23-rc1-mm1) adds a new function to get the
> processor clock. It originally comes from the OpenWrt patches.
>
> Cc: Felix Fietkau <nbd@openwrt.org>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> Signed-off-by: Michael Buesch <mb@bu3sch.de>
>
> --- a/drivers/ssb/driver_chipcommon.c 2007-07-14 21:05:44.000000000 +0200
> +++ b/drivers/ssb/driver_chipcommon.c 2007-07-14 21:22:04.000000000 +0200
> @@ -264,6 +264,30 @@
> ssb_chipco_set_clockmode(cc, SSB_CLKMODE_FAST);
> }
>
> +/* Get the processor clock */
> +void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,
> + u32 *plltype, u32 *n, u32 *m)
> +{
> + *n = chipco_read32(cc, SSB_CHIPCO_CLOCK_N);
> + *plltype = (cc->capabilities & SSB_CHIPCO_CAP_PLLT);
> + switch (*plltype) {
> + case SSB_PLLTYPE_2:
> + case SSB_PLLTYPE_4:
> + case SSB_PLLTYPE_6:
> + case SSB_PLLTYPE_7:
> + *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_MIPS);
> + break;
> + case SSB_PLLTYPE_3:
> + /* 5350 uses m2 to control mips */
> + *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_M2);
> + break;
> + default:
> + *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_SB);
> + break;
> + }
> +}
Please indent the body of switch statements one tabstop less than this.
> +/* Get the bus clock */
> void ssb_chipco_get_clockcontrol(struct ssb_chipcommon *cc,
> u32 *plltype, u32 *n, u32 *m)
> {
> --- a/include/linux/ssb/ssb_driver_chipcommon.h 2007-07-14 21:05:44.000000000 +0200
> +++ b/include/linux/ssb/ssb_driver_chipcommon.h 2007-07-14 21:17:28.000000000 +0200
> @@ -364,6 +364,8 @@
> extern void ssb_chipco_suspend(struct ssb_chipcommon *cc, pm_message_t state);
> extern void ssb_chipco_resume(struct ssb_chipcommon *cc);
>
> +extern void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,
> + u32 *plltype, u32 *n, u32 *m);
But it has no callers?
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ssb-chipcommon: Add function to get processor clock
2007-08-01 22:06 ` Andrew Morton
@ 2007-08-01 22:09 ` Michael Buesch
2007-08-02 9:12 ` Aurelien Jarno
0 siblings, 1 reply; 6+ messages in thread
From: Michael Buesch @ 2007-08-01 22:09 UTC (permalink / raw)
To: Andrew Morton
Cc: John Linville, linux-wireless, Aurelien Jarno, Felix Fietkau
On Thursday 02 August 2007 00:06:11 Andrew Morton wrote:
> On Wed, 1 Aug 2007 00:11:56 +0200
> Michael Buesch <mb@bu3sch.de> wrote:
>
> > From: Aurelien Jarno <aurelien@aurel32.net>
> >
> > The patch below (against 2.6.23-rc1-mm1) adds a new function to get the
> > processor clock. It originally comes from the OpenWrt patches.
> >
> > Cc: Felix Fietkau <nbd@openwrt.org>
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > Signed-off-by: Michael Buesch <mb@bu3sch.de>
> >
> > --- a/drivers/ssb/driver_chipcommon.c 2007-07-14 21:05:44.000000000 +0200
> > +++ b/drivers/ssb/driver_chipcommon.c 2007-07-14 21:22:04.000000000 +0200
> > @@ -264,6 +264,30 @@
> > ssb_chipco_set_clockmode(cc, SSB_CLKMODE_FAST);
> > }
> >
> > +/* Get the processor clock */
> > +void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,
> > + u32 *plltype, u32 *n, u32 *m)
> > +{
> > + *n = chipco_read32(cc, SSB_CHIPCO_CLOCK_N);
> > + *plltype = (cc->capabilities & SSB_CHIPCO_CAP_PLLT);
> > + switch (*plltype) {
> > + case SSB_PLLTYPE_2:
> > + case SSB_PLLTYPE_4:
> > + case SSB_PLLTYPE_6:
> > + case SSB_PLLTYPE_7:
> > + *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_MIPS);
> > + break;
> > + case SSB_PLLTYPE_3:
> > + /* 5350 uses m2 to control mips */
> > + *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_M2);
> > + break;
> > + default:
> > + *m = chipco_read32(cc, SSB_CHIPCO_CLOCK_SB);
> > + break;
> > + }
> > +}
>
> Please indent the body of switch statements one tabstop less than this.
Ok, please resend, Aurelien :)
> > +/* Get the bus clock */
> > void ssb_chipco_get_clockcontrol(struct ssb_chipcommon *cc,
> > u32 *plltype, u32 *n, u32 *m)
> > {
> > --- a/include/linux/ssb/ssb_driver_chipcommon.h 2007-07-14 21:05:44.000000000 +0200
> > +++ b/include/linux/ssb/ssb_driver_chipcommon.h 2007-07-14 21:17:28.000000000 +0200
> > @@ -364,6 +364,8 @@
> > extern void ssb_chipco_suspend(struct ssb_chipcommon *cc, pm_message_t state);
> > extern void ssb_chipco_resume(struct ssb_chipcommon *cc);
> >
> > +extern void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,
> > + u32 *plltype, u32 *n, u32 *m);
>
> But it has no callers?
>
>
The callers are in the bcm47xx arch code. We are going to merge
that, too. This patch is part of the merge.
We can't (and shouldn't) merge it all at once.
There are still a few dirty hacks in there that won't get accepted, yet.
--
Greetings Michael.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ssb-chipcommon: Add function to get processor clock
2007-08-01 22:09 ` Michael Buesch
@ 2007-08-02 9:12 ` Aurelien Jarno
2007-08-02 9:40 ` Michael Buesch
0 siblings, 1 reply; 6+ messages in thread
From: Aurelien Jarno @ 2007-08-02 9:12 UTC (permalink / raw)
To: Michael Buesch
Cc: Andrew Morton, John Linville, linux-wireless, Felix Fietkau
Michael Buesch a =E9crit :
> On Thursday 02 August 2007 00:06:11 Andrew Morton wrote:
>> On Wed, 1 Aug 2007 00:11:56 +0200
>> Michael Buesch <mb@bu3sch.de> wrote:
>>
>>> From: Aurelien Jarno <aurelien@aurel32.net>
>>>
>>> The patch below (against 2.6.23-rc1-mm1) adds a new function to get=
the=20
>>> processor clock. It originally comes from the OpenWrt patches.
>>>
>>> Cc: Felix Fietkau <nbd@openwrt.org>
>>> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
>>> Signed-off-by: Michael Buesch <mb@bu3sch.de>
>>>
>>> --- a/drivers/ssb/driver_chipcommon.c 2007-07-14 21:05:44.000000000=
+0200
>>> +++ b/drivers/ssb/driver_chipcommon.c 2007-07-14 21:22:04.000000000=
+0200
>>> @@ -264,6 +264,30 @@
>>> ssb_chipco_set_clockmode(cc, SSB_CLKMODE_FAST);
>>> }
>>> =20
>>> +/* Get the processor clock */
>>> +void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,
>>> + u32 *plltype, u32 *n, u32 *m)
>>> +{
>>> + *n =3D chipco_read32(cc, SSB_CHIPCO_CLOCK_N);
>>> + *plltype =3D (cc->capabilities & SSB_CHIPCO_CAP_PLLT);
>>> + switch (*plltype) {
>>> + case SSB_PLLTYPE_2:
>>> + case SSB_PLLTYPE_4:
>>> + case SSB_PLLTYPE_6:
>>> + case SSB_PLLTYPE_7:
>>> + *m =3D chipco_read32(cc, SSB_CHIPCO_CLOCK_MIPS);
>>> + break;
>>> + case SSB_PLLTYPE_3:
>>> + /* 5350 uses m2 to control mips */
>>> + *m =3D chipco_read32(cc, SSB_CHIPCO_CLOCK_M2);
>>> + break;
>>> + default:
>>> + *m =3D chipco_read32(cc, SSB_CHIPCO_CLOCK_SB);
>>> + break;
>>> + }
>>> +}
>> Please indent the body of switch statements one tabstop less than th=
is.
>=20
> Ok, please resend, Aurelien :)
It looks like Andrew took care of that.
>>> +/* Get the bus clock */
>>> void ssb_chipco_get_clockcontrol(struct ssb_chipcommon *cc,
>>> u32 *plltype, u32 *n, u32 *m)
>>> {
>>> --- a/include/linux/ssb/ssb_driver_chipcommon.h 2007-07-14 21:05:44=
=2E000000000 +0200
>>> +++ b/include/linux/ssb/ssb_driver_chipcommon.h 2007-07-14 21:17:28=
=2E000000000 +0200
>>> @@ -364,6 +364,8 @@
>>> extern void ssb_chipco_suspend(struct ssb_chipcommon *cc, pm_messa=
ge_t state);
>>> extern void ssb_chipco_resume(struct ssb_chipcommon *cc);
>>> =20
>>> +extern void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc,
>>> + u32 *plltype, u32 *n, u32 *m);
>> But it has no callers?
>>
>>
>=20
> The callers are in the bcm47xx arch code. We are going to merge
> that, too. This patch is part of the merge.
> We can't (and shouldn't) merge it all at once.
> There are still a few dirty hacks in there that won't get accepted, y=
et.
Yep the merge of the bcm47xx is on my TODO list, but I want to finish
the SSB parts first. I hope to finish that before the end of this week-=
end.
About the bcm47xx arch code, my plan is to merge first a very simple
version that allow the machine to boot, but without support for CFE.
--=20
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ssb-chipcommon: Add function to get processor clock
2007-08-02 9:12 ` Aurelien Jarno
@ 2007-08-02 9:40 ` Michael Buesch
2007-08-02 10:24 ` Aurelien Jarno
0 siblings, 1 reply; 6+ messages in thread
From: Michael Buesch @ 2007-08-02 9:40 UTC (permalink / raw)
To: Aurelien Jarno
Cc: Andrew Morton, John Linville, linux-wireless, Felix Fietkau
On Thursday 02 August 2007 11:12:30 Aurelien Jarno wrote:
> Yep the merge of the bcm47xx is on my TODO list, but I want to finish
> the SSB parts first. I hope to finish that before the end of this week-end.
>
> About the bcm47xx arch code, my plan is to merge first a very simple
> version that allow the machine to boot, but without support for CFE.
>
There are also mipscore patches in openwrt that need to get merged upstream.
Do you take care of these, too?
--
Greetings Michael.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ssb-chipcommon: Add function to get processor clock
2007-08-02 9:40 ` Michael Buesch
@ 2007-08-02 10:24 ` Aurelien Jarno
0 siblings, 0 replies; 6+ messages in thread
From: Aurelien Jarno @ 2007-08-02 10:24 UTC (permalink / raw)
To: Michael Buesch
Cc: Andrew Morton, John Linville, linux-wireless, Felix Fietkau
Michael Buesch a =E9crit :
> On Thursday 02 August 2007 11:12:30 Aurelien Jarno wrote:
>> Yep the merge of the bcm47xx is on my TODO list, but I want to finis=
h
>> the SSB parts first. I hope to finish that before the end of this we=
ek-end.
>>
>> About the bcm47xx arch code, my plan is to merge first a very simple
>> version that allow the machine to boot, but without support for CFE.
>>
>=20
> There are also mipscore patches in openwrt that need to get merged up=
stream.
> Do you take care of these, too?
Yep I am currently working on that.
--=20
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-08-02 10:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31 22:11 [PATCH] ssb-chipcommon: Add function to get processor clock Michael Buesch
2007-08-01 22:06 ` Andrew Morton
2007-08-01 22:09 ` Michael Buesch
2007-08-02 9:12 ` Aurelien Jarno
2007-08-02 9:40 ` Michael Buesch
2007-08-02 10:24 ` Aurelien Jarno
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).