All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Graute <oliver.graute@gmail.com>
To: Anson Huang <anson.huang@nxp.com>
Cc: Aisheng Dong <aisheng.dong@nxp.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"mturquette@baylibre.com" <mturquette@baylibre.com>,
	Leonard Crestez <leonard.crestez@nxp.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: RFC: imx8qm: imx-scu-clk: probe of clk failed
Date: Fri, 28 Feb 2020 10:14:29 +0100	[thread overview]
Message-ID: <20200228091429.GE16310@optiplex> (raw)
In-Reply-To: <DB3PR0402MB3916849150B4778E117B6F86F5E80@DB3PR0402MB3916.eurprd04.prod.outlook.com>

On 28/02/20, Anson Huang wrote:
> Hi, Oliver
> 
> > Subject: Re: RFC: imx8qm: imx-scu-clk: probe of clk failed
> > 
> > On 27/02/20, Oliver Graute wrote:
> > > Hello Aisheng,
> > > Hello Anson,
> > >
> > > I get the following imx-scu errors when using Linux version
> > > 5.6.0-rc1-next-20200214 with scfw Build 3353, Commit 494c97f3
> > >
> > > It seems that important clocks are off somehow and that lpspi isn't
> > > working because of that. What is the best way to debug such issues?
> > >
> > > [    1.103799] imx-scu scu: NXP i.MX SCU Initialized
> > > [    1.111383] a35_clk: failed to get clock rate -22
> > 
> > After some deeper digging I saw that the reason for "a35_clk: failed" is an
> > IMX_SC_ERR_PARM = 3. Because he trys to get the resource SC_R_A35 which
> > is only available on imx8qxp and not on imx8qm. No clue why he try that
> > instead of SC_R_A53.
> 
> You are running on i.MX8QM board, right? Is it because the A35/A53/A72 clocks
> are registered on same clock driver, so that clock core will calculate their rate during
> clock tree setup? But even A35 clock get rate failed on i.MX8QM, I don't see it will
> impact lpspi.

yes I'am using a i.MX8QM based board. Which clocks are needed to get
lpspi working on imx8qm?
> 
> i.MX8QM is already supported on our internal v5.4 tree, there are some
> changes in clk-scu.c, I pasted some code piece as below, maybe you can
> compare the difference and have a try?

ok I use your proposed code now. A struct clk_scu_pi_ops is missing for
me here. Also I added this:

--- a/include/dt-bindings/clock/imx8-clock.h
+++ b/include/dt-bindings/clock/imx8-clock.h
@@ -131,7 +131,9 @@
 #define IMX_ADMA_PWM_CLK                               188
 #define IMX_ADMA_LCD_CLK                               189

-#define IMX_SCU_CLK_END                                        190
+#define IMX_A53_CLK                                    190
+#define IMX_A72_CLK                                    191
+#define IMX_SCU_CLK_END                                        192

--- a/drivers/clk/imx/clk-imx8qxp.c
+++ b/drivers/clk/imx/clk-imx8qxp.c
@@ -60,6 +68,8 @@ static int imx8qxp_clk_probe(struct platform_device *pdev)

        /* ARM core */
        clks[IMX_A35_CLK]               = imx_clk_scu("a35_clk", IMX_SC_R_A35, IMX_SC_PM_CLK_CPU, clk_cells);
+       clks[IMX_A53_CLK]               = imx_clk_scu("a53_clk", IMX_SC_R_A53, IMX_SC_PM_CLK_CPU, clk_cells);
+       clks[IMX_A72_CLK]               = imx_clk_scu("a72_clk", IMX_SC_R_A72, IMX_SC_PM_CLK_CPU, clk_cells);


Is it correct to use the imx8qxp clock probing here?

Best regards,

Oliver

WARNING: multiple messages have this Message-ID (diff)
From: Oliver Graute <oliver.graute@gmail.com>
To: Anson Huang <anson.huang@nxp.com>
Cc: Aisheng Dong <aisheng.dong@nxp.com>,
	"mturquette@baylibre.com" <mturquette@baylibre.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	Leonard Crestez <leonard.crestez@nxp.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: RFC: imx8qm: imx-scu-clk: probe of clk failed
