Skip to contentSkip to conversation

Add SD/MMC EDAC for Altera Arria10

PATCH Applied [email protected] 2 participants 5 messages Aug 9, 2016 – Aug 10, 2016

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH v2 1/3 Documentation: dt: socfpga: Add Arria10 SD-MMC EDAC binding

In reply to [email protected]

From: Thor Thayer <[email protected]>

Add the device tree bindings needed to support the Altera SD-MMC FIFO buffers EDAC on the Arria10 chip.

---
v2 No change

---
 .../bindings/arm/altera/socfpga-eccmgr.txt         |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
Documentation/devicetree/bindings/arm/altera/socfpga-eccmgr.txt +19 -0
index ee66df0..4a1714f 100644
@@ -122,6 +122,15 @@ Required Properties:
 - interrupts      : Should be single bit error interrupt, then double bit error
 	interrupt, in this order.
 
+SDMMC FIFO ECC
+Required Properties:
+- compatible      : Should be "altr,socfpga-sdmmc-ecc"
+- reg             : Address and size for ECC block registers.
+- altr,ecc-parent : phandle to parent SD/MMC node.
+- interrupts      : Should be single bit error interrupt, then double bit error
+	interrupt, in this order for port A, and then single bit error interrupt,
+	then double bit error interrupt in this order for port B.
+
 Example:
 
 	eccmgr: eccmgr@ffd06000 {
@@ -211,4 +220,14 @@ Example:
 			interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
 				     <46 IRQ_TYPE_LEVEL_HIGH>;
 		};
+
+		sdmmc-ecc@ff8c2c00 {
+			compatible = "altr,socfpga-sdmmc-ecc";
+			reg = <0xff8c2c00 0x400>;
+			altr,ecc-parent = <&mmc>;
+			interrupts = <15 IRQ_TYPE_LEVEL_HIGH>,
+				     <47 IRQ_TYPE_LEVEL_HIGH>,
+				     <16 IRQ_TYPE_LEVEL_HIGH>,
+				     <48 IRQ_TYPE_LEVEL_HIGH>;
+		};
 	};
Signature · 1 line
1.7.9.5
#0 lore raw

v2 cover Add SD/MMC EDAC for Altera Arria10

From: Thor Thayer <[email protected]>

Add the SD/MMC FIFO EDAC module which is a dual-port RAM as opposed to the other Arria10 peripheral's single port RAM FIFOs.

Thor Thayer (3):
Documentation: dt: socfpga: Add Arria10 SD-MMC EDAC binding EDAC, altera: Add Arria10 SD-MMC EDAC support
ARM: dts: Add Arria10 SD/MMC EDAC devicetree entry

 .../bindings/arm/altera/socfpga-eccmgr.txt         |   19 ++
 arch/arm/boot/dts/socfpga_arria10_socdk_sdmmc.dts  |   12 ++
 drivers/edac/Kconfig                               |    7 +
 drivers/edac/altera_edac.c                         |  188 +++++++++++++++++++-
 drivers/edac/altera_edac.h                         |    5 +
 5 files changed, 230 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 2/3 EDAC, altera: Add Arria10 SD-MMC EDAC support

From: Thor Thayer <[email protected]>

Add Altera Arria10 SD-MMC FIFO memory EDAC support. The SD-MMC is a dual port RAM implementation which is different than any of the other peripherals and therefore requires additional code.

---
v2 Cleanup PortB initialization by moving device tree search to
top of function.
Improve unhandled IRQ message using WARN_ONCE() with IRQ#. Change KERN_ERR on device tree not found to KERN_WARNING.

---
 drivers/edac/Kconfig       |    7 ++
 drivers/edac/altera_edac.c |  188 +++++++++++++++++++++++++++++++++++++++++++-
 drivers/edac/altera_edac.h |    5 ++
 3 files changed, 199 insertions(+), 1 deletion(-)
drivers/edac/Kconfig +7 -0
index 72752f4..394cd16 100644
@@ -426,6 +426,13 @@ config EDAC_ALTERA_QSPI
 	  Support for error detection and correction on the
 	  Altera QSPI FIFO Memory for Altera SoCs.
 
