Skip to contentSkip to conversation

Add EDAC support for Cadence ddr controller

PATCH Superseded Dhananjay Kangude 2 participants 5 messages Apr 6, 2020 – Apr 15, 2020

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add EDAC support for Cadence ddr controller

These patches add new edac driver for Cadence ddr memory controller. Cadence controller detects single(CE) and double(UE) bit errors during memory operations(RMW). DDR controller raised the interrupt on detection of the ecc error event and fill the data into registers. Driver handle the interrupt event and notify edac subsystem about ecc errors.

Changes since v3:
=================
- Corrected YAML file location

Changes since v2:
=================
- Added minor fixes to YAML file
- Split ISR into two differnt functions
- Removed unused paramters
- Fixed indentation issues
- Improved code readabilty
- Checked return value for edac_get_dimm
- Modified quirks as a ip_features

Changes since v1:
=================
- Made predefined arrays as static

Fixes 201447a5db9b ("EDAC/Cadence:Add EDAC driver for cadence memory controller")

- Replace macro 'EDAC_DIMM_PTR' with newly introduce function
- Removed unused variable root

Dhananjay Kangude (2):
dt-bindings: edac: Add cadence ddr mc support EDAC/Cadence:Add EDAC driver for cadence memory controller

 .../devicetree/bindings/edac/cdns,ddr-edac.yaml    |   47 ++
 drivers/edac/Kconfig                               |    8 +
 drivers/edac/cadence_edac.c                        |  641 ++++++++++++++++++++
 3 files changed, 696 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml
 create mode 100644 drivers/edac/cadence_edac.c
#1 lore raw

PATCH v3 1/2 dt-bindings: edac: Add cadence ddr mc support

Add documentation for cadence ddr memory controller EDAC DTS bindings

---
 .../devicetree/bindings/edac/cdns,ddr-edac.yaml    |   47 ++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +47 -0
new file mode 100644
index 0000000..30ea757
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/edac/cdns,ddr-edac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cadence DDR IP with ECC support (EDAC)
+
+description:
+  This binding describes the Cadence DDR/LPDDR IP with ECC feature enabled
+  to detect and correct CE/UE errors.
+
+maintainers:
+  - Dhananjay Kangdue <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - cdns,ddr4-mc
+
+  reg:
+    minItems: 1
+    maxItems: 2
+    items:
+      - description:
+          Register block of DDR/LPDDR apb registers up to mapped area.
+          Mapped area contains the register set for memory controller,
+          phy and PI module register set doesn't part of this mapping.
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    edac: edac@fd100000 {
+        compatible = "cdns,ddr4-mc-edac";
+        reg = <0xfd100000 0x4000>;
+        interrupts = <0x00 0x01 0x04>;
+    };
+...
Signature · 1 line
1.7.1
maintainer
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: edac: Add cadence ddr mc support

Quoted 23 lines · Dhananjay Kangude

Add documentation for cadence ddr memory controller EDAC DTS bindings

---
 .../devicetree/bindings/edac/cdns,ddr-edac.yaml    |   47 ++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +9 -0
new file mode 100644
index 0000000..30ea757
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/edac/cdns,ddr-edac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cadence DDR IP with ECC support (EDAC)
+
+description:

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml line 19

Quoted 10 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +10 -0
+  This binding describes the Cadence DDR/LPDDR IP with ECC feature enabled
+  to detect and correct CE/UE errors.
+
+maintainers:
+  - Dhananjay Kangdue <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - cdns,ddr4-mc

Surely there's more than 1 version?

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml line 28

Quoted 9 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +9 -0
+
+  reg:
+    minItems: 1
+    maxItems: 2
+    items:
+      - description:
+          Register block of DDR/LPDDR apb registers up to mapped area.
+          Mapped area contains the register set for memory controller,
+          phy and PI module register set doesn't part of this mapping.

doesn't part of this mapping?

Need a description for the 2nd region.

Quoted 4 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +4 -0
+
+  interrupts:
+    maxItems: 1
+

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml line 42

Quoted 10 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +10 -0
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    edac: edac@fd100000 {

memory-controller@

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml line 43

Quoted 1 line
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +1 -0
+        compatible = "cdns,ddr4-mc-edac";

Doesn't match.

Quoted 7 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +4 -0
+        reg = <0xfd100000 0x4000>;
+        interrupts = <0x00 0x01 0x04>;
+    };
+...
Signature · 1 line
1.7.1
#3 lore raw

RE: [PATCH v3 1/2] dt-bindings: edac: Add cadence ddr mc support

