* [PATCH 0/4] Stratix10 EDAC Improvements
@ 2019-01-16 23:11 thor.thayer
2019-01-16 23:11 ` [PATCH 1/4] EDAC, altera: Fix S10 persistent register offset thor.thayer
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: thor.thayer @ 2019-01-16 23:11 UTC (permalink / raw)
To: bp, dinguyen, robh+dt, mark.rutland, mchehab
Cc: thor.thayer, devicetree, linux-edac
From: Thor Thayer <thor.thayer@linux.intel.com>
This patch series includes a fix, an improvement and the
addition of OCRAM EDAC for Stratix10 SOCFPGA.
Thor Thayer (4):
EDAC, altera: Fix S10 persistent register offset
EDAC, altera: Less Intrusive Error Injection
EDAC, altera: Add Stratix10 OCRAM ECC support
arm64: dts: stratix10: Add OCRAM EDAC node
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 7 +++
drivers/edac/altera_edac.c | 52 ++++++++++++++---------
drivers/edac/altera_edac.h | 6 +--
3 files changed, 43 insertions(+), 22 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] EDAC, altera: Fix S10 persistent register offset
2019-01-16 23:11 [PATCH 0/4] Stratix10 EDAC Improvements thor.thayer
@ 2019-01-16 23:11 ` thor.thayer
2019-01-17 14:52 ` Dinh Nguyen
2019-01-16 23:11 ` [PATCH 2/4] EDAC, altera: Less Intrusive Error Injection thor.thayer
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: thor.thayer @ 2019-01-16 23:11 UTC (permalink / raw)
To: bp, dinguyen, robh+dt, mark.rutland, mchehab
Cc: thor.thayer, devicetree, linux-edac
From: Thor Thayer <thor.thayer@linux.intel.com>
Correct the persistent register offset where address
and status are stored.
Fixes: 08f08bfb7b4c ("EDAC, altera: Merge Stratix10 into the Arria10 SDRAM
probe routine")
Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
drivers/edac/altera_edac.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/edac/altera_edac.h b/drivers/edac/altera_edac.h
index 4213cb0bb2a7..f8664bac9fa8 100644
--- a/drivers/edac/altera_edac.h
+++ b/drivers/edac/altera_edac.h
@@ -295,8 +295,8 @@ struct altr_sdram_mc_data {
#define S10_SYSMGR_ECC_INTSTAT_DERR_OFST 0xA0
/* Sticky registers for Uncorrected Errors */
-#define S10_SYSMGR_UE_VAL_OFST 0x120
-#define S10_SYSMGR_UE_ADDR_OFST 0x124
+#define S10_SYSMGR_UE_VAL_OFST 0x220
+#define S10_SYSMGR_UE_ADDR_OFST 0x224
#define S10_DDR0_IRQ_MASK BIT(16)
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] EDAC, altera: Less Intrusive Error Injection
2019-01-16 23:11 [PATCH 0/4] Stratix10 EDAC Improvements thor.thayer
2019-01-16 23:11 ` [PATCH 1/4] EDAC, altera: Fix S10 persistent register offset thor.thayer
@ 2019-01-16 23:11 ` thor.thayer
2019-01-16 23:11 ` [PATCH 3/4] EDAC, altera: Add Stratix10 OCRAM ECC support thor.thayer
2019-01-16 23:11 ` [PATCH 4/4] arm64: dts: stratix10: Add OCRAM EDAC node thor.thayer
3 siblings, 0 replies; 7+ messages in thread
From: thor.thayer @ 2019-01-16 23:11 UTC (permalink / raw)
To: bp, dinguyen, robh+dt, mark.rutland, mchehab
Cc: thor.thayer, devicetree, linux-edac
From: Thor Thayer <thor.thayer@linux.intel.com>
Improve the Arria10 and Stratix10 error injection routines
by reading the data and changing just 1 bit before writing
back out. Previous routine would set the first bytes to 0
then change to 1 but this method is less intrusive.
Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
drivers/edac/altera_edac.c | 30 +++++++++++++-----------------
drivers/edac/altera_edac.h | 2 +-
2 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index c89d82aa2776..56af98d18645 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -1756,28 +1756,24 @@ static ssize_t altr_edac_a10_device_trig2(struct file *file,
if (trig_type == ALTR_UE_TRIGGER_CHAR) {
writel(priv->ue_set_mask, set_addr);
} else {
- /* Setup write of 0 to first 4 bytes */
- writel(0x0, drvdata->base + ECC_BLK_WDATA0_OFST);
- writel(0x0, drvdata->base + ECC_BLK_WDATA1_OFST);
- writel(0x0, drvdata->base + ECC_BLK_WDATA2_OFST);
- writel(0x0, drvdata->base + ECC_BLK_WDATA3_OFST);
- /* Setup write of 4 bytes */
+ /* Setup read/write of 4 bytes */
writel(ECC_WORD_WRITE, drvdata->base + ECC_BLK_DBYTECTRL_OFST);
/* Setup Address to 0 */
- writel(0x0, drvdata->base + ECC_BLK_ADDRESS_OFST);
- /* Setup accctrl to write & data override */
- writel(ECC_WRITE_DOVR, drvdata->base + ECC_BLK_ACCCTRL_OFST);
- /* Kick it. */
- writel(ECC_XACT_KICK, drvdata->base + ECC_BLK_STARTACC_OFST);
- /* Setup accctrl to read & ecc override */
- writel(ECC_READ_EOVR, drvdata->base + ECC_BLK_ACCCTRL_OFST);
+ writel(0, drvdata->base + ECC_BLK_ADDRESS_OFST);
+ /* Setup accctrl to read & ecc & data override */
+ writel(ECC_READ_EDOVR, drvdata->base + ECC_BLK_ACCCTRL_OFST);
/* Kick it. */
writel(ECC_XACT_KICK, drvdata->base + ECC_BLK_STARTACC_OFST);
/* Setup write for single bit change */
- writel(0x1, drvdata->base + ECC_BLK_WDATA0_OFST);
- writel(0x0, drvdata->base + ECC_BLK_WDATA1_OFST);
- writel(0x0, drvdata->base + ECC_BLK_WDATA2_OFST);
- writel(0x0, drvdata->base + ECC_BLK_WDATA3_OFST);
+ writel(readl(drvdata->base + ECC_BLK_RDATA0_OFST) ^ 0x1,
+ drvdata->base + ECC_BLK_WDATA0_OFST);
+ writel(readl(drvdata->base + ECC_BLK_RDATA1_OFST),
+ drvdata->base + ECC_BLK_WDATA1_OFST);
+ writel(readl(drvdata->base + ECC_BLK_RDATA2_OFST),
+ drvdata->base + ECC_BLK_WDATA2_OFST);
+ writel(readl(drvdata->base + ECC_BLK_RDATA3_OFST),
+ drvdata->base + ECC_BLK_WDATA3_OFST);
+
/* Copy Read ECC to Write ECC */
writel(readl(drvdata->base + ECC_BLK_RECC0_OFST),
drvdata->base + ECC_BLK_WECC0_OFST);
diff --git a/drivers/edac/altera_edac.h b/drivers/edac/altera_edac.h
index f8664bac9fa8..a1acca99c50b 100644
--- a/drivers/edac/altera_edac.h
+++ b/drivers/edac/altera_edac.h
@@ -319,7 +319,7 @@ struct altr_sdram_mc_data {
#define ECC_BLK_STARTACC_OFST 0x7C
#define ECC_XACT_KICK 0x10000
-#define ECC_WORD_WRITE 0xF
+#define ECC_WORD_WRITE 0xFF
#define ECC_WRITE_DOVR 0x101
#define ECC_WRITE_EDOVR 0x103
#define ECC_READ_EOVR 0x2
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] EDAC, altera: Add Stratix10 OCRAM ECC support
2019-01-16 23:11 [PATCH 0/4] Stratix10 EDAC Improvements thor.thayer
2019-01-16 23:11 ` [PATCH 1/4] EDAC, altera: Fix S10 persistent register offset thor.thayer
2019-01-16 23:11 ` [PATCH 2/4] EDAC, altera: Less Intrusive Error Injection thor.thayer
@ 2019-01-16 23:11 ` thor.thayer
2019-01-16 23:11 ` [PATCH 4/4] arm64: dts: stratix10: Add OCRAM EDAC node thor.thayer
3 siblings, 0 replies; 7+ messages in thread
From: thor.thayer @ 2019-01-16 23:11 UTC (permalink / raw)
To: bp, dinguyen, robh+dt, mark.rutland, mchehab
Cc: thor.thayer, devicetree, linux-edac
From: Thor Thayer <thor.thayer@linux.intel.com>
Use the newer ECC error injection method for Arria10 and
Stratix10 OCRAM.
OCRAM can't call the common peripheral init routine since
OCRAM is being used. An OCRAM specific init routine ensures
the OCRAM ECC is setup without clearing memory.
Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
drivers/edac/altera_edac.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 56af98d18645..6a8993e6a278 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -1216,8 +1216,26 @@ static const struct edac_device_prv_data ocramecc_data = {
.inject_fops = &altr_edac_device_inject_fops,
};
+static int __maybe_unused
+altr_a10_check_ecc_deps_init(struct altr_edac_device_dev *device)
+{
+ void __iomem *base = device->base;
+ int ret;
+
+ ret = altr_check_ecc_deps(device);
+ if (ret)
+ return ret;
+
+ /* Enable IRQ on Single Bit Error */
+ writel(ALTR_A10_ECC_SERRINTEN, (base + ALTR_A10_ECC_ERRINTENS_OFST));
+ /* Ensure all writes complete */
+ wmb();
+
+ return 0;
+}
+
static const struct edac_device_prv_data a10_ocramecc_data = {
- .setup = altr_check_ecc_deps,
+ .setup = altr_a10_check_ecc_deps_init,
.ce_clear_mask = ALTR_A10_ECC_SERRPENA,
.ue_clear_mask = ALTR_A10_ECC_DERRPENA,
.irq_status_mask = A10_SYSMGR_ECC_INTSTAT_OCRAM,
@@ -1227,7 +1245,7 @@ static const struct edac_device_prv_data a10_ocramecc_data = {
.ue_set_mask = ALTR_A10_ECC_TDERRA,
.set_err_ofst = ALTR_A10_ECC_INTTEST_OFST,
.ecc_irq_handler = altr_edac_a10_ecc_irq,
- .inject_fops = &altr_edac_a10_device_inject_fops,
+ .inject_fops = &altr_edac_a10_device_inject2_fops,
/*
* OCRAM panic on uncorrectable error because sleep/resume
* functions and FPGA contents are stored in OCRAM. Prefer
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] arm64: dts: stratix10: Add OCRAM EDAC node
2019-01-16 23:11 [PATCH 0/4] Stratix10 EDAC Improvements thor.thayer
` (2 preceding siblings ...)
2019-01-16 23:11 ` [PATCH 3/4] EDAC, altera: Add Stratix10 OCRAM ECC support thor.thayer
@ 2019-01-16 23:11 ` thor.thayer
3 siblings, 0 replies; 7+ messages in thread
From: thor.thayer @ 2019-01-16 23:11 UTC (permalink / raw)
To: bp, dinguyen, robh+dt, mark.rutland, mchehab
Cc: thor.thayer, devicetree, linux-edac
From: Thor Thayer <thor.thayer@linux.intel.com>
Add the OCRAM ECC node following the Arria10 format.
Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
index 8253a1a9e985..a625dc472b91 100644
--- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
+++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
@@ -494,6 +494,13 @@
interrupts = <16 4>, <48 4>;
};
+ ocram-ecc@ff8cc000 {
+ compatible = "altr,socfpga-a10-ocram-ecc";
+ reg = <0xff8cc000 0x100>;
+ interrupts = <1 4>,
+ <33 4>;
+ };
+
usb0-ecc@ff8c4000 {
compatible = "altr,socfpga-usb-ecc";
reg = <0xff8c4000 0x100>;
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] EDAC, altera: Fix S10 persistent register offset
2019-01-16 23:11 ` [PATCH 1/4] EDAC, altera: Fix S10 persistent register offset thor.thayer
@ 2019-01-17 14:52 ` Dinh Nguyen
2019-01-17 15:36 ` Thor Thayer
0 siblings, 1 reply; 7+ messages in thread
From: Dinh Nguyen @ 2019-01-17 14:52 UTC (permalink / raw)
To: thor.thayer, bp, robh+dt, mark.rutland, mchehab; +Cc: devicetree, linux-edac
On 1/16/19 5:11 PM, thor.thayer@linux.intel.com wrote:
> From: Thor Thayer <thor.thayer@linux.intel.com>
>
> Correct the persistent register offset where address
> and status are stored.
>
> Fixes: 08f08bfb7b4c ("EDAC, altera: Merge Stratix10 into the Arria10 SDRAM
> probe routine")
The "Fixes" line should be all on one line. I recently got dinged for this.
>From Documentation/process/submitting-patches.rst"
"If your patch fixes a bug in a specific commit, e.g. you found an issue
using
``git bisect``, please use the 'Fixes:' tag with the first 12 characters of
the SHA-1 ID, and the one line summary. For example::
Fixes: e21d2170f366 ("video: remove unnecessary platform_set_drvdata()")"
Dinh
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] EDAC, altera: Fix S10 persistent register offset
2019-01-17 14:52 ` Dinh Nguyen
@ 2019-01-17 15:36 ` Thor Thayer
0 siblings, 0 replies; 7+ messages in thread
From: Thor Thayer @ 2019-01-17 15:36 UTC (permalink / raw)
To: Dinh Nguyen, bp, robh+dt, mark.rutland, mchehab; +Cc: devicetree, linux-edac
On 1/17/19 8:52 AM, Dinh Nguyen wrote:
>
>
> On 1/16/19 5:11 PM, thor.thayer@linux.intel.com wrote:
>> From: Thor Thayer <thor.thayer@linux.intel.com>
>>
>> Correct the persistent register offset where address
>> and status are stored.
>>
>> Fixes: 08f08bfb7b4c ("EDAC, altera: Merge Stratix10 into the Arria10 SDRAM
>> probe routine")
>
> The "Fixes" line should be all on one line. I recently got dinged for this.
>
>>>From Documentation/process/submitting-patches.rst"
>
> "If your patch fixes a bug in a specific commit, e.g. you found an issue
> using
> ``git bisect``, please use the 'Fixes:' tag with the first 12 characters of
> the SHA-1 ID, and the one line summary. For example::
>
> Fixes: e21d2170f366 ("video: remove unnecessary platform_set_drvdata()")"
>
> Dinh
> I'll fix that and send out another patchset. Thanks Dinh.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-01-17 15:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-16 23:11 [PATCH 0/4] Stratix10 EDAC Improvements thor.thayer
2019-01-16 23:11 ` [PATCH 1/4] EDAC, altera: Fix S10 persistent register offset thor.thayer
2019-01-17 14:52 ` Dinh Nguyen
2019-01-17 15:36 ` Thor Thayer
2019-01-16 23:11 ` [PATCH 2/4] EDAC, altera: Less Intrusive Error Injection thor.thayer
2019-01-16 23:11 ` [PATCH 3/4] EDAC, altera: Add Stratix10 OCRAM ECC support thor.thayer
2019-01-16 23:11 ` [PATCH 4/4] arm64: dts: stratix10: Add OCRAM EDAC node thor.thayer
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).