From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.85.39 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796206499; b=w9/AvU/XSJGyPWQADF1TLvzqHS6JnUTPfR556szkjvWVh1K5PW/vjMHtj0UgEocVbWIC DWgVs3wCp9PsDEFscNFjEWDaqg84gnsx5H/x7yd3s70b3/hjJ8eMM6Gbhr2FIg3inTewr Ea9RfY63svYtFwjSDLiHew+SVkw2DGHKM1AP/Yzcx2sT/u+C6vWhTZbISzrMeziRj/6GW HqKLQTVcKJGOf7n9L1R9bsMMO6G6GMqQCMwx390JJ16lEzvY7aoohFm4cW3kyWhVtG9Ql jr/tV/M8ujUX/6FAiu59szLibicRzE2hdU4argBwNRtQ/OMwKTgxpXI40JNJgHzX9Qg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796206499; h=DMARC-Filter:DKIM-Signature:Received:Received:Message-ID:Date: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-ClientProxiedBy:MIME-Version: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-LD-Processed: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=rVz9yXGJMJn0ewaIgAnYHqWWmL3TC713oCgYr5heZiU=; b=QvfneU6mX0U/VK7ZyX7Ej+BBoI/OTo8pHnqs4hJx+nx/WV20lH/jgjXIhjvIJOwRoM6H hnf/bDA84pGTclakROnK08EEmMw/mVtuwxuNJoh7W92XTT/d75EBsLzfb9kTl2chd3oeV E203Gy8sEt2gMxBlX02reGgpSEfl9R+KEJYZkP10Mt453SBGnvd3ldfmxcaBBO7aDhhVM eEvyV6/SPrbJdksIKEdWKGLiPZl3EJyhX34NQh1n7De+ZtZFfc35q/Snrj7VpTt5/Jt3m 7gXhrBYsR5s7Tqr4Af0mssvAN4Zzq0arMRVbfPNiNFzHtRIvyPu298skYO1bq7QhwYw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=bY9yP8oQ; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.85.39 Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazon11010039.outbound.protection.outlook.com [52.101.85.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CDF5606A322; Wed, 2 Dec 2026 10:14:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2CDF5606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=bY9yP8oQ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mio/ta7OnB/cjpQmAh+KaSHTrCPpF3XVs6dMf/hCOV1amaBfnW4t7+OCyd8tOoH7hLw0EKPHUJXEGlWy/WpkJarClpIB9HcoLYzbW3mAU4z8TSfuGfEhFnP9unmeq5hjuwKFUAbtehKV+Wzf6Wabc5G35Ma705YXoPZtLEZsMgx9qKDbSKhZxxLmbOs++mQhJJ+gLyfGw2C+7c1iojRtgw62NjP+ppNSWRD93T7MbdGxZ2jTW3LbG6bPH+XI44LBTrfsmnoxGa7WLdACHiqnNsVSv6ZTiUAwwbijPyQ3XGS27qE79CxR4E/NP0bL2y4blu8GA+400WkBanBuP+rFFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rVz9yXGJMJn0ewaIgAnYHqWWmL3TC713oCgYr5heZiU=; b=wK8ZChUkkmBYu5PqYMw2Zo80+VFR+aozYlwFWT4q2rNv4Eb1ia/XyTwuYd6Kv0XEqhvADGnucMGfXGl3htOm1j8bjv5aVZtXOJGIkG1UqtxNxBidgagAqDkkI0FKsv0A2qdlwvzIK4a6TUAUURWU02jdZX9HsbqqRnh2RiAY9xvn+lVKEhVBcKZoUX+91qgwEBlI8M4uUn1mKAyTXSTms5bElpR72viVaXmmQMKhm6Ue3Vlx9OZ8b28XNlArZg8ItbtbNyGKY6c6ovapqG899VCcTFAYQOenbW/7MHPxPrhPTsvkK9RCn2yQTKjbE4PAYVOxDgiZkHhDPbsLMUYbFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rVz9yXGJMJn0ewaIgAnYHqWWmL3TC713oCgYr5heZiU=; b=bY9yP8oQfAGhe62WHFKUMWTTI6uPlTG85TyeqmikJuHEFYtZ4s4z7yjga5sMHBg6avXFQQyvtegN2oUw+oYcxsBDU7aUF9nniJrXlYetWrBf+FMrLKYNjbank13HvmLD0ovZbeisk1BDyc3HzJNTL5JmK0OFKQqep2h9uziH6Mg= Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CY1PR12MB9697.namprd12.prod.outlook.com (2603:10b6:930:107::6) by SJ2PR12MB8064.namprd12.prod.outlook.com (2603:10b6:a03:4cc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Wed, 2 Dec 2026 10:14:53 +0000 Received: from CY1PR12MB9697.namprd12.prod.outlook.com ([fe80::3a41:55a0:8203:596d]) by CY1PR12MB9697.namprd12.prod.outlook.com ([fe80::3a41:55a0:8203:596d%4]) with mapi id 15.21.0688.009; Wed, 2 Dec 2026 10:14:53 +0000 Message-ID: <85f55d39-e95f-4fa6-8725-6f3c8f16be46@amd.com> Date: Wed, 2 Dec 2026 15:44:45 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 2/3] firmware: xilinx: Add XilSEM firmware interface To: Rama devi Veggalam , bp@alien8.de, tony.luck@intel.com, michal.simek@amd.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, devicetree@vger.kernel.org, james.morse@arm.com, mchehab@kernel.org, rric@kernel.org, git@amd.com References: <1795313124-2138932-1-git-send-email-rama.devi.veggalam@amd.com> <1795313124-2138932-3-git-send-email-rama.devi.veggalam@amd.com> Content-Language: en-US From: "Pandey, Radhey Shyam" In-Reply-To: <1795313124-2138932-3-git-send-email-rama.devi.veggalam@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PNYP287CA0094.INDP287.PROD.OUTLOOK.COM (2603:1096:c01:2b8::10) To CY1PR12MB9697.namprd12.prod.outlook.com (2603:10b6:930:107::6) X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR12MB9697:EE_|SJ2PR12MB8064:EE_ X-MS-Office365-Filtering-Correlation-Id: faf78e5e-f2c2-451b-1fba-08df505d1b69 X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|23010399003|366016|7416014|1800799024|11063799006|5023799004|4143699003|6133799003|22082099003|18002099003|3023799007|10067099003|56012099006|261026140227099003|261026121527099003|261102123227099003|261026130827099003|261028144727099003|261026135527099003|261021133027099003|261022105027099003|261009223027099003|261022113327099003|261021121427099003|261022075727099003|261021130227099003|261021135927099003|261022115727099003|261021123027099003|261102130727099003; X-Microsoft-Antispam-Message-Info: AfAJLeZkQFsjR7BsR+m53tPqbAz8pntbce+KKoOXcfnly4kjLXhVNsP4a2psWn28/U+wSfQxV674pIUTxN/1YuaN9bqGekZNsPdO6VeDSwxld5UyYNmmnfg/wQnekUaudglhCSbLgVPIc8twff9V2G4c0mee6r75DcrJbUlHX+fTyaM/z8OZUu6U7BL4htQEGG5sziDbkXHHGKCjhCTtdFBFybcGSRfKy++Sj13CKAp9ePaqGQkoPmjxIFqU+22+g+vBWGMnxqdxdNAxfi6DX/4KrKdNXLTTN+TLFwoQubMH2XfPfWZUpQean9mR6Nck/Rui4/smF2UenyGJVGCXml7tl7eD6oHeQZ0N3T9T1VjztLxoscF836FRKyk1OxIy2YRqUDdIMPbkMDcc0absm5+7DcV3QKSmcWPLfu1ZX6aO7weuwu5odH14OeNcNlv9+Wgp7jEdxZ0kA4aqUogqdUw1V6fcfcwDT/PRf49cBwvPniOiZNQ9+7wWzZP7RwULczT+XvB0l7e0J/FXl7FuQRRXDFdylLYfLbsvn5um6hpi2Dgna/tXnJpj4OZh8mlUkYGvnJTjQKnal6blcT+1qSE4bkDTyc2RTZf0A//kx/qwW7e6ypONqDq2imX+C1kqQ+TBr25v8psdOj4/85GMWntB+GeP/+YH7sg1gvDZ91Y= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY1PR12MB9697.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(366016)(7416014)(1800799024)(11063799006)(5023799004)(4143699003)(6133799003)(22082099003)(18002099003)(3023799007)(10067099003)(56012099006)(261026140227099003)(261026121527099003)(261102123227099003)(261026130827099003)(261028144727099003)(261026135527099003)(261021133027099003)(261022105027099003)(261009223027099003)(261022113327099003)(261021121427099003)(261022075727099003)(261021130227099003)(261021135927099003)(261022115727099003)(261021123027099003)(261102130727099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SUswU3YxS21JQ0hQTTY2RXZudytWd0RxK2ZHd28xZDVrcmFlV1ZaR2p3NXlM?= =?utf-8?B?QUFPbm00WmY3cDNSem9PdkczNEMydjkvYmV6UnlYQnhHY29DUU16VkNzQ255?= =?utf-8?B?MWNEQ0Q3Y3ZrNFZTdE9TU3RvSk43Z2tSbGFrNG1ZOUQxczZNZFhsTGxEcTJ4?= =?utf-8?B?azY4T3hlTnM4dGNGRUZhTTJMdGdEckdBK1RsMFk4NUJPR2N5QXdEYXdEVXUr?= =?utf-8?B?S2lmUmR5d2NvK2diT2JETlNVejFK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VTMx?= =?utf-8?B?RmtqU2MzNis5WkRqSG90bzB0emt4T2tPZm1sRjJpcVlvZXI1NDJCckJsZGNz?= =?utf-8?B?aE1UOXpZNWt6ZElUbHNZNXhDbmQyK0tWNUxTOWo1b2libzBKMDdRbVFTUXI4?= =?utf-8?B?Njh0c04xNkgxcktQQzBPbURSUWwxdDdoNktpUk41SWVOaWF6Z3pWUkwzUzh3?= =?utf-8?B?b2hJNFoza0xWTEY1aGlraGxFc090dDhMYkJZbWxVRUQ5TytOVC9JT0lRUFVI?= =?utf-8?Q?l6zF+qJrNwwdMyph+J?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: faf78e5e-f2c2-451b-1fba-08df505d1b69 X-MS-Exchange-CrossTenant-AuthSource: CY1PR12MB9697.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 10:14:53.3604 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VAllprrjOJ+Q3wpLNRX54PI4RKfC9QKq7fGN4Iz6iAbzYwDrvT/gLbf39K0Nei98 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8064 On 11/22/2026 7:35 AM, Rama devi Veggalam wrote: > Add 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. > > Signed-off-by: Rama devi Veggalam > --- > 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 > > diff --git a/drivers/firmware/xilinx/Makefile b/drivers/firmware/xilinx/Makefile > index 8db0e66..a71919a 100644 > --- a/drivers/firmware/xilinx/Makefile > +++ b/drivers/firmware/xilinx/Makefile > @@ -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 > diff --git a/drivers/firmware/xilinx/zynqmp-sem.c b/drivers/firmware/xilinx/zynqmp-sem.c > new file mode 100644 > index 0000000..ae73864 > --- /dev/null > +++ b/drivers/firmware/xilinx/zynqmp-sem.c > @@ -0,0 +1,142 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Firmware layer for XilSEM APIs. > + * > + * Copyright (C), 2026 Advanced Micro Devices, Inc. > + */ > + > +#include > +#include > +#include > +#include > + > +/** > + * zynqmp_pm_xilsem_cntrl_ops - PM call to perform XilSEM operations > + * @cmd: Command for XilSEM scan control operations > + * @id: Reserved for future use, must be 0 > + * @response: Output response > + * > + * Return: 0 on success, -EIO on a non-zero firmware status, or another > + * negative errno. @response is left unchanged if @cmd is invalid. Trim this description. > + * Otherwise it is cleared first and filled once the firmware call > + * completes (return value 0 or -EIO). > + */ > +int zynqmp_pm_xilsem_cntrl_ops(u32 cmd, u32 id, struct xsem_cntrl_ops_response *response) > +{ > + u32 ret_buf[PAYLOAD_ARG_CNT]; > + int ret; > + > + switch (cmd) { > + case PM_XSEM_CRAM_INIT_SCAN: > + case PM_XSEM_CRAM_START_SCAN: > + case PM_XSEM_CRAM_STOP_SCAN: > + case PM_XSEM_NPI_START_SCAN: > + case PM_XSEM_NPI_STOP_SCAN: > + case PM_XSEM_NPI_ERR_INJECT: > + break; > + default: > + return -EINVAL; > + } > + > + memset(response, 0, sizeof(*response)); > + > + ret = zynqmp_pm_invoke_fn(PM_XSEM_HEADER | cmd, ret_buf, 1, id); > + if (ret) > + return ret; > + > + memcpy(response, &ret_buf[1], sizeof(*response)); > + > + /* The call completed, but the firmware may report a failure in the response */ > + return response->status ? -EIO : 0; > +} > +EXPORT_SYMBOL_GPL(zynqmp_pm_xilsem_cntrl_ops); > + > +/** > + * zynqmp_pm_xilsem_cram_err_inj - PM call to perform CRAM error injection > + * @id: Reserved for future use, must be 0 > + * @frame: Frame number to be used for error injection > + * @qword: Word number to be used for error injection > + * @bit: Bit location to be used for error injection > + * @row: CFRAME row number to be used for error injection Avoid redundant - "to be used for error injection" > + * @response: Output response > + * > + * Return: 0 on success, -EIO on a non-zero firmware status, or another > + * negative errno. @response is cleared first and filled once the > + * firmware call completes (return value 0 or -EIO). > + */ Trim return description. > +int zynqmp_pm_xilsem_cram_err_inj(u32 id, u32 frame, u32 qword, u32 bit, u32 row, > + struct xsem_cram_errinj_response *response) > +{ > + u32 ret_buf[PAYLOAD_ARG_CNT]; > + int ret; > + > + memset(response, 0, sizeof(*response)); > + > + ret = zynqmp_pm_invoke_fn(PM_XSEM_CRAM_ERRINJ, ret_buf, 5, id, frame, qword, > + bit, row); > + if (ret) > + return ret; > + > + memcpy(response, &ret_buf[1], sizeof(*response)); > + > + /* The call completed, but the firmware may report a failure in the response */ This comment is not really neeeded. Same for later occurences. > + return response->status ? -EIO : 0; > +} > +EXPORT_SYMBOL_GPL(zynqmp_pm_xilsem_cram_err_inj); > + > +/** > + * zynqmp_pm_xilsem_cram_read_ecc - PM call to perform CFRAME ECC read > + * @id: Reserved for future use, must be 0 > + * @frame: Frame number to be used for reading ECC > + * @row: CFRAME row number to be used for reading ECC > + * @response: Output response > + * > + * Return: 0 on success, -EIO on a non-zero firmware status, or another > + * negative errno. @response is cleared first and filled once the > + * firmware call completes (return value 0 or -EIO). > + */ > +int zynqmp_pm_xilsem_cram_read_ecc(u32 id, u32 frame, u32 row, > + struct xsem_cram_readecc_response *response) > +{ > + u32 ret_buf[PAYLOAD_ARG_CNT]; > + int ret; > + > + memset(response, 0, sizeof(*response)); > + > + ret = zynqmp_pm_invoke_fn(PM_XSEM_CRAM_RD_ECC, ret_buf, 3, id, frame, row); > + if (ret) > + return ret; > + > + memcpy(response, &ret_buf[1], sizeof(*response)); > + > + /* The call completed, but the firmware may report a failure in the response */ > + return response->status ? -EIO : 0; > +} > +EXPORT_SYMBOL_GPL(zynqmp_pm_xilsem_cram_read_ecc); > + > +/** > + * zynqmp_pm_xilsem_read_cfg - PM call to perform Xilsem configuration read > + * @id: Reserved for future use, must be 0 > + * @response: Output response > + * > + * Return: 0 on success, -EIO on a non-zero firmware status, or another > + * negative errno. @response is cleared first and filled once the > + * firmware call completes (return value 0 or -EIO). > + */ > +int zynqmp_pm_xilsem_read_cfg(u32 id, struct xsem_read_cfg_response *response) > +{ > + u32 ret_buf[PAYLOAD_ARG_CNT]; > + int ret; > + > + memset(response, 0, sizeof(*response)); > + > + ret = zynqmp_pm_invoke_fn(PM_XSEM_RD_CONFIG, ret_buf, 1, id); > + if (ret) > + return ret; > + > + memcpy(response, &ret_buf[1], sizeof(*response)); > + > + /* The call completed, but the firmware may report a failure in the response */ > + return response->status ? -EIO : 0; > +} > +EXPORT_SYMBOL_GPL(zynqmp_pm_xilsem_read_cfg); > diff --git a/drivers/soc/xilinx/xlnx_event_manager.c b/drivers/soc/xilinx/xlnx_event_manager.c > index f733dc4..d832ee6 100644 > --- a/drivers/soc/xilinx/xlnx_event_manager.c > +++ b/drivers/soc/xilinx/xlnx_event_manager.c > @@ -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; > } > > diff --git a/include/linux/firmware/xlnx-zynqmp-sem.h b/include/linux/firmware/xlnx-zynqmp-sem.h > new file mode 100644 > index 0000000..9e703ae > --- /dev/null > +++ b/include/linux/firmware/xlnx-zynqmp-sem.h > @@ -0,0 +1,127 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Firmware layer for XilSEM APIs. > + * > + * Copyright (C), 2026 Advanced Micro Devices, Inc. > + */ > + > +#ifndef __FIRMWARE_ZYNQMP_SEM_H__ > +#define __FIRMWARE_ZYNQMP_SEM_H__ > + > +#include > +#include > + > +/* XilSEM commands */ > +#define PM_XSEM_HEADER 0x300 > +#define PM_XSEM_CRAM_ERRINJ 0x304 > +#define PM_XSEM_RD_CONFIG 0x309 > +#define PM_XSEM_CRAM_RD_ECC 0x30B The inconsistency. Within the one new header, the module prefix is expressed two different ways: #define PM_XSEM_HEADER 0x300 /* prefix, ORed at the call site */ #define PM_XSEM_CRAM_ERRINJ 0x304 /* prefix baked in */ #define PM_XSEM_RD_CONFIG 0x309 /* prefix baked in */ #define PM_XSEM_CRAM_RD_ECC 0x30B /* prefix baked in */ enum pm_xsem_cntrl_op { PM_XSEM_CRAM_INIT_SCAN = 1, /* bare, prefix added later */ ... }; Better to define all nine commands as bare IDs and apply the module prefix in one place: #define PM_XSEM_API(id) (FIELD_PREP(MODULE_ID_MASK, XSEM_MODULE_ID) | (id)) #define PM_XSEM_CRAM_ERRINJ 4 #define PM_XSEM_RD_CONFIG 9 #define PM_XSEM_CRAM_RD_ECC 0xB > + > +/* > + * Valid cmd values for zynqmp_pm_xilsem_cntrl_ops(). CRAM error injection > + * has its own dedicated firmware call (zynqmp_pm_xilsem_cram_err_inj()) and > + * must not be reachable through this generic entry point, so it is > + * deliberately not a member of this enum. Don't define the implementation here. > + */ > +enum pm_xsem_cntrl_op { > + PM_XSEM_CRAM_INIT_SCAN = 1, > + PM_XSEM_CRAM_START_SCAN = 2, > + PM_XSEM_CRAM_STOP_SCAN = 3, > + PM_XSEM_NPI_START_SCAN = 5, > + PM_XSEM_NPI_STOP_SCAN = 6, > + PM_XSEM_NPI_ERR_INJECT = 7, > +}; > + > +/** > + * struct xsem_cntrl_ops_response - Response to zynqmp_pm_xilsem_cntrl_ops() > + * @hdr: Command header > + * @status: Error code or status, non-zero if the firmware reported a failure > + * @id: Reserved for future use > + * @status1: Reserved for future use > + * @status2: Reserved for future use > + * @status3: Reserved for future use Say : Reserved > + */ > +struct xsem_cntrl_ops_response { > + u32 hdr; > + u32 status; > + u32 id; > + u32 status1; > + u32 status2; > + u32 status3; > +}; > + > +/** > + * struct xsem_cram_errinj_response - Response to zynqmp_pm_xilsem_cram_err_inj() > + * @hdr: Command header > + * @status: Error code or status, non-zero if the firmware reported a failure > + * @id: Reserved for future use > + */ > +struct xsem_cram_errinj_response { > + u32 hdr; > + u32 status; > + u32 id; > +}; > + > +/** > + * struct xsem_cram_readecc_response - Response to zynqmp_pm_xilsem_cram_read_ecc() > + * @hdr: Frame ECC read command header > + * @ecc0: First ECC word > + * @ecc1: Second ECC word > + * @status: Status, non-zero if the firmware reported a failure > + */ > +struct xsem_cram_readecc_response { > + u32 hdr; > + u32 ecc0; > + u32 ecc1; > + u32 status; > +}; > + > +/** > + * struct xsem_read_cfg_response - Response to zynqmp_pm_xilsem_read_cfg() > + * @hdr: Config read command header > + * @cram_cfg: CRAM scan configuration > + * @npi_cfg: NPI scan configuration > + * @status: Status, non-zero if the firmware reported a failure > + */ > +struct xsem_read_cfg_response { > + u32 hdr; > + u32 cram_cfg; > + u32 npi_cfg; > + u32 status; > +}; > + > +#if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE) > +int zynqmp_pm_xilsem_cntrl_ops(u32 cmd, u32 id, struct xsem_cntrl_ops_response *response); > +int zynqmp_pm_xilsem_cram_err_inj(u32 id, u32 frame, u32 qword, u32 bit, u32 row, > + struct xsem_cram_errinj_response *response); > +int zynqmp_pm_xilsem_cram_read_ecc(u32 id, u32 frame, u32 row, > + struct xsem_cram_readecc_response *response); > +int zynqmp_pm_xilsem_read_cfg(u32 id, struct xsem_read_cfg_response *response); > +#else > +static inline int zynqmp_pm_xilsem_cntrl_ops(u32 cmd, u32 id, > + struct xsem_cntrl_ops_response *response) > +{ > + return -ENODEV; > +} > + > +static inline int zynqmp_pm_xilsem_cram_err_inj(u32 id, u32 frame, u32 qword, u32 bit, > + u32 row, > + struct xsem_cram_errinj_response *response) > +{ > + return -ENODEV; > +} > + > +static inline int zynqmp_pm_xilsem_cram_read_ecc(u32 id, u32 frame, u32 row, > + struct xsem_cram_readecc_response *response) > +{ > + return -ENODEV; > +} > + > +static inline int zynqmp_pm_xilsem_read_cfg(u32 id, > + struct xsem_read_cfg_response *response) > +{ > + return -ENODEV; > +} > +#endif > + > +#endif /* __FIRMWARE_ZYNQMP_SEM_H__ */ > diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h > index 41a1cd8..2d64b02 100644 > --- a/include/linux/firmware/xlnx-zynqmp.h > +++ b/include/linux/firmware/xlnx-zynqmp.h > @@ -121,6 +121,12 @@ > #define VERSAL_EVENT_ERROR_PMC_ERR2 (0x28104000U) > #define VERSAL_EVENT_ERROR_PSM_ERR1 (0x28108000U) > #define VERSAL_EVENT_ERROR_PSM_ERR2 (0x2810C000U) > +/* > + * SW Error Event Node Id (0x4000 stride from PSM_ERR2 above). This > + * value coincidentally equals VERSAL_NET_EVENT_ERROR_PSM_ERR2 below - > + * harmless, since each family's node IDs are an independent sequence. > + */ > +#define VERSAL_EVENT_ERROR_SW_ERR (0x28110000U) > > #define VERSAL_NET_EVENT_ERROR_PMC_ERR1 (0x28100000U) > #define VERSAL_NET_EVENT_ERROR_PMC_ERR2 (0x28104000U) > @@ -129,6 +135,8 @@ > #define VERSAL_NET_EVENT_ERROR_PSM_ERR2 (0x28110000U) > #define VERSAL_NET_EVENT_ERROR_PSM_ERR3 (0x28114000U) > #define VERSAL_NET_EVENT_ERROR_PSM_ERR4 (0x28118000U) > +/* SW Error Event Node Id */ > +#define VERSAL_NET_EVENT_ERROR_SW_ERR (0x2811C000U) > > /* ZynqMP SD tap delay tuning */ > #define SD_ITAPDLY 0xFF180314 > @@ -146,6 +154,48 @@ > #define XPM_EVENT_ERROR_MASK_NOC_NCR BIT(13) > #define XPM_EVENT_ERROR_MASK_NOC_CR BIT(12) > > +/* > + * XPM_VERSAL_EVENT_ERROR_MASK_XSEM_CRAM_CE_5: Error event mask for handling > + * correctable error in Versal Configuration RAM which is reported by > + * Soft Error Mitigation (XilSEM). > + */ > +#define XPM_VERSAL_EVENT_ERROR_MASK_XSEM_CRAM_CE_5 BIT(5) > + > +/* > + * XPM_VERSAL_EVENT_ERROR_MASK_XSEM_CRAM_UE_6: Error event mask for handling > + * uncorrectable error in Versal Configuration RAM which is reported by > + * Soft Error Mitigation (XilSEM). > + */ > +#define XPM_VERSAL_EVENT_ERROR_MASK_XSEM_CRAM_UE_6 BIT(6) > + > +/* > + * XPM_VERSAL_EVENT_ERROR_MASK_XSEM_NPI_UE_7: Error event mask for handling > + * uncorrectable error in Versal NoC programming interface (NPI) > + * register which is reported by Soft Error Mitigation (XilSEM). > + */ > +#define XPM_VERSAL_EVENT_ERROR_MASK_XSEM_NPI_UE_7 BIT(7) These follow the XPM_EVENT_ERROR_MASK_DDRMC_* precedent a few lines up, so the per-define comment is fine, but please use /** like those do rather than /*, since the body is in kernel-doc form. The _5 / _6 / _7 suffixes are worth dropping, though. They encode the bit position in the name, which the BIT() already states, and the Versal NET variants added in the same hunk do not carry them -- so the two families end up named inconsistently for the same three errors. > + > +/* > + * XPM_VERSAL_NET_EVENT_ERROR_MASK_XSEM_CRAM_CE: Error event mask for handling > + * correctable error in Versal Configuration RAM which is reported by > + * Soft Error Mitigation (XilSEM). > + */ > +#define XPM_VERSAL_NET_EVENT_ERROR_MASK_XSEM_CRAM_CE BIT(7) > + > +/* > + * XPM_VERSAL_NET_EVENT_ERROR_MASK_XSEM_CRAM_UE: Error event mask for handling > + * uncorrectable error in Versal Configuration RAM which is reported by > + * Soft Error Mitigation (XilSEM). > + */ > +#define XPM_VERSAL_NET_EVENT_ERROR_MASK_XSEM_CRAM_UE BIT(8) > + > +/* > + * XPM_VERSAL_NET_EVENT_ERROR_MASK_XSEM_NPI_UE: Error event mask for handling > + * uncorrectable error in Versal NoC programming interface (NPI) > + * register which is reported by Soft Error Mitigation (XilSEM). > + */ These defines name are self explanatory. In next version trim all un-necessary documentation. > +#define XPM_VERSAL_NET_EVENT_ERROR_MASK_XSEM_NPI_UE BIT(9) > + > /* Node ID for all peripheral devices */ > #define PM_DEV_ALL_PERIPH 0x18224FFFU > Thanks, Radhey