* [PATCH 0/4] Add support for the Cortex A5 global timer
@ 2014-03-10 11:51 Matthew Leach
2014-03-10 11:51 ` [PATCH 1/4] clocksource: arm_global_timer: Only check for unusable timer on A9 Matthew Leach
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Matthew Leach @ 2014-03-10 11:51 UTC (permalink / raw)
To: linux-arm-kernel
This patch series adds support for the global timer with the Cortex
A5. This is relatively simple patch series and mainly consists of:
- Update a check in the drive probe code for an unusable global timer
to be non-specific to the A9.
- Add the appropriate device tree node and Kconfig options.
- Add a compatible node for the specifc A5 global timer in the DT
binding.
Any comments welcome.
Matt
Matthew Leach (4):
clocksource: arm_global_timer: Only check for unusable timer on A9
documentaion: DT: allow a A5 compatible string in global timer
dts: ca5: add the global timer for the A5
KConfig: Vexpress: build the ARM_GLOBAL_TIMER with vexpress platform
Documentation/devicetree/bindings/arm/global_timer.txt | 6 ++++--
arch/arm/boot/dts/vexpress-v2p-ca5s.dts | 10 +++++++++-
arch/arm/mach-vexpress/Kconfig | 1 +
drivers/clocksource/arm_global_timer.c | 5 +++--
4 files changed, 17 insertions(+), 5 deletions(-)
--
1.8.5.3
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/4] clocksource: arm_global_timer: Only check for unusable timer on A9
2014-03-10 11:51 [PATCH 0/4] Add support for the Cortex A5 global timer Matthew Leach
@ 2014-03-10 11:51 ` Matthew Leach
2014-03-10 11:51 ` [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer Matthew Leach
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Matthew Leach @ 2014-03-10 11:51 UTC (permalink / raw)
To: linux-arm-kernel
The check for a usable global timer in the probe code does not enquire
which CPU we are currently running on. This can cause the driver to
incorrectly assume we have an unusable global timer if we are running
on a CPU other than A9.
Before checking the CPU revision, ensure we are running on an A9 CPU.
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Matthew Leach <matthew.leach@arm.com>
---
drivers/clocksource/arm_global_timer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/arm_global_timer.c b/drivers/clocksource/arm_global_timer.c
index 0fc31d0..60e5a170 100644
--- a/drivers/clocksource/arm_global_timer.c
+++ b/drivers/clocksource/arm_global_timer.c
@@ -246,11 +246,12 @@ static void __init global_timer_of_register(struct device_node *np)
int err = 0;
/*
- * In r2p0 the comparators for each processor with the global timer
+ * In A9 r2p0 the comparators for each processor with the global timer
* fire when the timer value is greater than or equal to. In previous
* revisions the comparators fired when the timer value was equal to.
*/
- if ((read_cpuid_id() & 0xf0000f) < 0x200000) {
+ if (read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9
+ && (read_cpuid_id() & 0xf0000f) < 0x200000) {
pr_warn("global-timer: non support for this cpu version.\n");
return;
}
--
1.8.5.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer
2014-03-10 11:51 [PATCH 0/4] Add support for the Cortex A5 global timer Matthew Leach
2014-03-10 11:51 ` [PATCH 1/4] clocksource: arm_global_timer: Only check for unusable timer on A9 Matthew Leach
@ 2014-03-10 11:51 ` Matthew Leach
2014-03-10 11:57 ` Mark Rutland
` (2 more replies)
2014-03-10 11:51 ` [PATCH 3/4] dts: ca5: add the global timer for the A5 Matthew Leach
2014-03-10 11:51 ` [PATCH 4/4] KConfig: Vexpress: build the ARM_GLOBAL_TIMER with vexpress platform Matthew Leach
3 siblings, 3 replies; 11+ messages in thread
From: Matthew Leach @ 2014-03-10 11:51 UTC (permalink / raw)
To: linux-arm-kernel
The global timer is present on the Cortex A5. Add a compatibility
string to the DT binding to allow a Cortex A5 global timer.
Signed-off-by: Matthew Leach <matthew.leach@arm.com>
---
Documentation/devicetree/bindings/arm/global_timer.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt b/Documentation/devicetree/bindings/arm/global_timer.txt
index 1e54898..0932891 100644
--- a/Documentation/devicetree/bindings/arm/global_timer.txt
+++ b/Documentation/devicetree/bindings/arm/global_timer.txt
@@ -4,8 +4,10 @@
** Timer node required properties:
-- compatible : Should be "arm,cortex-a9-global-timer"
- Driver supports versions r2p0 and above.
+- compatible : should contain
+ * "arm,cortex-a5-global-timer" for Cortex-A5 global timers.
+ * "arm,cortex-a9-global-timer" for Cortex-A9 global timers
+ or any compatible implementation.
- interrupts : One interrupt to each core
--
1.8.5.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/4] dts: ca5: add the global timer for the A5
2014-03-10 11:51 [PATCH 0/4] Add support for the Cortex A5 global timer Matthew Leach
2014-03-10 11:51 ` [PATCH 1/4] clocksource: arm_global_timer: Only check for unusable timer on A9 Matthew Leach
2014-03-10 11:51 ` [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer Matthew Leach
@ 2014-03-10 11:51 ` Matthew Leach
2014-03-10 11:51 ` [PATCH 4/4] KConfig: Vexpress: build the ARM_GLOBAL_TIMER with vexpress platform Matthew Leach
3 siblings, 0 replies; 11+ messages in thread
From: Matthew Leach @ 2014-03-10 11:51 UTC (permalink / raw)
To: linux-arm-kernel
The Cortex A5 contains a global timer: add the appropriate device tree
node.
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Matthew Leach <matthew.leach@arm.com>
---
arch/arm/boot/dts/vexpress-v2p-ca5s.dts | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca5s.dts b/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
index c544a55..d2709b7 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
@@ -88,6 +88,14 @@
interrupts = <1 13 0x304>;
};
+ timer at 2c000200 {
+ compatible = "arm,cortex-a5-global-timer",
+ "arm,cortex-a9-global-timer";
+ reg = <0x2c000200 0x20>;
+ interrupts = <1 11 0x304>;
+ clocks = <&oscclk0>;
+ };
+
watchdog at 2c000620 {
compatible = "arm,cortex-a5-twd-wdt";
reg = <0x2c000620 0x20>;
@@ -120,7 +128,7 @@
compatible = "arm,vexpress,config-bus";
arm,vexpress,config-bridge = <&v2m_sysreg>;
- osc at 0 {
+ oscclk0: osc at 0 {
/* CPU and internal AXI reference clock */
compatible = "arm,vexpress-osc";
arm,vexpress-sysreg,func = <1 0>;
--
1.8.5.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/4] KConfig: Vexpress: build the ARM_GLOBAL_TIMER with vexpress platform
2014-03-10 11:51 [PATCH 0/4] Add support for the Cortex A5 global timer Matthew Leach
` (2 preceding siblings ...)
2014-03-10 11:51 ` [PATCH 3/4] dts: ca5: add the global timer for the A5 Matthew Leach
@ 2014-03-10 11:51 ` Matthew Leach
3 siblings, 0 replies; 11+ messages in thread
From: Matthew Leach @ 2014-03-10 11:51 UTC (permalink / raw)
To: linux-arm-kernel
The Cortex A5 now contains bindings for the global timer
driver. Ensure that the driver is built with a vexpress platform.
Signed-off-by: Matthew Leach <matthew.leach@arm.com>
---
arch/arm/mach-vexpress/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 4a70be4..4fb2a65 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -4,6 +4,7 @@ config ARCH_VEXPRESS
select ARCH_SUPPORTS_BIG_ENDIAN
select ARM_AMBA
select ARM_GIC
+ select ARM_GLOBAL_TIMER
select ARM_TIMER_SP804
select COMMON_CLK
select COMMON_CLK_VERSATILE
--
1.8.5.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer
2014-03-10 11:51 ` [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer Matthew Leach
@ 2014-03-10 11:57 ` Mark Rutland
2014-03-10 16:27 ` Rob Herring
2014-03-10 16:28 ` Rob Herring
2 siblings, 0 replies; 11+ messages in thread
From: Mark Rutland @ 2014-03-10 11:57 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 10, 2014 at 11:51:32AM +0000, Matthew Leach wrote:
> The global timer is present on the Cortex A5. Add a compatibility
> string to the DT binding to allow a Cortex A5 global timer.
>
> Signed-off-by: Matthew Leach <matthew.leach@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Mark.
> ---
> Documentation/devicetree/bindings/arm/global_timer.txt | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt b/Documentation/devicetree/bindings/arm/global_timer.txt
> index 1e54898..0932891 100644
> --- a/Documentation/devicetree/bindings/arm/global_timer.txt
> +++ b/Documentation/devicetree/bindings/arm/global_timer.txt
> @@ -4,8 +4,10 @@
>
> ** Timer node required properties:
>
> -- compatible : Should be "arm,cortex-a9-global-timer"
> - Driver supports versions r2p0 and above.
> +- compatible : should contain
> + * "arm,cortex-a5-global-timer" for Cortex-A5 global timers.
> + * "arm,cortex-a9-global-timer" for Cortex-A9 global timers
> + or any compatible implementation.
>
> - interrupts : One interrupt to each core
>
> --
> 1.8.5.3
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer
2014-03-10 11:51 ` [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer Matthew Leach
2014-03-10 11:57 ` Mark Rutland
@ 2014-03-10 16:27 ` Rob Herring
2014-03-10 16:51 ` Mark Rutland
2014-03-10 16:28 ` Rob Herring
2 siblings, 1 reply; 11+ messages in thread
From: Rob Herring @ 2014-03-10 16:27 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 10, 2014 at 6:51 AM, Matthew Leach <matthew.leach@arm.com> wrote:
> The global timer is present on the Cortex A5. Add a compatibility
> string to the DT binding to allow a Cortex A5 global timer.
>
> Signed-off-by: Matthew Leach <matthew.leach@arm.com>
> ---
> Documentation/devicetree/bindings/arm/global_timer.txt | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt b/Documentation/devicetree/bindings/arm/global_timer.txt
> index 1e54898..0932891 100644
> --- a/Documentation/devicetree/bindings/arm/global_timer.txt
> +++ b/Documentation/devicetree/bindings/arm/global_timer.txt
> @@ -4,8 +4,10 @@
>
> ** Timer node required properties:
>
> -- compatible : Should be "arm,cortex-a9-global-timer"
> - Driver supports versions r2p0 and above.
Shouldn't you keep this information for the A9?
> +- compatible : should contain
> + * "arm,cortex-a5-global-timer" for Cortex-A5 global timers.
> + * "arm,cortex-a9-global-timer" for Cortex-A9 global timers
> + or any compatible implementation.
>
> - interrupts : One interrupt to each core
>
> --
> 1.8.5.3
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer
2014-03-10 11:51 ` [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer Matthew Leach
2014-03-10 11:57 ` Mark Rutland
2014-03-10 16:27 ` Rob Herring
@ 2014-03-10 16:28 ` Rob Herring
2 siblings, 0 replies; 11+ messages in thread
From: Rob Herring @ 2014-03-10 16:28 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 10, 2014 at 6:51 AM, Matthew Leach <matthew.leach@arm.com> wrote:
> The global timer is present on the Cortex A5. Add a compatibility
> string to the DT binding to allow a Cortex A5 global timer.
Also, please use get_maintainers.pl so you copy the right people and list.
Rob
>
> Signed-off-by: Matthew Leach <matthew.leach@arm.com>
> ---
> Documentation/devicetree/bindings/arm/global_timer.txt | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt b/Documentation/devicetree/bindings/arm/global_timer.txt
> index 1e54898..0932891 100644
> --- a/Documentation/devicetree/bindings/arm/global_timer.txt
> +++ b/Documentation/devicetree/bindings/arm/global_timer.txt
> @@ -4,8 +4,10 @@
>
> ** Timer node required properties:
>
> -- compatible : Should be "arm,cortex-a9-global-timer"
> - Driver supports versions r2p0 and above.
> +- compatible : should contain
> + * "arm,cortex-a5-global-timer" for Cortex-A5 global timers.
> + * "arm,cortex-a9-global-timer" for Cortex-A9 global timers
> + or any compatible implementation.
>
> - interrupts : One interrupt to each core
>
> --
> 1.8.5.3
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer
2014-03-10 16:27 ` Rob Herring
@ 2014-03-10 16:51 ` Mark Rutland
2014-03-10 17:57 ` Rob Herring
0 siblings, 1 reply; 11+ messages in thread
From: Mark Rutland @ 2014-03-10 16:51 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 10, 2014 at 04:27:09PM +0000, Rob Herring wrote:
> On Mon, Mar 10, 2014 at 6:51 AM, Matthew Leach <matthew.leach@arm.com> wrote:
> > The global timer is present on the Cortex A5. Add a compatibility
> > string to the DT binding to allow a Cortex A5 global timer.
> >
> > Signed-off-by: Matthew Leach <matthew.leach@arm.com>
> > ---
> > Documentation/devicetree/bindings/arm/global_timer.txt | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt b/Documentation/devicetree/bindings/arm/global_timer.txt
> > index 1e54898..0932891 100644
> > --- a/Documentation/devicetree/bindings/arm/global_timer.txt
> > +++ b/Documentation/devicetree/bindings/arm/global_timer.txt
> > @@ -4,8 +4,10 @@
> >
> > ** Timer node required properties:
> >
> > -- compatible : Should be "arm,cortex-a9-global-timer"
> > - Driver supports versions r2p0 and above.
>
> Shouldn't you keep this information for the A9?
To me it feels like documenting the driver rather than the binding for
the hardware.
I'm happy to retain notes about the constraints imposed by Linux
drivers, but I'd prefer if it were the exception rather than the rule.
Mark.
>
> > +- compatible : should contain
> > + * "arm,cortex-a5-global-timer" for Cortex-A5 global timers.
> > + * "arm,cortex-a9-global-timer" for Cortex-A9 global timers
> > + or any compatible implementation.
> >
> > - interrupts : One interrupt to each core
> >
> > --
> > 1.8.5.3
> >
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer
2014-03-10 16:51 ` Mark Rutland
@ 2014-03-10 17:57 ` Rob Herring
2014-03-10 18:11 ` Mark Rutland
0 siblings, 1 reply; 11+ messages in thread
From: Rob Herring @ 2014-03-10 17:57 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 10, 2014 at 11:51 AM, Mark Rutland <mark.rutland@arm.com> wrote:
> On Mon, Mar 10, 2014 at 04:27:09PM +0000, Rob Herring wrote:
>> On Mon, Mar 10, 2014 at 6:51 AM, Matthew Leach <matthew.leach@arm.com> wrote:
>> > The global timer is present on the Cortex A5. Add a compatibility
>> > string to the DT binding to allow a Cortex A5 global timer.
>> >
>> > Signed-off-by: Matthew Leach <matthew.leach@arm.com>
>> > ---
>> > Documentation/devicetree/bindings/arm/global_timer.txt | 6 ++++--
>> > 1 file changed, 4 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt b/Documentation/devicetree/bindings/arm/global_timer.txt
>> > index 1e54898..0932891 100644
>> > --- a/Documentation/devicetree/bindings/arm/global_timer.txt
>> > +++ b/Documentation/devicetree/bindings/arm/global_timer.txt
>> > @@ -4,8 +4,10 @@
>> >
>> > ** Timer node required properties:
>> >
>> > -- compatible : Should be "arm,cortex-a9-global-timer"
>> > - Driver supports versions r2p0 and above.
>>
>> Shouldn't you keep this information for the A9?
>
> To me it feels like documenting the driver rather than the binding for
> the hardware.
>
> I'm happy to retain notes about the constraints imposed by Linux
> drivers, but I'd prefer if it were the exception rather than the rule.
Isn't the driver constraint based on the global timer h/w being broken
on pre r2p0? If it is truly a Linux limitation that could be fixed,
then I agree.
Rob
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer
2014-03-10 17:57 ` Rob Herring
@ 2014-03-10 18:11 ` Mark Rutland
0 siblings, 0 replies; 11+ messages in thread
From: Mark Rutland @ 2014-03-10 18:11 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 10, 2014 at 05:57:32PM +0000, Rob Herring wrote:
> On Mon, Mar 10, 2014 at 11:51 AM, Mark Rutland <mark.rutland@arm.com> wrote:
> > On Mon, Mar 10, 2014 at 04:27:09PM +0000, Rob Herring wrote:
> >> On Mon, Mar 10, 2014 at 6:51 AM, Matthew Leach <matthew.leach@arm.com> wrote:
> >> > The global timer is present on the Cortex A5. Add a compatibility
> >> > string to the DT binding to allow a Cortex A5 global timer.
> >> >
> >> > Signed-off-by: Matthew Leach <matthew.leach@arm.com>
> >> > ---
> >> > Documentation/devicetree/bindings/arm/global_timer.txt | 6 ++++--
> >> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt b/Documentation/devicetree/bindings/arm/global_timer.txt
> >> > index 1e54898..0932891 100644
> >> > --- a/Documentation/devicetree/bindings/arm/global_timer.txt
> >> > +++ b/Documentation/devicetree/bindings/arm/global_timer.txt
> >> > @@ -4,8 +4,10 @@
> >> >
> >> > ** Timer node required properties:
> >> >
> >> > -- compatible : Should be "arm,cortex-a9-global-timer"
> >> > - Driver supports versions r2p0 and above.
> >>
> >> Shouldn't you keep this information for the A9?
> >
> > To me it feels like documenting the driver rather than the binding for
> > the hardware.
> >
> > I'm happy to retain notes about the constraints imposed by Linux
> > drivers, but I'd prefer if it were the exception rather than the rule.
>
> Isn't the driver constraint based on the global timer h/w being broken
> on pre r2p0? If it is truly a Linux limitation that could be fixed,
> then I agree.
Unfortunately, I must admit ignorance on this matter.
>From a quick look, the comparator behaviour on Cortex-A9 cores prior to
r2p0 seems to make it unusable in practice (though I'm not aware of the
precise behaviour, perhaps there is some possible workaround).
We can note the problem in the binding document, but we don't need to
refer to any particular driver. :)
Cheers,
Mark.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-03-10 18:11 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10 11:51 [PATCH 0/4] Add support for the Cortex A5 global timer Matthew Leach
2014-03-10 11:51 ` [PATCH 1/4] clocksource: arm_global_timer: Only check for unusable timer on A9 Matthew Leach
2014-03-10 11:51 ` [PATCH 2/4] documentaion: DT: allow a A5 compatible string in global timer Matthew Leach
2014-03-10 11:57 ` Mark Rutland
2014-03-10 16:27 ` Rob Herring
2014-03-10 16:51 ` Mark Rutland
2014-03-10 17:57 ` Rob Herring
2014-03-10 18:11 ` Mark Rutland
2014-03-10 16:28 ` Rob Herring
2014-03-10 11:51 ` [PATCH 3/4] dts: ca5: add the global timer for the A5 Matthew Leach
2014-03-10 11:51 ` [PATCH 4/4] KConfig: Vexpress: build the ARM_GLOBAL_TIMER with vexpress platform Matthew Leach
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).