devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "R, Vignesh" <vigneshr@ti.com>
To: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Benoit Cousson <bcousson@baylibre.com>,
	Tony Lindgren <tony@atomide.com>,
	Russell King <linux@arm.linux.org.uk>,
	Mike Turquette <mturquette@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org
Subject: Re: [PATCH v2 2/5] ARM: OMAP2+: DRA7: Add hwmod entries for PWMSS
Date: Thu, 16 Jul 2015 21:01:37 +0530	[thread overview]
Message-ID: <55A7CE59.6010600@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1507152029460.32764@utopia.booyaka.com>

Hi,

On 07/16/2015 03:24 AM, Paul Walmsley wrote:
> Hi,
> 
> some comments.
> 
> On Wed, 3 Jun 2015, Vignesh R wrote:
> 
>> Add hwmod entries for the PWMSS on DRA7.
>>
>> Set l4_root_clk_div as the main_clk of PWMSS. It is fixed-factored clock
>> equal to L4PER2_L3_GICLK/2(l3_iclk_div/2).
>> As per AM57x TRM SPRUHZ6[1], October 2014, Section 29.1.3 Table 29-4,
>> clock source to PWMSS is L4PER2_L3_GICLK. But it is actually
>> L4PER2_L3_GICLK/2. The TRM does not show the division by 2.
> 
> Is the divide-by-two coming from PWMSS_EPWM.EPWM_TBCTL[HSPCLKDIV]?  Or is 
> HSPCLKDIV a separate divider after the divide-by-2 you mention above?

No, it not related to HSPCLKDIV. The TRM wrongly states L4PER2_L3_GICLK
as clock input for PWMSS. But actually  L4PER2_L4_GICLK(=L3_GICLK/2) is
the clock input for PWMSS. This will be updated in TRM soon.

