linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support
@ 2019-04-23 14:36 thor.thayer
  2019-04-23 14:36 ` [PATCH 1/4] EDAC, altera: Add Stratix10 OCRAM ECC support thor.thayer
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: thor.thayer @ 2019-04-23 14:36 UTC (permalink / raw)
  To: bp, mchehab, james.morse, dinguyen, robh+dt, mark.rutland
  Cc: thor.thayer, devicetree, linux-edac, linux-kernel

From: Thor Thayer <thor.thayer@linux.intel.com>

This patch series adds EDAC support for the Stratix10 OCRAM
and SDMMC peripherals.

Thor Thayer (4):
  EDAC, altera: Add Stratix10 OCRAM ECC support
  arm64: dts: stratix10: Add OCRAM EDAC node
  EDAC, altera: Add Stratix10 SDMMC support
  arm64: dts: stratix10: Add SDMMC EDAC node

 arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi  |  8 ++++
 .../boot/dts/altera/socfpga_stratix10_socdk.dts    | 11 ++++++
 drivers/edac/altera_edac.c                         | 43 ++++++++++++++++++++--
 3 files changed, 59 insertions(+), 3 deletions(-)

-- 
2.7.4


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

* [PATCH 1/4] EDAC, altera: Add Stratix10 OCRAM ECC support
  2019-04-23 14:36 [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support thor.thayer
@ 2019-04-23 14:36 ` thor.thayer
  2019-04-23 14:36 ` [PATCH 2/4] arm64: dts: stratix10: Add OCRAM EDAC node thor.thayer
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: thor.thayer @ 2019-04-23 14:36 UTC (permalink / raw)
  To: bp, mchehab, james.morse, dinguyen, robh+dt, mark.rutland
  Cc: thor.thayer, devicetree, linux-edac, linux-kernel

From: Thor Thayer <thor.thayer@linux.intel.com>

Use the newer ECC error injection method for Arria10 and
Stratix10 OCRAM.
If OCRAM has already been initialized during the boot and
OCRAM ECC is enabled, ensure the Single Bit Error IRQ is
enabled.

Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
 drivers/edac/altera_edac.c | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 8816f74a22b4..b7bc8f020df8 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -1223,8 +1223,31 @@ static const struct edac_device_prv_data ocramecc_data = {
 	.inject_fops = &altr_edac_device_inject_fops,
 };
 
+static int __maybe_unused
+altr_check_ocram_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;
+
+	/* Verify OCRAM has been initialized */
+	if (!ecc_test_bits(ALTR_A10_ECC_INITCOMPLETEA,
+			   (base + ALTR_A10_ECC_INITSTAT_OFST)))
+		return -ENODEV;
+
+	/* 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_check_ocram_deps_init,
 	.ce_clear_mask = ALTR_A10_ECC_SERRPENA,
 	.ue_clear_mask = ALTR_A10_ECC_DERRPENA,
 	.irq_status_mask = A10_SYSMGR_ECC_INTSTAT_OCRAM,
@@ -1234,7 +1257,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] 8+ messages in thread

* [PATCH 2/4] arm64: dts: stratix10: Add OCRAM EDAC node
  2019-04-23 14:36 [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support thor.thayer
  2019-04-23 14:36 ` [PATCH 1/4] EDAC, altera: Add Stratix10 OCRAM ECC support thor.thayer
