linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: dts: Add mask-tpm-reset to the device tree
@ 2014-07-14  6:33 Vikas Sajjan
  2014-07-14 12:42 ` Naveen Krishna Ch
  2014-07-14 17:00 ` Doug Anderson
  0 siblings, 2 replies; 5+ messages in thread
From: Vikas Sajjan @ 2014-07-14  6:33 UTC (permalink / raw)
  To: linux-arm-kernel

From: Doug Anderson <dianders@chromium.org>

The mask-tpm-reset GPIO is used by the kernel to prevent the TPM from
being reset across sleep/wake.  If we don't set it to anything then
the TPM will be reset.  U-Boot will detect this as invalid
and will reset the system on resume time. This GPIO can always be low
and not hurt anything.  It will get pulled back high again during a
normal warm reset when it will default back to an input.

To properly preserve the TPM state across suspend/resume and to make
the chrome U-Boot happy, properly set the GPIO to mask the
reset to the TPM.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Vikas Sajjan <vikas.sajjan@samsung.com>
---
changes since v1:
	- removed fixed regulator and used hogs instead.

 arch/arm/boot/dts/exynos5420-peach-pit.dts |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts b/arch/arm/boot/dts/exynos5420-peach-pit.dts
index 6c7cab0..c036d9e 100644
--- a/arch/arm/boot/dts/exynos5420-peach-pit.dts
+++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts
@@ -211,6 +211,18 @@
 
 
 &pinctrl_0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mask_tpm_reset>;
+
+	/* We need GPX0_6 to be low at sleep time; just keep it low always */
+	mask_tpm_reset: mask-tpm-reset {
+		samsung,pins = "gpx0-6";
+		samsung,pin-function = <1>;
+		samsung,pin-pud = <0>;
+		samsung,pin-drv = <0>;
+		samsung,pin-val = <0>;
+	};
+
 	max98090_irq: max98090-irq {
 		samsung,pins = "gpx0-2";
 		samsung,pin-function = <0>;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] ARM: dts: Add mask-tpm-reset to the device tree
  2014-07-14  6:33 [PATCH v2] ARM: dts: Add mask-tpm-reset to the device tree Vikas Sajjan
@ 2014-07-14 12:42 ` Naveen Krishna Ch
  2014-07-14 17:00 ` Doug Anderson
  1 sibling, 0 replies; 5+ messages in thread
From: Naveen Krishna Ch @ 2014-07-14 12:42 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Vikas,


On 14 July 2014 12:03, Vikas Sajjan <vikas.sajjan@samsung.com> wrote:
> From: Doug Anderson <dianders@chromium.org>
>
> The mask-tpm-reset GPIO is used by the kernel to prevent the TPM from
> being reset across sleep/wake.  If we don't set it to anything then
> the TPM will be reset.  U-Boot will detect this as invalid
> and will reset the system on resume time. This GPIO can always be low
> and not hurt anything.  It will get pulled back high again during a
> normal warm reset when it will default back to an input.
>
> To properly preserve the TPM state across suspend/resume and to make
> the chrome U-Boot happy, properly set the GPIO to mask the
> reset to the TPM.
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> Signed-off-by: Vikas Sajjan <vikas.sajjan@samsung.com>

After merging Linus Walleij's for-next branch of pinctrl git.

S2R on Exynos5420 based Peach PIT works fine.

Tested-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> ---
> changes since v1:
>         - removed fixed regulator and used hogs instead.
>
>  arch/arm/boot/dts/exynos5420-peach-pit.dts |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts b/arch/arm/boot/dts/exynos5420-peach-pit.dts
> index 6c7cab0..c036d9e 100644
> --- a/arch/arm/boot/dts/exynos5420-peach-pit.dts
> +++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts
> @@ -211,6 +211,18 @@
>
>
>  &pinctrl_0 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&mask_tpm_reset>;
> +
> +       /* We need GPX0_6 to be low at sleep time; just keep it low always */
> +       mask_tpm_reset: mask-tpm-reset {
> +               samsung,pins = "gpx0-6";
> +               samsung,pin-function = <1>;
> +               samsung,pin-pud = <0>;
> +               samsung,pin-drv = <0>;
> +               samsung,pin-val = <0>;
> +       };
> +
>         max98090_irq: max98090-irq {
>                 samsung,pins = "gpx0-2";
>                 samsung,pin-function = <0>;
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Shine bright,
(: Nav :)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] ARM: dts: Add mask-tpm-reset to the device tree
  2014-07-14  6:33 [PATCH v2] ARM: dts: Add mask-tpm-reset to the device tree Vikas Sajjan
  2014-07-14 12:42 ` Naveen Krishna Ch
@ 2014-07-14 17:00 ` Doug Anderson
  2014-07-14 17:02   ` Doug Anderson
  2014-07-15  4:34   ` Vikas Sajjan
  1 sibling, 2 replies; 5+ messages in thread
From: Doug Anderson @ 2014-07-14 17:00 UTC (permalink / raw)
  To: linux-arm-kernel

Vikas,

