Skip to contentSkip to conversation

EDAC/nuvoton: Add NPCM memory controller driver

PATCH Superseded Marvin Lin 2 participants 9 messages Dec 16, 2022 – Dec 19, 2022

Subsystems (5)

v16 of 18 Superseded Latest is v18 →

lore
Share & tools
lore

Marvin Lin

author
#0 lore raw

v16 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 v16:
- Correct dt-bindings document path in MAINTAINERS.
- Fix wrong indentation in driver.

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

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/npcm: 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                      | 520 ++++++++++++++++++
 6 files changed, 600 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 v16 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
#4 lore raw

PATCH v16 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
#8 lore raw

PATCH v16 3/3 EDAC/npcm: 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 | 520 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 539 insertions(+)
 create mode 100644 drivers/edac/npcm_edac.c
MAINTAINERS +7 -0
index 5a4526a171d6..9522354aa60b 100644
@@ -7524,6 +7524,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/memory-controllers/nuvoton,npcm-mc.yaml
+F:	drivers/edac/npcm_edac.c
+
 EDAC-PASEMI
 M:	Egor Martovetsky <[email protected]>
 L:	[email protected]
drivers/edac/Kconfig +11 -0
index 4cfdefbd744d..aa575f5b3125 100644
@@ -542,4 +542,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 +520 -0

520 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v16 1/3] Arm: dts: nuvoton: Add node for NPCM memory controller

In reply to Marvin Lin
Quoted 5 lines · Marvin Lin

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

Use subject prefixes matching the subsystem (git log --oneline -- ...).

It's "ARM:"

Quoted 4 lines
---
 arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

Best regards,
Krzysztof

#5 lore raw

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

In reply to Marvin Lin
Quoted 4 lines · Marvin Lin

Add dt-bindings document for Nuvoton NPCM memory controller.

So this is a 16th version but through this entire year you never Cced the maintainers... You did not send a single version to the memory controller maintainers.

I don't know why it is so big problem to use scripts/get_maintainers.pl.

Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml

Quoted 10 lines
---
 .../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 +0 -0
new file mode 100644
index 000000000000..0e752a673453

filename based on compatibles, so nuvoton,npcm-memory-controller.yaml

Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml line 2

Quoted 3 lines
Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml new file +2 -0
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+

No blank lines.

Quoted 39 lines
Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml new file +36 -0
+%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

Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml line 48

Quoted 10 lines
Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml new file +10 -0
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    ahb {
+        #address-cells = <1>;
+        #size-cells = <1>;

Why do you need this node in the example?

Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml line 54

Quoted 6 lines
Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml new file +6 -0
+        mc: memory-controller@f0824000 {
+            compatible = "nuvoton,npcm750-memory-controller";
+            reg = <0xf0824000 0x1000>;
+            interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };

Best regards,
Krzysztof

#6 lore raw

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

Quoted 11 lines · Krzysztof Kozlowski
Quoted 4 lines · Marvin Lin

Add dt-bindings document for Nuvoton NPCM memory controller.

So this is a 16th version but through this entire year you never Cced the maintainers... You did not send a single version to the memory controller maintainers.

I don't know why it is so big problem to use scripts/get_maintainers.pl.

Although maybe the reason for this is that it was being put in edac directory... eh...

Best regards,
Krzysztof

author
#7 lore raw

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

Hi Krzysztof,

Thanks for the review.

Quoted 8 lines
Quoted 5 lines

So this is a 16th version but through this entire year you never Cced the maintainers... You did not send a single version to the memory controller maintainers.

I don't know why it is so big problem to use scripts/get_maintainers.pl.

Although maybe the reason for this is that it was being put in edac directory... eh...

I should check the CC list for each version anyway. I'm sorry about that.

Quoted 9 lines
Quoted 1 line

+++ b/Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml

filename based on compatibles, so nuvoton,npcm-memory-controller.yaml

Review

Quoted 2 lines
(quoted diff) +2 -0
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+

No blank lines.

Quoted 5 lines

Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml line 48

Quoted 3 lines
Documentation/devicetree/bindings/memory-controllers/nuvoton,npcm-mc.yaml new file +3 -0
+    ahb {
+        #address-cells = <1>;
+        #size-cells = <1>;

Why do you need this node in the example?

These problems will be addressed in next patch. Thank you.

Regards,
Marvin

author
#3 lore raw

Re: [PATCH v16 1/3] Arm: dts: nuvoton: Add node for NPCM memory controller

In reply to Krzysztof Kozlowski

Hi Krzysztof,

Quoted 3 lines

Use subject prefixes matching the subsystem (git log --oneline -- ...).

It's "ARM:"

Will correct the subject prefixes in next patch. Thanks for the review.

Regards,
Marvin