edac: Add APM X-Gene SoC EDAC driver
Subsystems (3)
v5 cover edac: Add APM X-Gene SoC EDAC driver
This patch adds support for the APM X-Gene SoC EDAC driver.
v5:
* Rebase to 3.17.rc1 (next)
* Update binding documentation for additional SoC node binding resource
* Enable MCU correctable and uncorrectable interrupts if not enabled by firmware
* Enable top level interrupt only after all MCU registered. Otherwise, error interrupt will never get cleared by the corresponding MCU.
* Remove clearing of L1 and L2 errors during initialization time. Otherwise, they will not be captured between firmware booting and error configuration.
* Add capture and clearing SoC register bus errors
* Add register bus resource to SoC DT node
v4:
* Fix PMD l1/l2 error reading address due to wrong variable type
* Fix clearing of software generated and HW errors for l1/l2
v3:
* Update binding documentation for PMD DT node and exampples
* Add binding documentation for SoC DT node
* Change MC, PMD, and L3C driver error injection to use debugfs
* Add missing IRQ for MC correctable error (code and DT)
* Use true/false where appropriate instead 1/0
* Add bit definition for L1 MMUESR register and fully decode this error
* Remove the un-necessary dev variable from xgene_edac_pmd_ctx structure
* Add check for disabled PMD (code and DT)
* Switch to edac_printk instead pr_err
* Some minor comments update
v2:
* Add EDAC entry in MAINTAINERS for APM EDAC driver
* Remove the MC scrub patch
* Remove the word 'Caches' from Kconfig
* Change all MASK defines to use BIT(x)
* Update comment or remove them
* Wrap error injection code around CONFIG_EDAC_DEBUG
* Change function name xgene_edac_mc_hw_init to xgene_edac_mc_irq_ctl
* Change all function XXX_hw_init to XXX_hw_ctl
* Fix typo 'activie'
* Move calling function edac_mc_alloc after resource retrieval
* Check for NULL on platform_get_resource return if reference directly
* Add documentation for struct xgene_edac_pmd_ctx
* Move L1 and L2 check out of function xgene_edac_pmd_check to its own functions
* Use for loop for configure each CPU of an PMD
* Replace /2 by >> 1
* Remove unnecessary comment on edac_device_add_device failure
* Make mem_err_ip static const
* Unwind EDAC register correctly if failed
---
Loc Ho (4):
MAINTAINERS: Add entry for APM X-Gene SoC EDAC driver
Documentation: Add documentation for the APM X-Gene SoC EDAC DTS
binding
edac: Add APM X-Gene SoC EDAC driver
arm64: Add APM X-Gene SoC EDAC DTS entries
.../devicetree/bindings/edac/apm-xgene-edac.txt | 83 + MAINTAINERS | 8 + arch/arm64/boot/dts/apm-storm.dtsi | 98 + drivers/edac/Kconfig | 9 +- drivers/edac/Makefile | 3 + drivers/edac/xgene_edac.c | 2132 ++++++++++++++++++++ 6 files changed, 2332 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/edac/apm-xgene-edac.txt create mode 100644 drivers/edac/xgene_edac.c
PATCH v5 1/4 MAINTAINERS: Add entry for APM X-Gene SoC EDAC driver
This patch adds a MAINTAINERS entry for APM X-Gene SoC EDAC driver.
--- MAINTAINERS | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
MAINTAINERS +8 -0
@@ -3427,6 +3427,14 @@ W: bluesmoke.sourceforge.net S: Maintained F: drivers/edac/sb_edac.c +EDAC-XGENE +APPLIED MICRO (APM) X-GENE SOC EDAC +M: Loc Ho <[email protected]> +M: Feng Kan <[email protected]> +S: Supported +F: drivers/edac/xgene_edac.c +F: Documentation/devicetree/bindings/edac/apm-xgene-edac.txt + EDIROL UA-101/UA-1000 DRIVER M: Clemens Ladisch <[email protected]> L: alsa-devel at alsa-project.org (moderated for non-subscribers)
Signature · 1 line
1.5.5
PATCH v5 2/4 Documentation: Add documentation for the APM X-Gene SoC EDAC DTS binding
This patch adds documentation for the APM X-Gene SoC EDAC DTS binding.
--- .../devicetree/bindings/edac/apm-xgene-edac.txt | 83 ++++++++++++++++++++ 1 files changed, 83 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt new file +83 -0
@@ -0,0 +1,83 @@ +* APM X-Gene SoC EDAC nodes + +EDAC nodes are defined to describe on-chip error detection and correction. +There are four types of EDAC: + + memory controller - Memory controller + PMD (L1/L2) - Processor module unit (PMD) L1/L2 cache + L3 - CPU L3 cache + SoC - SoC IP such as SATA, Ethernet, and etc + +The following section describes the memory controller DT node binding. + +Required properties: +- compatible : Shall be "apm,xgene-edac-mc". +- reg : First resource shall be the PCP resource. + Second resource shall be the CSW resource. + Third resource shall be the MCB-A resource. + Fourth resource shall be the MCB-B resource. + Fifth resource shall be the MCU resource. +- interrupts : Interrupt-specifier for MCU error IRQ(s). + +The following section describes the L1/L2 DT node binding. + +- compatible : Shall be "apm,xgene-edac-pmd". +- reg : First resource shall be the PCP resource. + Second resource shall be the PMD resource. + Third resource shall be the PMD efuse resource. +- interrupts : Interrupt-specifier for PMD error IRQ(s). + +The following section describes the L3 DT node binding. + +- compatible : Shall be "apm,xgene-edac-l3". +- reg : First resource shall be the PCP resource. + Second resource shall be the L3 resource. +- interrupts : Interrupt-specifier for L3 error IRQ(s). + +The following section describes the SoC DT node binding. + +- compatible : Shall be "apm,xgene-edac-soc"". +- reg : First resource shall be the PCP resource. + Second resource shall be the SoC resource. + Third resource shall be the register bus resource. +- interrupts : Interrupt-specifier for SoC error IRQ(s). + +Example: + edacmc0: edacmc0 at 7e800000 { + compatible = "apm,xgene-edac-mc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e200000 0x0 0x1000>, + <0x0 0x7e700000 0x0 0x1000>, + <0x0 0x7e720000 0x0 0x1000>, + <0x0 0x7e800000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacl3: edacl3 at 7e600000 { + compatible = "apm,xgene-edac-l3"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e600000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacpmd0: edacpmd0 at 7c000000 { + compatible = "apm,xgene-edac-pmd"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7c000000 0x0 0x200000>, + <0x0 0x1054a000 0x0 0x10>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacsoc: edacsoc at 7e930000 { + compatible = "apm,xgene-edac-soc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e930000 0x0 0x1000>, + <0x0 0x7e000000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>, + <0x0 0x27 0x4>; + }; +
Signature · 1 line
1.5.5
PATCH v5 3/4 edac: Add APM X-Gene SoC EDAC driver
This patch adds support for the APM X-Gene SoC EDAC driver. It requires ARM64 EDAC support patch [1] to compile due to dependence on MC module which calls an unused software memory scrub function.
[1] http://www.spinics.net/lists/arm-kernel/msg324093.html
--- drivers/edac/Kconfig | 9 +- drivers/edac/Makefile | 3 + drivers/edac/xgene_edac.c | 2132 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2143 insertions(+), 1 deletions(-) create mode 100644 drivers/edac/xgene_edac.c
drivers/edac/Kconfig +8 -1
@@ -10,7 +10,7 @@ config EDAC_SUPPORT menuconfig EDAC bool "EDAC (Error Detection And Correction) reporting" depends on HAS_IOMEM - depends on X86 || PPC || TILE || ARM || EDAC_SUPPORT + depends on X86 || PPC || TILE || ARM || ARM64 || EDAC_SUPPORT help EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or
@@ -376,4 +376,11 @@ config EDAC_OCTEON_PCI Support for error detection and correction on the Cavium Octeon family of SOCs. +config EDAC_XGENE + tristate "APM X-Gene SoC" + depends on EDAC_MM_EDAC && ARM64 + help + Support for error detection and correction on the + APM X-Gene family of SOCs. + endif # EDAC
drivers/edac/Makefile +3 -0
@@ -65,3 +65,6 @@ obj-$(CONFIG_EDAC_OCTEON_PC) += octeon_edac-pc.o obj-$(CONFIG_EDAC_OCTEON_L2C) += octeon_edac-l2c.o obj-$(CONFIG_EDAC_OCTEON_LMC) += octeon_edac-lmc.o obj-$(CONFIG_EDAC_OCTEON_PCI) += octeon_edac-pci.o + +obj-$(CONFIG_EDAC_XGENE) += xgene_edac.o +
drivers/edac/xgene_edac.c new file +2132 -0
2,132 lines not on this page · raw message
Signature · 1 line
1.5.5
PATCH v5 4/4 arm64: Add APM X-Gene SoC EDAC DTS entries
This patch adds APM X-Gene SoC EDAC DTS entries.
--- arch/arm64/boot/dts/apm-storm.dtsi | 98 ++++++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 0 deletions(-)
arch/arm64/boot/dts/apm-storm.dtsi +98 -0
@@ -315,6 +315,104 @@ interrupts = <0x0 0x4f 0x4>; }; + edacmc0: edacmc0 at 7e800000 { + compatible = "apm,xgene-edac-mc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e200000 0x0 0x1000>, + <0x0 0x7e700000 0x0 0x1000>, + <0x0 0x7e720000 0x0 0x1000>, + <0x0 0x7e800000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacmc1: edacmc1 at 7e840000 { + compatible = "apm,xgene-edac-mc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e200000 0x0 0x1000>, + <0x0 0x7e700000 0x0 0x1000>, + <0x0 0x7e720000 0x0 0x1000>, + <0x0 0x7e840000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacmc2: edacmc2 at 7e880000 { + compatible = "apm,xgene-edac-mc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e200000 0x0 0x1000>, + <0x0 0x7e700000 0x0 0x1000>, + <0x0 0x7e720000 0x0 0x1000>, + <0x0 0x7e880000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacmc3: edacmc3 at 7e8c0000 { + compatible = "apm,xgene-edac-mc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e200000 0x0 0x1000>, + <0x0 0x7e700000 0x0 0x1000>, + <0x0 0x7e720000 0x0 0x1000>, + <0x0 0x7e8c0000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacpmd0: edacpmd0 at 7c000000 { + compatible = "apm,xgene-edac-pmd"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7c000000 0x0 0x200000>, + <0x0 0x1054a000 0x0 0x10>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacpmd1: edacpmd1 at 7c200000 { + compatible = "apm,xgene-edac-pmd"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7c200000 0x0 0x200000>, + <0x0 0x1054a000 0x0 0x10>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacpmd2: edacpmd2 at 7c400000 { + compatible = "apm,xgene-edac-pmd"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7c400000 0x0 0x200000>, + <0x0 0x1054a000 0x0 0x10>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacpmd3: edacpmd3 at 7c600000 { + compatible = "apm,xgene-edac-pmd"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7c600000 0x0 0x200000>, + <0x0 0x1054a000 0x0 0x10>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacl3: edacl3 at 7e600000 { + compatible = "apm,xgene-edac-l3"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e600000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacsoc: edacsoc at 7e930000 { + compatible = "apm,xgene-edac-soc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e930000 0x0 0x1000>, + <0x0 0x7e000000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>, + <0x0 0x27 0x4>; + }; + phy1: phy at 1f21a000 { compatible = "apm,xgene-phy"; reg = <0x0 0x1f21a000 0x0 0x100>;
Signature · 1 line
1.5.5
PATCH v5 4/4 arm64: Add APM X-Gene SoC EDAC DTS entries
Hi Rob/Mark/Ian,
Can one of you help review the DT node?
-Loc
Quoted 120 lines · Loc Ho
This patch adds APM X-Gene SoC EDAC DTS entries.
Signed-off-by Feng Kan <[email protected]>Signed-off-by Loc Ho <[email protected]>--- arch/arm64/boot/dts/apm-storm.dtsi | 98 ++++++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 0 deletions(-)arch/arm64/boot/dts/apm-storm.dtsi +98
-1@@ -315,6 +315,104 @@ interrupts = <0x0 0x4f 0x4>; }; + edacmc0: edacmc0 at 7e800000 { + compatible = "apm,xgene-edac-mc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e200000 0x0 0x1000>, + <0x0 0x7e700000 0x0 0x1000>, + <0x0 0x7e720000 0x0 0x1000>, + <0x0 0x7e800000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacmc1: edacmc1 at 7e840000 { + compatible = "apm,xgene-edac-mc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e200000 0x0 0x1000>, + <0x0 0x7e700000 0x0 0x1000>, + <0x0 0x7e720000 0x0 0x1000>, + <0x0 0x7e840000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacmc2: edacmc2 at 7e880000 { + compatible = "apm,xgene-edac-mc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e200000 0x0 0x1000>, + <0x0 0x7e700000 0x0 0x1000>, + <0x0 0x7e720000 0x0 0x1000>, + <0x0 0x7e880000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacmc3: edacmc3 at 7e8c0000 { + compatible = "apm,xgene-edac-mc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e200000 0x0 0x1000>, + <0x0 0x7e700000 0x0 0x1000>, + <0x0 0x7e720000 0x0 0x1000>, + <0x0 0x7e8c0000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacpmd0: edacpmd0 at 7c000000 { + compatible = "apm,xgene-edac-pmd"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7c000000 0x0 0x200000>, + <0x0 0x1054a000 0x0 0x10>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacpmd1: edacpmd1 at 7c200000 { + compatible = "apm,xgene-edac-pmd"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7c200000 0x0 0x200000>, + <0x0 0x1054a000 0x0 0x10>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacpmd2: edacpmd2 at 7c400000 { + compatible = "apm,xgene-edac-pmd"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7c400000 0x0 0x200000>, + <0x0 0x1054a000 0x0 0x10>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacpmd3: edacpmd3 at 7c600000 { + compatible = "apm,xgene-edac-pmd"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7c600000 0x0 0x200000>, + <0x0 0x1054a000 0x0 0x10>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacl3: edacl3 at 7e600000 { + compatible = "apm,xgene-edac-l3"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e600000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>; + }; + + edacsoc: edacsoc at 7e930000 { + compatible = "apm,xgene-edac-soc"; + reg = <0x0 0x78800000 0x0 0x1000>, + <0x0 0x7e930000 0x0 0x1000>, + <0x0 0x7e000000 0x0 0x1000>; + interrupts = <0x0 0x20 0x4>, + <0x0 0x21 0x4>, + <0x0 0x27 0x4>; + }; + phy1: phy at 1f21a000 { compatible = "apm,xgene-phy"; reg = <0x0 0x1f21a000 0x0 0x100>; --1.5.5
PATCH v5 3/4 edac: Add APM X-Gene SoC EDAC driver
In reply to Loc HoQuoted 16 lines · Loc Ho
This patch adds support for the APM X-Gene SoC EDAC driver. It requires ARM64 EDAC support patch [1] to compile due to dependence on MC module which calls an unused software memory scrub function.
[1] http://www.spinics.net/lists/arm-kernel/msg324093.html
Signed-off-by Feng Kan <[email protected]>Signed-off-by Loc Ho <[email protected]>--- drivers/edac/Kconfig | 9 +- drivers/edac/Makefile | 3 + drivers/edac/xgene_edac.c | 2132 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2143 insertions(+), 1 deletions(-) create mode 100644 drivers/edac/xgene_edac.c
[...]
Review
Quoted 7 lines
(quoted diff) +7
-0+#ifdef CONFIG_OF +static struct of_device_id xgene_edac_mc_of_match[] = { + { .compatible = "apm,xgene-edac-mc" }, + {}, +}; +MODULE_DEVICE_TABLE(of, xgene_edac_of_match); +#endif
Something I apparently forgot to mention when I tested v3 was that I had to manually fix this up to get it to build:
drivers/edac/xgene_edac.c +1 -1
@@ -452,7 +452,7 @@ static struct of_device_id xgene_edac_mc_of_match[] = { { .compatible = "apm,xgene-edac-mc" }, {}, }; -MODULE_DEVICE_TABLE (of, xgene_edac_of_match); +MODULE_DEVICE_TABLE (of, xgene_edac_mc_of_match);#endif static struct platform_driver xgene_edac_mc_driver = {
PATCH v5 2/4 Documentation: Add documentation for the APM X-Gene SoC EDAC DTS binding
In reply to Loc HoQuoted 15 lines · Loc Ho
This patch adds documentation for the APM X-Gene SoC EDAC DTS binding.
Signed-off-by Feng Kan <[email protected]>Signed-off-by Loc Ho <[email protected]>--- .../devicetree/bindings/edac/apm-xgene-edac.txt | 83 ++++++++++++++++++++ 1 files changed, 83 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/edac/apm-xgene-edac.txtDocumentation/devicetree/bindings/edac/apm-xgene-edac.txt new file +0
-0
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt line 4
Quoted 4 lines
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt new file +4
-0@@ -0,0 +1,83 @@ +* APM X-Gene SoC EDAC nodes + +EDAC nodes are defined to describe on-chip error detection and correction. +There are four types of EDAC:
EDAC is somewhat a Linux term which makes me suspicious. Is this really how the h/w is defined (i.e. I would find "EDAC" blocks in the h/w reference manual?)?
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt line 14
Quoted 10 lines
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt new file +10
-0+ + memory controller - Memory controller + PMD (L1/L2) - Processor module unit (PMD) L1/L2 cache + L3 - CPU L3 cache + SoC - SoC IP such as SATA, Ethernet, and etc + +The following section describes the memory controller DT node binding. + +Required properties: +- compatible : Shall be "apm,xgene-edac-mc".
This is only EDAC registers or the entire memory controller? If they are truly separate and only for EDAC, then it is fine. Otherwise, you should define the actual h/w block in DT and if a block needs to hook up to multiple drivers, then that is a Linux problem in which you should use drivers/mfd or drivers/soc.
Similar question for the rest.
Rob
PATCH v5 2/4 Documentation: Add documentation for the APM X-Gene SoC EDAC DTS binding
Hi Rob,
Quoted 9 lines
Quoted 9 lines
This patch adds documentation for the APM X-Gene SoC EDAC DTS binding.
Signed-off-by Feng Kan <[email protected]>Signed-off-by Loc Ho <[email protected]>--- .../devicetree/bindings/edac/apm-xgene-edac.txt | 83 ++++++++++++++++++++ 1 files changed, 83 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
Quoted 14 lines
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt line 4
Quoted 10 lines
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt new file +4
-0@@ -0,0 +1,83 @@ +* APM X-Gene SoC EDAC nodes + +EDAC nodes are defined to describe on-chip error detection and correction. +There are four types of EDAC:EDAC is somewhat a Linux term which makes me suspicious. Is this really how the h/w is defined (i.e. I would find "EDAC" blocks in the h/w reference manual?)?
For memory controller and logically, there is such HW block in the hardware. Physical, the designer just arrange them in sequential order with other memory controller registers. For example, from offset 0x0 to 0xdc for controller registers and from 0xe0 to 0x118 for error enable and status registers, and etc. From the memory controller register used by error detection and correction, it is 0x110, 0x114, 0x314, 0x318, 0x31c, 0x320, and 0x324. All the 0x3xx repeated by an stride for 8 ranks.
For the CPU L1/L2, it has an dedicate region for error configuration and status.
For the L3, it is similar to the memory controller. it is arranged in sequential order.
For the SoC error, it has its own page (region).
Quoted 13 lines
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt line 14
Quoted 11 lines
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt new file +10
-0+ + memory controller - Memory controller + PMD (L1/L2) - Processor module unit (PMD) L1/L2 cache + L3 - CPU L3 cache + SoC - SoC IP such as SATA, Ethernet, and etc + +The following section describes the memory controller DT node binding. + +Required properties: +- compatible : Shall be "apm,xgene-edac-mc".This is only EDAC registers or the entire memory controller?
I explained them above comment. It span two segments and interleave with some controller registers.
Quoted 2 lines
If they
are truly separate and only for EDAC, then it is fine.
For CPU L1/L2, yes. For other, they are arranged sequentially span two segments.
Quoted 4 lines
Otherwise, you
should define the actual h/w block in DT and if a block needs to hook up to multiple drivers, then that is a Linux problem in which you should usedrivers/mfdordrivers/soc.
At this point, there is no other driver that accesses them. Memory controllers are only access by FW. L1/l2 controller has it own region. L3 is only configured by FW. And SoC has its own page.
I hope this provide enough info for suggestion if this still need to be changed.
-Loc
v5 cover edac: Add APM X-Gene SoC EDAC driver
In reply to Loc HoHi Rob,
Any update on the ARM64 memory scrub patch since posted v3?
-Loc
Quoted 68 lines · Loc Ho
This patch adds support for the APM X-Gene SoC EDAC driver.
v5:
* Rebase to 3.17.rc1 (next)
* Update binding documentation for additional SoC node binding resource
* Enable MCU correctable and uncorrectable interrupts if not enabled by firmware
* Enable top level interrupt only after all MCU registered. Otherwise, error interrupt will never get cleared by the corresponding MCU.
* Remove clearing of L1 and L2 errors during initialization time. Otherwise, they will not be captured between firmware booting and error configuration.
* Add capture and clearing SoC register bus errors
* Add register bus resource to SoC DT nodev4:
* Fix PMD l1/l2 error reading address due to wrong variable type
* Fix clearing of software generated and HW errors for l1/l2v3:
* Update binding documentation for PMD DT node and exampples
* Add binding documentation for SoC DT node
* Change MC, PMD, and L3C driver error injection to use debugfs
* Add missing IRQ for MC correctable error (code and DT)
* Use true/false where appropriate instead 1/0
* Add bit definition for L1 MMUESR register and fully decode this error
* Remove the un-necessary dev variable fromxgene_edac_pmd_ctxstructure
* Add check for disabled PMD (code and DT)
* Switch toedac_printkinsteadpr_err
* Some minor comments updatev2:
* Add EDAC entry inMAINTAINERSfor APM EDAC driver
* Remove the MC scrub patch
* Remove the word 'Caches' fromKconfig
* Change all MASK defines to use BIT(x)
* Update comment or remove them
* Wrap error injection code aroundCONFIG_EDAC_DEBUG
* Change function namexgene_edac_mc_hw_inittoxgene_edac_mc_irq_ctl
* Change all functionXXX_hw_inittoXXX_hw_ctl
* Fix typo 'activie'
* Move calling functionedac_mc_allocafter resource retrieval
* Check for NULL onplatform_get_resourcereturn if reference directly
* Add documentation for structxgene_edac_pmd_ctx
* Move L1 and L2 check out of functionxgene_edac_pmd_checkto its own functions
* Use for loop for configure each CPU of an PMD
* Replace /2 by >> 1
* Remove unnecessary comment onedac_device_add_devicefailure
* Makemem_err_ipstatic const
* Unwind EDAC register correctly if failed
---
Loc Ho (4):
MAINTAINERS: Add entry for APM X-Gene SoC EDAC driver
Documentation: Add documentation for the APM X-Gene SoC EDAC DTS
binding
edac: Add APM X-Gene SoC EDAC driver
arm64: Add APM X-Gene SoC EDAC DTS entries.../devicetree/bindings/edac/apm-xgene-edac.txt | 83 + MAINTAINERS | 8 + arch/arm64/boot/dts/apm-storm.dtsi | 98 + drivers/edac/Kconfig | 9 +- drivers/edac/Makefile | 3 + drivers/edac/xgene_edac.c | 2132 ++++++++++++++++++++ 6 files changed, 2332 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/edac/apm-xgene-edac.txt create mode 100644 drivers/edac/xgene_edac.c