On Sun, Jul 13, 2014 at 11:33 PM, Vikas Sajjan <vikas.sajjan@samsung.com> wrote:
> From: Doug Anderson <dianders@chromium.org>
>
> The mask-tpm-reset GPIO is used by the kernel to prevent the TPM from
> being reset across sleep/wake.  If we don't set it to anything then
> the TPM will be reset.  U-Boot will detect this as invalid
> and will reset the system on resume time. This GPIO can always be low
> and not hurt anything.  It will get pulled back high again during a
> normal warm reset when it will default back to an input.
>
> To properly preserve the TPM state across suspend/resume and to make
> the chrome U-Boot happy, properly set the GPIO to mask the
> reset to the TPM.
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> Signed-off-by: Vikas Sajjan <vikas.sajjan@samsung.com>
> ---
> changes since v1:
>         - removed fixed regulator and used hogs instead.
>
>  arch/arm/boot/dts/exynos5420-peach-pit.dts |   12 ++++++++++++
>  1 file changed, 12 insertions(+)

This looks reasonable to me except for two things:

1. You need to apply this to pit and pi (not just pi)

2. The proper sort ordering for elements within a pin control group is
by pin number, so this pin should be _after_ gpx0-2, not before.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] ARM: dts: Add mask-tpm-reset to the device tree
  2014-07-14 17:00 ` Doug Anderson
@ 2014-07-14 17:02   ` Doug Anderson
  2014-07-15  4:34   ` Vikas Sajjan
  1 sibling, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-07-14 17:02 UTC (permalink / raw)
  To: linux-arm-kernel

Vikas,

On Mon, Jul 14, 2014 at 10:00 AM, Doug Anderson <dianders@chromium.org> wrote:
> Vikas,
>
> On Sun, Jul 13, 2014 at 11:33 PM, Vikas Sajjan <vikas.sajjan@samsung.com> wrote:
>> From: Doug Anderson <dianders@chromium.org>
>>
>> The mask-tpm-reset GPIO is used by the kernel to prevent the TPM from
>> being reset across sleep/wake.  If we don't set it to anything then
>> the TPM will be reset.  U-Boot will detect this as invalid
>> and will reset the system on resume time. This GPIO can always be low
>> and not hurt anything.  It will get pulled back high again during a
>> normal warm reset when it will default back to an input.
>>
>> To properly preserve the TPM state across suspend/resume and to make
>> the chrome U-Boot happy, properly set the GPIO to mask the
>> reset to the TPM.
>>
>> Signed-off-by: Doug Anderson <dianders@chromium.org>
>> Signed-off-by: Vikas Sajjan <vikas.sajjan@samsung.com>
>> ---
>> changes since v1:
>>         - removed fixed regulator and used hogs instead.
>>
>>  arch/arm/boot/dts/exynos5420-peach-pit.dts |   12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>
> This looks reasonable to me except for two things:
>
> 1. You need to apply this to pit and pi (not just pi)

Sorry, just realized that you had two patches and they weren't just
revisions (I got confused when one was v1 and one was v2).  I would
have just put them in the same patch, but two patches is OK.


> 2. The proper sort ordering for elements within a pin control group is
> by pin number, so this pin should be _after_ gpx0-2, not before.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] ARM: dts: Add mask-tpm-reset to the device tree
  2014-07-14 17:00 ` Doug Anderson
  2014-07-14 17:02   ` Doug Anderson
@ 2014-07-15  4:34   ` Vikas Sajjan
  1 sibling, 0 replies; 5+ messages in thread
From: Vikas Sajjan @ 2014-07-15  4:34 UTC (permalink / raw)
  To: linux-arm-kernel

Doug,

On Mon, Jul 14, 2014 at 10:30 PM, Doug Anderson <dianders@chromium.org> wrote:
> Vikas,
>
> On Sun, Jul 13, 2014 at 11:33 PM, Vikas Sajjan <vikas.sajjan@samsung.com> wrote:
>> From: Doug Anderson <dianders@chromium.org>
>>
>> The mask-tpm-reset GPIO is used by the kernel to prevent the TPM from
>> being reset across sleep/wake.  If we don't set it to anything then
>> the TPM will be reset.  U-Boot will detect this as invalid
>> and will reset the system on resume time. This GPIO can always be low
>> and not hurt anything.  It will get pulled back high again during a
>> normal warm reset when it will default back to an input.
>>
>> To properly preserve the TPM state across suspend/resume and to make
>> the chrome U-Boot happy, properly set the GPIO to mask the
>> reset to the TPM.
>>
>> Signed-off-by: Doug Anderson <dianders@chromium.org>
>> Signed-off-by: Vikas Sajjan <vikas.sajjan@samsung.com>
>> ---
>> changes since v1:
>>         - removed fixed regulator and used hogs instead.
>>
>>  arch/arm/boot/dts/exynos5420-peach-pit.dts |   12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>
> This looks reasonable to me except for two things:
>
> 1. You need to apply this to pit and pi (not just pi)
>
> 2. The proper sort ordering for elements within a pin control group is
> by pin number, so this pin should be _after_ gpx0-2, not before.


Sure, will repost both pit and pi by reordering the pin as you suggested.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-15  4:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-14  6:33 [PATCH v2] ARM: dts: Add mask-tpm-reset to the device tree Vikas Sajjan
2014-07-14 12:42 ` Naveen Krishna Ch
2014-07-14 17:00 ` Doug Anderson
2014-07-14 17:02   ` Doug Anderson
2014-07-15  4:34   ` Vikas Sajjan

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).