Skip to contentSkip to conversation

EDAC: Add ARM64 EDAC

PATCH Superseded Brijesh Singh 2 participants 3 messages Oct 27, 2015

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 EDAC: Add ARM64 EDAC

Add support for Cortex A57 and A53 EDAC driver.

CC robh+dt at kernel.org
CC pawel.moll at arm.com
CC mark.rutland at arm.com
CC ijc+devicetree at hellion.org.uk
CC galak at codeaurora.org
CC dougthompson at xmission.com
CC bp at alien8.de
CC mchehab at osg.samsung.com
CC devicetree at vger.kernel.org
CC guohanjun at huawei.com
CC andre.przywara at arm.com
CC arnd at arndb.de
CC sboyd at codeaurora.org
CC linux-kernel at vger.kernel.org
CC linux-edac at vger.kernel.org

---
v3:
* change DT binding compatibilty string to 'cortex-a57-edac'
* remove A57/A53 prefix from register bit definition
* unify A57 and A53 L1/L2 error parsing functions
* use mc trace event function to report the error
* update Kconfig default to 'n'

v2:
* convert into generic arm64 edac driver
* remove AMD specific references from dt binding
* remove poll_msec property from dt binding
* add poll_msec as a module param, default is 100ms
* update copyright text
* define macro mnemonics for L1 and L2 RAMID
* check L2 error per-cluster instead of per core
* update function names
* use get_online_cpus() and put_online_cpus() to make L1 and L2 register read hotplug-safe
* add error check in probe routine

 .../devicetree/bindings/edac/cortex-arm64-edac.txt |  15 +
 drivers/edac/Kconfig                               |   8 +
 drivers/edac/Makefile                              |   1 +
 drivers/edac/cortex_arm64_edac.c                   | 349 +++++++++++++++++++++
 4 files changed, 373 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/edac/cortex-arm64-edac.txt
 create mode 100644 drivers/edac/cortex_arm64_edac.c
Documentation/devicetree/bindings/edac/cortex-arm64-edac.txt new file +15 -0
new file mode 100644
index 0000000..552f0c7
@@ -0,0 +1,15 @@
+* ARM Cortex A57 and A53 L1/L2 cache error reporting
+
+CPU Memory Error Syndrome and L2 Memory Error Syndrome registers can be used
+for checking L1 and L2 memory errors.
+
+The following section describes the Cortex A57/A53 EDAC DT node binding.
+
+Required properties:
+- compatible: Should be "arm,cortex-a57-edac" or "arm,cortex-a53-edac"
+
+Example:
+	edac {
+		compatible = "arm,cortex-a57-edac";
+	};
+
drivers/edac/Kconfig +8 -0
index ef25000..84507b5 100644
@@ -390,4 +390,12 @@ config EDAC_XGENE
 	  Support for error detection and correction on the
 	  APM X-Gene family of SOCs.
 
+config EDAC_CORTEX_ARM64
+	tristate "ARM Cortex A57/A53"
+	depends on EDAC_MM_EDAC && ARM64
+	default n
+	help
+	  Support for error detection and correction on the
+	  ARM Cortex A57 and A53.
+
 endif # EDAC
drivers/edac/Makefile +1 -0
index ae3c5f3..ac01660 100644
@@ -68,3 +68,4 @@ obj-$(CONFIG_EDAC_OCTEON_PCI)		+= octeon_edac-pci.o
 obj-$(CONFIG_EDAC_ALTERA_MC)		+= altera_edac.o
 obj-$(CONFIG_EDAC_SYNOPSYS)		+= synopsys_edac.o
 obj-$(CONFIG_EDAC_XGENE)		+= xgene_edac.o
+obj-$(CONFIG_EDAC_CORTEX_ARM64)		+= cortex_arm64_edac.o
drivers/edac/cortex_arm64_edac.c new file +349 -0

349 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw

drivers/edac/Kconfig config EDAC_XGENE · line 396

Quoted 12 lines · Brijesh Singh
drivers/edac/Kconfig +4 -0
index ef25000..84507b5 100644
@@ -390,4 +390,12 @@ config EDAC_XGENE
 	  Support for error detection and correction on the
 	  APM X-Gene family of SOCs.
 
+config EDAC_CORTEX_ARM64
+	tristate "ARM Cortex A57/A53"
+	depends on EDAC_MM_EDAC && ARM64
+	default n

n is the default so this can be removed.

Quoted 10 lines
drivers/edac/Kconfig +4 -0
+	help
+	  Support for error detection and correction on the
+	  ARM Cortex A57 and A53.
+
 endif # EDAC
drivers/edac/cortex_arm64_edac.c new file +0 -0
new file mode 100644
index 0000000..7c936b66

drivers/edac/cortex_arm64_edac.c line 328

Quoted 7 lines
drivers/edac/cortex_arm64_edac.c new file +7 -0
+
+static struct platform_driver cortex_arm64_edac_driver = {
+	.probe = cortex_arm64_edac_probe,
+	.remove = cortex_arm64_edac_remove,
+	.driver = {
+		.name = DRV_NAME,
+		.owner = THIS_MODULE,

This line can be removed. THIS_MODULE is assigned by platform_driver_register().

Quoted 5 lines
drivers/edac/cortex_arm64_edac.c new file +5 -0
+		.of_match_table = cortex_arm64_edac_of_match,
+	},
+};
+
+static int __init cortex_arm64_edac_init(void)

drivers/edac/cortex_arm64_edac.c line 343

Quoted 10 lines
drivers/edac/cortex_arm64_edac.c new file +10 -0
+{
+	return platform_driver_register(&cortex_arm64_edac_driver);
+}
+module_init(cortex_arm64_edac_init);
+
+static void __exit cortex_arm64_edac_exit(void)
+{
+	platform_driver_unregister(&cortex_arm64_edac_driver);
+}
+module_exit(cortex_arm64_edac_exit);

This can be module_platform_driver(cortex_arm64_edac_driver) now.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#2 lore raw

Thanks for review Steve.

Quoted 7 lines · Stephen Boyd

drivers/edac/Kconfig config EDAC_XGENE · line 396

Quoted 4 lines
drivers/edac/Kconfig +4 -0
+config EDAC_CORTEX_ARM64
+	tristate "ARM Cortex A57/A53"
+	depends on EDAC_MM_EDAC && ARM64
+	default n

n is the default so this can be removed.

noted

Quoted 6 lines

drivers/edac/cortex_arm64_edac.c line 328

Quoted 3 lines
drivers/edac/cortex_arm64_edac.c new file +3 -0
+	.driver = {
+		.name = DRV_NAME,
+		.owner = THIS_MODULE,

This line can be removed. THIS_MODULE is assigned by platform_driver_register().

noted.

Quoted 10 lines
Quoted 10 lines
drivers/edac/cortex_arm64_edac.c new file +9 -0
+		.of_match_table = cortex_arm64_edac_of_match,
+	},
+};
+
+static int __init cortex_arm64_edac_init(void)
+{
+	return platform_driver_register(&cortex_arm64_edac_driver);
+}
+module_init(cortex_arm64_edac_init);
Quoted 9 lines

drivers/edac/cortex_arm64_edac.c line 343

Quoted 6 lines
drivers/edac/cortex_arm64_edac.c new file +6 -0
+
+static void __exit cortex_arm64_edac_exit(void)
+{
+	platform_driver_unregister(&cortex_arm64_edac_driver);
+}
+module_exit(cortex_arm64_edac_exit);

This can be module_platform_driver(cortex_arm64_edac_driver) now.

noted.

-Brijesh