Skip to contentSkip to conversation

EDAC/nuvoton: Add NPCM memory controller driver

PATCH Superseded Marvin Lin 2 participants 6 messages Aug 30, 2022 – Sep 2, 2022

Subsystems (4)

v14 of 18 Superseded Latest is v18 →

lore
Share & tools
lore

Marvin Lin

author
#0 lore raw

v14 cover EDAC/nuvoton: Add NPCM memory controller driver

This patch series add DTS node, dt-bindings document and driver for memory controller present on Nuvoton NPCM SoCs.

The memory controller supports single bit error correction and double bit error detection (in-line ECC in which a section 1/8th of the memory device used to store data is used for ECC storage).

Changes in v14:
- Fix compile warnings

Changes in v13:
- Support error injection via debugfs
- Fix coding style issues

Marvin Lin (3):
arm: dts: nuvoton: Add node for NPCM memory controller
dt-bindings: edac: nuvoton: Add document for NPCM memory controller EDAC/nuvoton: Add NPCM memory controller driver

 .../edac/nuvoton,npcm-memory-controller.yaml  |  54 ++
 MAINTAINERS                                   |   7 +
 arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi |   7 +
 drivers/edac/Kconfig                          |  11 +
 drivers/edac/Makefile                         |   1 +
 drivers/edac/npcm_edac.c                      | 516 ++++++++++++++++++
 6 files changed, 596 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml
 create mode 100644 drivers/edac/npcm_edac.c
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH v14 1/3 arm: dts: nuvoton: Add node for NPCM memory controller

Add node for memory controller present on Nuvoton NPCM SoCs. The memory controller supports single bit error correction and double bit error detection.

---
 arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi +7 -0
index c7b5ef15b716..d875e8ac1e09 100644
@@ -179,6 +179,13 @@
 			status = "disabled";
 		};
 
+		mc: memory-controller@f0824000 {
+			compatible = "nuvoton,npcm750-memory-controller";
+			reg = <0xf0824000 0x1000>;
+			interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
 		apb {
 			#address-cells = <1>;
 			#size-cells = <1>;
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH v14 2/3 dt-bindings: edac: nuvoton: Add document for NPCM memory controller

In reply to Marvin Lin

Add dt-bindings document for Nuvoton NPCM memory controller.

---
 .../edac/nuvoton,npcm-memory-controller.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml
Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml new file +54 -0
new file mode 100644
index 000000000000..d5ef7e7a65f9
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/edac/nuvoton,npcm-memory-controller.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton NPCM Memory Controller Device Tree Bindings
+
+maintainers:
+  - Marvin Lin <[email protected]>
+  - Stanley Chu <[email protected]>
+
+description: |
+  The Nuvoton BMC SoC supports DDR4 memory with and without ECC (error
+  correction check).
+
+  The memory controller supports single bit error correction, double bit
+  error detection (in-line ECC in which a section (1/8th) of the memory
+  device used to store data is used for ECC storage).
+
+  Note, the bootloader must configure ECC mode for the memory controller.
+
+properties:
+  compatible:
+    enum:
+      - nuvoton,npcm750-memory-controller
+      - nuvoton,npcm845-memory-controller
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    ahb {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        mc: memory-controller@f0824000 {
+            compatible = "nuvoton,npcm750-memory-controller";
+            reg = <0xf0824000 0x1000>;
+            interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
Signature · 1 line
2.17.1
author
#5 lore raw

PATCH v14 3/3 EDAC/nuvoton: Add NPCM memory controller driver

In reply to Marvin Lin

Add driver for memory controller present on Nuvoton NPCM SoCs. The memory controller supports single bit error correction and double bit error detection.

---
 MAINTAINERS              |   7 +
 drivers/edac/Kconfig     |  11 +
 drivers/edac/Makefile    |   1 +
 drivers/edac/npcm_edac.c | 516 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 535 insertions(+)
 create mode 100644 drivers/edac/npcm_edac.c
MAINTAINERS +7 -0
index 868bbf31603d..dde5b3e647ce 100644
@@ -7409,6 +7409,13 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/edac/mpc85xx_edac.[ch]
 
+EDAC-NPCM
+M:	Marvin Lin <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml
+F:	drivers/edac/npcm_edac.c
+
 EDAC-PASEMI
 M:	Egor Martovetsky <[email protected]>
 L:	[email protected]
drivers/edac/Kconfig +11 -0
index 17562cf1fe97..69b92dff7dbb 100644
@@ -541,4 +541,15 @@ config EDAC_DMC520
 	  Support for error detection and correction on the
 	  SoCs with ARM DMC-520 DRAM controller.
 
+config EDAC_NPCM
+	tristate "Nuvoton NPCM DDR Memory Controller"
+	depends on (ARCH_NPCM || COMPILE_TEST)
+	help
+	  Support for error detection and correction on the Nuvoton NPCM DDR
+	  memory controller.
+
+	  The memory controller supports single bit error correction, double bit
+	  error detection (in-line ECC in which a section 1/8th of the memory
+	  device used to store data is used for ECC storage).
+
 endif # EDAC
drivers/edac/Makefile +1 -0
index 2d1641a27a28..db3c59d3ad84 100644
@@ -84,3 +84,4 @@ obj-$(CONFIG_EDAC_QCOM)			+= qcom_edac.o
 obj-$(CONFIG_EDAC_ASPEED)		+= aspeed_edac.o
 obj-$(CONFIG_EDAC_BLUEFIELD)		+= bluefield_edac.o
 obj-$(CONFIG_EDAC_DMC520)		+= dmc520_edac.o
+obj-$(CONFIG_EDAC_NPCM)			+= npcm_edac.o
drivers/edac/npcm_edac.c new file +516 -0

516 lines not on this page · raw message

Signature · 1 line
2.17.1
#3 lore raw

Re: [PATCH v14 2/3] dt-bindings: edac: nuvoton: Add document for NPCM memory controller

In reply to Marvin Lin
Quoted 15 lines · Marvin Lin

Add dt-bindings document for Nuvoton NPCM memory controller.

---
 .../edac/nuvoton,npcm-memory-controller.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml
Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml new file +0 -0
new file mode 100644
index 000000000000..d5ef7e7a65f9

Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml line 5

Quoted 5 lines
Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml new file +5 -0
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/edac/nuvoton,npcm-memory-controller.yaml#

This should be in memory-controllers directory.

Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml line 8

Quoted 3 lines
Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml new file +3 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton NPCM Memory Controller Device Tree Bindings

s/Device Tree Bindings//

Best regards,
Krzysztof

author
#4 lore raw

Re: [PATCH v14 2/3] dt-bindings: edac: nuvoton: Add document for NPCM memory controller

Hi Krzysztof,

Quoted 10 lines

Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml line 5

Quoted 7 lines

+++ b/Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml

Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml new file +5 -0
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/edac/nuvoton,npcm-memory-controller.yaml#

This should be in memory-controllers directory.

Quoted 5 lines

Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml line 8

Quoted 3 lines
Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml new file +3 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton NPCM Memory Controller Device Tree Bindings

s/Device Tree Bindings//

Thanks for the review. Next version will move YAML to memory-controllers directory and remove "Device Tree Bindings".

Regards,
Marvin