+config EDAC_ALTERA_SDMMC
+	bool "Altera SDMMC FIFO ECC"
+	depends on EDAC_ALTERA=y && MMC_DW
+	help
+	  Support for error detection and correction on the
+	  Altera SDMMC FIFO Memory for Altera SoCs.
+
 config EDAC_SYNOPSYS
 	tristate "Synopsys DDR Memory Controller"
 	depends on EDAC_MM_EDAC && ARCH_ZYNQ
drivers/edac/altera_edac.c +187 -1

206 lines not on this page · raw message

drivers/edac/altera_edac.h +5 -0
index 687d8e7..cf3a68b 100644
@@ -250,6 +250,8 @@ struct altr_sdram_mc_data {
 #define ALTR_A10_ECC_INTTEST_OFST       0x24
 #define ALTR_A10_ECC_TSERRA             BIT(0)
 #define ALTR_A10_ECC_TDERRA             BIT(8)
+#define ALTR_A10_ECC_TSERRB             BIT(16)
+#define ALTR_A10_ECC_TDERRB             BIT(24)
 
 /* ECC Manager Defines */
 #define A10_SYSMGR_ECC_INTMASK_SET_OFST   0x94
@@ -288,6 +290,9 @@ struct altr_sdram_mc_data {
 /* Arria 10 Ethernet ECC Management Group Defines */
 #define ALTR_A10_COMMON_ECC_EN_CTL      BIT(0)
 
+/* Arria 10 SDMMC ECC Management Group Defines */
+#define ALTR_A10_SDMMC_IRQ_MASK         (BIT(16) | BIT(15))
+
 /* A10 ECC Controller memory initialization timeout */
 #define ALTR_A10_ECC_INIT_WATCHDOG_10US      10000
 
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v2 3/3 ARM: dts: Add Arria10 SD/MMC EDAC devicetree entry

In reply to [email protected]

From: Thor Thayer <[email protected]>

Add the device tree entries needed to support the Altera SD/MMC FIFO buffer EDAC on the Arria10 chip.

---
v2 No change

---
 arch/arm/boot/dts/socfpga_arria10_socdk_sdmmc.dts |   12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/socfpga_arria10_socdk_sdmmc.dts +12 -0
index 8a7dfa4..040a164 100644
@@ -25,3 +25,15 @@
 	broken-cd;
 	bus-width = <4>;
 };
+
+&eccmgr {
+	sdmmca-ecc at ff8c2c00 {
+		compatible = "altr,socfpga-sdmmc-ecc";
+		reg = <0xff8c2c00 0x400>;
+		altr,ecc-parent = <&mmc>;
+		interrupts = <15 IRQ_TYPE_LEVEL_HIGH>,
+			     <47 IRQ_TYPE_LEVEL_HIGH>,
+			     <16 IRQ_TYPE_LEVEL_HIGH>,
+			     <48 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
Signature · 1 line
1.7.9.5
maintainer Applied
#4 lore raw
In reply to [email protected]
Quoted 10 lines · tthayer at opensource.altera.com

From: Thor Thayer <[email protected]>

Add the SD/MMC FIFO EDAC module which is a dual-port RAM as opposed to the other Arria10 peripheral's single port RAM FIFOs.

Thor Thayer (3):
Documentation: dt: socfpga: Add Arria10 SD-MMC EDAC binding EDAC, altera: Add Arria10 SD-MMC EDAC support
ARM: dts: Add Arria10 SD/MMC EDAC devicetree entry

Quoted 6 lines
 .../bindings/arm/altera/socfpga-eccmgr.txt         |   19 ++
 arch/arm/boot/dts/socfpga_arria10_socdk_sdmmc.dts  |   12 ++
 drivers/edac/Kconfig                               |    7 +
 drivers/edac/altera_edac.c                         |  188 +++++++++++++++++++-
 drivers/edac/altera_edac.h                         |    5 +
 5 files changed, 230 insertions(+), 1 deletion(-)

Applied, thanks.

Signature · 5 lines
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--