From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Bai Ping <ping.bai@nxp.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Eduardo Valentin <edubezval@gmail.com>,
Sascha Hauer <kernel@pengutronix.de>,
Fabio Estevam <fabio.estevam@nxp.com>,
Zhang Rui <rui.zhang@intel.com>,
Fabio Estevam <festevam@gmail.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] ARM: dts: imx6ul: Add imx6ul-tempmon
Date: Mon, 12 Jun 2017 12:40:29 +0200 [thread overview]
Message-ID: <20170612124029.1643469d@karo-electronics.de> (raw)
In-Reply-To: <1497022484.28352.105.camel@nxp.com>
Hi,
On Fri, 9 Jun 2017 18:34:44 +0300 Leonard Crestez wrote:
> On Fri, 2017-06-09 at 15:46 +0200, Lothar Waßmann wrote:
> > On Fri, 9 Jun 2017 13:58:15 +0300 Leonard Crestez wrote:
> > > On Thu, 2017-06-08 at 13:45 -0300, Fabio Estevam wrote:
> > > > On Thu, Jun 8, 2017 at 1:26 PM, Leonard Crestez wrote:
> > > > > + tempmon: tempmon {
> > > > > + compatible = "fsl,imx6ul-tempmon", "fsl,imx6sx-tempmon";
> > > > > + interrupts = ;
> > > > > + fsl,tempmon = <&anatop>;
> > > > > + fsl,tempmon-data = <&ocotp>;
> > > > > + clocks = <&clks IMX6UL_CLK_PLL3_USB_OTG>;
> > > > Does the IMX6UL_CLK_PLL3_USB_OTG clock really control tempmon? Please
> > > > double check.
> > > Yes, as far as I can tell the tempmon block uses the 480 Mhz PLL3 clock
> > > directly. This is similar to other imx6 SOCs. This PLL is used for
> > > stuff like USB but not only that. My understanding is the _USB_OTG
> > > suffix is descriptive, similar to PLL4_AUDIO and PLL6_ENET. Other non-
> > > usb components use PLL3 (like UART) but through other gates/dividers.
> > >
> > > Setting this to IMX6UL_CLK_DUMMY will cause temperature reads to fail.
> > > Even if PLL3 usually ends up being constantly enabled because of uarts
> > > this is not true at imx_thermal_probe time (or uarts can be disabled).
> > >
> > Since the driver is accessing the OCOTP registers it definitely needs
> > the IMX6UL_CLK_OCOTP too!
> >
> I don't think so. OCOTP reads fuse values into shadows registers on
> chip reset and values seem to be available even if it's specific OCOTP
>
Shadow registers are registers nonetheless which require a clock for
accessing them.
> clock is off. I think that clock is only required for writes or shadow
> updates.
>
Sometimes it helps to read the Reference Manual or take hardware and try
it out. The i.MX6(Q|UL) Reference Manual lists the required clocks as:
Table 35-1. OCOTP Clocks
Clock name Clock Root Description
ipg_clk ipg_clk_root Peripheral clock
ipg_clk_s ipg_clk_root Peripheral access clock
and Table 18-3. "System Clocks, Gating, and Override (continued)"
for i.MX6UL shows:
OCOTP IPG_CLK IPG_CLK_ROOT CCGR2[CG6] (IIM_CLK_ENABLE)
IPG_CLK_S IPG_CLK_ROOT CCGR2[CG6] (IIM_CLK_ENABLE)
while the same table for i.MX6Q shows:
OCOTP ipg_clk ipg_clk_root CCGR2[CG6] (iim_clk_enable)
ipg_clk_s ipg_clk_root
with a blank entry in the "Clock Gating" column for the access clock.
So, for i.MX6Q there is no clock enable necessary for the access clock,
but for i.MX6UL there is!
You can simply verify it by trying to read any of the fuse registers
with the OCOTP clock disabled (which immediately hangs the processor).
> In theory perhaps tempmon could be made to read ocotp through the imx-
> ocotp nvmem driver? It is not clear in what scenario this would
> actually be required.
>
> This discussion is not specific to 6ul/6ull. There are other reads from
> ocotp which don't enable it's clock, for example
> imx6q_opp_check_speed_grading.
>
Which works, because i.MX6Q doesn't require to enable the OCOTP access
clock.
Lothar Waßmann
next prev parent reply other threads:[~2017-06-12 10:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-08 16:26 [PATCH 1/2] ARM: imx_v6_v7_defconfig: Set THERMAL_WRITABLE_TRIPS=y for testing Leonard Crestez
2017-06-08 16:26 ` [PATCH 2/2] ARM: dts: imx6ul: Add imx6ul-tempmon Leonard Crestez
2017-06-08 16:45 ` Fabio Estevam
2017-06-09 10:58 ` Leonard Crestez
2017-06-09 12:18 ` Fabio Estevam
2017-06-09 13:46 ` Lothar Waßmann
2017-06-09 15:34 ` Leonard Crestez
2017-06-12 10:40 ` Lothar Waßmann [this message]
2017-06-12 11:47 ` Leonard Crestez
2017-06-12 13:22 ` Fabio Estevam
2017-06-12 13:37 ` Lothar Waßmann
2017-06-12 14:30 ` Fabio Estevam
2017-06-15 1:35 ` [PATCH 1/2] ARM: imx_v6_v7_defconfig: Set THERMAL_WRITABLE_TRIPS=y for testing Shawn Guo
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=20170612124029.1643469d@karo-electronics.de \
--to=lw@karo-electronics.de \
--cc=edubezval@gmail.com \
--cc=fabio.estevam@nxp.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=leonard.crestez@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=ping.bai@nxp.com \
--cc=rui.zhang@intel.com \
--cc=shawnguo@kernel.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;
as well as URLs for NNTP newsgroup(s).