Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Mike Turquette <mturquette@linaro.org>
Cc: "Andrii Tseglytskyi" <andrii.tseglytskyi@ti.com>,
	"Tero Kristo" <t-kristo@ti.com>,
	"Benoît Cousson" <b-cousson@ti.com>,
	linux-omap@vger.kernel.org
Subject: Re: [PATCH 5/6] ARM: OMAP3+: ABB: introduce ABB driver
Date: Thu, 28 Mar 2013 17:35:13 -0500	[thread overview]
Message-ID: <20130328223513.GA19470@kahuna> (raw)
In-Reply-To: <20130328212739.13785.44736@quantum>

- ti internal list which got into the git send-email by error. Apologies
on the bounces which might have resulted...

On 14:27-20130328, Mike Turquette wrote:
> Quoting Andrii Tseglytskyi (2013-03-28 10:16:07)
> > From: "Andrii.Tseglytskyi" <andrii.tseglytskyi@ti.com>
Ownership of ABB driver patch probably still belongs to Mike as the original
author of the code and working out all the details to entitle ABB on OMAP
platforms :)
> > 
[..]
> You should probably post this as an RFC.  It remains to be seen if using
> the clk rate-change notifiers will be the mechanism for scaling voltage
> in The Future.  This patch is helpful for the purposes of that
> discussion but shouldn't be merged until there is more consensus.
I agree. + include linux-arm-kernel and lkml in CC on the next *public*
revision :).

[..]
> 
> > +/*
> > + * struct omap_abb_data - common data for each instance of ABB ldo
> > + *
> > + * @opp_sel_mask:      selects Fast/Nominal/Slow OPP for ABB
> > + * @opp_change_mask:   selects OPP_CHANGE bit value
> > + * @sr2_wtcnt_value_mask:      LDO settling time for active-mode OPP change
> > + * @sr2en_mask:                        enables/disables ABB
> > + * @fbb_sel_mask:              selects FBB mode
> > + * @rbb_sel_mask:              selects RBB mode
> > + * @settling_time:     IRQ handle used to resolve IRQSTATUS offset & masks
> > + * @clock_cycles:      value needed for LDO setting time calculation
> > + * @setup_offs:                PRM_LDO_ABB_XXX_SETUP register offset
> > + * @control_offs:      PRM_LDO_ABB_IVA_CTRL register offset
> 
> Can you align all of these?
We should check up on AM and DM series as well - if the bit offsets are
precisely the same, we could stick with macros instead of having the
masks and register offsets in a device specific manner.

[..]
> > +/**
> > + * omap_abb_readl() - reads ABB control memory
> > + * @abb:       pointer to the abb instance
> > + * @offs:      offset to read
> > + *
> > + * Returns @offs value
> > + */
> > +static u32 omap_abb_readl(struct omap_abb *abb, u32 offs)
> > +{
> > +       return __raw_readl(abb->control + offs);
> > +}
> 
> readl instead of __raw_readl?
Ack. readl/writel should be used..

> > +/**
> > + * omap_abb_clock_rate_change() - ABB clock notifier callback
> > + * @nb:                notifier block
> > + * @flags:     notifier event type
> > + * @data:      notifier data, contains clock rates
> > + *
> > + * Returns NOTIFY_OK
> > + */
> > +static int omap_abb_clock_rate_change(struct notifier_block *nb,
> > +                                     unsigned long flags, void *data)
> > +{
> > +       struct clk_notifier_data *cnd = data;
> > +       struct omap_abb *abb = container_of(nb, struct omap_abb, abb_clk_nb);
> > +
> > +       switch (flags) {
> > +       case PRE_RATE_CHANGE:
> > +               omap_abb_pre_scale(abb, cnd->old_rate, cnd->new_rate);
> > +               break;
> > +       case POST_RATE_CHANGE:
> > +               omap_abb_post_scale(abb, cnd->old_rate, cnd->new_rate);
> > +               break;
> > +       }
> > +
> > +       return NOTIFY_OK;
> > +}
> 
> How does this synchronize with the VC/VP voltage transition?  Ordering
> is important here and if the clk rate-change notifiers are used for both
> a VP force update and for an FBB transition there is no guarantee of the
> ordering.
I need to dig into this series deeper, but the requirement is as
follows:
Actual voltage change may occur with vc/vp - OMAP3,4,5 OR with i2c1- AM
series or the upcoming DRA SoCs, intent is to model the vc-vp->pmic as
regulators (some internal patches circulate for this, but not mature enough
to be send out in a public list yet)

Key however is:
* if we do as clock notifiers(as this series attempts I believe), we'd get ABB
settings around clock change boundary.
Alternative might be to do it around voltage change - we could, in
theory:
a) make an omap voltage regulator and provide notifier around the same
and hook ABB to it. the omap voltage regulator will in turn call the
appropriate voltage regulator (modelled from a regulator that controls
an PMIC over i2c1 OR over vc-vp regulator)
b) make ABB as an regulator by itself?
c) how might this work if we have DVFS capability in CCF itself[1]? it
might be better to have it as notifiers to regulator (the pseudo
omap-voltage regulator perhaps?)

[1] CCF DVFS patches:
https://patchwork.kernel.org/patch/2195431/
https://patchwork.kernel.org/patch/2195421/
https://patchwork.kernel.org/patch/2195451/
https://patchwork.kernel.org/patch/2195441/
https://patchwork.kernel.org/patch/2195461/

-- 
Regards,
Nishanth Menon

  reply	other threads:[~2013-03-28 22:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 17:16 [PATCH 1/6] ARM: dts: OMAP36xx: add device tree for ABB Andrii Tseglytskyi
2013-03-28 17:16 ` [PATCH 2/6] ARM: dts: OMAP4: " Andrii Tseglytskyi
2013-03-28 17:16 ` [PATCH 3/6] ARM: dts: OMAP5: " Andrii Tseglytskyi
2013-03-28 17:16 ` [PATCH 4/6] ARM: OMAP3+: ABB: add aliases for clocks used in ABB driver Andrii Tseglytskyi
2013-03-28 17:16 ` [PATCH 5/6] ARM: OMAP3+: ABB: introduce " Andrii Tseglytskyi
2013-03-28 21:27   ` Mike Turquette
2013-03-28 22:35     ` Nishanth Menon [this message]
2013-04-01 11:04       ` Andrii Tseglytskyi
2013-04-01 11:07       ` Andrii Tseglytskyi
     [not found]       ` <51596725.9060109@ti.com>
2013-04-01 18:10         ` [RFC PATCH " Mike Turquette
2013-04-01 19:28           ` Nishanth Menon
     [not found]             ` <20130401213430.8177.21940@quantum>
2013-04-01 23:00               ` Nishanth Menon
     [not found]                 ` <20130402000545.8177.65252@quantum>
2013-04-02  3:35                   ` Nishanth Menon
2013-04-02 10:15                     ` Grygorii Strashko
2013-04-02 12:49                       ` Nishanth Menon
     [not found]                     ` <20130402171614.8177.68752@quantum>
2013-04-02 17:35                       ` Andrii Tseglytskyi
2013-04-03  2:00                         ` Nishanth Menon
2013-04-03 20:09                           ` Mike Turquette
2013-03-28 17:16 ` [PATCH 6/6] ARM: OMAP3+: ABB: introduce debugfs entry Andrii Tseglytskyi

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=20130328223513.GA19470@kahuna \
    --to=nm@ti.com \
    --cc=andrii.tseglytskyi@ti.com \
    --cc=b-cousson@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=t-kristo@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