> 
>> [1] www.ti.com/lit/ug/spruhz6/spruhz6.pdf
>>
>> Signed-off-by: Vignesh R <vigneshr@ti.com>
>> ---
>>
>> v2:
>>  * add TRM references.
>>
>>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 239 ++++++++++++++++++++++++++++++
>>  1 file changed, 239 insertions(+)
>>
>> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>> index 0e64c2fac0b5..86a7ac9a3138 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>> @@ -362,6 +362,149 @@ static struct omap_hwmod dra7xx_dcan2_hwmod = {
>>  	},
>>  };
>>  
>> +/* pwmss  */
>> +static struct omap_hwmod_class_sysconfig dra7xx_epwmss_sysc = {
>> +	.rev_offs	= 0x0,
>> +	.sysc_offs	= 0x4,
>> +	.sysc_flags	= SYSC_HAS_SIDLEMODE | SYSC_HAS_RESET_STATUS,
> 
> This doesn't match SPRUHZ6 Table 29-13 "PWMSS_SYSCONFIG".  There's no 
> RESETSTATUS bit.  There is a SOFTRESET bit. 
> 
> Could you please confirm whether this is intentional?

sorry my bad... I will change this in v3.

> 
>> +	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
>> +	.sysc_fields	= &omap_hwmod_sysc_type2,
>> +};
>> +
>> +struct omap_hwmod_class dra7xx_epwmss_hwmod_class = {
>> +	.name		= "epwmss",
>> +	.sysc		= &dra7xx_epwmss_sysc,
>> +};
>> +
>> +static struct omap_hwmod_class dra7xx_ecap_hwmod_class = {
>> +	.name		= "ecap",
>> +};
>> +
>> +static struct omap_hwmod_class dra7xx_eqep_hwmod_class = {
>> +	.name		= "eqep",
>> +};
>> +
>> +struct omap_hwmod_class dra7xx_ehrpwm_hwmod_class = {
>> +	.name		= "ehrpwm",
>> +};
>> +
>> +/* epwmss0 */
>> +struct omap_hwmod dra7xx_epwmss0_hwmod = {
>> +	.name		= "epwmss0",
>> +	.class		= &dra7xx_epwmss_hwmod_class,
>> +	.clkdm_name	= "l4per2_clkdm",
>> +	.main_clk	= "l4_root_clk_div",
>> +	.prcm		= {
>> +		.omap4	= {
>> +			.modulemode	= MODULEMODE_SWCTRL,
>> +			.clkctrl_offs	= DRA7XX_CM_L4PER2_PWMSS1_CLKCTRL_OFFSET,
>> +			.context_offs	= DRA7XX_RM_L4PER2_PWMSS1_CONTEXT_OFFSET,
>> +		},
>> +	},
> 
> Per my comment on the previous patch, sounds like it might be better to 
> mark this as HWMOD_SWSUP_SIDLE?  Then again, see the next comment below 
> re: main_clk.
> 
>> +};
>> +
>> +/* ecap0 */
>> +struct omap_hwmod dra7xx_ecap0_hwmod = {
>> +	.name		= "ecap0",
>> +	.class		= &dra7xx_ecap_hwmod_class,
>> +	.clkdm_name	= "l4per2_clkdm",
>> +	.main_clk	= "l4_root_clk_div",
> 
> Looking at SPRUHZ6 Section 29.1.4.2 "PWMSS Modules Local Clock Gating", 
> there appears to be a local "mini-PRCM" for the PWMSS which implements 
> clock gating and reports back on the status of what I'd guess is the local 
> clock gating FSM.
> 
> So from that point of view, you should probably create a clock driver that 
> manages both the clock gate request bit and the FSM status bit.  It should 
> be something that can be reused for the other PWMSS IP blocks.  Then 
> you'd create per-IP block clock nodes and set the main_clk to point to 
> that node.
> 

Since, this register is within the config space of PWMSS, the individual
gating and reporting for the modules within PWMSS
(PWMSS_CLKCONFIG) is currently being taken care by pwm-tipwmss.c(almost
the sole function this driver is doing). It has been the same since
am335x. Adding new clock nodes will result in driver changes and also
changes to am335x, am437x (and other platforms) hwmod files. It also
involves adding new nodes to clocks.dtsi and it will be difficult to
maintain backward compatibility for older platforms. Is it not better to
keep this as is, in order to maintain consistency (with am335x, am437x
etc) and also that these clock bits are within IP's config space?



-- 
Regards
Vignesh

  reply	other threads:[~2015-07-16 15:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-03 11:51 [PATCH v2 0/5] Add support for PWMSS on DRA7 Vignesh R
2015-06-03 11:51 ` [PATCH v2 1/5] ARM: OMAP2+: DRA7: clockdomain: change l4per2_7xx_clkdm to SW_WKUP Vignesh R
2015-07-15 19:56   ` Paul Walmsley
     [not found]     ` <alpine.DEB.2.02.1507151955330.32764-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org>
2015-07-15 20:27       ` Paul Walmsley
2015-07-16 15:26         ` R, Vignesh
2015-06-03 11:51 ` [PATCH v2 2/5] ARM: OMAP2+: DRA7: Add hwmod entries for PWMSS Vignesh R
2015-07-15 21:54   ` Paul Walmsley
2015-07-16 15:31     ` R, Vignesh [this message]
2015-07-23 15:35       ` R, Vignesh
2015-07-29  6:32         ` Vignesh R
2015-08-31 15:51       ` Paul Walmsley
     [not found]         ` <alpine.DEB.2.02.1508121700500.7154-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org>
2016-02-17 20:42           ` Franklin S Cooper Jr.
2016-02-18  6:58             ` Paul Walmsley
2016-02-18 15:33               ` Franklin S Cooper Jr.
2016-02-18 17:21                 ` Paul Walmsley
2015-06-03 11:51 ` [PATCH v2 3/5] ARM: dts: DRA7: Add TBCLK " Vignesh R
2015-06-03 11:51 ` [PATCH v2 4/5] clk: ti: DRA7: Add tbclk data for ehrpwm Vignesh R
2015-06-18 22:39   ` Michael Turquette
     [not found] ` <1433332284-10766-1-git-send-email-vigneshr-l0cyMroinI0@public.gmane.org>
2015-06-03 11:51   ` [PATCH v2 5/5] ARM: dts: DRA7: Add dt nodes for PWMSS Vignesh R
2015-07-06  6:11   ` [PATCH v2 0/5] Add support for PWMSS on DRA7 Vignesh R
2015-07-07 12:49     ` Tero Kristo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55A7CE59.6010600@ti.com \
    --to=vigneshr@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@linaro.org \
    --cc=paul@pwsan.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=t-kristo@ti.com \
    --cc=thierry.reding@gmail.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).