devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/2] ARM: dts: Add PMU support for OMAP2+
@ 2012-12-17 17:49 Jon Hunter
  2012-12-17 17:49 ` [PATCH V2 1/2] ARM: OMAP2+: Prepare for device-tree PMU support Jon Hunter
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jon Hunter @ 2012-12-17 17:49 UTC (permalink / raw)
  To: Tony Lindgren, Benoit Cousson
  Cc: linux-omap, linux-arm, device-tree, Jon Hunter

Add device-tree PMU support for OMAP2, OMAP3 and OMAP4460. OMAP4430
is not included because PMU is not currently supported on this device
due to absence of a cross-trigger interface driver.

Tested with PERF on OMAP3430 Beagle Board and OMAP4460 Panda Board.
Boot tested only on OMAP2420 H4.

Jon Hunter (2):
  ARM: OMAP2+: Prepare for device-tree PMU support
  ARM: dts: OMAP2+: Add PMU nodes

 arch/arm/boot/dts/omap2.dtsi         |    5 +++++
 arch/arm/boot/dts/omap3.dtsi         |    6 ++++++
 arch/arm/boot/dts/omap4-panda-es.dts |    2 ++
 arch/arm/boot/dts/omap4460.dtsi      |   18 ++++++++++++++++++
 arch/arm/mach-omap2/pmu.c            |   14 +++++++++++---
 5 files changed, 42 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4460.dtsi

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V2 1/2] ARM: OMAP2+: Prepare for device-tree PMU support
  2012-12-17 17:49 [PATCH V2 0/2] ARM: dts: Add PMU support for OMAP2+ Jon Hunter
@ 2012-12-17 17:49 ` Jon Hunter
  2013-01-11 17:59   ` Tony Lindgren
  2012-12-17 17:49 ` [PATCH V2 2/2] ARM: dts: OMAP2+: Add PMU nodes Jon Hunter
       [not found] ` <1355766548-5702-1-git-send-email-jon-hunter-l0cyMroinI0@public.gmane.org>
  2 siblings, 1 reply; 8+ messages in thread
From: Jon Hunter @ 2012-12-17 17:49 UTC (permalink / raw)
  To: Tony Lindgren, Benoit Cousson
  Cc: linux-omap, linux-arm, device-tree, Jon Hunter

If device-tree is present, then do not create the PMU device from within
the OMAP specific PMU code. This is required to allow device-tree to
create the PMU device from the PMU device-tree node.

PMU is not currently supported for OMAP4430 (due to a dependency on
having a cross-trigger interface driver) and so ensure that this
indicated on boot with or without device-tree.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
 arch/arm/mach-omap2/pmu.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c
index eb78ae7..1a0799c 100644
--- a/arch/arm/mach-omap2/pmu.c
+++ b/arch/arm/mach-omap2/pmu.c
@@ -11,6 +11,8 @@
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  */
+#include <linux/of.h>
+
 #include <asm/pmu.h>
 
 #include "soc.h"
@@ -64,6 +66,15 @@ static int __init omap_init_pmu(void)
 	unsigned oh_num;
 	char **oh_names;
 
+	/* XXX Remove this check when the CTI driver is available */
+	if (cpu_is_omap443x()) {
+		pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n");
+		return 0;
+	}
+
+	if (of_have_populated_dt())
+		return 0;
+
 	/*
 	 * To create an ARM-PMU device the following HWMODs
 	 * are required for the various OMAP2+ devices.
@@ -76,9 +87,6 @@ static int __init omap_init_pmu(void)
 	if (cpu_is_omap443x()) {
 		oh_num = ARRAY_SIZE(omap4430_pmu_oh_names);
 		oh_names = omap4430_pmu_oh_names;
-		/* XXX Remove the next two lines when CTI driver available */
-		pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n");
-		return 0;
 	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 		oh_num = ARRAY_SIZE(omap3_pmu_oh_names);
 		oh_names = omap3_pmu_oh_names;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V2 2/2] ARM: dts: OMAP2+: Add PMU nodes
  2012-12-17 17:49 [PATCH V2 0/2] ARM: dts: Add PMU support for OMAP2+ Jon Hunter
  2012-12-17 17:49 ` [PATCH V2 1/2] ARM: OMAP2+: Prepare for device-tree PMU support Jon Hunter
