Skip to contentSkip to conversation

EDAC/nuvoton: Add NPCM memory controller driver

PATCH New Marvin Lin 1 participant 4 messages Aug 18, 2022

Subsystems (4)
lore
Share & tools
lore

Marvin Lin

author
#0 lore raw

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

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                                   |   6 +
 .../boot/dts/nuvoton/nuvoton-npcm845-evb.dts  |   4 +
 .../boot/dts/nuvoton/nuvoton-npcm845.dtsi     |   7 +
 drivers/edac/Kconfig                          |  11 +
 drivers/edac/Makefile                         |   1 +
 drivers/edac/npcm_edac.c                      | 512 ++++++++++++++++++
 7 files changed, 595 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 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/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts | 4 ++++
 arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi    | 7 +++++++
 2 files changed, 11 insertions(+)
arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts +4 -0
index 76137513e567..913c9cbdebee 100644
@@ -438,6 +438,10 @@
 	status = "okay";
 };
 
+&mc {
+	status = "okay";
+};
+
 &pinctrl {
 	pinctrl-names = "default";
 	pinctrl-0 = <
arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi +7 -0
index 6a1f75c93f59..100565118a59 100644
@@ -82,6 +82,13 @@
 	};
 
 	ahb {
+		mc: memory-controller@f0824000 {
+			compatible = "nuvoton,npcm845-memory-controller";
+			reg = <0x0 0xf0824000 0x0 0x1000>;
+			interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
 		udc0:udc@f0830000 {
 			compatible = "nuvoton,npcm845-udc";
 			reg = <0x0 0xf0830000 0x0 0x1000
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 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..eb525dd848b2
@@ -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 = <2>;
+        #size-cells = <2>;
+        mc: memory-controller@f0824000 {
+            compatible = "nuvoton,npcm750-memory-controller";
+            reg = <0x0 0xf0824000 0x0 0x1000>;
+            interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
Signature · 1 line
2.17.1
author
#3 lore raw

PATCH 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              |   6 +
 drivers/edac/Kconfig     |  11 +
 drivers/edac/Makefile    |   1 +
 drivers/edac/npcm_edac.c | 512 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 530 insertions(+)
 create mode 100644 drivers/edac/npcm_edac.c
MAINTAINERS +6 -0
index be3a3197700f..66804a23cbf3 100644
@@ -6809,6 +6809,12 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/edac/mpc85xx_edac.[ch]
 
+EDAC-NPCM
+M:	Marvin Lin <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/edac/nuvoton,npcm-memory-controller.yaml
+F:	drivers/edac/npcm_edac.c
+
 EDAC-NPCM7XX
 M:	George Hung <[email protected]>
 S:	Maintained
drivers/edac/Kconfig +11 -0
index 836fdefc7967..61b6b01c4b23 100644
@@ -546,4 +546,15 @@ config EDAC_NPCM7XX
 	  Support for error detection and correction on the
 	  Nuvoton NPCM7xx DDR memory 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 38bc2262ad8f..01a4f4a4564e 100644
@@ -85,3 +85,4 @@ obj-$(CONFIG_EDAC_ASPEED)		+= aspeed_edac.o
 obj-$(CONFIG_EDAC_BLUEFIELD)		+= bluefield_edac.o
 obj-$(CONFIG_EDAC_DMC520)		+= dmc520_edac.o
 obj-$(CONFIG_EDAC_NPCM7XX)              += npcm7xx_edac.o
+obj-$(CONFIG_EDAC_NPCM)                 += npcm_edac.o
drivers/edac/npcm_edac.c new file +512 -0

512 lines not on this page · raw message

Signature · 1 line
2.17.1