All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Alice Guo (OSS)" <alice.guo@oss.nxp.com>,
	rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-imx@nxp.com
Subject: Re: [PATCH v1 2/4] thermal: qoriq: add i.MX93 TMU support
Date: Fri, 10 Feb 2023 14:48:38 +0100	[thread overview]
Message-ID: <3b215d83-9b8e-d881-44c4-ee1301bb9044@linaro.org> (raw)
In-Reply-To: <20230105101748.6714-3-alice.guo@oss.nxp.com>

On 05/01/2023 11:17, Alice Guo (OSS) wrote:
> From: Alice Guo <alice.guo@nxp.com>
> 
> The procedure to program the calibration table of i.MX93 TMU:
> 1. disable monitoring mode
> 2. configure TCMCFG
> 3. write TTCFGR with TTCFGR[CAL_PT] = n
> 4. write TSCFGR with the sensor value of the calibration point n
> 5. write TTRCRn associated with the calibration point n
> Need to repeat steps 3—5 for all calibration points from the calibration
> table provided by the TMU device node.
> 
> When TRITSR[V] = 1 and TRITSR[TP5] = 1, need to add 0.5K to
> TRITSR[TEMP].
> 
> IPBRR0s of lx2160ardb, lx2162aqds and i.MX93 have the same value
> 0x01900201 so that use the compatible to determine whether the current
> TMU belongs to i.MX93 or not.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
> Reviewed-by: Ye Li <ye.li@nxp.com>
> Acked-by: Jason Liu <jason.hui.liu@nxp.com>
> ---

[ ... ]

> @@ -369,6 +416,7 @@ static SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
>   static const struct of_device_id qoriq_tmu_match[] = {
>   	{ .compatible = "fsl,qoriq-tmu", },
>   	{ .compatible = "fsl,imx8mq-tmu", },
> +	{ .compatible = "fsl,imx93-tmu", },
>   	{},

Now that you have more than 2, I suggest the pass a ops structure to 
.data, so you can call them directly instead of checking the TMU version 
in the calibration, the initialization and get the temperature.

>   };
>   MODULE_DEVICE_TABLE(of, qoriq_tmu_match);

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


WARNING: multiple messages have this Message-ID (diff)
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Alice Guo (OSS)" <alice.guo@oss.nxp.com>,
	rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-imx@nxp.com
Subject: Re: [PATCH v1 2/4] thermal: qoriq: add i.MX93 TMU support
Date: Fri, 10 Feb 2023 14:48:38 +0100	[thread overview]
Message-ID: <3b215d83-9b8e-d881-44c4-ee1301bb9044@linaro.org> (raw)
In-Reply-To: <20230105101748.6714-3-alice.guo@oss.nxp.com>

On 05/01/2023 11:17, Alice Guo (OSS) wrote:
> From: Alice Guo <alice.guo@nxp.com>
> 
> The procedure to program the calibration table of i.MX93 TMU:
> 1. disable monitoring mode
> 2. configure TCMCFG
> 3. write TTCFGR with TTCFGR[CAL_PT] = n
> 4. write TSCFGR with the sensor value of the calibration point n
> 5. write TTRCRn associated with the calibration point n
> Need to repeat steps 3—5 for all calibration points from the calibration
> table provided by the TMU device node.
> 
> When TRITSR[V] = 1 and TRITSR[TP5] = 1, need to add 0.5K to
> TRITSR[TEMP].
> 
> IPBRR0s of lx2160ardb, lx2162aqds and i.MX93 have the same value
> 0x01900201 so that use the compatible to determine whether the current
> TMU belongs to i.MX93 or not.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
> Reviewed-by: Ye Li <ye.li@nxp.com>
> Acked-by: Jason Liu <jason.hui.liu@nxp.com>
> ---

[ ... ]

> @@ -369,6 +416,7 @@ static SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
>   static const struct of_device_id qoriq_tmu_match[] = {
>   	{ .compatible = "fsl,qoriq-tmu", },
>   	{ .compatible = "fsl,imx8mq-tmu", },
> +	{ .compatible = "fsl,imx93-tmu", },
>   	{},

Now that you have more than 2, I suggest the pass a ops structure to 
.data, so you can call them directly instead of checking the TMU version 
in the calibration, the initialization and get the temperature.

>   };
>   MODULE_DEVICE_TABLE(of, qoriq_tmu_match);

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

  parent reply	other threads:[~2023-02-10 13:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 10:17 [PATCH v1 0/4] add i.MX93 TMU support Alice Guo (OSS)
2023-01-05 10:17 ` Alice Guo (OSS)
2023-01-05 10:17 ` [PATCH v1 1/4] dt-bindings: thermal: qoriq-thermal: Add compatible for i.MX93 Alice Guo (OSS)
2023-01-05 10:17   ` Alice Guo (OSS)
2023-01-06 12:53   ` Krzysztof Kozlowski
2023-01-06 12:53     ` Krzysztof Kozlowski
2023-01-05 10:17 ` [PATCH v1 2/4] thermal: qoriq: add i.MX93 TMU support Alice Guo (OSS)
2023-01-05 10:17   ` Alice Guo (OSS)
2023-01-31  6:04   ` Alice Guo (OSS)
2023-01-31  6:04     ` Alice Guo (OSS)
2023-02-10 13:48   ` Daniel Lezcano [this message]
2023-02-10 13:48     ` Daniel Lezcano
2023-03-10  8:20   ` Alexander Stein
2023-03-10  8:20     ` Alexander Stein
2023-01-05 10:17 ` [PATCH v1 3/4] qoriq_thermal: No need to program site adjustment register Alice Guo (OSS)
2023-01-05 10:17   ` Alice Guo (OSS)
2023-01-05 10:17 ` [PATCH v1 4/4] arm64: dts: imx93: Add CPU thermal zone Alice Guo (OSS)
2023-01-05 10:17   ` Alice Guo (OSS)
2023-01-06 12:53   ` Krzysztof Kozlowski
2023-01-06 12:53     ` Krzysztof Kozlowski
2023-03-10  8:20   ` Alexander Stein
2023-03-10  8:20     ` Alexander Stein
2023-03-10  9:09 ` [PATCH v1 0/4] add i.MX93 TMU support Alexander Stein
2023-03-10  9:09   ` Alexander Stein

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=3b215d83-9b8e-d881-44c4-ee1301bb9044@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=alice.guo@oss.nxp.com \
    --cc=amitk@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    --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 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.