mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@kernel.org>
To: niravkumarlaxmidas.rabara@altera.com, bp@alien8.de, tony.luck@intel.com
Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] EDAC/altera: Handle OCRAM ECC enable after warm reset
Date: Wed, 5 Nov 2025 22:49:40 -0600	[thread overview]
Message-ID: <3f138af5-8473-4366-9562-3cdea3862f1a@kernel.org> (raw)
In-Reply-To: <20251103140920.1060643-1-niravkumarlaxmidas.rabara@altera.com>



On 11/3/25 08:09, niravkumarlaxmidas.rabara@altera.com wrote:
> From: Niravkumar L Rabara <niravkumarlaxmidas.rabara@altera.com>
> 
> The OCRAM ECC is always enabled either by the BootROM or by the Secure
> Device Manager (SDM) during a power-on reset on SoCFPGA.
> 
> However, during a warm reset, the OCRAM content is retained to preserve
> data, while the control and status registers are reset to their default
> values. As a result, ECC must be explicitly re-enabled after a warm reset.
> 
> Signed-off-by: Niravkumar L Rabara <niravkumarlaxmidas.rabara@altera.com>
> ---
>   drivers/edac/altera_edac.c | 18 +++++++++++++++---
>   1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
> index 103b2c2eba2a..a776d61027f2 100644
> --- a/drivers/edac/altera_edac.c
> +++ b/drivers/edac/altera_edac.c
> @@ -1184,10 +1184,22 @@ altr_check_ocram_deps_init(struct altr_edac_device_dev *device)
>   	if (ret)
>   		return ret;
>   
> -	/* Verify OCRAM has been initialized */
> +	/*
> +	 * Verify that OCRAM has been initialized.
> +	 * During a warm reset, OCRAM contents are retained, but the control
> +	 * and status registers are reset to their default values. Therefore,
> +	 * ECC must be explicitly re-enabled in the control register.
> +	 * Error condition: if INITCOMPLETEA is clear and ECC_EN is already set.
> +	 */
>   	if (!ecc_test_bits(ALTR_A10_ECC_INITCOMPLETEA,
> -			   (base + ALTR_A10_ECC_INITSTAT_OFST)))
> -		return -ENODEV;
> +			   (base + ALTR_A10_ECC_INITSTAT_OFST))) {
> +		if (!ecc_test_bits(ALTR_A10_ECC_EN,
> +				   (base + ALTR_A10_ECC_CTRL_OFST)))
> +			ecc_set_bits(ALTR_A10_ECC_EN,
> +				     (base + ALTR_A10_ECC_CTRL_OFST));
> +		else
> +			return -ENODEV;
> +	}
>   
>   	/* Enable IRQ on Single Bit Error */
>   	writel(ALTR_A10_ECC_SERRINTEN, (base + ALTR_A10_ECC_ERRINTENS_OFST));


Acked-by: Dinh Nguyen <dinguyen@kernel.org>

  reply	other threads:[~2025-11-06  4:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 14:09 niravkumarlaxmidas.rabara
2025-11-06  4:49 ` Dinh Nguyen [this message]
2025-11-09 18:57 ` Borislav Petkov
2025-11-11  7:13   ` Niravkumar L Rabara

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=3f138af5-8473-4366-9562-3cdea3862f1a@kernel.org \
    --to=dinguyen@kernel.org \
    --cc=bp@alien8.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niravkumarlaxmidas.rabara@altera.com \
    --cc=tony.luck@intel.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

all inboxes | Powered by JetHome®