linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/4] 44x/fsp2: tvsense workaround for dd1
@ 2017-11-02 13:07 Ivan Mikhaylov
  2017-11-27  5:50 ` Alistair Popple
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Mikhaylov @ 2017-11-02 13:07 UTC (permalink / raw)
  To: Alistair Popple, Matt Porter
  Cc: linuxppc-dev, linux-kernel, Benjamin Herrenschmidt, Joel Stanley,
	Paul Mackerras, Michael Ellerman

* tvsense(temperature and voltage sensors) may provide
  erratic sense values which may result in parity errors
  on CMU.

Signed-off-by: Ivan Mikhaylov <ivan@de.ibm.com>
---
 arch/powerpc/platforms/44x/fsp2.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/44x/fsp2.c b/arch/powerpc/platforms/44x/fsp2.c
index 9585725..4e12490 100644
--- a/arch/powerpc/platforms/44x/fsp2.c
+++ b/arch/powerpc/platforms/44x/fsp2.c
@@ -59,6 +59,23 @@ static int __init fsp2_probe(void)
 	mtdcr(DCRN_PLB6_HD, 0xffff0000);
 	mtdcr(DCRN_PLB6_SHD, 0xffff0000);
 
+	/* TVSENSE reset is blocked (clock gated) by the POR default of the TVS
+	 * sleep config bit. As a consequence, TVSENSE will provide erratic
+	 * sensor values, which may result in spurious (parity) errors
+	 * recorded in the CMU FIR and leading to erroneous interrupt requests
+	 * once the CMU interrupt is unmasked.
+	 */
+
+	/* 1. set TVS1[UNDOZE] */
+	val = mfcmu(CMUN_TVS1);
+	val |= 0x4;
+	mtcmu(CMUN_TVS1, val);
+
+	/* 2. clear FIR[TVS] and FIR[TVSPAR] */
+	val = mfcmu(CMUN_FIR0);
+	val |= 0x30000000;
+	mtcmu(CMUN_FIR0, val);
+
 	/* L2 machine checks */
 	mtl2(L2PLBMCKEN0, 0xffffffff);
 	mtl2(L2PLBMCKEN1, 0x0000ffff);
-- 
1.7.1

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

* Re: [PATCH 3/4] 44x/fsp2: tvsense workaround for dd1
  2017-11-02 13:07 [PATCH 3/4] 44x/fsp2: tvsense workaround for dd1 Ivan Mikhaylov
@ 2017-11-27  5:50 ` Alistair Popple
  0 siblings, 0 replies; 2+ messages in thread
From: Alistair Popple @ 2017-11-27  5:50 UTC (permalink / raw)
  To: Ivan Mikhaylov
  Cc: Matt Porter, linuxppc-dev, linux-kernel, Benjamin Herrenschmidt,
	Joel Stanley, Paul Mackerras, Michael Ellerman

Again, I'm not familiar with this specific hardware so can only provide general
comments.

On Thursday, 2 November 2017 4:07:05 PM AEDT Ivan Mikhaylov wrote:
> * tvsense(temperature and voltage sensors) may provide
>   erratic sense values which may result in parity errors
>   on CMU.

It would be good if you could provide a more detailed description of the problem
(like in the comment below) and what this patch does to address it.

Feel free to add my reviewed by as well.

- Alistair

> Signed-off-by: Ivan Mikhaylov <ivan@de.ibm.com>
> ---
>  arch/powerpc/platforms/44x/fsp2.c |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/44x/fsp2.c b/arch/powerpc/platforms/44x/fsp2.c
> index 9585725..4e12490 100644
> --- a/arch/powerpc/platforms/44x/fsp2.c
> +++ b/arch/powerpc/platforms/44x/fsp2.c
> @@ -59,6 +59,23 @@ static int __init fsp2_probe(void)
>  	mtdcr(DCRN_PLB6_HD, 0xffff0000);
>  	mtdcr(DCRN_PLB6_SHD, 0xffff0000);
>  
> +	/* TVSENSE reset is blocked (clock gated) by the POR default of the TVS
> +	 * sleep config bit. As a consequence, TVSENSE will provide erratic
> +	 * sensor values, which may result in spurious (parity) errors
> +	 * recorded in the CMU FIR and leading to erroneous interrupt requests
> +	 * once the CMU interrupt is unmasked.
> +	 */
> +
> +	/* 1. set TVS1[UNDOZE] */
> +	val = mfcmu(CMUN_TVS1);
> +	val |= 0x4;
> +	mtcmu(CMUN_TVS1, val);
> +
> +	/* 2. clear FIR[TVS] and FIR[TVSPAR] */
> +	val = mfcmu(CMUN_FIR0);
> +	val |= 0x30000000;
> +	mtcmu(CMUN_FIR0, val);
> +
>  	/* L2 machine checks */
>  	mtl2(L2PLBMCKEN0, 0xffffffff);
>  	mtl2(L2PLBMCKEN1, 0x0000ffff);
> 

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

end of thread, other threads:[~2017-11-27  6:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-02 13:07 [PATCH 3/4] 44x/fsp2: tvsense workaround for dd1 Ivan Mikhaylov
2017-11-27  5:50 ` Alistair Popple

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