@ 2012-12-17 17:49 ` Jon Hunter
  2013-01-11 13:23   ` Benoit Cousson
       [not found] ` <1355766548-5702-1-git-send-email-jon-hunter-l0cyMroinI0@public.gmane.org>
  2 siblings, 1 reply; 8+ messages in thread
From: Jon Hunter @ 2012-12-17 17:49 UTC (permalink / raw)
  To: Tony Lindgren, Benoit Cousson
  Cc: linux-omap, linux-arm, device-tree, Jon Hunter

Add PMU nodes for OMAP2, OMAP3 and OMAP4460 devices.

Please note that the node for OMAP4460 has been placed in a separate
header file for OMAP4460, because the node is not compatible with
OMAP4430. The node for OMAP4430 is not included because PMU is not
currently supported on OMAP4430 due to the absence of a cross-trigger
interface driver.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
 arch/arm/boot/dts/omap2.dtsi         |    5 +++++
 arch/arm/boot/dts/omap3.dtsi         |    6 ++++++
 arch/arm/boot/dts/omap4-panda-es.dts |    2 ++
 arch/arm/boot/dts/omap4460.dtsi      |   18 ++++++++++++++++++
 4 files changed, 31 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap4460.dtsi

diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
index 761c4b6..27f5ea1 100644
--- a/arch/arm/boot/dts/omap2.dtsi
+++ b/arch/arm/boot/dts/omap2.dtsi
@@ -26,6 +26,11 @@
 		};
 	};
 
+	pmu {
+		compatible = "arm,arm1136-pmu";
+		interrupts = <3>;
+	};
+
 	soc {
 		compatible = "ti,omap-infra";
 		mpu {
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 1acc261..6c63118 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -26,6 +26,12 @@
 		};
 	};
 
+	pmu {
+		compatible = "arm,cortex-a8-pmu";
+		interrupts = <3>;
+		ti,hwmods = "debugss";
+	};
+
 	/*
 	 * The soc node represents the soc top level view. It is uses for IPs
 	 * that are not memory mapped in the MPU view or for the MPU itself.
diff --git a/arch/arm/boot/dts/omap4-panda-es.dts b/arch/arm/boot/dts/omap4-panda-es.dts
index 73bc1a6..2a6e344 100644
--- a/arch/arm/boot/dts/omap4-panda-es.dts
+++ b/arch/arm/boot/dts/omap4-panda-es.dts
@@ -5,7 +5,9 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
 /include/ "omap4-panda.dts"
+/include/ "omap4460.dtsi"
 
 /* Audio routing is differnet between PandaBoard4430 and PandaBoardES */
 &sound {
diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
new file mode 100644
index 0000000..0a1d38b
--- /dev/null
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -0,0 +1,18 @@
+/*
+ * Device Tree Source for OMAP4460 SoC
+ *
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/ {
+	pmu {
+		compatible = "arm,cortex-a9-pmu";
+		interrupts = <0 54 0x4>,
+			     <0 55 0x4>;
+		ti,hwmods = "debugss";
+	};
+};
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH V2 0/2] ARM: dts: Add PMU support for OMAP2+
       [not found] ` <1355766548-5702-1-git-send-email-jon-hunter-l0cyMroinI0@public.gmane.org>
@ 2012-12-17 17:52   ` Jon Hunter
  0 siblings, 0 replies; 8+ messages in thread
From: Jon Hunter @ 2012-12-17 17:52 UTC (permalink / raw)
  To: Jon Hunter; +Cc: device-tree, linux-omap, linux-arm


On 12/17/2012 11:49 AM, Jon Hunter wrote:
> Add device-tree PMU support for OMAP2, OMAP3 and OMAP4460. OMAP4430
> is not included because PMU is not currently supported on this device
> due to absence of a cross-trigger interface driver.
> 
> Tested with PERF on OMAP3430 Beagle Board and OMAP4460 Panda Board.
> Boot tested only on OMAP2420 H4.

Forgot to mention that V2, addresses Mark Rutland's comment on interrupt
syntax for omap4460 PMU node. I also added a comment on why OMAP4430 is
not supported too.

Cheers
Jon

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2 2/2] ARM: dts: OMAP2+: Add PMU nodes
  2012-12-17 17:49 ` [PATCH V2 2/2] ARM: dts: OMAP2+: Add PMU nodes Jon Hunter
@ 2013-01-11 13:23   ` Benoit Cousson
  2013-01-11 13:59     ` Jon Hunter
  0 siblings, 1 reply; 8+ messages in thread
From: Benoit Cousson @ 2013-01-11 13:23 UTC (permalink / raw)
  To: Jon Hunter; +Cc: Tony Lindgren, linux-omap, linux-arm, device-tree

Hi Jon,

On 12/17/2012 06:49 PM, Jon Hunter wrote:
> Add PMU nodes for OMAP2, OMAP3 and OMAP4460 devices.
> 
> Please note that the node for OMAP4460 has been placed in a separate
> header file for OMAP4460, because the node is not compatible with
> OMAP4430. The node for OMAP4430 is not included because PMU is not
> currently supported on OMAP4430 due to the absence of a cross-trigger
> interface driver.
> 
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>

