diff mbox

[v3,4/4] arm: pxa: add non device-tree timer link to clocksource

Message ID 1405356724-32207-4-git-send-email-robert.jarzmik@free.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Robert Jarzmik July 14, 2014, 4:52 p.m. UTC
As clocksource pxa_timer was moved to clocksource framework, the
pxa_timer initialization needs to be a bit amended, to pass the
necessary informations to clocksource, ie :
 - the timer interrupt (mach specific)
 - the timer registers base (ditto)
 - the timer clockrate

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>

---
Since V2: Arnd's comment : moved extern declaration into .h file
---
 arch/arm/mach-pxa/generic.c | 11 +++++++++++
 include/clocksource/pxa.h   | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 include/clocksource/pxa.h

Comments

Daniel Lezcano July 21, 2014, 2:37 p.m. UTC | #1
On 07/14/2014 06:52 PM, Robert Jarzmik wrote:
> As clocksource pxa_timer was moved to clocksource framework, the
> pxa_timer initialization needs to be a bit amended, to pass the
> necessary informations to clocksource, ie :
>   - the timer interrupt (mach specific)
>   - the timer registers base (ditto)
>   - the timer clockrate
>
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
>
> ---
> Since V2: Arnd's comment : moved extern declaration into .h file
> ---

Shall I take the patches 4-5 also ?

Arnd ?

Thanks

   -- Daniel

>   arch/arm/mach-pxa/generic.c | 11 +++++++++++
>   include/clocksource/pxa.h   | 18 ++++++++++++++++++
>   2 files changed, 29 insertions(+)
>   create mode 100644 include/clocksource/pxa.h
>
> diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
> index 4225417..6f38e1a 100644
> --- a/arch/arm/mach-pxa/generic.c
> +++ b/arch/arm/mach-pxa/generic.c
> @@ -25,11 +25,13 @@
>   #include <asm/mach/map.h>
>   #include <asm/mach-types.h>
>
> +#include <mach/irqs.h>
>   #include <mach/reset.h>
>   #include <mach/smemc.h>
>   #include <mach/pxa3xx-regs.h>
>
>   #include "generic.h"
> +#include <clocksource/pxa.h>
>
>   void clear_reset_status(unsigned int mask)
>   {
> @@ -57,6 +59,15 @@ unsigned long get_clock_tick_rate(void)
>   EXPORT_SYMBOL(get_clock_tick_rate);
>
>   /*
> + * For non device-tree builds, keep legacy timer init
> + */
> +void pxa_timer_init(void)
> +{
> +	pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000),
> +			    get_clock_tick_rate());
> +}
> +
> +/*
>    * Get the clock frequency as reflected by CCCR and the turbo flag.
>    * We assume these values have been applied via a fcs.
>    * If info is not 0 we also display the current settings.
> diff --git a/include/clocksource/pxa.h b/include/clocksource/pxa.h
> new file mode 100644
> index 0000000..1efbe5a
> --- /dev/null
> +++ b/include/clocksource/pxa.h
> @@ -0,0 +1,18 @@
> +/*
> + * PXA clocksource, clockevents, and OST interrupt handlers.
> + *
> + * Copyright (C) 2014 Robert Jarzmik
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; version 2 of the License.
> + *
> + */
> +
> +#ifndef _CLOCKSOURCE_PXA_H
> +#define _CLOCKSOURCE_PXA_H
> +
> +extern void pxa_timer_nodt_init(int irq, void __iomem *base,
> +			   unsigned long clock_tick_rate);
> +
> +#endif
>
Robert Jarzmik July 21, 2014, 6:15 p.m. UTC | #2
Daniel Lezcano <daniel.lezcano@linaro.org> writes:

> On 07/14/2014 06:52 PM, Robert Jarzmik wrote:
>> As clocksource pxa_timer was moved to clocksource framework, the
>> pxa_timer initialization needs to be a bit amended, to pass the
>> necessary informations to clocksource, ie :
>>   - the timer interrupt (mach specific)
>>   - the timer registers base (ditto)
>>   - the timer clockrate
>>
>> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
>>
>> ---
>> Since V2: Arnd's comment : moved extern declaration into .h file
>> ---
>
> Shall I take the patches 4-5 also ?
Mmm you mean patch 4 I think.
Then I'd like you too, because it's linked in the serie, and without it the
former non-DT platforms break, hence I'd like all the serie to go through 1
tree.

