Skip to contentSkip to conversation

EDAC/nuvoton: Add NPCM memory controller driver

PATCH Superseded Marvin Lin 1 participant 4 messages Sep 2, 2022

Subsystems (5)

v15 of 18 Superseded Latest is v18 →

lore
Share & tools
lore

Marvin Lin

author
#0 lore raw

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

v15:
- Move dt-bindings document to memory-controllers directory and remove superfluous string in content title

v14:
- Fix compile warnings

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

 .../memory-controllers/nuvoton,npcm-mc.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/memory-controllers/nuvoton,npcm-mc.yaml
 create mode 100644 drivers/edac/npcm_edac.c
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v15 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 @@ fiux: spi@fb001000 {
 			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.34.1
author
#2 lore raw

PATCH v15 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.

---
 .../memory-controllers/nuvoton,npcm-mc.yaml   | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml
Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml new file +54 -0
new file mode 100644
index 000000000000..0e752a673453
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/memory-controllers/nuvoton,npcm-mc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton NPCM Memory Controller
+
+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.34.1
author
#3 lore raw

PATCH v15 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.34.1