@ 2019-04-23 14:36 ` thor.thayer
  2019-05-06 15:17   ` Dinh Nguyen
  2019-04-23 14:36 ` [PATCH 3/4] EDAC, altera: Add Stratix10 SDMMC support thor.thayer
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: thor.thayer @ 2019-04-23 14:36 UTC (permalink / raw)
  To: bp, mchehab, james.morse, dinguyen, robh+dt, mark.rutland
  Cc: thor.thayer, devicetree, linux-edac, linux-kernel

From: Thor Thayer <thor.thayer@linux.intel.com>

Add the OCRAM ECC node with Stratix10 compatible string.

Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
 arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
index 41109995563c..c28310ff70a0 100644
--- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
+++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
@@ -547,6 +547,14 @@
 				interrupts = <16 4>;
 			};
 
+			ocram-ecc@ff8cc000 {
+				compatible = "altr,socfpga-s10-ocram-ecc",
+					     "altr,socfpga-a10-ocram-ecc";
+				reg = <0xff8cc000 0x100>;
+				altr,ecc-parent = <&ocram>;
+				interrupts = <1 4>;
+			};
+
 			usb0-ecc@ff8c4000 {
 				compatible = "altr,socfpga-s10-usb-ecc",
 					     "altr,socfpga-usb-ecc";
-- 
2.7.4


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

* [PATCH 3/4] EDAC, altera: Add Stratix10 SDMMC support
  2019-04-23 14:36 [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support thor.thayer
  2019-04-23 14:36 ` [PATCH 1/4] EDAC, altera: Add Stratix10 OCRAM ECC support thor.thayer
  2019-04-23 14:36 ` [PATCH 2/4] arm64: dts: stratix10: Add OCRAM EDAC node thor.thayer
@ 2019-04-23 14:36 ` thor.thayer
  2019-04-23 14:36 ` [PATCH 4/4] arm64: dts: stratix10: Add SDMMC EDAC node thor.thayer
  2019-05-10 14:34 ` [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support Borislav Petkov
  4 siblings, 0 replies; 8+ messages in thread
From: thor.thayer @ 2019-04-23 14:36 UTC (permalink / raw)
  To: bp, mchehab, james.morse, dinguyen, robh+dt, mark.rutland
  Cc: thor.thayer, devicetree, linux-edac, linux-kernel

From: Thor Thayer <thor.thayer@linux.intel.com>

Addition of SDMMC EDAC for Stratix10 which has IRQ
differences from Arria10. Update comment accordingly.

Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
 drivers/edac/altera_edac.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index b7bc8f020df8..c2e693e34d43 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -1583,8 +1583,12 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
 	dci->mod_name = ecc_name;
 	dci->dev_name = ecc_name;
 
-	/* Update the IRQs for PortB */
+	/* Update the PortB IRQs - A10 has 4, S10 has 2, Index accordingly */
+#ifdef CONFIG_ARCH_STRATIX10
+	altdev->sb_irq = irq_of_parse_and_map(np, 1);
+#else
 	altdev->sb_irq = irq_of_parse_and_map(np, 2);
+#endif
 	if (!altdev->sb_irq) {
 		edac_printk(KERN_ERR, EDAC_DEVICE, "Error PortB SBIRQ alloc\n");
 		rc = -ENODEV;
@@ -1599,6 +1603,15 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
 		goto err_release_group_1;
 	}
 
+#ifdef CONFIG_ARCH_STRATIX10
+	/* Use IRQ to determine SError origin instead of assigning IRQ */
+	rc = of_property_read_u32_index(np, "interrupts", 1, &altdev->db_irq);
+	if (rc) {
+		edac_printk(KERN_ERR, EDAC_DEVICE,
+			    "Error PortB DBIRQ alloc\n");
+		goto err_release_group_1;
+	}
+#else
 	altdev->db_irq = irq_of_parse_and_map(np, 3);
 	if (!altdev->db_irq) {
 		edac_printk(KERN_ERR, EDAC_DEVICE, "Error PortB DBIRQ alloc\n");
@@ -1613,6 +1626,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
 		edac_printk(KERN_ERR, EDAC_DEVICE, "PortB DBERR IRQ error\n");
 		goto err_release_group_1;
 	}
+#endif
 
 	rc = edac_device_add_device(dci);
 	if (rc) {
-- 
2.7.4


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

* [PATCH 4/4] arm64: dts: stratix10: Add SDMMC EDAC node
  2019-04-23 14:36 [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support thor.thayer
                   ` (2 preceding siblings ...)
  2019-04-23 14:36 ` [PATCH 3/4] EDAC, altera: Add Stratix10 SDMMC support thor.thayer
@ 2019-04-23 14:36 ` thor.thayer
  2019-05-06 15:17   ` Dinh Nguyen
  2019-05-10 14:34 ` [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support Borislav Petkov
  4 siblings, 1 reply; 8+ messages in thread
From: thor.thayer @ 2019-04-23 14:36 UTC (permalink / raw)
  To: bp, mchehab, james.morse, dinguyen, robh+dt, mark.rutland
  Cc: thor.thayer, devicetree, linux-edac, linux-kernel

From: Thor Thayer <thor.thayer@linux.intel.com>

Add the Stratix10 SDMMC EDAC node.

Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
 arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
index 2e3863ee12b3..91fed85cf8e5 100644
--- a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
+++ b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
@@ -67,6 +67,17 @@
 				clock-frequency = <25000000>;
 			};
 		};
+
+		eccmgr {
+			sdmmca-ecc@ff8c8c00 {
+				compatible = "altr,socfpga-s10-sdmmc-ecc",
+					     "altr,socfpga-sdmmc-ecc";
+				reg = <0xff8c8c00 0x100>;
+				altr,ecc-parent = <&mmc>;
+				interrupts = <14 4>,
+					     <15 4>;
+			};
+		};
 	};
 };
 
-- 
2.7.4


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

* Re: [PATCH 2/4] arm64: dts: stratix10: Add OCRAM EDAC node
  2019-04-23 14:36 ` [PATCH 2/4] arm64: dts: stratix10: Add OCRAM EDAC node thor.thayer
@ 2019-05-06 15:17   ` Dinh Nguyen
  0 siblings, 0 replies; 8+ messages in thread
From: Dinh Nguyen @ 2019-05-06 15:17 UTC (permalink / raw)
  To: thor.thayer, bp, mchehab, james.morse, robh+dt, mark.rutland
  Cc: devicetree, linux-edac, linux-kernel



On 4/23/19 9:36 AM, thor.thayer@linux.intel.com wrote:
> From: Thor Thayer <thor.thayer@linux.intel.com>
> 
> Add the OCRAM ECC node with Stratix10 compatible string.
> 
> Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
> ---
>  arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
> index 41109995563c..c28310ff70a0 100644
> --- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
> +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
> @@ -547,6 +547,14 @@
>  				interrupts = <16 4>;
>  			};
>  
> +			ocram-ecc@ff8cc000 {
> +				compatible = "altr,socfpga-s10-ocram-ecc",
> +					     "altr,socfpga-a10-ocram-ecc";
> +				reg = <0xff8cc000 0x100>;
> +				altr,ecc-parent = <&ocram>;
> +				interrupts = <1 4>;
> +			};
> +
>  			usb0-ecc@ff8c4000 {
>  				compatible = "altr,socfpga-s10-usb-ecc",
>  					     "altr,socfpga-usb-ecc";
> 

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

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

* Re: [PATCH 4/4] arm64: dts: stratix10: Add SDMMC EDAC node
  2019-04-23 14:36 ` [PATCH 4/4] arm64: dts: stratix10: Add SDMMC EDAC node thor.thayer
@ 2019-05-06 15:17   ` Dinh Nguyen
  0 siblings, 0 replies; 8+ messages in thread
From: Dinh Nguyen @ 2019-05-06 15:17 UTC (permalink / raw)
  To: thor.thayer, bp, mchehab, james.morse, robh+dt, mark.rutland
  Cc: devicetree, linux-edac, linux-kernel



On 4/23/19 9:36 AM, thor.thayer@linux.intel.com wrote:
> From: Thor Thayer <thor.thayer@linux.intel.com>
> 
> Add the Stratix10 SDMMC EDAC node.
> 
> Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
> ---
>  arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
> index 2e3863ee12b3..91fed85cf8e5 100644
> --- a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
> +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
> @@ -67,6 +67,17 @@
>  				clock-frequency = <25000000>;
>  			};
>  		};
> +
> +		eccmgr {
> +			sdmmca-ecc@ff8c8c00 {
> +				compatible = "altr,socfpga-s10-sdmmc-ecc",
> +					     "altr,socfpga-sdmmc-ecc";
> +				reg = <0xff8c8c00 0x100>;
> +				altr,ecc-parent = <&mmc>;
> +				interrupts = <14 4>,
> +					     <15 4>;
> +			};
> +		};
>  	};
>  };
>  
> 

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

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

* Re: [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support
  2019-04-23 14:36 [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support thor.thayer
                   ` (3 preceding siblings ...)
  2019-04-23 14:36 ` [PATCH 4/4] arm64: dts: stratix10: Add SDMMC EDAC node thor.thayer
@ 2019-05-10 14:34 ` Borislav Petkov
  4 siblings, 0 replies; 8+ messages in thread
From: Borislav Petkov @ 2019-05-10 14:34 UTC (permalink / raw)
  To: thor.thayer
  Cc: mchehab, james.morse, dinguyen, robh+dt, mark.rutland,
	devicetree, linux-edac, linux-kernel

On Tue, Apr 23, 2019 at 09:36:33AM -0500, thor.thayer@linux.intel.com wrote:
> From: Thor Thayer <thor.thayer@linux.intel.com>
> 
> This patch series adds EDAC support for the Stratix10 OCRAM
> and SDMMC peripherals.
> 
> Thor Thayer (4):
>   EDAC, altera: Add Stratix10 OCRAM ECC support
>   arm64: dts: stratix10: Add OCRAM EDAC node
>   EDAC, altera: Add Stratix10 SDMMC support
>   arm64: dts: stratix10: Add SDMMC EDAC node
> 
>  arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi  |  8 ++++
>  .../boot/dts/altera/socfpga_stratix10_socdk.dts    | 11 ++++++
>  drivers/edac/altera_edac.c                         | 43 ++++++++++++++++++++--
>  3 files changed, 59 insertions(+), 3 deletions(-)
> 
> -- 

All 4 queued locally, will appear after -rc1 releases.

Thx.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

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

end of thread, other threads:[~2019-05-10 14:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 14:36 [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support thor.thayer
2019-04-23 14:36 ` [PATCH 1/4] EDAC, altera: Add Stratix10 OCRAM ECC support thor.thayer
2019-04-23 14:36 ` [PATCH 2/4] arm64: dts: stratix10: Add OCRAM EDAC node thor.thayer
2019-05-06 15:17   ` Dinh Nguyen
2019-04-23 14:36 ` [PATCH 3/4] EDAC, altera: Add Stratix10 SDMMC support thor.thayer
2019-04-23 14:36 ` [PATCH 4/4] arm64: dts: stratix10: Add SDMMC EDAC node thor.thayer
2019-05-06 15:17   ` Dinh Nguyen
2019-05-10 14:34 ` [PATCH 0/4] Add Stratix10 OCRAM & SDMMC EDAC Support Borislav Petkov

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