[PATCH v4 0/3] Add Renesas RZ/N1x EDAC driver
From: Paul Louvel
Date: Mon Sep 28 2026 - 06:53:12 EST
The Cadence memory controller found on Renesas RZ/N1x SoCs supports ECC
with SECDED.
The memory controller found on the r9a06g032 supports at most a single
DIMM of DDR2/3, up to 2GB.
Add the EDAC driver for this memory controller, and the relevant
device-tree binding. Also add the EDAC node to the existing r9a06g032
SoC base device-tree.
Signed-off-by: Paul Louvel (Schneider Electric) <paul.louvel@xxxxxxxxxxx>
---
Changes in v4:
- Patch 1 and 3: drop the RZN1 family compatible, as requested by Geert.
- Patch 2:
- Instead of using FIELD_MODIFY macro that expect a compile-time
constant mask, use binary operators instead. Note that the new
code is doing exactly what FIELD_MODIFY do, minus the error if
cdns_rmw() is not inlined.
- Use a spinlock instead of mutex since the locked region will be
really fast to execute. Only lock it once for two register rmw.
- Use edac_debugfs_* facility instead of sysfs attributes. Use a
separate "bits" and "inject" file instead of just a single file.
This is better since clients can read the previously set syndrome.
- Cleaned up the probe function in separate functions. Use a remove
function instead of registering custom devm action. Use a goto for
resources cleaning.
- Mask all interrupts before un-registering the memory controller.
- Link to v3: https://patch.msgid.link/20260924-paul-v7-3-rc1-edac-v3-0-bd8054a5b180@xxxxxxxxxxx
Changes in v3:
- Patch 2:
- Added trailing newline to end message.
- Forgot mutex_init() in probe...
- Registering the MC at the end of the probe.
- Link to v2: https://patch.msgid.link/20260924-paul-v7-3-rc1-edac-v2-0-bc1406161ecc@xxxxxxxxxxx
Changes in v2:
- Patch 2:
- FIELD_MODIFY() is always called with a compile-time constant mask
in this driver. I see no problem here.
- Use devm_clk_get_enabled() so the driver does not need to store
struct clk_bulk_data outside the stack space.
Clocks are not manipulated outside of probe.
- Introduced a mutex for rmw operations in inject_ctrl_store() sysfs
callback. Rename drv to priv in cdns_rmw().
- Return IRQ_NONE if the stat int register is empty.
- I see no reason to follow Sashiko last remark on this patch.
Is an unhandled interrupt a big deal in this case ?
- Link to v1: https://patch.msgid.link/20260924-paul-v7-3-rc1-edac-v1-0-70be37c41a18@xxxxxxxxxxx
---
Paul Louvel (3):
dt-bindings: edac: cdns,ddr-edac: add Cadence DDR EDAC binding
EDAC/cadence: Add Cadence DDR EDAC driver
ARM: dts: renesas: r9a06g032: add EDAC node
.../devicetree/bindings/edac/cdns,ddr-edac.yaml | 61 ++++
MAINTAINERS | 7 +
arch/arm/boot/dts/renesas/r9a06g032.dtsi | 9 +
drivers/edac/Kconfig | 10 +
drivers/edac/Makefile | 1 +
drivers/edac/cadence_edac.c | 390 +++++++++++++++++++++
6 files changed, 478 insertions(+)
---
base-commit: d9f39b2c0579f313d14954a9ec584511c543aab5
change-id: 20260916-paul-v7-3-rc1-edac-1f479f96fc57
Best regards,
--
Paul Louvel, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com