EDAC: Add Xilinx XilSEM error monitoring driver
v5 cover EDAC: Add Xilinx XilSEM error monitoring driver
Add a driver for XilSEM (Xilinx Soft Error Mitigation) on Versal and Versal NET devices. XilSEM runs as part of the Platform Loader and Manager (PLM) on the PMC and monitors Configuration RAM (CRAM) and the NoC Programming Interface (NPI) for correctable and uncorrectable errors. The driver reports these errors to the EDAC core and provides sysfs attributes to control scans, inject CRAM errors and read status. It is a separate driver, matched through a single "xlnx,xilsem" compatible, because XilSEM is common to Versal and Versal NET. Only monolithic devices are supported.
Note on CE reporting after a bitstream reload:
The PLM clears the XilSEM RTCA, including the CE count, when a new bitstream is loaded. The driver reads the CE count to find the CEs that are new since its last report, and takes a count below the saved one as a reload. A reload is not detected if the count has already reached or passed the saved value when the callback runs, so the CEs up to the saved value are not reported, and the EDAC CE count is too low by that number. No CE is reported that did not happen. The RTCA does not indicate that a reload happened. A complete fix needs a reload counter in the RTCA, added in the XilSEM and PLM source, which the driver can compare. This driver is not changed for it.
Note on xlnx_unregister_event():xsem_edac_remove() unregisters the event and then frees its state, which is the normal sequence for an event manager client. It is only safe if xlnx_unregister_event() does not return while a callback is still running on another CPU, and the event manager does not guarantee that
today: it walks its callback list from the SGI handler without RCU or a lock. The missing wait belongs in the event manager, where one fix covers every client, so this driver is not changed. A fix in the event manager is planned. Until it lands, unbinding the driver while error events are being raised is not safe. The probe path is not affected, because the event is registered as the last step of probe.
This series contains:
- A new devicetree binding for the "xlnx,xilsem" compatible.
- The firmware (EEMI) interface and the XilSEM error event node IDs and masks.
- The EDAC driver, with its sysfs ABI documentation in the same patch.
Changes in v5:
- Moved the XilSEM binding out of the Versal DDRMC EDAC yaml into its own xilsem yaml, with a single "xlnx,xilsem" compatible.
- Moved the driver out of versal_edac.c into a separate xilsem_edac driver.
- Limited support to monolithic devices and documented it in the binding and ABI.
- Added the xlnx_unregister_event() and CE reload notes above.
- Added the L: linux-edac entry to MAINTAINERS.
Rama devi Veggalam (3):
dt-bindings: edac: Add Xilinx XilSEM
firmware: xilinx: Add XilSEM firmware interface
edac: Add Xilinx XilSEM error monitoring driver
.../ABI/testing/sysfs-devices-xilsem-edac | 188 +++++ .../devicetree/bindings/edac/xlnx,xilsem.yaml | 53 ++ MAINTAINERS | 12 + drivers/edac/Kconfig | 16 + drivers/edac/Makefile | 1 + drivers/edac/xilsem_edac.c | 859 +++++++++++++++++++++ drivers/edac/xilsem_edac.h | 131 ++++ drivers/firmware/xilinx/Makefile | 2 +- drivers/firmware/xilinx/zynqmp-sem.c | 142 ++++ drivers/soc/xilinx/xlnx_event_manager.c | 16 +- include/linux/firmware/xlnx-zynqmp-sem.h | 127 +++ include/linux/firmware/xlnx-zynqmp.h | 50 ++ 12 files changed, 1594 insertions(+), 3 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-devices-xilsem-edac create mode 100644 Documentation/devicetree/bindings/edac/xlnx,xilsem.yaml create mode 100644 drivers/edac/xilsem_edac.c create mode 100644 drivers/edac/xilsem_edac.h create mode 100644 drivers/firmware/xilinx/zynqmp-sem.c create mode 100644 include/linux/firmware/xlnx-zynqmp-sem.h
Signature · 1 line
1.9.5
PATCH v5 1/3 dt-bindings: edac: Add Xilinx XilSEM
Add a devicetree binding for the Xilinx Soft Error Mitigation (XilSEM) block on Versal and Versal NET devices.
XilSEM is part of the Platform Loader and Manager (PLM) that runs on the Platform Management Controller (PMC). It detects, and optionally corrects, soft errors in the Configuration RAM (CRAM) and the NoC programming interface (NPI) registers. Errors are reported to Linux through the firmware's event notification interface, so the node needs no interrupt property. The only resource is the register region used to read the CRAM and NPI scan status.
Only monolithic (single-SLR) devices are supported; multi-SLR devices are not covered by this binding.
Use a single compatible, xlnx,xilsem, because XilSEM is common to Versal and Versal NET devices.
---
Changes in v5:
- Moved the XilSEM binding out of the Versal DDRMC EDAC yaml into a separate xilsem yaml.
- Renamed the compatible to xlnx,xilsem, shared by Versal and Versal NET.
- Described the CRAM and NPI coverage, and why there is no interrupt property.
- Described reg as the PLM RTCA region used to read the CRAM and NPI scan status.
- Stated that only monolithic devices are supported.
Changes in v4:
- Added a new "xlnx,versal-xilsem" compatible string to the existing xlnx,versal-ddrmc-edac.yaml binding, gated via allOf/if-then so DDRMC and XilSEM requirements (reg, reg-names, interrupts) are validated independently per compatible string.
Changes in v3:
- Merged XilSEM edac with Versal Edac
Changes in v2:
- Changed "xlnx,versal-xilsem-edac" to constant
- Removed "compatible: in required section
- Removed "|" in description
- Removed "items" in compatible
- Fixed indentation in examples
- Updated title and description
--- .../devicetree/bindings/edac/xlnx,xilsem.yaml | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/edac/xlnx,xilsem.yaml
Documentation/devicetree/bindings/edac/xlnx,xilsem.yaml new file +53 -0
@@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/edac/xlnx,xilsem.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Xilinx XilSEM EDAC + +maintainers: + - Rama devi Veggalam <[email protected]> + +description: + Xilinx Soft Error Mitigation (XilSEM) is part of the Platform Loader and + Manager (PLM) which is loaded into and runs on the Platform Management + Controller (PMC) of Versal and Versal NET devices. XilSEM is responsible for + detecting and optionally correcting soft errors in Configuration RAM (CRAM) + and the NoC Programming Interface (NPI) registers. Whenever an error is + detected, be it correctable or uncorrectable, XilSEM notifies the errors to + user applications via the firmware's event notification interface, so no + interrupt property is needed. + + Only monolithic (single Super Logic Region, SLR) devices are supported. + Multi-SLR devices, built with Stacked Silicon Interconnect Technology + (SSIT), are not supported, and this node must not be used on them. + +properties: + compatible: + const: xlnx,xilsem + + reg: + items: + - description: + XilSEM region in the PLM Run-Time Configuration Area (RTCA), which + the PLM firmware updates and Linux only reads, used to read the CRAM + and NPI scan status + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + bus { + #address-cells = <2>; + #size-cells = <2>; + + edac@f2014050 { + compatible = "xlnx,xilsem"; + reg = <0x0 0xf2014050 0x0 0xc4>; + }; + };
Signature · 1 line
1.9.5
Re: [PATCH v5 1/3] dt-bindings: edac: Add Xilinx XilSEM
Quoted 14 lines · Rama devi Veggalam
Add a devicetree binding for the Xilinx Soft Error Mitigation (XilSEM) block on Versal and Versal NET devices.
XilSEM is part of the Platform Loader and Manager (PLM) that runs on the Platform Management Controller (PMC). It detects, and optionally corrects, soft errors in the Configuration RAM (CRAM) and the NoC programming interface (NPI) registers. Errors are reported to Linux through the firmware's event notification interface, so the node needs no interrupt property. The only resource is the register region used to read the CRAM and NPI scan status.
Only monolithic (single-SLR) devices are supported; multi-SLR devices are not covered by this binding.
Quoted 8 lines
Use a single compatible, xlnx,xilsem, because XilSEM is common to Versal and Versal NET devices.
Signed-off-by Rama devi Veggalam <[email protected]>---
Changes in v5:
- Moved the XilSEM binding out of the Versal DDRMC EDAC yaml into a separate xilsem yaml.
Why different directory? So not a memory controller?
Quoted 2 lines
- Renamed the compatible to xlnx,xilsem, shared by Versal and Versal NET.
Odd, you need to explain the reasons for deviating from the rules.
Best regards,
Krzysztof
PATCH v5 2/3 firmware: xilinx: Add XilSEM firmware interface
In reply to Rama devi VeggalamAdd the firmware interface used by the Xilinx Soft Error Mitigation (XilSEM) EDAC driver on Versal and Versal NET devices. XilSEM runs as part of the Platform Loader and Manager (PLM) on the Platform Management Controller (PMC) and performs Configuration RAM (CRAM) and NoC programming interface (NPI) scan and error injection operations on request from Linux.
Add zynqmp_pm_xilsem_*() wrappers for scan control, CRAM error injection, frame ECC read and configuration read. Add the XilSEM error event node IDs and masks, and update xlnx_event_manager.c to accept the new software error node ID as a valid error event on both families.
---
Changes in v5:
- Replaced the SLR ID with a reserved id argument (must be 0) in the zynqmp_pm_xilsem_*() wrappers and response structs.
- Dropped SSIT support.
- Cleared @response at the start of each zynqmp_pm_xilsem_*() wrapper, so a failed call leaves no data from an earlier call.
- Returned -EIO when the firmware reports a non-zero status, keeping the firmware's code in the response.
Changes in v4:
- Added XilSEM error-event node ID and error masks to the existing include/linux/firmware/xlnx-zynqmp.h, used to register for error event notification.
- Updated xlnx_event_manager.c to recognize the new SW_ERR node ID as a valid error event for both Versal and Versal NET.
- Added full SSIT (multi-die) support.
- Changed all firmware responses to use typed struct xsem_*_response * output parameters (7 response structs) instead of raw buffers.
- Added xsem_narrow_dma_addr() to validate and narrow coherent DMA addresses for the two calls that take a DMA buffer.
- Added NPI error injection as its own scan-control operation, CRAM error injection has its own dedicated call and is not reachable through the generic control-ops entry point.
Changes in v3:
- created separate file for Xilsem ATF EEMI calls.
Changes in v2:
- Patch created on top of dependent patch series "enhance zynqmp_pm_get_family_info()"
- Removed non-relevant SOB names in error event header files
- Updated copyright information
- Merged Versal and Versal NET error event definitions to firmware patch
--- drivers/firmware/xilinx/Makefile | 2 +- drivers/firmware/xilinx/zynqmp-sem.c | 142 +++++++++++++++++++++++++++++++ drivers/soc/xilinx/xlnx_event_manager.c | 16 +++- include/linux/firmware/xlnx-zynqmp-sem.h | 127 +++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 50 +++++++++++ 5 files changed, 334 insertions(+), 3 deletions(-) create mode 100644 drivers/firmware/xilinx/zynqmp-sem.c create mode 100644 include/linux/firmware/xlnx-zynqmp-sem.h
drivers/firmware/xilinx/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for Xilinx firmwares -obj-$(CONFIG_ZYNQMP_FIRMWARE) += zynqmp.o zynqmp-ufs.o zynqmp-crypto.o +obj-$(CONFIG_ZYNQMP_FIRMWARE) += zynqmp.o zynqmp-ufs.o zynqmp-crypto.o zynqmp-sem.o obj-$(CONFIG_ZYNQMP_FIRMWARE_DEBUG) += zynqmp-debug.o
drivers/firmware/xilinx/zynqmp-sem.c new file +142 -0
142 lines not on this page · raw message
drivers/soc/xilinx/xlnx_event_manager.c +14 -2
@@ -75,6 +75,16 @@ struct registered_event_data {struct hlist_node hentry; }; +/* +* Error-event node ids are per-family firmware IDs, packed at +* 0x28100000 + n * 0x4000. The same value names different nodes on +* different families: 0x28110000 is VERSAL_EVENT_ERROR_SW_ERR and +* VERSAL_NET_EVENT_ERROR_PSM_ERR2. Compare a node_id only inside the +* arm for the family that owns it. For this predicate the overlap does +* not change the result, because 0x28110000 is an error-event node on +* every family that defines it. The family split is required for ids +* that exist in only one table. +*/ static bool xlnx_is_error_event (const u32 node_id) {u32 pm_family_code;
@@ -85,7 +95,8 @@ static bool xlnx_is_error_event(const u32 node_id)if (node_id ==VERSAL_EVENT_ERROR_PMC_ERR1 || node_id ==VERSAL_EVENT_ERROR_PMC_ERR2 || node_id ==VERSAL_EVENT_ERROR_PSM_ERR1 || - node_id ==VERSAL_EVENT_ERROR_PSM_ERR2 ) + node_id ==VERSAL_EVENT_ERROR_PSM_ERR2 || + node_id ==VERSAL_EVENT_ERROR_SW_ERR )return true; }else if (pm_family_code ==PM_VERSAL_NET_FAMILY_CODE ) { if (node_id == VERSAL_NET_EVENT_ERROR_PMC_ERR1 ||
@@ -94,7 +105,8 @@ static bool xlnx_is_error_event(const u32 node_id) node_id ==VERSAL_NET_EVENT_ERROR_PSM_ERR1 || node_id ==VERSAL_NET_EVENT_ERROR_PSM_ERR2 || node_id ==VERSAL_NET_EVENT_ERROR_PSM_ERR3 || - node_id == VERSAL_NET_EVENT_ERROR_PSM_ERR4) + node_id ==VERSAL_NET_EVENT_ERROR_PSM_ERR4 || + node_id == VERSAL_NET_EVENT_ERROR_SW_ERR) return true; }
include/linux/firmware/xlnx-zynqmp-sem.h new file +127 -0
127 lines not on this page · raw message
include/linux/firmware/xlnx-zynqmp.h +50 -0
68 lines not on this page · raw message
Signature · 1 line
1.9.5
PATCH v5 3/3 edac: Add Xilinx XilSEM error monitoring driver
In reply to Rama devi VeggalamAdd an EDAC driver for the Xilinx Soft Error Mitigation (XilSEM) block on Versal and Versal NET devices. It reports correctable and uncorrectable CRAM and NPI errors, received through the firmware event notification interface, to the EDAC core, and provides sysfs attributes under /sys/devices/system/edac/xilsem/ to control the scans, inject CRAM errors and read the status.
Only monolithic (single-SLR) devices are supported. The driver cannot tell at probe time whether a device has more than one SLR, because the firmware interface has no query for it, so this is stated in the binding and the ABI and is not checked by the driver.
The PLM raises one event per corrected CRAM frame, which can hold up to four CEs, and it can merge events raised back to back. The driver therefore reports the CEs from the CE count register, which gives the number of new CEs, and reads their locations from the PLM log, which keeps the last seven. A bitstream reload clears the count, and the driver detects it when the new count is below the saved one. It cannot detect a reload once the count has reached the saved value, as the RTCA has no reload indicator.
The XilSEM interfaces are exposed through sysfs rather than debugfs because they are intended for runtime use on production systems and are not limited to debugging. They allow applications to initiate on-demand CRAM scans, retrieve scan status, configuration, and frame ECC information, and inject CRAM errors to verify the scan and error-reporting paths while the system is running.
The result of the most recent request is maintained per device and returned on the subsequent read of the corresponding file. Concurrent users are responsible for serializing access, as documented in the ABI file.
Add the EDAC_XILSEM Kconfig option, the Makefile entry, the ABI documentation and a MAINTAINERS entry.
---
Changes in v5:
- Made XilSEM a separate driver, xilsem_edac, instead of an additional EDAC device in versal_edac.
- Made Kconfig depend on ZYNQMP_FIRMWARE && XLNX_EVENT_MANAGER.
- Dropped the SLR ID from the sysfs output.
- Removed the duplicate command enum and unused counters and fields.
- Rejected extra values in written input, and accepted repeated spaces and tabs.
- Reported every CRAM CE since the last event, each with its own location.
- Stopped printing unused data for CRAM uncorrectable errors.
- Moved the error event registration to the end of probe.
- Updated the ABI: -EIO on firmware errors, corrected frame ECC example.
- Documented that only monolithic devices are supported, and why the interfaces use sysfs.
Changes in v4:
- Registered a second, independent EDAC device for XilSEM alongside the existing DDRMC device, under the same driver module.
- Added drivers/edac/xsem_edac.h with XilSEM register/structure definitions.
- Added xsem_edac_probe()/xsem_edac_remove() and 8 xsem_* sysfs attributes, with matching ABI docs in sysfs-devices-versal-edac (same commit).
- Updated Kconfig help text and MAINTAINERS for the new files/ maintainer.
Changes in v3:
- Merged Versal XilSem edac with Versal edac
Changes in v2:
- Patch created on top of dependent patch series "enhance zynqmp_pm_get_family_info()"
- Fixed maximum length warning in patch description
- Added details for eprobe_defer conditions
- Updated copyright information
- Removed ARCH_ZYNQMP in dependent list of XilSEM Kconfig
- Added error code for invalid versal device type
- Removed redundant sysfs details in function headers
- Included MAINTAINERS to this patch
- Added more description in commit message
- Removed print for probe success
- Removed function comments for xsem_edac_remove()
--- .../ABI/testing/sysfs-devices-xilsem-edac | 188 +++++ MAINTAINERS | 12 + drivers/edac/Kconfig | 16 + drivers/edac/Makefile | 1 + drivers/edac/xilsem_edac.c | 859 +++++++++++++++++++++ drivers/edac/xilsem_edac.h | 131 ++++ 6 files changed, 1207 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-devices-xilsem-edac create mode 100644 drivers/edac/xilsem_edac.c create mode 100644 drivers/edac/xilsem_edac.h
Documentation/ABI/testing/sysfs-devices-xilsem-edac new file +188 -0
@@ -0,0 +1,188 @@ +What: /sys/devices/system/edac/xilsem/xsem_scan_control_ops +Date: November 2026 +Contact: [email protected] +Description: + It is a read/write file. + Writing to this file causes the software to initiate a + request to the firmware for doing requested scan operation in + Configuration RAM (CRAM) or NPI of Versal and Versal NET monolithic devices. + User needs to provide the scan operation id (init, start, + stop). + Write format: <scan operation id>, in decimal or 0x-prefixed + hex. Extra values are rejected with -EINVAL. + The scan operation id values are as given below: + 1 - Initialize the scan + 2 - Start CRAM scan + 3 - Stop CRAM scan + 5 - Start NPI scan + 6 - Stop NPI scan + 7 - Inject NPI error in first descriptor + Id 4 (CRAM error injection) is reserved for the separate + xsem_cram_injecterr attribute below; writing 4, or any other value not + listed above, returns -EINVAL. + + When read, it shows the current scan status with error code. + The format is [header][error code][status word 1] + [status word 2][status word 3], where header is + (0x10300 | operation Id) and the three trailing status words + are additional firmware status data returned alongside the + error code. + The different error codes are as given below: + ========== ===== + Error Code Cause + ========== ===== + 0x0 Scan operation success + 0x1 Failure in NPI scan + 0x80 Calibration timeout + 0x2000 Internal error + 0x500000 CRAM initialization not yet done + 0x600000 Start scan failed + 0x700000 Stop scan failed + 0xF00000 Active CRC/UE error + 0x1000000 ECC/CRC error detected during calibration + ========== ===== + + Note: the result read back is that of the last command the + firmware executed for this attribute, held in state shared by + every opener of this file, not per-caller state. If the firmware + call itself fails, the stored result is cleared and reads back as + all zeros, including the header. A valid result always has a non-zero + header. A request that the driver rejects (invalid input) leaves the + previous result unchanged. Concurrent writers must serialize their + own access if they need a guaranteed request/response pairing. + A write fails with -EIO if the firmware reports an error for the + request; the error code can then be read back from this file. + +What: /sys/devices/system/edac/xilsem/xsem_cram_injecterr +Date: November 2026 +Contact: [email protected] +Description: + It is a read/write file. + Writing to this file causes the software to initiate a + request to the firmware for doing error injection in + Configuration RAM (CRAM) of Versal and Versal NET monolithic devices. + User needs to provide the location details of CRAM + (frame, qword, bit number, row number) to inject the error. + Write format: <frame> <qword> <bit number> <row number>, + space-separated, each value in decimal or 0x-prefixed hex. + Extra values are rejected with -EINVAL. + The row number must be in the range 0 to 4; a larger value returns + -EINVAL. + When read, it shows the current error injection status. The + format is [header][error code]. + Example: [0x10304][0x0] + The different error codes are as given below: + ========== ===== + Error Code Cause + ========== ===== + 0x0 Error injection success + 0x2000 Internal NULL pointer error + 0x500000 CRAM initialization not yet done + 0x800000 Invalid row + 0x900000 Invalid qword + 0xA00000 Invalid bit + 0xB00000 Invalid frame address + 0xC00000 Unexpected bits flipped + 0xD00000 Masked bit + 0xE00000 Invalid block type + 0xF00000 Active CRC/UE error in CRAM + ========== ===== + + Note: the result read back is that of the last command the + firmware executed for this attribute, held in state shared by + every opener of this file, not per-caller state. If the firmware + call itself fails, the stored result is cleared and reads back as + all zeros, including the header. A valid result always has a non-zero + header. A request that the driver rejects (invalid input) leaves the + previous result unchanged. Concurrent writers must serialize their + own access if they need a guaranteed request/response pairing. + A write fails with -EIO if the firmware reports an error for the + request; the error code can then be read back from this file. + +What: /sys/devices/system/edac/xilsem/xsem_cram_framecc_read +Date: November 2026 +Contact: [email protected] +Description: + It is a read/write file. + Writing to this file causes the software to initiate a + request to the firmware for reading frame ECC values in + Configuration RAM (CRAM) of Versal and Versal NET monolithic devices. + User needs to provide the location details of CRAM + (frame, row number) to read the ECC values. + Write format: <frame> <row number>, space-separated, each + value in decimal or 0x-prefixed hex. Extra values are rejected with + -EINVAL. + The row number must be in the range 0 to 4; a larger value returns + -EINVAL. + When read, it shows the ECC values for the requested frame. + The format is <header> <ECC_0> <ECC_1> <status> + Example: + Read Frame ECC Cmd: [0x3030b] + Frame ECC Word_0: [0x52f245] + Frame ECC Word_1: [0x7c5a6b] + Cmd Status: [0x0] + + Note: the result read back is that of the last command the + firmware executed for this attribute, held in state shared by + every opener of this file, not per-caller state. If the firmware + call itself fails, the stored result is cleared and reads back as + all zeros, including the header. A valid result always has a non-zero + header. A request that the driver rejects (invalid input) leaves the + previous result unchanged. Concurrent writers must serialize their + own access if they need a guaranteed request/response pairing. + A write fails with -EIO if the firmware reports an error for the + request; the error code can then be read back from this file. + +What: /sys/devices/system/edac/xilsem/xsem_read_config +Date: November 2026 +Contact: [email protected] +Description: + It is a read/write file. + Writing to this file causes the software to initiate a + request to the firmware for reading Xilsem configuration. + Any value written triggers the read; the value is ignored. + When read, it shows the CRAM and NPI scan configuration. + The format is <header> <CRAM config> <NPI config> <status> + Example: Read Config Cmd: [0x30309] + CRAM Scan Config: [0x2e] + NPI Scan Config: [0x5016] + Cmd Status: [0x0] + + Note: the result read back is that of the last command the + firmware executed for this attribute, held in state shared by + every opener of this file, not per-caller state. If the firmware + call itself fails, the stored result is cleared and reads back as + all zeros, including the header. A valid result always has a non-zero + header. A request that the driver rejects (invalid input) leaves the + previous result unchanged. Concurrent writers must serialize their + own access if they need a guaranteed request/response pairing. + A write fails with -EIO if the firmware reports an error for the + request; the error code can then be read back from this file. + +What: /sys/devices/system/edac/xilsem/xsem_read_status +Date: November 2026 +Contact: [email protected] +Description: + It is a read/write file. + Writing to this file causes the software to initiate a + request to read the Xilsem status. User needs to provide + the module id for status. The module id values are as given below: + 1 - CRAM scan + 2 - NPI scan + Write format: <module id>, in decimal or 0x-prefixed hex. Any other + value returns -EINVAL. + When read, it shows the status of the requested module. The + format is always [value 0][value 1][value 2]. + For CRAM: value 0 is status, value 1 is CE count, value 2 is + always 0 (unused for this module). + Example: [0x10005][0x0][0x0] + For NPI: value 0 is status, value 1 is scan count, value 2 is + heartbeat count. + Example: [0xA01][0x10][0x1] + + Note: the result read back is that of the last status read for this + attribute, held in state shared by every opener of this file, not + per-caller state. A request that the driver rejects (invalid module + id) leaves the previous result unchanged. Concurrent writers must + serialize their own access if they need a guaranteed + request/response pairing.
MAINTAINERS +12 -0
@@ -30817,6 +30817,18 @@ F: drivers/dma/xilinx/xdma.c F: include/linux/dma/amd_xdma.h F: include/linux/platform_data/amd_xdma.h +XILINX XILSEM EDAC DRIVER +M: Rama devi Veggalam <[email protected]> +R: Radhey Shyam Pandey <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/ABI/testing/sysfs-devices-xilsem-edac +F: Documentation/devicetree/bindings/edac/xlnx,xilsem.yaml +F: drivers/edac/xilsem_edac.c +F: drivers/edac/xilsem_edac.h +F: drivers/firmware/xilinx/zynqmp-sem.c +F: include/linux/firmware/xlnx-zynqmp-sem.h + XILINX ZYNQMP DPDMA DRIVER M: Laurent Pinchart <[email protected]> L: [email protected]
drivers/edac/Kconfig +16 -0
@@ -569,6 +569,22 @@ config EDAC_VERSAL Support injecting both correctable and uncorrectable errors for debugging purposes. +config EDAC_XILSEM + tristate "Xilinx XilSEM (Soft Error Mitigation)" + depends on (ZYNQMP_FIRMWARE && XLNX_EVENT_MANAGER) || COMPILE_TEST + help + Support for monitoring the XilSEM (Soft Error Mitigation) soft-error + detection and correction block on Xilinx Versal and Versal NET, which covers + configuration memory in the programmable logic (PL) fabric and the + NoC Programming Interface (NPI) interconnect. + + Report correctable and uncorrectable CRAM and NPI errors, and + support injecting both error types, which user applications can use + to run on-demand CRAM scan tests and which also help with debugging. + + Only monolithic Versal and Versal NET devices are supported; + multi-SLR (SSIT) devices are not. + config EDAC_LOONGSON tristate "Loongson Memory Controller" depends on LOONGARCH && ACPI
drivers/edac/Makefile +1 -0
@@ -90,6 +90,7 @@ obj-$(CONFIG_EDAC_DMC520) += dmc520_edac.o obj-$(CONFIG_EDAC_NPCM) += npcm_edac.o obj-$(CONFIG_EDAC_ZYNQMP) += zynqmp_edac.o obj-$(CONFIG_EDAC_VERSAL) += versal_edac.o +obj-$(CONFIG_EDAC_XILSEM) += xilsem_edac.o obj-$(CONFIG_EDAC_LOONGSON) += loongson_edac.o obj-$(CONFIG_EDAC_VERSALNET) += versalnet_edac.o obj-$(CONFIG_EDAC_CORTEX_A72) += a72_edac.o
drivers/edac/xilsem_edac.c new file +859 -0
859 lines not on this page · raw message
drivers/edac/xilsem_edac.h new file +131 -0
131 lines not on this page · raw message
Signature · 1 line
1.9.5
Quoted 50 lines · Rama devi Veggalam
Add a driver for XilSEM (Xilinx Soft Error Mitigation) on Versal and Versal NET devices. XilSEM runs as part of the Platform Loader and Manager (PLM) on the PMC and monitors Configuration RAM (CRAM) and the NoC Programming Interface (NPI) for correctable and uncorrectable errors. The driver reports these errors to the EDAC core and provides sysfs attributes to control scans, inject CRAM errors and read status. It is a separate driver, matched through a single "xlnx,xilsem" compatible, because XilSEM is common to Versal and Versal NET. Only monolithic devices are supported.
Note on CE reporting after a bitstream reload:
The PLM clears the XilSEM RTCA, including the CE count, when a new bitstream is loaded. The driver reads the CE count to find the CEs that are new since its last report, and takes a count below the saved one as a reload. A reload is not detected if the count has already reached or passed the saved value when the callback runs, so the CEs up to the saved value are not reported, and the EDAC CE count is too low by that number. No CE is reported that did not happen. The RTCA does not indicate that a reload happened. A complete fix needs a reload counter in the RTCA, added in the XilSEM and PLM source, which the driver can compare. This driver is not changed for it.Note on
xlnx_unregister_event():xsem_edac_remove()unregisters the event and then frees its state, which is the normal sequence for an event manager client. It is only safe ifxlnx_unregister_event()does not return while a callback is still running on another CPU, and the event manager does not guarantee that
today: it walks its callback list from the SGI handler without RCU or a lock. The missing wait belongs in the event manager, where one fix covers every client, so this driver is not changed. A fix in the event manager is planned. Until it lands, unbinding the driver while error events are being raised is not safe. The probe path is not affected, because the event is registered as the last step of probe.This series contains:
- A new devicetree binding for the "xlnx,xilsem" compatible.
- The firmware (EEMI) interface and the XilSEM error event node IDs and masks.
- The EDAC driver, with its sysfs ABI documentation in the same patch.Changes in v5:
- Moved the XilSEM binding out of the Versal DDRMC EDAC yaml into its own xilsem yaml, with a single "xlnx,xilsem" compatible.
- Moved the driver out ofversal_edac.cinto a separatexilsem_edacdriver.
- Limited support to monolithic devices and documented it in the binding and ABI.
- Added thexlnx_unregister_event()and CE reload notes above.
- Added the L: linux-edac entry toMAINTAINERS.
Quoted 5 lines
Rama devi Veggalam (3):
dt-bindings: edac: Add Xilinx XilSEM
firmware: xilinx: Add XilSEM firmware interface
edac: Add Xilinx XilSEM error monitoring driver
Hi Rama,
Did you look into the "platform driver" idea?
If so, how did it compare to this DT solution?
Thanks,
Yazen