Devicetree
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] cpufreq: cpufreq-cpu0: provide compatibility string for DT matchup
       [not found] ` <1363043130-30270-3-git-send-email-nm@ti.com>
@ 2013-03-12  5:07   ` Santosh Shilimkar
  2013-03-12 14:28     ` Benoit Cousson
       [not found]   ` <1363043130-30270-3-git-send-email-nm-l0cyMroinI0@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Santosh Shilimkar @ 2013-03-12  5:07 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: cpufreq, Rafael J. Wysocki, Shawn Guo, linux-kernel, linux-pm,
	linux-omap, devicetree-discuss@lists.ozlabs.org

On Tuesday 12 March 2013 04:35 AM, Nishanth Menon wrote:
> commit 5553f9e (cpufreq: instantiate cpufreq-cpu0 as a platform_driver)
> now forces platform device to be registered for allowing cpufreq-cpu0
> to be used by SoCs. example: drivers/cpufreq/highbank-cpufreq.c
> 
> However, for SoCs that wish to link up using device tree, instead
> of platform device, provide compatibility string match:
> compatible = "cpufreq,cpu0";
> 
> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: cpufreq@vger.kernel.org
> Cc: linux-pm@vger.kernel.org
> Cc: linux-omap@vger.kernel.org
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
>  .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt   |    3 +++
>  drivers/cpufreq/cpufreq-cpu0.c                     |    6 ++++++
>  2 files changed, 9 insertions(+)
> 
Looks fine to me. CC'ing dt list in case some one has
comments on binding updates.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>


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

* Re: [PATCH 2/2] cpufreq: cpufreq-cpu0: provide compatibility string for DT matchup
       [not found]   ` <1363043130-30270-3-git-send-email-nm-l0cyMroinI0@public.gmane.org>
@ 2013-03-12  7:57     ` Shawn Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2013-03-12  7:57 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, cpufreq, Rafael J. Wysocki,
	Santosh Shilimkar, linux-omap-u79uwXL29TY76Z2rM5mHXA

Copied devicetree-discuss list.

On Mon, Mar 11, 2013 at 06:05:30PM -0500, Nishanth Menon wrote:
> commit 5553f9e (cpufreq: instantiate cpufreq-cpu0 as a platform_driver)
> now forces platform device to be registered for allowing cpufreq-cpu0
> to be used by SoCs. example: drivers/cpufreq/highbank-cpufreq.c
> 
> However, for SoCs that wish to link up using device tree, instead
> of platform device, provide compatibility string match:
> compatible = "cpufreq,cpu0";

This compatible is merely added for asking DT core code to populate
a platform_device for cpufreq driver.  It's not describing
hardware/cpus, and it does not belong to device tree.

Shawn

