All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 3/3] dt-bindings: memory-controllers: Convert Altera SDRAM EDAC .txt to YAML
@ 2025-06-23 19:57 Shankari Anand
  2025-06-23 23:24 ` Matthew Gerlach
  2025-06-24  7:31 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 3+ messages in thread
From: Shankari Anand @ 2025-06-23 19:57 UTC (permalink / raw)
  To: devicetree
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthew Gerlach,
	Shankari Anand

Convert the Altera SOCFPGA SDRAM EDAC devicetree binding from the
.txt format to a YAML schema.

Added a 'reg' property as dt_binding_check flagged its absence.
Dropped it from required as it causes warnings in altr,socfpga-ecc-manager.
The controller is memory-mapped; address is confirmed from Intel's manual.

Also added two strings: altr,sdram-edac-a10 and altr,sdram-edac-s10,
compatible with altr,sdram-edac but use two interrupts;
Schema enforces interrupt count per variant.

Signed-off-by: Shankari Anand <shankari.ak0208@gmail.com>
---
v5 -> v6: 
- Drop dummy intc/sdr/model/compatible from examples
- Make reg optional to fix warning with ecc-manager binding
- Reduced the examples to one
---
 .../arm/altera/socfpga-sdram-edac.txt         | 15 -----
 .../memory-controllers/altr,sdram-edac.yaml   | 65 +++++++++++++++++++
 2 files changed, 65 insertions(+), 15 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/altera/socfpga-sdram-edac.txt
 create mode 100644 Documentation/devicetree/bindings/memory-controllers/altr,sdram-edac.yaml

diff --git a/Documentation/devicetree/bindings/arm/altera/socfpga-sdram-edac.txt b/Documentation/devicetree/bindings/arm/altera/socfpga-sdram-edac.txt
deleted file mode 100644
index f5ad0ff69fae..000000000000
--- a/Documentation/devicetree/bindings/arm/altera/socfpga-sdram-edac.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Altera SOCFPGA SDRAM Error Detection & Correction [EDAC]
-The EDAC accesses a range of registers in the SDRAM controller.
-
-Required properties:
-- compatible : should contain "altr,sdram-edac" or "altr,sdram-edac-a10"
-- altr,sdr-syscon : phandle of the sdr module
-- interrupts : Should contain the SDRAM ECC IRQ in the
-	appropriate format for the IRQ controller.
-
-Example:
-	sdramedac {
-		compatible = "altr,sdram-edac";
-		altr,sdr-syscon = <&sdr>;
-		interrupts = <0 39 4>;
-	};
diff --git a/Documentation/devicetree/bindings/memory-controllers/altr,sdram-edac.yaml b/Documentation/devicetree/bindings/memory-controllers/altr,sdram-edac.yaml
new file mode 100644
index 000000000000..96677fdfa7f8
--- /dev/null
+++ b/Documentation/devicetree/bindings/memory-controllers/altr,sdram-edac.yaml
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/memory-controllers/altr,sdram-edac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Altera SoCFPGA SDRAM EDAC Controller
+
+maintainers:
+  - Matthew Gerlach <matthew.gerlach@altera.com>
+
+description: |
+  EDAC-compatible controller for SDRAM error detection and correction on
+  Altera (Intel) SoCFPGA platforms.
+
+properties:
+  compatible:
+    enum:
+      - altr,sdram-edac
+      - altr,sdram-edac-a10
+      - altr,sdram-edac-s10
+
+  reg:
+    maxItems: 1
+
+  altr,sdr-syscon:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: Phandle to the SDRAM system controller (SDR) syscon node.
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+required:
+  - compatible
+  - altr,sdr-syscon
+  - interrupts
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - altr,sdram-edac-a10
+              - altr,sdram-edac-s10
+    then:
+      properties:
+        interrupts:
+          minItems: 2
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    memory-controller@f8004000 {
+        compatible = "altr,sdram-edac-a10";
+        reg = <0xf8004000 0x1000>;
+        altr,sdr-syscon = <&sdr>;
+        interrupt-parent = <&intc>;
+        interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+                     	<GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+    };
-- 
2.34.1


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

end of thread, other threads:[~2025-06-24  7:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-23 19:57 [PATCH v6 3/3] dt-bindings: memory-controllers: Convert Altera SDRAM EDAC .txt to YAML Shankari Anand
2025-06-23 23:24 ` Matthew Gerlach
2025-06-24  7:31 ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.