I've just applied this patch in my for_3.9/dts branch.

I'm wondering if there is any dependency with the previous patch? If
Tony ack it I can take it as well.

Regards,
Benoit

> ---
>  arch/arm/boot/dts/omap2.dtsi         |    5 +++++
>  arch/arm/boot/dts/omap3.dtsi         |    6 ++++++
>  arch/arm/boot/dts/omap4-panda-es.dts |    2 ++
>  arch/arm/boot/dts/omap4460.dtsi      |   18 ++++++++++++++++++
>  4 files changed, 31 insertions(+)
>  create mode 100644 arch/arm/boot/dts/omap4460.dtsi
> 
> diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
> index 761c4b6..27f5ea1 100644
> --- a/arch/arm/boot/dts/omap2.dtsi
> +++ b/arch/arm/boot/dts/omap2.dtsi
> @@ -26,6 +26,11 @@
>  		};
>  	};
>  
> +	pmu {
> +		compatible = "arm,arm1136-pmu";
> +		interrupts = <3>;
> +	};
> +
>  	soc {
>  		compatible = "ti,omap-infra";
>  		mpu {
> diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
> index 1acc261..6c63118 100644
> --- a/arch/arm/boot/dts/omap3.dtsi
> +++ b/arch/arm/boot/dts/omap3.dtsi
> @@ -26,6 +26,12 @@
>  		};
>  	};
>  
> +	pmu {
> +		compatible = "arm,cortex-a8-pmu";
> +		interrupts = <3>;
> +		ti,hwmods = "debugss";
> +	};
> +
>  	/*
>  	 * The soc node represents the soc top level view. It is uses for IPs
>  	 * that are not memory mapped in the MPU view or for the MPU itself.
> diff --git a/arch/arm/boot/dts/omap4-panda-es.dts b/arch/arm/boot/dts/omap4-panda-es.dts
> index 73bc1a6..2a6e344 100644
> --- a/arch/arm/boot/dts/omap4-panda-es.dts
> +++ b/arch/arm/boot/dts/omap4-panda-es.dts
> @@ -5,7 +5,9 @@
>   * it under the terms of the GNU General Public License version 2 as
>   * published by the Free Software Foundation.
>   */
> +
>  /include/ "omap4-panda.dts"
> +/include/ "omap4460.dtsi"
>  
>  /* Audio routing is differnet between PandaBoard4430 and PandaBoardES */
>  &sound {
> diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
> new file mode 100644
> index 0000000..0a1d38b
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap4460.dtsi
> @@ -0,0 +1,18 @@
> +/*
> + * Device Tree Source for OMAP4460 SoC
> + *
> + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2.  This program is licensed "as is" without any warranty of any
> + * kind, whether express or implied.
> + */
> +
> +/ {
> +	pmu {
> +		compatible = "arm,cortex-a9-pmu";
> +		interrupts = <0 54 0x4>,
> +			     <0 55 0x4>;
> +		ti,hwmods = "debugss";
> +	};
> +};
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2 2/2] ARM: dts: OMAP2+: Add PMU nodes
  2013-01-11 13:23   ` Benoit Cousson
@ 2013-01-11 13:59     ` Jon Hunter
  2013-01-11 17:59       ` Tony Lindgren
  0 siblings, 1 reply; 8+ messages in thread
From: Jon Hunter @ 2013-01-11 13:59 UTC (permalink / raw)
  To: Benoit Cousson; +Cc: Tony Lindgren, linux-omap, linux-arm, device-tree

Hi Benoit,

On 01/11/2013 07:23 AM, Benoit Cousson wrote:
> Hi Jon,
> 
> On 12/17/2012 06:49 PM, Jon Hunter wrote:
>> Add PMU nodes for OMAP2, OMAP3 and OMAP4460 devices.
>>
>> Please note that the node for OMAP4460 has been placed in a separate
>> header file for OMAP4460, because the node is not compatible with
>> OMAP4430. The node for OMAP4430 is not included because PMU is not
>> currently supported on OMAP4430 due to the absence of a cross-trigger
>> interface driver.
>>
>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> 
> I've just applied this patch in my for_3.9/dts branch.
> 
> I'm wondering if there is any dependency with the previous patch? If
> Tony ack it I can take it as well.

I have been thinking about the best way to handle that. May be best for
you to take both if Tony can ack the first.

Cheers
Jon

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2 1/2] ARM: OMAP2+: Prepare for device-tree PMU support
  2012-12-17 17:49 ` [PATCH V2 1/2] ARM: OMAP2+: Prepare for device-tree PMU support Jon Hunter
