mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Stefan Riedmüller" <S.Riedmueller@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: Antwort: Re: [PATCH 2/3] ARM: i.MX6ul: Add Clock support for i.MX6ull
Date: Wed, 17 May 2017 08:48:47 +0200	[thread overview]
Message-ID: <20170517064847.yxpz3cviz76ywvgg@pengutronix.de> (raw)
In-Reply-To: <OF32A232A4.871E3CE8-ONC1258122.0050FDDF-C1258122.00511D61@phytec.de>

On Tue, May 16, 2017 at 04:46:00PM +0200, Stefan Riedmüller wrote:
> Sascha Hauer <s.hauer@pengutronix.de> wrote on 16/05/2017 07:47:39:
> 
> > Von: Sascha Hauer <s.hauer@pengutronix.de>
> > An: Stefan Riedmueller <s.riedmueller@phytec.de>
> > Kopie: barebox@lists.infradead.org
> > Datum: 16/05/2017 07:47
> > Betreff: Re: [PATCH 2/3] ARM: i.MX6ul: Add Clock support for i.MX6ull
> > 
> > On Thu, May 11, 2017 at 11:09:27AM +0200, Stefan Riedmueller wrote:
> > > From linux-4.10 clock support, only skipped some unnecessary clocks
> > > 
> > > Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
> > > ---
> > >  drivers/clk/imx/clk-imx6ul.c | 73 +++++++++++++++++++++++++++++++
> > ++++++-------
> > >  1 file changed, 62 insertions(+), 11 deletions(-)
> > > 
> > > diff --git a/drivers/clk/imx/clk-imx6ul.c 
> b/drivers/clk/imx/clk-imx6ul.c
> > > index f28660d..b0a6bb0 100644
> > > --- a/drivers/clk/imx/clk-imx6ul.c
> > > +++ b/drivers/clk/imx/clk-imx6ul.c
> > > @@ -66,10 +66,24 @@ static const char *perclk_sels[] = { "ipg", "osc", 
> };
> > >  static const char *lcdif_sels[] = { "lcdif_podf", "ipp_di0", 
> > "ipp_di1", "ldb_di0", "ldb_di1", };
> > >  static const char *csi_sels[] = { "osc", "pll2_pfd2_396m", 
> > "pll3_120m", "pll3_pfd1_540m", };
> > >  static const char *sim_sels[] = { "sim_podf", "ipp_di0", 
> > "ipp_di1", "ldb_di0", "ldb_di1", };
> > > +/* epdc_pre_sels, epdc_sels, esai_sels only exists on i.MX6ULL */
> > > +static const char *epdc_pre_sels[] = { "pll2_bus", 
> > "pll3_usb_otg", "pll5_video_div", "pll2_pfd0_352m", 
> > "pll2_pfd2_396m", "pll3_pfd2_508m", };
> > > +static const char *esai_sels[] = { "pll4_audio_div", 
> > "pll3_pfd2_508m", "pll5_video_div", "pll3_usb_otg", };
> > > +static const char *epdc_sels[] = { "epdc_podf", "ipp_di0", 
> > "ipp_di1", "ldb_di0", "ldb_di1", };
> > > 
> > >  static struct clk *clks[IMX6UL_CLK_END];
> > >  static struct clk_onecell_data clk_data;
> > > 
> > > +static inline int clk_on_imx6ul(void)
> > > +{
> > > +   return of_machine_is_compatible("fsl,imx6ul");
> > > +}
> > > +
> > > +static inline int clk_on_imx6ull(void)
> > > +{
> > > +   return of_machine_is_compatible("fsl,imx6ull");
> > > +}
> > 
> > Can we use cpu_is_imx6ul(l) instead here? This would allow
> > us to compile away the code if we one of the two SoCs is
> > disabled in the config.
> > 
> > Sascha
> > 
> 
> Hi Sascha, 
> 
> I tried to use cpu_is_mx6ul, but it seems it is not valid yet in the clk 
> initcall. I found that __imx_cpu_type is set in a postcore initcall but 
> would be already evaluated in cpu_is_mx6ul in the clk initcall which is a 
> core initcall. So cpu_is_mx6ul would not evaluate correctly at this point. 
> 
> 
> I also checked this with an i.MX6 DualLight where the cpu_is_mx6dl is 
> implemented in the ccm init and there it evaluates wrong. In the ccm 
> initcall it evaluates to 0 but later after the postcore initcalls it 
> evaluates correctly to 1. So it seems the cpu_is_mx6ul/dl is not working 
> correctly in the clk initcall. Did I get this correct or did I miss 
> anything?

I looked at arch/arm/mach-imx/include/mach/imx6.h and saw that
__imx6_cpu_type() only reads from SoC registers, so assumed this would
work. What I didn't see is that the functions depend on cpu_is_mx6()
which goes down to __imx_cpu_type which you found out already.

Just like you I also found the cpu_is_mx6dl() in the i.MX6 clock driver,
but unlike you I just assumed that it works ;)

For now I think we can apply your original patch. I'll keep the issue on
my mental todo list.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-05-17  6:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  9:09 [PATCH 1/3] ARM: i.MX: Add i.MX6 ULL support Stefan Riedmueller
2017-05-11  9:09 ` [PATCH 2/3] ARM: i.MX6ul: Add Clock support for i.MX6ull Stefan Riedmueller
2017-05-16  5:47   ` Sascha Hauer
2017-05-16 14:46     ` Antwort: " Stefan Riedmüller
2017-05-17  6:48       ` Sascha Hauer [this message]
2017-05-11  9:09 ` [PATCH 3/3] ARCH: ARM: Add support for phytec-phycore-imx6ull Stefan Riedmueller
2017-05-17  6:49 ` [PATCH 1/3] ARM: i.MX: Add i.MX6 ULL support Sascha Hauer

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=20170517064847.yxpz3cviz76ywvgg@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=S.Riedmueller@phytec.de \
    --cc=barebox@lists.infradead.org \
    /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