> 
> Cc: "Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>
> Cc: Santosh Shilimkar <santosh.shilimkar-l0cyMroinI0@public.gmane.org>
> Cc: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> 
> Signed-off-by: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
> ---
>  .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt   |    3 +++
>  drivers/cpufreq/cpufreq-cpu0.c                     |    6 ++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt b/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt
> index f180963..a5699f0 100644
> --- a/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt
> +++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt
> @@ -10,6 +10,8 @@ under node /cpus/cpu@0.
>  Required properties:
>  - operating-points: Refer to Documentation/devicetree/bindings/power/opp.txt
>    for details
> +- compatible: if platform_device is *not* used, should be:
> +  "cpufreq,cpu0"
>  
>  Optional properties:
>  - clock-name: If the clock is not converted to device tree, then describe
> @@ -24,6 +26,7 @@ Examples:
>  cpus {
>  	#address-cells = <1>;
>  	#size-cells = <0>;
> +	compatible = "cpufreq,cpu0";
>  
>  	cpu@0 {
>  		compatible = "arm,cortex-a9";
> diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
> index 28223c9..a6f0a9b 100644
> --- a/drivers/cpufreq/cpufreq-cpu0.c
> +++ b/drivers/cpufreq/cpufreq-cpu0.c
> @@ -277,9 +277,15 @@ static int cpu0_cpufreq_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static struct of_device_id of_cpu0_cpufreq_match[] = {
> +	{ .compatible = "cpufreq,cpu0", },
> +	{ /* end */ }
> +};
> +
>  static struct platform_driver cpu0_cpufreq_platdrv = {
>  	.driver = {
>  		.name	= "cpufreq-cpu0",
> +		.of_match_table = of_cpu0_cpufreq_match,
>  		.owner	= THIS_MODULE,
>  	},
>  	.probe		= cpu0_cpufreq_probe,
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH 2/2] cpufreq: cpufreq-cpu0: provide compatibility string for DT matchup
  2013-03-12  5:07   ` [PATCH 2/2] cpufreq: cpufreq-cpu0: provide compatibility string for DT matchup Santosh Shilimkar
@ 2013-03-12 14:28     ` Benoit Cousson
  2013-03-12 14:35       ` Santosh Shilimkar
  2013-03-12 14:43       ` Nishanth Menon
  0 siblings, 2 replies; 6+ messages in thread
From: Benoit Cousson @ 2013-03-12 14:28 UTC (permalink / raw)
  To: Santosh Shilimkar, Nishanth Menon
  Cc: linux-pm, devicetree-discuss@lists.ozlabs.org, linux-kernel,
	cpufreq, Rafael J. Wysocki, linux-omap

On 03/12/2013 06:07 AM, Santosh Shilimkar wrote:
> On Tuesday 12 March 2013 04:35 AM, Nishanth Menon wrote:
>> commit 5553f9e (cpufreq: instantiate cpufreq-cpu0 as a platform_driver)
>> now forces platform device to be registered for allowing cpufreq-cpu0
>> to be used by SoCs. example: drivers/cpufreq/highbank-cpufreq.c
>>
>> However, for SoCs that wish to link up using device tree, instead
>> of platform device, provide compatibility string match:
>> compatible = "cpufreq,cpu0";

You cannot add a non-HW relative binding... DT is supposed to represent
the pure HW.
AFAIK, cpufreq has nothing to do with the HW definition.

>>
>> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
>> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
>> Cc: Shawn Guo <shawn.guo@linaro.org>
>> Cc: linux-kernel@vger.kernel.org
>> Cc: cpufreq@vger.kernel.org
>> Cc: linux-pm@vger.kernel.org
>> Cc: linux-omap@vger.kernel.org
>>
>> Signed-off-by: Nishanth Menon <nm@ti.com>
>> ---
>>  .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt   |    3 +++
>>  drivers/cpufreq/cpufreq-cpu0.c                     |    6 ++++++
>>  2 files changed, 9 insertions(+)
>>
> Looks fine to me. CC'ing dt list in case some one has
> comments on binding updates.
> 
> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

Not-Acked-by-me.

Regards,
Benoit




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

* Re: [PATCH 2/2] cpufreq: cpufreq-cpu0: provide compatibility string for DT matchup
  2013-03-12 14:28     ` Benoit Cousson
@ 2013-03-12 14:35       ` Santosh Shilimkar
  2013-03-12 14:43       ` Nishanth Menon
  1 sibling, 0 replies; 6+ messages in thread
From: Santosh Shilimkar @ 2013-03-12 14:35 UTC (permalink / raw)
  To: Benoit Cousson
  Cc: Nishanth Menon, linux-pm, devicetree-discuss@lists.ozlabs.org,
	linux-kernel, cpufreq, Rafael J. Wysocki, linux-omap

On Tuesday 12 March 2013 07:58 PM, Benoit Cousson wrote:
> On 03/12/2013 06:07 AM, Santosh Shilimkar wrote:
>> On Tuesday 12 March 2013 04:35 AM, Nishanth Menon wrote:
>>> commit 5553f9e (cpufreq: instantiate cpufreq-cpu0 as a platform_driver)
>>> now forces platform device to be registered for allowing cpufreq-cpu0
>>> to be used by SoCs. example: drivers/cpufreq/highbank-cpufreq.c
>>>
>>> However, for SoCs that wish to link up using device tree, instead
>>> of platform device, provide compatibility string match:
>>> compatible = "cpufreq,cpu0";
> 
> You cannot add a non-HW relative binding... DT is supposed to represent
> the pure HW.
> AFAIK, cpufreq has nothing to do with the HW definition.
> 
You are right. 

>>>
>>> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
>>> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>> Cc: Shawn Guo <shawn.guo@linaro.org>
>>> Cc: linux-kernel@vger.kernel.org
>>> Cc: cpufreq@vger.kernel.org
>>> Cc: linux-pm@vger.kernel.org
>>> Cc: linux-omap@vger.kernel.org
>>>
>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>> ---
>>>  .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt   |    3 +++
>>>  drivers/cpufreq/cpufreq-cpu0.c                     |    6 ++++++
>>>  2 files changed, 9 insertions(+)
>>>
>> Looks fine to me. CC'ing dt list in case some one has
>> comments on binding updates.
>>
>> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> 
> Not-Acked-by-me.
> 
I obviously missed the point while acking the patch.

Regards,
santosh



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

* Re: [PATCH 2/2] cpufreq: cpufreq-cpu0: provide compatibility string for DT matchup
  2013-03-12 14:28     ` Benoit Cousson
  2013-03-12 14:35       ` Santosh Shilimkar
@ 2013-03-12 14:43       ` Nishanth Menon
  2013-03-12 15:31         ` Benoit Cousson
  1 sibling, 1 reply; 6+ messages in thread
From: Nishanth Menon @ 2013-03-12 14:43 UTC (permalink / raw)
  To: Benoit Cousson
  Cc: Santosh Shilimkar, linux-pm, devicetree-discuss@lists.ozlabs.org,
	linux-kernel, cpufreq, Rafael J. Wysocki, linux-omap

On 15:28-20130312, Benoit Cousson wrote:
> On 03/12/2013 06:07 AM, Santosh Shilimkar wrote:
> > On Tuesday 12 March 2013 04:35 AM, Nishanth Menon wrote:
> >> commit 5553f9e (cpufreq: instantiate cpufreq-cpu0 as a platform_driver)
> >> now forces platform device to be registered for allowing cpufreq-cpu0
> >> to be used by SoCs. example: drivers/cpufreq/highbank-cpufreq.c
> >>
> >> However, for SoCs that wish to link up using device tree, instead
> >> of platform device, provide compatibility string match:
> >> compatible = "cpufreq,cpu0";
> 
> You cannot add a non-HW relative binding... DT is supposed to represent
> the pure HW.
> AFAIK, cpufreq has nothing to do with the HW definition.
Ref:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/cpufreq/highbank-cpufreq.c#n61
there is a need for a device of some sort.  in the example above, we
register a dummy device for linking up with cpufreq-cpu0 driver.
what we do in this patch is to indicate that SoC CPUs are managed by
cpufreq-cpu0 driver.

I am a bit curious to see how else would we represent drivers to manage
real h/w devices like CPU? Is the highbank style the recommended way to do
things?
> 
> >>
> >> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> >> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> >> Cc: Shawn Guo <shawn.guo@linaro.org>
> >> Cc: linux-kernel@vger.kernel.org
> >> Cc: cpufreq@vger.kernel.org
> >> Cc: linux-pm@vger.kernel.org
> >> Cc: linux-omap@vger.kernel.org
> >>
> >> Signed-off-by: Nishanth Menon <nm@ti.com>
> >> ---
> >>  .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt   |    3 +++
> >>  drivers/cpufreq/cpufreq-cpu0.c                     |    6 ++++++
> >>  2 files changed, 9 insertions(+)
> >>
> > Looks fine to me. CC'ing dt list in case some one has
> > comments on binding updates.
> > 
> > Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> 
> Not-Acked-by-me.

-- 
Regards,
Nishanth Menon

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

* Re: [PATCH 2/2] cpufreq: cpufreq-cpu0: provide compatibility string for DT matchup
  2013-03-12 14:43       ` Nishanth Menon
@ 2013-03-12 15:31         ` Benoit Cousson
  0 siblings, 0 replies; 6+ messages in thread
From: Benoit Cousson @ 2013-03-12 15:31 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, cpufreq, Rafael J. Wysocki,
	Santosh Shilimkar, linux-omap-u79uwXL29TY76Z2rM5mHXA

On 03/12/2013 03:43 PM, Nishanth Menon wrote:
> On 15:28-20130312, Benoit Cousson wrote:
>> On 03/12/2013 06:07 AM, Santosh Shilimkar wrote:
>>> On Tuesday 12 March 2013 04:35 AM, Nishanth Menon wrote:
>>>> commit 5553f9e (cpufreq: instantiate cpufreq-cpu0 as a platform_driver)
>>>> now forces platform device to be registered for allowing cpufreq-cpu0
>>>> to be used by SoCs. example: drivers/cpufreq/highbank-cpufreq.c
>>>>
>>>> However, for SoCs that wish to link up using device tree, instead
>>>> of platform device, provide compatibility string match:
>>>> compatible = "cpufreq,cpu0";
>>
>> You cannot add a non-HW relative binding... DT is supposed to represent
>> the pure HW.
>> AFAIK, cpufreq has nothing to do with the HW definition.
> Ref:
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/cpufreq/highbank-cpufreq.c#n61
> there is a need for a device of some sort.  in the example above, we
> register a dummy device for linking up with cpufreq-cpu0 driver.
> what we do in this patch is to indicate that SoC CPUs are managed by
> cpufreq-cpu0 driver.
> 
> I am a bit curious to see how else would we represent drivers to manage
> real h/w devices like CPU? Is the highbank style the recommended way to do
> things?

Yep, I don't think this is a very elegant way to do that, but until we
do have a generic DVFS layer, I'm not sure we have any other approach.
But maybe not.

The CPU is the real device, but AFAIK, nobody beside OMAP is
representing the CPU as the device.
But I'd rather use a CPU device than a fake CPUFREQ device.

Regards,
Benoit

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

end of thread, other threads:[~2013-03-12 15:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1363043130-30270-1-git-send-email-nm@ti.com>
     [not found] ` <1363043130-30270-3-git-send-email-nm@ti.com>
2013-03-12  5:07   ` [PATCH 2/2] cpufreq: cpufreq-cpu0: provide compatibility string for DT matchup Santosh Shilimkar
2013-03-12 14:28     ` Benoit Cousson
2013-03-12 14:35       ` Santosh Shilimkar
2013-03-12 14:43       ` Nishanth Menon
2013-03-12 15:31         ` Benoit Cousson
     [not found]   ` <1363043130-30270-3-git-send-email-nm-l0cyMroinI0@public.gmane.org>
2013-03-12  7:57     ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox