linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@linaro.org>
To: "Mohammed, Afzal" <afzal@ti.com>,
	"linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"devicetree-discuss@lists.ozlabs.org"
	<devicetree-discuss@lists.ozlabs.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	"Valkeinen, Tomi" <tomi.valkeinen@ti.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>
Subject: Re: RE: [PATCH v4 12/12] video: da8xx-fb: CCF clock divider handling
Date: Thu, 24 Jan 2013 17:00:44 +0000	[thread overview]
Message-ID: <20130124170044.10623.45314@quantum> (raw)
In-Reply-To: <C8443D0743D26F4388EA172BF4E2A7A93EA92ADF@DBDE01.ent.ti.com>

Quoting Mohammed, Afzal (2013-01-24 03:36:02)
> Hi Mike,
> 
> On Thu, Jan 24, 2013 at 01:52:04, Mike Turquette wrote:
> > Quoting Afzal Mohammed (2013-01-23 03:48:56)
> 
> > > +static inline void da8xx_fb_clkc_enable(void)
> > > +{
> > >         if (lcd_revision = LCD_VERSION_2)
> > >                 lcdc_write(LCD_V2_DMA_CLK_EN | LCD_V2_LIDD_CLK_EN |
> > >                                 LCD_V2_CORE_CLK_EN, LCD_CLK_ENABLE_REG);
> 
> > > +static inline int da8xx_fb_calc_config_clk_divider(struct da8xx_fb_par *par,
> > > +                                                   struct fb_videomode *mode)
> > > +{
> 
> > > +       ret = clk_set_rate(par->child_clk, PICOS2KHZ(mode->pixclock) * 1000);
> > > +       if (IS_ERR_VALUE(ret)) {
> > > +               dev_err(par->dev, "unable to setup pixel clock of %u ps",
> > > +                       mode->pixclock);
> > > +               return ret;
> > > +       }
> > > +       da8xx_fb_clkc_enable();
> 
> > It looks like you are using the legacy method to enable/disable the
> > clock and using the CCF basic divider to set the rate.  This feels a bit
> > hacky to me.  If you want to model your clock in CCF then you should
> > probably model the whole clock, not just the rate-change aspects of it.
> 
> Initially I thought about it, but seeing requirement of 3 gate clocks
> (due to 3 bits meant for different purposes - DMA, LIDD and CORE
> functionalities), felt that having 4 clocks (3 gate + 1 divider) in
> driver would be an overdesign [leaving a branch instead of a leaf of
> the tree in driver ;)].
> 
> > Have you looked at the composite clock patches from Prashant?  Those
> > might give you the divider+gate properties that you are looking for:
> > http://article.gmane.org/gmane.linux.kernel/1416697
> 
> Thanks for the pointer,
> 
> Now with the composite clock in mind, it was tried to relate to what
> was required for the present scenario.
> 
> So there are 3 - LIDD is actually not for present use case, CORE could
> be clubbed with the divider to have a composite clock. And CORE is
> in functional clock path and logically it's perfectly alright to have
> the composite clock.
> 

Some of the clock names are a bit generic, so a question that I'm going
to repeat throughout my response: "is this clock only inside of your
video IP ?"

Regarding the CORE clock, is this only inside of your IP or are you
referring to the SoC CORE clock which is driven by a DPLL and clocks
DDR and many other peripherals (often MMC, UART, etc)?

Note that this is from my past experience with OMAP, and I'm making an
assumption that the clock scheme between OMAP and Da Vinci/AM335x parts
isn't very different.

Is there a public TRM I can look at?  It would help me understand this
without having to ask you so many annoying questions ;)

> And now we are left with DMA, this is actually in the interface clock
> path which driver in unaware. An option would be to have DMA clock
> as child of CORE plus divider composite clock, even though logically
> DMA can't be considered in the same path.
> 

Why is the driver unaware of the interface clk?  For instance OMAP3 had
separate fclk and iclk for IPs and drivers would call clk_enable on
both.  Or am I misunderstanding something?

In general I don't think the clock subtree should be modeled in a way
that is convenient for software, but instead model the actual hardware.
Trust me, if you don't model the actual hardware then you will be very
confused when you come back and revisit this code in 6 months and can't
remember why things are so weird looking.

Thanks,
Mike

> Also tried not enabling DMA clock, but driver is able to provide
> display without any issues, so was thinking whether to avoid
> instantiating DMA clock at all and hence to have a simple single
> composite clock. Trying to get information internally on whether
> not setting DMA clock bits would actually make a difference.
> 
> If you have any opinion on how to deal here, let me know.
> 
> Regards
> Afzal

  reply	other threads:[~2013-01-24 17:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23 11:59 [PATCH v4 00/12] video: da8xx-fb: am335x DT support Afzal Mohammed
2013-01-23 11:49 ` [PATCH v4 08/12] video: da8xx-fb: invoke platform callback safely Afzal Mohammed
2013-01-23 11:49 ` [PATCH v4 12/12] video: da8xx-fb: CCF clock divider handling Afzal Mohammed
2013-01-23 20:22   ` Mike Turquette
2013-01-24 11:36     ` Mohammed, Afzal
2013-01-24 17:00       ` Mike Turquette [this message]
2013-01-25 12:05         ` Mohammed, Afzal
2013-01-25 22:44           ` Mike Turquette
2013-01-28  9:17             ` Mohammed, Afzal
2013-01-23 11:49 ` [PATCH v4 11/12] video: da8xx-fb: setup struct lcd_ctrl_config for dt Afzal Mohammed
2013-01-23 11:49 ` [PATCH v4 10/12] video: da8xx-fb: ensure pdata only for non-dt Afzal Mohammed
2013-01-23 11:50 ` [PATCH v4 09/12] video: da8xx-fb: obtain fb_videomode info from dt Afzal Mohammed
2013-01-23 11:50 ` [PATCH v4 07/12] video: da8xx-fb: minimal dt support Afzal Mohammed
     [not found] ` <cover.1358937685.git.afzal-l0cyMroinI0@public.gmane.org>
2013-01-23 11:51   ` [PATCH v4 06/12] video: da8xx-fb: reorganize panel detection Afzal Mohammed
2013-01-23 11:52   ` [PATCH v4 02/12] video: da8xx-fb: fix 24bpp raster configuration Afzal Mohammed
2013-01-23 11:51 ` [PATCH v4 05/12] video: da8xx-fb: ensure non-null cfg in pdata Afzal Mohammed
2013-01-23 11:51 ` [PATCH v4 04/12] video: da8xx-fb: use devres Afzal Mohammed
2013-01-23 11:51 ` [PATCH v4 03/12] video: da8xx-fb: enable sync lost intr for v2 ip Afzal Mohammed
2013-01-23 11:59 ` [PATCH v4 01/12] video: da8xx-fb: make io operations safe Afzal Mohammed

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=20130124170044.10623.45314@quantum \
    --to=mturquette@linaro.org \
    --cc=FlorianSchandinat@gmx.de \
    --cc=afzal@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=tomi.valkeinen@ti.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).