Quoted 52 lines

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Wednesday, April 15, 2020 5:20 AM
To: Dhananjay Vilasrao Kangude <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Milind Parab <[email protected]>; [email protected]
Subject: Re: [PATCH v3 1/2] dt-bindings: edac: Add cadence ddr mc support

EXTERNAL MAIL

Quoted 5 lines · Dhananjay Kangude

Add documentation for cadence ddr memory controller EDAC DTS bindings

---
 .../devicetree/bindings/edac/cdns,ddr-edac.yaml    |   47

++++++++++++++++++++

Quoted 10 lines
 1 files changed, 47 insertions(+), 0 deletions(-)  create mode 100644

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +0 -0
new file mode 100644
index 0000000..30ea757

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml line 5

Quoted 5 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +5 -0
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2
+---
+$id:
+https://urldefense.com/v3/__http://devicetree.org/schemas/edac/cdns,d
+dr-

edac.yaml*__;Iw!!EHscmS1ygiU1lA!T49K56JzhGnA7nxu4mq55aDfl80QsXPj-l

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml line 9

Quoted 4 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +4 -0
+Egtf_PILMzq2Np6NqhLRXeTNuBLx0$
+$schema:
+https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.y
+aml*__;Iw!!EHscmS1ygiU1lA!T49K56JzhGnA7nxu4mq55aDfl80QsXPj-

lEgtf_PILM

Quoted 10 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +10 -0
+zq2Np6NqhLRXe69d40qY$
+
+title: Cadence DDR IP with ECC support (EDAC)
+
+description:
+  This binding describes the Cadence DDR/LPDDR IP with ECC feature
+enabled
+  to detect and correct CE/UE errors.
+
+maintainers:
Quoted 8 lines

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml line 19

Quoted 6 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +6 -0
+  - Dhananjay Kangdue <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - cdns,ddr4-mc

Surely there's more than 1 version?

[Dhananjay Kangude] No, as of now we have only one version of hardware module. I will change the property with items instead of enum.

Quoted 11 lines

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml line 28

Quoted 10 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +9 -0
+
+  reg:
+    minItems: 1
+    maxItems: 2
+    items:
+      - description:
+          Register block of DDR/LPDDR apb registers up to mapped area.
+          Mapped area contains the register set for memory controller,
+          phy and PI module register set doesn't part of this mapping.
Quoted 2 lines

doesn't part of this mapping?

[Dhananjay Kangude] In case of combo IP, controller and phy module are together. But ecc doesn't have any dependencies on phy module so we can exclude phy module .

Quoted 1 line

Need a description for the 2nd region.

[Dhananjay Kangude] Removed maxItems property. We don't have another region to access. fix will release in next version

Quoted 17 lines
Quoted 5 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +4 -0
+
+  interrupts:
+    maxItems: 1
+

Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml line 42

Quoted 10 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +10 -0
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    edac: edac@fd100000 {

memory-controller@

[Dhananjay Kangude] ] memory-controller might not the appropriate name. the driver module is only focused on ecc not on actual memory-controller functionality.

Quoted 4 lines
Quoted 2 lines

+ compatible = "cdns,ddr4-mc-edac";

Doesn't match.

[Dhananjay Kangude] fixed. Changes will be part of next version.

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/edac/cdns,ddr-edac.yaml new file +4 -1
+        reg = <0xfd100000 0x4000>;
+        interrupts = <0x00 0x01 0x04>;
+    };
+...
--

1.7.1

#4 lore raw

PATCH v3 2/2 EDAC/Cadence:Add EDAC driver for cadence memory controller

In reply to Dhananjay Kangude

Added edac platform driver for Cadence DDR controller which notify the ecc events based on the single or double bit errors during memory operations.

---
 drivers/edac/Kconfig        |    8 +
 drivers/edac/cadence_edac.c |  641 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 649 insertions(+), 0 deletions(-)
 create mode 100644 drivers/edac/cadence_edac.c
drivers/edac/Kconfig +8 -0
index fe2eb89..d5bb399 100644
@@ -530,4 +530,12 @@ config EDAC_DMC520
 	  Support for error detection and correction on the
 	  SoCs with ARM DMC-520 DRAM controller.
 
+config EDAC_CADENCE
+	tristate "Candence DDR Memory Controller ECC"
+	depends on ARM
+	help
+	  Support for error detection and correction on the Cadence DDR
+	  memory controller. The driver reports correctable and uncorrectable
+	  memory errors.
+
 endif # EDAC
drivers/edac/cadence_edac.c new file +641 -0

641 lines not on this page · raw message

Signature · 1 line
1.7.1