Yet we'd need Haojian's ack here. Haojian, would you give your blessing on the
serie and agree that Daniel carries all the patches including patch 4/4 ?

Cheers.

--
Robert
Daniel Lezcano Sept. 26, 2014, 7:52 a.m. UTC | #3
On 07/21/2014 08:15 PM, Robert Jarzmik wrote:
> Daniel Lezcano <daniel.lezcano@linaro.org> writes:
>
>> On 07/14/2014 06:52 PM, Robert Jarzmik wrote:
>>> As clocksource pxa_timer was moved to clocksource framework, the
>>> pxa_timer initialization needs to be a bit amended, to pass the
>>> necessary informations to clocksource, ie :
>>>    - the timer interrupt (mach specific)
>>>    - the timer registers base (ditto)
>>>    - the timer clockrate
>>>
>>> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
>>>
>>> ---
>>> Since V2: Arnd's comment : moved extern declaration into .h file
>>> ---
>>
>> Shall I take the patches 4-5 also ?
> Mmm you mean patch 4 I think.
> Then I'd like you too, because it's linked in the serie, and without it the
> former non-DT platforms break, hence I'd like all the serie to go through 1
> tree.
>
> Yet we'd need Haojian's ack here. Haojian, would you give your blessing on the
> serie and agree that Daniel carries all the patches including patch 4/4 ?

Hi,

May be I missed it but I don't see the Haojian's ack.

Thanks
   -- Daniel
Robert Jarzmik Sept. 26, 2014, 5:08 p.m. UTC | #4
Daniel Lezcano <daniel.lezcano@linaro.org> writes:

> On 07/21/2014 08:15 PM, Robert Jarzmik wrote:
>> Daniel Lezcano <daniel.lezcano@linaro.org> writes:
>>
>>> On 07/14/2014 06:52 PM, Robert Jarzmik wrote:
>>>> As clocksource pxa_timer was moved to clocksource framework, the
>>>> pxa_timer initialization needs to be a bit amended, to pass the
>>>> necessary informations to clocksource, ie :
>>>>    - the timer interrupt (mach specific)
>>>>    - the timer registers base (ditto)
>>>>    - the timer clockrate
>>>>
>>>> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
>>>>
>>>> ---
>>>> Since V2: Arnd's comment : moved extern declaration into .h file
>>>> ---
>>>

> Hi,
>
> May be I missed it but I don't see the Haojian's ack.
>
> Thanks
>   -- Daniel

You're right, I scanned through my mail and didn't find the ack.
Haojian, would you review this one please ?

It's here :
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/272311.html

Cheers.
diff mbox

Patch

diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 4225417..6f38e1a 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -25,11 +25,13 @@ 
 #include <asm/mach/map.h>
 #include <asm/mach-types.h>
 
+#include <mach/irqs.h>
 #include <mach/reset.h>
 #include <mach/smemc.h>
 #include <mach/pxa3xx-regs.h>
 
 #include "generic.h"
+#include <clocksource/pxa.h>
 
 void clear_reset_status(unsigned int mask)
 {
@@ -57,6 +59,15 @@  unsigned long get_clock_tick_rate(void)
 EXPORT_SYMBOL(get_clock_tick_rate);
 
 /*
+ * For non device-tree builds, keep legacy timer init
+ */
+void pxa_timer_init(void)
+{
+	pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000),
+			    get_clock_tick_rate());
+}
+
+/*
  * Get the clock frequency as reflected by CCCR and the turbo flag.
  * We assume these values have been applied via a fcs.
  * If info is not 0 we also display the current settings.
diff --git a/include/clocksource/pxa.h b/include/clocksource/pxa.h
new file mode 100644
index 0000000..1efbe5a
--- /dev/null
+++ b/include/clocksource/pxa.h
@@ -0,0 +1,18 @@ 
+/*
+ * PXA clocksource, clockevents, and OST interrupt handlers.
+ *
+ * Copyright (C) 2014 Robert Jarzmik
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ */
+
+#ifndef _CLOCKSOURCE_PXA_H
+#define _CLOCKSOURCE_PXA_H
+
+extern void pxa_timer_nodt_init(int irq, void __iomem *base,
+			   unsigned long clock_tick_rate);
+
+#endif