@ 2013-01-11 17:59   ` Tony Lindgren
  0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2013-01-11 17:59 UTC (permalink / raw)
  To: Jon Hunter; +Cc: Benoit Cousson, linux-omap, linux-arm, device-tree

* Jon Hunter <jon-hunter@ti.com> [121217 09:51]:
> If device-tree is present, then do not create the PMU device from within
> the OMAP specific PMU code. This is required to allow device-tree to
> create the PMU device from the PMU device-tree node.
> 
> PMU is not currently supported for OMAP4430 (due to a dependency on
> having a cross-trigger interface driver) and so ensure that this
> indicated on boot with or without device-tree.

Acked-by: Tony Lindgren <tony@atomide.com>
 
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
>  arch/arm/mach-omap2/pmu.c |   14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c
> index eb78ae7..1a0799c 100644
> --- a/arch/arm/mach-omap2/pmu.c
> +++ b/arch/arm/mach-omap2/pmu.c
> @@ -11,6 +11,8 @@
>   * the Free Software Foundation; either version 2 of the License, or
>   * (at your option) any later version.
>   */
> +#include <linux/of.h>
> +
>  #include <asm/pmu.h>
>  
>  #include "soc.h"
> @@ -64,6 +66,15 @@ static int __init omap_init_pmu(void)
>  	unsigned oh_num;
>  	char **oh_names;
>  
> +	/* XXX Remove this check when the CTI driver is available */
> +	if (cpu_is_omap443x()) {
> +		pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n");
> +		return 0;
> +	}
> +
> +	if (of_have_populated_dt())
> +		return 0;
> +
>  	/*
>  	 * To create an ARM-PMU device the following HWMODs
>  	 * are required for the various OMAP2+ devices.
> @@ -76,9 +87,6 @@ static int __init omap_init_pmu(void)
>  	if (cpu_is_omap443x()) {
>  		oh_num = ARRAY_SIZE(omap4430_pmu_oh_names);
>  		oh_names = omap4430_pmu_oh_names;
> -		/* XXX Remove the next two lines when CTI driver available */
> -		pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n");
> -		return 0;
>  	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
>  		oh_num = ARRAY_SIZE(omap3_pmu_oh_names);
>  		oh_names = omap3_pmu_oh_names;
> -- 
> 1.7.10.4
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2 2/2] ARM: dts: OMAP2+: Add PMU nodes
  2013-01-11 13:59     ` Jon Hunter
@ 2013-01-11 17:59       ` Tony Lindgren
  0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2013-01-11 17:59 UTC (permalink / raw)
  To: Jon Hunter; +Cc: Benoit Cousson, linux-omap, linux-arm, device-tree

* Jon Hunter <jon-hunter@ti.com> [130111 06:02]:
> Hi Benoit,
> 
> On 01/11/2013 07:23 AM, Benoit Cousson wrote:
> > Hi Jon,
> > 
> > On 12/17/2012 06:49 PM, Jon Hunter wrote:
> >> Add PMU nodes for OMAP2, OMAP3 and OMAP4460 devices.
> >>
> >> Please note that the node for OMAP4460 has been placed in a separate
> >> header file for OMAP4460, because the node is not compatible with
> >> OMAP4430. The node for OMAP4430 is not included because PMU is not
> >> currently supported on OMAP4430 due to the absence of a cross-trigger
> >> interface driver.
> >>
> >> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> > 
> > I've just applied this patch in my for_3.9/dts branch.
> > 
> > I'm wondering if there is any dependency with the previous patch? If
> > Tony ack it I can take it as well.
> 
> I have been thinking about the best way to handle that. May be best for
> you to take both if Tony can ack the first.

Sounds good to me, I've acked it now.

Tony

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-11 17:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-17 17:49 [PATCH V2 0/2] ARM: dts: Add PMU support for OMAP2+ Jon Hunter
2012-12-17 17:49 ` [PATCH V2 1/2] ARM: OMAP2+: Prepare for device-tree PMU support Jon Hunter
2013-01-11 17:59   ` Tony Lindgren
2012-12-17 17:49 ` [PATCH V2 2/2] ARM: dts: OMAP2+: Add PMU nodes Jon Hunter
2013-01-11 13:23   ` Benoit Cousson
2013-01-11 13:59     ` Jon Hunter
2013-01-11 17:59       ` Tony Lindgren
     [not found] ` <1355766548-5702-1-git-send-email-jon-hunter-l0cyMroinI0@public.gmane.org>
2012-12-17 17:52   ` [PATCH V2 0/2] ARM: dts: Add PMU support for OMAP2+ Jon Hunter

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).