From: Mikko Perttunen <mikko.perttunen@kapsi.fi>
To: Alexandre Courbot <acourbot@nvidia.com>,
swarren@wwwdotorg.org, thierry.reding@gmail.com,
gnurou@gmail.com
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-tegra@vger.kernel.org, wni@nvidia.com,
Mikko Perttunen <mperttunen@nvidia.com>
Subject: Re: [PATCH v4 REPOST 1/5] of: Add descriptions of thermtrip properties to Tegra PMC bindings
Date: Wed, 12 Nov 2014 14:07:51 +0200 [thread overview]
Message-ID: <54634D97.9050500@kapsi.fi> (raw)
In-Reply-To: <5461AEB7.70507@nvidia.com>
On 11/11/2014 08:37 AM, Alexandre Courbot wrote:
> On 11/10/2014 10:12 PM, Mikko Perttunen wrote:
>> From: Mikko Perttunen <mperttunen@nvidia.com>
>>
>> Hardware-triggered thermal reset requires configuring the I2C
>> reset procedure. This configuration is read from the device tree,
>> so document the relevant properties in the binding documentation.
>>
>> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
>> Reviewed-by: Wei Ni <wni@nvidia.com>
>> Tested-by: Wei Ni <wni@nvidia.com>
>> ---
>> .../bindings/arm/tegra/nvidia,tegra20-pmc.txt | 24
>> ++++++++++++++++++++++
>> 1 file changed, 24 insertions(+)
>>
>> diff --git
>> a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt
>> b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt
>> index 68ac65f..dc13fb0 100644
>> --- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt
>> +++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt
>> @@ -47,6 +47,21 @@ Required properties when nvidia,suspend-mode=<0>:
>> sleep mode, the warm boot code will restore some PLLs, clocks and
>> then
>> bring up CPU0 for resuming the system.
>>
>> +Hardware-triggered thermal reset:
>> +On Tegra30, Tegra114 and Tegra124, if the 'i2c-thermtrip' subnode
>> exists,
>> +hardware-triggered thermal reset will be enabled.
>> +
>> +Required properties for hardware-triggered thermal reset (inside
>> 'i2c-thermtrip'):
>> +- nvidia,i2c-bus : Phandle to I2C bus containing the PMU
>> +- nvidia,bus-addr : Bus address of the PMU on the I2C bus
>> +- nvidia,reg-addr : I2C register address to write poweroff command to
>> +- nvidia,reg-data : Poweroff command to write to PMU
>
> This binding is taking two different routes to provide values to the
> driver:
>
> 1) It uses a phandle for i2c-bus (which must then be provided by another
> binding implemented in the two following patches)
>
> 2) It uses direct values for bus-addr, reg-addr and reg-data.
>
> Do we need to use both approaches? bus-addr could just as well be
> obtained through a phandle to the i2c device and reading its reg
> property. From this phandle you could also go back up to the bus, making
> the i2c-bus property unnecessary. reg-addr and reg-data cannot be
> specified that way, obviously.
This was in fact how I used to implement this, but Stephen or Thierry
pointed out that the reg property actually might not contain the correct
address (I think because the PMIC could have multiple addresses, and the
one in DT might not be the one that accepts the reset command).
The workaround for that was to either add this integer property for
bus-addr or add a new PMIC API for querying. I went for this as it is
much simpler.
>
> Actually I think I'd prefer to see i2c-bus become an integer property
> instead of a phandle, because at the end of the day it is a value field
> of a particular register and the reference is only used to retrieve that
> value. It is not like we are actually going to call functions on the bus
> instance or change its state. And for the single purpose of retrieving
> that value, this binding requires the addition of a new property on the
> bus node that will probably never be used for something else.
And this was how I used to implement this even earlier, but Thierry
objected to that since it was duplicating information :)
>
> We can also imagine that some design may not have a PMIC device in the
> DT but still want to use the thermal reset feature. In this case, it is
> again preferable to use direct values.
>
I don't see how that'd change anything; the hardware feature still
requires an I2C device to send a message to. If there's an I2C device on
one of the SoC buses, you probably should have it in the DT..
Cheers,
Mikko
next prev parent reply other threads:[~2014-11-12 12:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-10 13:12 [PATCH v4 REPOST 0/5] Thermal reset support in PMC Mikko Perttunen
2014-11-10 13:12 ` [PATCH v4 REPOST 1/5] of: Add descriptions of thermtrip properties to Tegra PMC bindings Mikko Perttunen
[not found] ` <1415625137-4791-2-git-send-email-mikko.perttunen-/1wQRMveznE@public.gmane.org>
2014-11-11 6:37 ` Alexandre Courbot
2014-11-12 12:07 ` Mikko Perttunen [this message]
[not found] ` <54634D97.9050500-/1wQRMveznE@public.gmane.org>
2014-11-12 12:29 ` Thierry Reding
[not found] ` <20141112122951.GD30821-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2014-11-12 13:07 ` Mikko Perttunen
[not found] ` <54635B97.3030701-/1wQRMveznE@public.gmane.org>
2014-11-13 5:25 ` Alexandre Courbot
2014-11-10 13:12 ` [PATCH v4 REPOST 3/5] ARM: tegra124: Add I2C controller ids to device tree Mikko Perttunen
2014-11-10 13:12 ` [PATCH v4 REPOST 4/5] ARM: tegra: Add PMC thermtrip programming to Jetson TK1 " Mikko Perttunen
[not found] ` <1415625137-4791-1-git-send-email-mikko.perttunen-/1wQRMveznE@public.gmane.org>
2014-11-10 13:12 ` [PATCH v4 REPOST 2/5] of: Add nvidia,controller-id property to Tegra I2C bindings Mikko Perttunen
2014-11-10 13:12 ` [PATCH v4 REPOST 5/5] ARM: tegra: Add thermal reset (thermtrip) support to PMC Mikko Perttunen
[not found] ` <1415625137-4791-6-git-send-email-mikko.perttunen-/1wQRMveznE@public.gmane.org>
2014-11-11 6:21 ` Alexandre Courbot
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=54634D97.9050500@kapsi.fi \
--to=mikko.perttunen@kapsi.fi \
--cc=acourbot@nvidia.com \
--cc=gnurou@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mperttunen@nvidia.com \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@gmail.com \
--cc=wni@nvidia.com \
/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).