Date: Fri, 28 Feb 2020 10:14:29 +0100	[thread overview]
Message-ID: <20200228091429.GE16310@optiplex> (raw)
In-Reply-To: <DB3PR0402MB3916849150B4778E117B6F86F5E80@DB3PR0402MB3916.eurprd04.prod.outlook.com>

On 28/02/20, Anson Huang wrote:
> Hi, Oliver
> 
> > Subject: Re: RFC: imx8qm: imx-scu-clk: probe of clk failed
> > 
> > On 27/02/20, Oliver Graute wrote:
> > > Hello Aisheng,
> > > Hello Anson,
> > >
> > > I get the following imx-scu errors when using Linux version
> > > 5.6.0-rc1-next-20200214 with scfw Build 3353, Commit 494c97f3
> > >
> > > It seems that important clocks are off somehow and that lpspi isn't
> > > working because of that. What is the best way to debug such issues?
> > >
> > > [    1.103799] imx-scu scu: NXP i.MX SCU Initialized
> > > [    1.111383] a35_clk: failed to get clock rate -22
> > 
> > After some deeper digging I saw that the reason for "a35_clk: failed" is an
> > IMX_SC_ERR_PARM = 3. Because he trys to get the resource SC_R_A35 which
> > is only available on imx8qxp and not on imx8qm. No clue why he try that
> > instead of SC_R_A53.
> 
> You are running on i.MX8QM board, right? Is it because the A35/A53/A72 clocks
> are registered on same clock driver, so that clock core will calculate their rate during
> clock tree setup? But even A35 clock get rate failed on i.MX8QM, I don't see it will
> impact lpspi.

yes I'am using a i.MX8QM based board. Which clocks are needed to get
lpspi working on imx8qm?
> 
> i.MX8QM is already supported on our internal v5.4 tree, there are some
> changes in clk-scu.c, I pasted some code piece as below, maybe you can
> compare the difference and have a try?

ok I use your proposed code now. A struct clk_scu_pi_ops is missing for
me here. Also I added this:

--- a/include/dt-bindings/clock/imx8-clock.h
+++ b/include/dt-bindings/clock/imx8-clock.h
@@ -131,7 +131,9 @@
 #define IMX_ADMA_PWM_CLK                               188
 #define IMX_ADMA_LCD_CLK                               189

-#define IMX_SCU_CLK_END                                        190
+#define IMX_A53_CLK                                    190
+#define IMX_A72_CLK                                    191
+#define IMX_SCU_CLK_END                                        192

--- a/drivers/clk/imx/clk-imx8qxp.c
+++ b/drivers/clk/imx/clk-imx8qxp.c
@@ -60,6 +68,8 @@ static int imx8qxp_clk_probe(struct platform_device *pdev)

        /* ARM core */
        clks[IMX_A35_CLK]               = imx_clk_scu("a35_clk", IMX_SC_R_A35, IMX_SC_PM_CLK_CPU, clk_cells);
+       clks[IMX_A53_CLK]               = imx_clk_scu("a53_clk", IMX_SC_R_A53, IMX_SC_PM_CLK_CPU, clk_cells);
+       clks[IMX_A72_CLK]               = imx_clk_scu("a72_clk", IMX_SC_R_A72, IMX_SC_PM_CLK_CPU, clk_cells);


Is it correct to use the imx8qxp clock probing here?

Best regards,

Oliver

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-02-28  9:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 12:57 RFC: imx8qm: imx-scu-clk: probe of clk failed Oliver Graute
2020-02-27 12:57 ` Oliver Graute
2020-02-27 15:31 ` Oliver Graute
2020-02-27 15:31   ` Oliver Graute
2020-02-28  0:40   ` Anson Huang
2020-02-28  0:40     ` Anson Huang
2020-02-28  9:14     ` Oliver Graute [this message]
2020-02-28  9:14       ` Oliver Graute

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=20200228091429.GE16310@optiplex \
    --to=oliver.graute@gmail.com \
    --cc=aisheng.dong@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=festevam@gmail.com \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=mturquette@baylibre.com \
    --cc=s.hauer@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.