From: Anson Huang <anson.huang@nxp.com>
To: Oliver Graute <oliver.graute@gmail.com>,
Aisheng Dong <aisheng.dong@nxp.com>
Cc: "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 00:40:06 +0000 [thread overview]
Message-ID: <DB3PR0402MB3916849150B4778E117B6F86F5E80@DB3PR0402MB3916.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200227153110.GD16310@optiplex>
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.
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?
276 static int clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long rate,
277 unsigned long parent_rate)
278 {
279 struct clk_scu *clk = to_clk_scu(hw);
280 struct arm_smccc_res res;
281 unsigned long cluster_id;
282
283 if (clk->rsrc_id == IMX_SC_R_A35 || clk->rsrc_id == IMX_SC_R_A53)
284 cluster_id = 0;
285 else if (clk->rsrc_id == IMX_SC_R_A72)
286 cluster_id = 1;
287 else
288 return -EINVAL;
471 init.name = name;
472 init.ops = &clk_scu_ops;
473 if (rsrc_id == IMX_SC_R_A35 || rsrc_id == IMX_SC_R_A53 || rsrc_id == IMX_SC_R_A72)
474 init.ops = &clk_scu_cpu_ops;
475 else if (rsrc_id == IMX_SC_R_PI_0_PLL)
476 init.ops = &clk_scu_pi_ops;
477 else
478 init.ops = &clk_scu_ops;
646 static int imx_clk_scu_attach_pd(struct device *dev, u32 rsrc_id)
647 {
648 struct of_phandle_args genpdspec = {
649 .np = pd_np,
650 .args_count = 1,
651 .args[0] = rsrc_id,
652 };
653
654 if ((rsrc_id == IMX_SC_R_A35) || (rsrc_id == IMX_SC_R_A53) ||
655 (rsrc_id == IMX_SC_R_A72))
656 return 0;
Anson
WARNING: multiple messages have this Message-ID (diff)
From: Anson Huang <anson.huang@nxp.com>
To: Oliver Graute <oliver.graute@gmail.com>,
Aisheng Dong <aisheng.dong@nxp.com>
Cc: "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 00:40:06 +0000 [thread overview]
Message-ID: <DB3PR0402MB3916849150B4778E117B6F86F5E80@DB3PR0402MB3916.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200227153110.GD16310@optiplex>
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.
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?
276 static int clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long rate,
277 unsigned long parent_rate)
278 {
279 struct clk_scu *clk = to_clk_scu(hw);
280 struct arm_smccc_res res;
281 unsigned long cluster_id;
282
283 if (clk->rsrc_id == IMX_SC_R_A35 || clk->rsrc_id == IMX_SC_R_A53)
284 cluster_id = 0;
285 else if (clk->rsrc_id == IMX_SC_R_A72)
286 cluster_id = 1;
287 else
288 return -EINVAL;
471 init.name = name;
472 init.ops = &clk_scu_ops;
473 if (rsrc_id == IMX_SC_R_A35 || rsrc_id == IMX_SC_R_A53 || rsrc_id == IMX_SC_R_A72)
474 init.ops = &clk_scu_cpu_ops;
475 else if (rsrc_id == IMX_SC_R_PI_0_PLL)
476 init.ops = &clk_scu_pi_ops;
477 else
478 init.ops = &clk_scu_ops;
646 static int imx_clk_scu_attach_pd(struct device *dev, u32 rsrc_id)
647 {
648 struct of_phandle_args genpdspec = {
649 .np = pd_np,
650 .args_count = 1,
651 .args[0] = rsrc_id,
652 };
653
654 if ((rsrc_id == IMX_SC_R_A35) || (rsrc_id == IMX_SC_R_A53) ||
655 (rsrc_id == IMX_SC_R_A72))
656 return 0;
Anson
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-02-28 0:40 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 [this message]
2020-02-28 0:40 ` Anson Huang
2020-02-28 9:14 ` Oliver Graute
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=DB3PR0402MB3916849150B4778E117B6F86F5E80@DB3PR0402MB3916.eurprd04.prod.outlook.com \
--to=anson.huang@nxp.com \
--cc=aisheng.dong@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=oliver.graute@gmail.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.