From patchwork Thu Nov 9 07:00:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 163256 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp261111vqs; Wed, 8 Nov 2023 23:03:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEug31v3idjefnzHg9soHhCQ+JaM3exLVpF6gLZ4XQ7k9VW6iekpAKzZ1eUvaZxdRg9bhsY X-Received: by 2002:a05:6830:2643:b0:6b7:5687:8a9e with SMTP id f3-20020a056830264300b006b756878a9emr4855101otu.15.1699513382150; Wed, 08 Nov 2023 23:03:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699513382; cv=pass; d=google.com; s=arc-20160816; b=tTfgg0vHtZdtPH0UVOTa7z3SuquEtX57vHmlXo/llRrsa596Rc5lZ+RA3MVNgGZyg4 USBurcoE1CgcQYJnj5+Ynz6W9V6edlD7pEHovywnsXr9YLy4zXyTKFbZZTPMvCYGFE6I tKv303LAOOGt6qZpXMMsCyEJMCCV1XYogHR8wo3faqaeKvCGPKUVGgmoM0IwaosGC8Dt 6LXwaSBtNlDbKPloRXADiHyf6LZrfZLqy830DSvGGKCDpqxc2LWE/O4D8K2NeEUH1Lc+ jx8rg4xAqELVNKjL6mkrp9kYqzZUAbWvo8puejgjWYLCwSVrAyhl8T4zOE4sVOGhoyEI oaXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=F+YNQZu7nMRY046L//iSEe9Rv3xg5jrNTdXQTOKvDqQ=; fh=JIPmjIsUFAN0d3cqP/XaPvmjquVCxBc4TfC545qjvcA=; b=RUPot6rLRpZ2h+7TE+NRCt3+4zhU2Xw1NmByiOqOAd6lf2jVTY9mWcabQ7Igao45bd Vu5oNkCFNOJ6g7fbJIkO/F2Q9eRlZD81X255Q1Zzp078MzucSbBrjp8BLvv4X90y+CRO AfqPKA2XJqWIt7s5QeVw77gF3sIIGgd2HT/xtWpTS+AqQFrZQdGnWSTb2Z75ZOECM13d WKotPETqAOI0fXWSmAfr+ol9Q62uHq4DjtsjCdIpPMll+ARtG2UPwrAswvz/E74XADDZ wyCYCAeMa/XgjhPjfOOIpzAPmHwgUQ2wGEDkokaasBYRugXH97bu9/8IHj5TQ6G9givW oiLA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=rTlD9gMO; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d3-20020a9d5e03000000b006c4dfb79502si5765613oti.130.2023.11.08.23.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:03:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=rTlD9gMO; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id AA846804E6B5; Wed, 8 Nov 2023 23:01:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232589AbjKIHA7 (ORCPT + 32 others); Thu, 9 Nov 2023 02:00:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230300AbjKIHAz (ORCPT ); Thu, 9 Nov 2023 02:00:55 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2072.outbound.protection.outlook.com [40.107.244.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 366F92D4F for ; Wed, 8 Nov 2023 23:00:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k8gr6Nxi+eixCCAlGZiswCuwB0R8Hs5TZGR1W9460ZtOtesuQMzwo5p2Jsyc0DWm3ZIcnjPqN5s0IHfVMlD2Am1vx+A8wlhBo3Zt+YRNBio+dXtf2SNlywFxDXulqQqF5wYC7GvE70UKwFc1vDULLmO9mWjPExkUlzB6wRdP7rA7FdP1ia55KCbC1wfEYgpzAFpMQhPLJnV+lgo0wj3D9NkT+NlJo42Q94aDmD1JJelI0tUAo+S2yl886Us9d5kwPXd40iiWvtjcioIAHKPn+C1LUePMTfGi260fCmEN+P52dYcHpvRES/EaUkT+F+h2TkIczDVJdXuzVqvWoFE91w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=F+YNQZu7nMRY046L//iSEe9Rv3xg5jrNTdXQTOKvDqQ=; b=db3VUrRZUdhI49j6UYknHVQhQcL6mbvB8Fx+yV9eMHbM4srUSLSnTXemKW8dsg6TpH7xa7Ip+fjKAyWE7Cp61fRrjKEq3m7qiTKX8g1R2sEL2cBtiZJb82oLWzzW0Pi/bhnd3YQK9UDOIg0IYNUsakleVpY2xZjtw5akUmjj7UB4TvG0mBGOndRfu844ZYjCV/t+JFoCfjcFdO7chJjydG6u6mEqa9AN8RSj1wtnB61suCZrQmbYXIF90e2eCwAmFW0CHimPiFP0ejdhNIDnOvKgxvZEPcEKJkCAIHVhWlOAmZ6NFTQRDWW/lGFX111ysimWMUr1/3z6cyCnsGduCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=F+YNQZu7nMRY046L//iSEe9Rv3xg5jrNTdXQTOKvDqQ=; b=rTlD9gMO69JMtWcx2mjXBkuZhbP2lArkHJOiVKVJs0/TeRLZki9dImbwWR/YHYx/NNH7XSwmtzhCKO89HMj+5NbWeXjg69Y25qMGYfEIneOGt9eLM3qzImnElBG6iE/l0q+j0LIEjE0InLlCS7vz3jnGNUslPaF5iT/CAoITC0s= Received: from MW2PR16CA0066.namprd16.prod.outlook.com (2603:10b6:907:1::43) by LV2PR12MB5824.namprd12.prod.outlook.com (2603:10b6:408:176::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Thu, 9 Nov 2023 07:00:49 +0000 Received: from CO1PEPF000044FB.namprd21.prod.outlook.com (2603:10b6:907:1:cafe::6b) by MW2PR16CA0066.outlook.office365.com (2603:10b6:907:1::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19 via Frontend Transport; Thu, 9 Nov 2023 07:00:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1PEPF000044FB.mail.protection.outlook.com (10.167.241.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7002.1 via Frontend Transport; Thu, 9 Nov 2023 07:00:48 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 9 Nov 2023 01:00:46 -0600 Received: from xsjarunbala50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Thu, 9 Nov 2023 01:00:44 -0600 From: Jay Buddhabhatti To: , , , , , , , , , , , CC: , , Jay Buddhabhatti , Izhar Ameer Shaikh Subject: [PATCH v4 1/5] firmware: xilinx: Update firmware call interface to support additional args Date: Wed, 8 Nov 2023 23:00:17 -0800 Message-ID: <20231109070021.16291-2-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231109070021.16291-1-jay.buddhabhatti@amd.com> References: <20231109070021.16291-1-jay.buddhabhatti@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044FB:EE_|LV2PR12MB5824:EE_ X-MS-Office365-Filtering-Correlation-Id: 785e8c08-e007-439d-c0a5-08dbe0f19aa2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z2wZK8tWbRJoatWKzQ6vs5YbIYS+FcgrWctuAB7cYGlPI49lysn1kFOBGbtupdJppzqPiMUtXJ4Zi6wqLJ0vVrRu2nN86NRFdenaBbuRj6bXJyj4vZy7U8jnkxBzPDC81hxw5Ym4BHcj8ef3AwXwUzLsVAhi4yeDS2pP674QY2dISVBr50G7N1sMYjud+WZf+boZcuwP1GGrf043EfMiS8gXUG63Y5N96WET+nr+3NfwFO4wsFDq3xGrJHBBxK5FWLPZ+1DcDrSy7XFKQgaz1JK26YUno/eZT0sDRKUhZaLO8PUS9kcfkTN+LB6qmNgYBBwBvWetrYAtQtyKivVBU5JfZiXOwqIDYxDAeLs/2oaQyYfvUmMr4LsMaG93HZKAgWdqwFZ9+a2krZR7yIInUXvPbz/8Vmr7VEIKst/QrkqO+bByVeiyPytqUMuZCDmBApTPJG59vXc3f8trvexTJBLbKy+LROffl24cFFFlGxro7lIjB02hebAmrIXVM1QTLFHwAoQFMs3gWKMaaKKcVDCUoLLBX7WMRuon7Rh2D5vFwwk2Est3X+8/TgRQ8LXY+6ckpp1n8RVO1DFceBM53JWC+iIpVQZnaJ1NpgQNNoGFuSgiqXXWZfnlvbENWR+C0HgI77F6plhc8uNPTeeWAVjY3frBEoQKpprqAp/P9jvb5QouEJEhKy/QrK7k9sulfC/d4VJQP/Rouu1fIH3Xdr07avTzVZTFDbWcgfBZq1TvGvKSksGHVwNIJxoCiM0zOK079DZKbuDmG5G3M9DzpofK/iIH8Hs59bYWw7v5Dz4ldhqnAsJl7h8Hc9xw/h10WGLWQL+DoXKYuMOpXPF0VQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(136003)(396003)(39860400002)(346002)(230922051799003)(82310400011)(64100799003)(451199024)(1800799009)(186009)(46966006)(36840700001)(40470700004)(40480700001)(40460700003)(47076005)(36860700001)(83380400001)(86362001)(36756003)(8936002)(44832011)(41300700001)(4326008)(2906002)(15650500001)(8676002)(30864003)(921008)(336012)(426003)(6666004)(110136005)(478600001)(356005)(316002)(6636002)(81166007)(82740400003)(5660300002)(70586007)(26005)(54906003)(70206006)(2616005)(1076003)(36900700001)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 07:00:48.7748 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 785e8c08-e007-439d-c0a5-08dbe0f19aa2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044FB.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5824 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:01:28 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782068944275991768 X-GMAIL-MSGID: 1782068944275991768 System-level platform management layer (do_fw_call()) has support for maximum of 5 arguments as of now (1 EEMI API ID + 4 command arguments). In order to support new EEMI PM_IOCTL IDs (Secure Read/Write), this support must be extended to support one additional argument, which results in a configuration of - 1 EEMI API ID + 5 command arguments. Update zynqmp_pm_invoke_fn() and do_fw_call() with this new definition containing variable arguments. As a result, update all the references to pm invoke function with the updated definition. Co-developed-by: Izhar Ameer Shaikh Signed-off-by: Izhar Ameer Shaikh Signed-off-by: Jay Buddhabhatti --- drivers/firmware/xilinx/zynqmp.c | 278 +++++++++++------------- drivers/soc/xilinx/xlnx_event_manager.c | 2 +- drivers/soc/xilinx/zynqmp_power.c | 2 +- include/linux/firmware/xlnx-zynqmp.h | 3 +- 4 files changed, 132 insertions(+), 153 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index b0d22d4455d9..7cf056451a26 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -106,8 +106,7 @@ static int zynqmp_pm_ret_code(u32 ret_status) } } -static noinline int do_fw_call_fail(u64 arg0, u64 arg1, u64 arg2, - u32 *ret_payload) +static noinline int do_fw_call_fail(u32 *ret_payload, u8 num_args, ...) { return -ENODEV; } @@ -116,25 +115,35 @@ static noinline int do_fw_call_fail(u64 arg0, u64 arg1, u64 arg2, * PM function call wrapper * Invoke do_fw_call_smc or do_fw_call_hvc, depending on the configuration */ -static int (*do_fw_call)(u64, u64, u64, u32 *ret_payload) = do_fw_call_fail; +static int (*do_fw_call)(u32 *ret_payload, u8, ...) = do_fw_call_fail; /** * do_fw_call_smc() - Call system-level platform management layer (SMC) - * @arg0: Argument 0 to SMC call - * @arg1: Argument 1 to SMC call - * @arg2: Argument 2 to SMC call + * @num_args: Number of variable arguments should be <= 8 * @ret_payload: Returned value array * * Invoke platform management function via SMC call (no hypervisor present). * * Return: Returns status, either success or error+reason */ -static noinline int do_fw_call_smc(u64 arg0, u64 arg1, u64 arg2, - u32 *ret_payload) +static noinline int do_fw_call_smc(u32 *ret_payload, u8 num_args, ...) { struct arm_smccc_res res; + u64 args[8] = {0}; + va_list arg_list; + u8 i; - arm_smccc_smc(arg0, arg1, arg2, 0, 0, 0, 0, 0, &res); + if (num_args > 8) + return -EINVAL; + + va_start(arg_list, num_args); + + for (i = 0; i < num_args; i++) + args[i] = va_arg(arg_list, u64); + + va_end(arg_list); + + arm_smccc_smc(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], &res); if (ret_payload) { ret_payload[0] = lower_32_bits(res.a0); @@ -148,9 +157,7 @@ static noinline int do_fw_call_smc(u64 arg0, u64 arg1, u64 arg2, /** * do_fw_call_hvc() - Call system-level platform management layer (HVC) - * @arg0: Argument 0 to HVC call - * @arg1: Argument 1 to HVC call - * @arg2: Argument 2 to HVC call + * @num_args: Number of variable arguments should be <= 8 * @ret_payload: Returned value array * * Invoke platform management function via HVC @@ -159,12 +166,24 @@ static noinline int do_fw_call_smc(u64 arg0, u64 arg1, u64 arg2, * * Return: Returns status, either success or error+reason */ -static noinline int do_fw_call_hvc(u64 arg0, u64 arg1, u64 arg2, - u32 *ret_payload) +static noinline int do_fw_call_hvc(u32 *ret_payload, u8 num_args, ...) { struct arm_smccc_res res; + u64 args[8] = {0}; + va_list arg_list; + u8 i; + + if (num_args > 8) + return -EINVAL; + + va_start(arg_list, num_args); + + for (i = 0; i < num_args; i++) + args[i] = va_arg(arg_list, u64); - arm_smccc_hvc(arg0, arg1, arg2, 0, 0, 0, 0, 0, &res); + va_end(arg_list); + + arm_smccc_hvc(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], &res); if (ret_payload) { ret_payload[0] = lower_32_bits(res.a0); @@ -184,7 +203,7 @@ static int __do_feature_check_call(const u32 api_id, u32 *ret_payload) smc_arg[0] = PM_SIP_SVC | PM_FEATURE_CHECK; smc_arg[1] = api_id; - ret = do_fw_call(smc_arg[0], smc_arg[1], 0, ret_payload); + ret = do_fw_call(ret_payload, 2, smc_arg[0], smc_arg[1]); if (ret) ret = -EOPNOTSUPP; else @@ -295,11 +314,8 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_is_function_supported); * zynqmp_pm_invoke_fn() - Invoke the system-level platform management layer * caller function depending on the configuration * @pm_api_id: Requested PM-API call - * @arg0: Argument 0 to requested PM-API call - * @arg1: Argument 1 to requested PM-API call - * @arg2: Argument 2 to requested PM-API call - * @arg3: Argument 3 to requested PM-API call * @ret_payload: Returned value array + * @num_args: Number of arguments to requested PM-API call * * Invoke platform management function for SMC or HVC call, depending on * configuration. @@ -316,26 +332,38 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_is_function_supported); * * Return: Returns status, either success or error+reason */ -int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, - u32 arg2, u32 arg3, u32 *ret_payload) +int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 *ret_payload, u8 num_args, ...) { /* * Added SIP service call Function Identifier * Make sure to stay in x0 register */ - u64 smc_arg[4]; - int ret; + u64 smc_arg[8]; + int ret, i; + va_list arg_list; + u32 args[14] = {0}; + + if (num_args > 14) + return -EINVAL; + + va_start(arg_list, num_args); /* Check if feature is supported or not */ ret = zynqmp_pm_feature(pm_api_id); if (ret < 0) return ret; + for (i = 0; i < num_args; i++) + args[i] = va_arg(arg_list, u32); + + va_end(arg_list); + smc_arg[0] = PM_SIP_SVC | pm_api_id; - smc_arg[1] = ((u64)arg1 << 32) | arg0; - smc_arg[2] = ((u64)arg3 << 32) | arg2; + for (i = 0; i < 7; i++) + smc_arg[i + 1] = ((u64)args[(i * 2) + 1] << 32) | args[i * 2]; - return do_fw_call(smc_arg[0], smc_arg[1], smc_arg[2], ret_payload); + return do_fw_call(ret_payload, 8, smc_arg[0], smc_arg[1], smc_arg[2], smc_arg[3], + smc_arg[4], smc_arg[5], smc_arg[6], smc_arg[7]); } static u32 pm_api_version; @@ -347,14 +375,12 @@ int zynqmp_pm_register_sgi(u32 sgi_num, u32 reset) { int ret; - ret = zynqmp_pm_invoke_fn(TF_A_PM_REGISTER_SGI, sgi_num, reset, 0, 0, - NULL); + ret = zynqmp_pm_invoke_fn(TF_A_PM_REGISTER_SGI, NULL, 2, sgi_num, reset); if (!ret) return ret; /* try old implementation as fallback strategy if above fails */ - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_REGISTER_SGI, sgi_num, - reset, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 3, IOCTL_REGISTER_SGI, sgi_num, reset); } /** @@ -376,7 +402,7 @@ int zynqmp_pm_get_api_version(u32 *version) *version = pm_api_version; return 0; } - ret = zynqmp_pm_invoke_fn(PM_GET_API_VERSION, 0, 0, 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_GET_API_VERSION, ret_payload, 0); *version = ret_payload[1]; return ret; @@ -399,7 +425,7 @@ int zynqmp_pm_get_chipid(u32 *idcode, u32 *version) if (!idcode || !version) return -EINVAL; - ret = zynqmp_pm_invoke_fn(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_GET_CHIPID, ret_payload, 0); *idcode = ret_payload[1]; *version = ret_payload[2]; @@ -427,7 +453,7 @@ static int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily) return 0; } - ret = zynqmp_pm_invoke_fn(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_GET_CHIPID, ret_payload, 0); if (ret < 0) return ret; @@ -459,8 +485,7 @@ static int zynqmp_pm_get_trustzone_version(u32 *version) *version = pm_tz_version; return 0; } - ret = zynqmp_pm_invoke_fn(PM_GET_TRUSTZONE_VERSION, 0, 0, - 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_GET_TRUSTZONE_VERSION, ret_payload, 0); *version = ret_payload[1]; return ret; @@ -507,8 +532,8 @@ int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out) { int ret; - ret = zynqmp_pm_invoke_fn(PM_QUERY_DATA, qdata.qid, qdata.arg1, - qdata.arg2, qdata.arg3, out); + ret = zynqmp_pm_invoke_fn(PM_QUERY_DATA, out, 4, qdata.qid, qdata.arg1, qdata.arg2, + qdata.arg3); /* * For clock name query, all bytes in SMC response are clock name @@ -530,7 +555,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_query_data); */ int zynqmp_pm_clock_enable(u32 clock_id) { - return zynqmp_pm_invoke_fn(PM_CLOCK_ENABLE, clock_id, 0, 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_CLOCK_ENABLE, NULL, 1, clock_id); } EXPORT_SYMBOL_GPL(zynqmp_pm_clock_enable); @@ -545,7 +570,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_enable); */ int zynqmp_pm_clock_disable(u32 clock_id) { - return zynqmp_pm_invoke_fn(PM_CLOCK_DISABLE, clock_id, 0, 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_CLOCK_DISABLE, NULL, 1, clock_id); } EXPORT_SYMBOL_GPL(zynqmp_pm_clock_disable); @@ -564,8 +589,7 @@ int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state) u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; - ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETSTATE, clock_id, 0, - 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETSTATE, ret_payload, 1, clock_id); *state = ret_payload[1]; return ret; @@ -584,8 +608,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getstate); */ int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider) { - return zynqmp_pm_invoke_fn(PM_CLOCK_SETDIVIDER, clock_id, divider, - 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_CLOCK_SETDIVIDER, NULL, 2, clock_id, divider); } EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setdivider); @@ -604,8 +627,7 @@ int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider) u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; - ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETDIVIDER, clock_id, 0, - 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETDIVIDER, ret_payload, 1, clock_id); *divider = ret_payload[1]; return ret; @@ -623,10 +645,8 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getdivider); */ int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate) { - return zynqmp_pm_invoke_fn(PM_CLOCK_SETRATE, clock_id, - lower_32_bits(rate), - upper_32_bits(rate), - 0, NULL); + return zynqmp_pm_invoke_fn(PM_CLOCK_SETRATE, NULL, 3, clock_id, lower_32_bits(rate), + upper_32_bits(rate)); } EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setrate); @@ -645,8 +665,7 @@ int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate) u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; - ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETRATE, clock_id, 0, - 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETRATE, ret_payload, 1, clock_id); *rate = ((u64)ret_payload[2] << 32) | ret_payload[1]; return ret; @@ -664,8 +683,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getrate); */ int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id) { - return zynqmp_pm_invoke_fn(PM_CLOCK_SETPARENT, clock_id, - parent_id, 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_CLOCK_SETPARENT, NULL, 2, clock_id, parent_id); } EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setparent); @@ -684,8 +702,7 @@ int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; - ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETPARENT, clock_id, 0, - 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETPARENT, ret_payload, 1, clock_id); *parent_id = ret_payload[1]; return ret; @@ -704,8 +721,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getparent); */ int zynqmp_pm_set_pll_frac_mode(u32 clk_id, u32 mode) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_SET_PLL_FRAC_MODE, - clk_id, mode, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 4, 0, IOCTL_SET_PLL_FRAC_MODE, clk_id, mode); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_pll_frac_mode); @@ -721,8 +737,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_pll_frac_mode); */ int zynqmp_pm_get_pll_frac_mode(u32 clk_id, u32 *mode) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_GET_PLL_FRAC_MODE, - clk_id, 0, mode); + return zynqmp_pm_invoke_fn(PM_IOCTL, mode, 3, 0, IOCTL_GET_PLL_FRAC_MODE, clk_id); } EXPORT_SYMBOL_GPL(zynqmp_pm_get_pll_frac_mode); @@ -739,8 +754,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_get_pll_frac_mode); */ int zynqmp_pm_set_pll_frac_data(u32 clk_id, u32 data) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_SET_PLL_FRAC_DATA, - clk_id, data, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 4, 0, IOCTL_SET_PLL_FRAC_DATA, clk_id, data); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_pll_frac_data); @@ -756,8 +770,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_pll_frac_data); */ int zynqmp_pm_get_pll_frac_data(u32 clk_id, u32 *data) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_GET_PLL_FRAC_DATA, - clk_id, 0, data); + return zynqmp_pm_invoke_fn(PM_IOCTL, data, 3, 0, IOCTL_GET_PLL_FRAC_DATA, clk_id); } EXPORT_SYMBOL_GPL(zynqmp_pm_get_pll_frac_data); @@ -778,9 +791,8 @@ int zynqmp_pm_set_sd_tapdelay(u32 node_id, u32 type, u32 value) u32 mask = (node_id == NODE_SD_0) ? GENMASK(15, 0) : GENMASK(31, 16); if (value) { - return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, - IOCTL_SET_SD_TAPDELAY, - type, value, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 4, node_id, IOCTL_SET_SD_TAPDELAY, type, + value); } /* @@ -798,7 +810,7 @@ int zynqmp_pm_set_sd_tapdelay(u32 node_id, u32 type, u32 value) * Use PM_MMIO_READ/PM_MMIO_WRITE to re-implement the missing counter * part of IOCTL_SET_SD_TAPDELAY which clears SDx_ITAPDLYENA bits. */ - return zynqmp_pm_invoke_fn(PM_MMIO_WRITE, reg, mask, 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_MMIO_WRITE, NULL, 2, reg, mask); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_sd_tapdelay); @@ -814,8 +826,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_sd_tapdelay); */ int zynqmp_pm_sd_dll_reset(u32 node_id, u32 type) { - return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, IOCTL_SD_DLL_RESET, - type, 0, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 3, node_id, IOCTL_SD_DLL_RESET, type); } EXPORT_SYMBOL_GPL(zynqmp_pm_sd_dll_reset); @@ -831,8 +842,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_sd_dll_reset); */ int zynqmp_pm_ospi_mux_select(u32 dev_id, u32 select) { - return zynqmp_pm_invoke_fn(PM_IOCTL, dev_id, IOCTL_OSPI_MUX_SELECT, - select, 0, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 3, dev_id, IOCTL_OSPI_MUX_SELECT, select); } EXPORT_SYMBOL_GPL(zynqmp_pm_ospi_mux_select); @@ -847,8 +857,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_ospi_mux_select); */ int zynqmp_pm_write_ggs(u32 index, u32 value) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_WRITE_GGS, - index, value, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 4, 0, IOCTL_WRITE_GGS, index, value); } EXPORT_SYMBOL_GPL(zynqmp_pm_write_ggs); @@ -863,8 +872,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_write_ggs); */ int zynqmp_pm_read_ggs(u32 index, u32 *value) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_READ_GGS, - index, 0, value); + return zynqmp_pm_invoke_fn(PM_IOCTL, value, 3, 0, IOCTL_READ_GGS, index); } EXPORT_SYMBOL_GPL(zynqmp_pm_read_ggs); @@ -880,8 +888,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_read_ggs); */ int zynqmp_pm_write_pggs(u32 index, u32 value) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_WRITE_PGGS, index, value, - NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 4, 0, IOCTL_WRITE_PGGS, index, value); } EXPORT_SYMBOL_GPL(zynqmp_pm_write_pggs); @@ -897,15 +904,13 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_write_pggs); */ int zynqmp_pm_read_pggs(u32 index, u32 *value) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_READ_PGGS, index, 0, - value); + return zynqmp_pm_invoke_fn(PM_IOCTL, value, 3, 0, IOCTL_READ_PGGS, index); } EXPORT_SYMBOL_GPL(zynqmp_pm_read_pggs); int zynqmp_pm_set_tapdelay_bypass(u32 index, u32 value) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_SET_TAPDELAY_BYPASS, - index, value, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 4, 0, IOCTL_SET_TAPDELAY_BYPASS, index, value); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_tapdelay_bypass); @@ -920,8 +925,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_tapdelay_bypass); */ int zynqmp_pm_set_boot_health_status(u32 value) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_SET_BOOT_HEALTH_STATUS, - value, 0, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 3, 0, IOCTL_SET_BOOT_HEALTH_STATUS, value); } /** @@ -935,8 +939,7 @@ int zynqmp_pm_set_boot_health_status(u32 value) int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset, const enum zynqmp_pm_reset_action assert_flag) { - return zynqmp_pm_invoke_fn(PM_RESET_ASSERT, reset, assert_flag, - 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_RESET_ASSERT, NULL, 2, reset, assert_flag); } EXPORT_SYMBOL_GPL(zynqmp_pm_reset_assert); @@ -955,8 +958,7 @@ int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, u32 *status) if (!status) return -EINVAL; - ret = zynqmp_pm_invoke_fn(PM_RESET_GET_STATUS, reset, 0, - 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_RESET_GET_STATUS, ret_payload, 1, reset); *status = ret_payload[1]; return ret; @@ -981,9 +983,8 @@ int zynqmp_pm_fpga_load(const u64 address, const u32 size, const u32 flags) u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; - ret = zynqmp_pm_invoke_fn(PM_FPGA_LOAD, lower_32_bits(address), - upper_32_bits(address), size, flags, - ret_payload); + ret = zynqmp_pm_invoke_fn(PM_FPGA_LOAD, ret_payload, 4, lower_32_bits(address), + upper_32_bits(address), size, flags); if (ret_payload[0]) return -ret_payload[0]; @@ -1008,7 +1009,7 @@ int zynqmp_pm_fpga_get_status(u32 *value) if (!value) return -EINVAL; - ret = zynqmp_pm_invoke_fn(PM_FPGA_GET_STATUS, 0, 0, 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_FPGA_GET_STATUS, ret_payload, 0); *value = ret_payload[1]; return ret; @@ -1036,11 +1037,9 @@ int zynqmp_pm_fpga_get_config_status(u32 *value) lower_addr = lower_32_bits((u64)&buf); upper_addr = upper_32_bits((u64)&buf); - ret = zynqmp_pm_invoke_fn(PM_FPGA_READ, - XILINX_ZYNQMP_PM_FPGA_CONFIG_STAT_OFFSET, - lower_addr, upper_addr, - XILINX_ZYNQMP_PM_FPGA_READ_CONFIG_REG, - ret_payload); + ret = zynqmp_pm_invoke_fn(PM_FPGA_READ, ret_payload, 4, + XILINX_ZYNQMP_PM_FPGA_CONFIG_STAT_OFFSET, lower_addr, upper_addr, + XILINX_ZYNQMP_PM_FPGA_READ_CONFIG_REG); *value = ret_payload[1]; @@ -1058,7 +1057,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_fpga_get_config_status); */ int zynqmp_pm_pinctrl_request(const u32 pin) { - return zynqmp_pm_invoke_fn(PM_PINCTRL_REQUEST, pin, 0, 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_PINCTRL_REQUEST, NULL, 1, pin); } EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_request); @@ -1072,7 +1071,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_request); */ int zynqmp_pm_pinctrl_release(const u32 pin) { - return zynqmp_pm_invoke_fn(PM_PINCTRL_RELEASE, pin, 0, 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_PINCTRL_RELEASE, NULL, 1, pin); } EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_release); @@ -1093,8 +1092,7 @@ int zynqmp_pm_pinctrl_get_function(const u32 pin, u32 *id) if (!id) return -EINVAL; - ret = zynqmp_pm_invoke_fn(PM_PINCTRL_GET_FUNCTION, pin, 0, - 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_PINCTRL_GET_FUNCTION, ret_payload, 1, pin); *id = ret_payload[1]; return ret; @@ -1112,8 +1110,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_get_function); */ int zynqmp_pm_pinctrl_set_function(const u32 pin, const u32 id) { - return zynqmp_pm_invoke_fn(PM_PINCTRL_SET_FUNCTION, pin, id, - 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_PINCTRL_SET_FUNCTION, NULL, 2, pin, id); } EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_set_function); @@ -1136,8 +1133,7 @@ int zynqmp_pm_pinctrl_get_config(const u32 pin, const u32 param, if (!value) return -EINVAL; - ret = zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_GET, pin, param, - 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_GET, ret_payload, 2, pin, param); *value = ret_payload[1]; return ret; @@ -1166,8 +1162,7 @@ int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, return -EOPNOTSUPP; } - return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, pin, - param, value, 0, NULL); + return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, NULL, 3, pin, param, value); } EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_set_config); @@ -1185,8 +1180,7 @@ unsigned int zynqmp_pm_bootmode_read(u32 *ps_mode) unsigned int ret; u32 ret_payload[PAYLOAD_ARG_CNT]; - ret = zynqmp_pm_invoke_fn(PM_MMIO_READ, CRL_APB_BOOT_PIN_CTRL, 0, - 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_MMIO_READ, ret_payload, 1, CRL_APB_BOOT_PIN_CTRL); *ps_mode = ret_payload[1]; @@ -1205,8 +1199,8 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_bootmode_read); */ int zynqmp_pm_bootmode_write(u32 ps_mode) { - return zynqmp_pm_invoke_fn(PM_MMIO_WRITE, CRL_APB_BOOT_PIN_CTRL, - CRL_APB_BOOTPIN_CTRL_MASK, ps_mode, 0, NULL); + return zynqmp_pm_invoke_fn(PM_MMIO_WRITE, NULL, 3, CRL_APB_BOOT_PIN_CTRL, + CRL_APB_BOOTPIN_CTRL_MASK, ps_mode); } EXPORT_SYMBOL_GPL(zynqmp_pm_bootmode_write); @@ -1221,7 +1215,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_bootmode_write); */ int zynqmp_pm_init_finalize(void) { - return zynqmp_pm_invoke_fn(PM_PM_INIT_FINALIZE, 0, 0, 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_PM_INIT_FINALIZE, NULL, 0); } EXPORT_SYMBOL_GPL(zynqmp_pm_init_finalize); @@ -1235,7 +1229,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_init_finalize); */ int zynqmp_pm_set_suspend_mode(u32 mode) { - return zynqmp_pm_invoke_fn(PM_SET_SUSPEND_MODE, mode, 0, 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_SET_SUSPEND_MODE, NULL, 1, mode); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_suspend_mode); @@ -1254,8 +1248,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_suspend_mode); int zynqmp_pm_request_node(const u32 node, const u32 capabilities, const u32 qos, const enum zynqmp_pm_request_ack ack) { - return zynqmp_pm_invoke_fn(PM_REQUEST_NODE, node, capabilities, - qos, ack, NULL); + return zynqmp_pm_invoke_fn(PM_REQUEST_NODE, NULL, 4, node, capabilities, qos, ack); } EXPORT_SYMBOL_GPL(zynqmp_pm_request_node); @@ -1271,7 +1264,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_request_node); */ int zynqmp_pm_release_node(const u32 node) { - return zynqmp_pm_invoke_fn(PM_RELEASE_NODE, node, 0, 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_RELEASE_NODE, NULL, 1, node); } EXPORT_SYMBOL_GPL(zynqmp_pm_release_node); @@ -1290,8 +1283,7 @@ int zynqmp_pm_get_rpu_mode(u32 node_id, enum rpu_oper_mode *rpu_mode) u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; - ret = zynqmp_pm_invoke_fn(PM_IOCTL, node_id, - IOCTL_GET_RPU_OPER_MODE, 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_IOCTL, ret_payload, 2, node_id, IOCTL_GET_RPU_OPER_MODE); /* only set rpu_mode if no error */ if (ret == XST_PM_SUCCESS) @@ -1313,9 +1305,8 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_get_rpu_mode); */ int zynqmp_pm_set_rpu_mode(u32 node_id, enum rpu_oper_mode rpu_mode) { - return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, - IOCTL_SET_RPU_OPER_MODE, (u32)rpu_mode, - 0, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 3, node_id, IOCTL_SET_RPU_OPER_MODE, + (u32)rpu_mode); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_rpu_mode); @@ -1331,9 +1322,8 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_rpu_mode); */ int zynqmp_pm_set_tcm_config(u32 node_id, enum rpu_tcm_comb tcm_mode) { - return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, - IOCTL_TCM_COMB_CONFIG, (u32)tcm_mode, 0, - NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 3, node_id, IOCTL_TCM_COMB_CONFIG, + (u32)tcm_mode); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_tcm_config); @@ -1348,7 +1338,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_tcm_config); int zynqmp_pm_force_pwrdwn(const u32 node, const enum zynqmp_pm_request_ack ack) { - return zynqmp_pm_invoke_fn(PM_FORCE_POWERDOWN, node, ack, 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_FORCE_POWERDOWN, NULL, 2, node, ack); } EXPORT_SYMBOL_GPL(zynqmp_pm_force_pwrdwn); @@ -1367,8 +1357,8 @@ int zynqmp_pm_request_wake(const u32 node, const enum zynqmp_pm_request_ack ack) { /* set_addr flag is encoded into 1st bit of address */ - return zynqmp_pm_invoke_fn(PM_REQUEST_WAKEUP, node, address | set_addr, - address >> 32, ack, NULL); + return zynqmp_pm_invoke_fn(PM_REQUEST_WAKEUP, NULL, 4, node, address | set_addr, + address >> 32, ack); } EXPORT_SYMBOL_GPL(zynqmp_pm_request_wake); @@ -1388,8 +1378,7 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, const u32 qos, const enum zynqmp_pm_request_ack ack) { - return zynqmp_pm_invoke_fn(PM_SET_REQUIREMENT, node, capabilities, - qos, ack, NULL); + return zynqmp_pm_invoke_fn(PM_SET_REQUIREMENT, NULL, 4, node, capabilities, qos, ack); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); @@ -1404,9 +1393,8 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); */ int zynqmp_pm_load_pdi(const u32 src, const u64 address) { - return zynqmp_pm_invoke_fn(PM_LOAD_PDI, src, - lower_32_bits(address), - upper_32_bits(address), 0, NULL); + return zynqmp_pm_invoke_fn(PM_LOAD_PDI, NULL, 3, src, lower_32_bits(address), + upper_32_bits(address)); } EXPORT_SYMBOL_GPL(zynqmp_pm_load_pdi); @@ -1426,9 +1414,8 @@ int zynqmp_pm_aes_engine(const u64 address, u32 *out) if (!out) return -EINVAL; - ret = zynqmp_pm_invoke_fn(PM_SECURE_AES, upper_32_bits(address), - lower_32_bits(address), - 0, 0, ret_payload); + ret = zynqmp_pm_invoke_fn(PM_SECURE_AES, ret_payload, 2, upper_32_bits(address), + lower_32_bits(address)); *out = ret_payload[1]; return ret; @@ -1456,8 +1443,7 @@ int zynqmp_pm_sha_hash(const u64 address, const u32 size, const u32 flags) u32 lower_addr = lower_32_bits(address); u32 upper_addr = upper_32_bits(address); - return zynqmp_pm_invoke_fn(PM_SECURE_SHA, upper_addr, lower_addr, - size, flags, NULL); + return zynqmp_pm_invoke_fn(PM_SECURE_SHA, NULL, 4, upper_addr, lower_addr, size, flags); } EXPORT_SYMBOL_GPL(zynqmp_pm_sha_hash); @@ -1479,8 +1465,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_sha_hash); int zynqmp_pm_register_notifier(const u32 node, const u32 event, const u32 wake, const u32 enable) { - return zynqmp_pm_invoke_fn(PM_REGISTER_NOTIFIER, node, event, - wake, enable, NULL); + return zynqmp_pm_invoke_fn(PM_REGISTER_NOTIFIER, NULL, 4, node, event, wake, enable); } EXPORT_SYMBOL_GPL(zynqmp_pm_register_notifier); @@ -1493,8 +1478,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_register_notifier); */ int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype) { - return zynqmp_pm_invoke_fn(PM_SYSTEM_SHUTDOWN, type, subtype, - 0, 0, NULL); + return zynqmp_pm_invoke_fn(PM_SYSTEM_SHUTDOWN, NULL, 2, type, subtype); } /** @@ -1506,8 +1490,7 @@ int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype) */ int zynqmp_pm_set_feature_config(enum pm_feature_config_id id, u32 value) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_SET_FEATURE_CONFIG, - id, value, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 4, 0, IOCTL_SET_FEATURE_CONFIG, id, value); } /** @@ -1520,8 +1503,7 @@ int zynqmp_pm_set_feature_config(enum pm_feature_config_id id, u32 value) int zynqmp_pm_get_feature_config(enum pm_feature_config_id id, u32 *payload) { - return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_GET_FEATURE_CONFIG, - id, 0, payload); + return zynqmp_pm_invoke_fn(PM_IOCTL, payload, 3, 0, IOCTL_GET_FEATURE_CONFIG, id); } /** @@ -1534,8 +1516,7 @@ int zynqmp_pm_get_feature_config(enum pm_feature_config_id id, */ int zynqmp_pm_set_sd_config(u32 node, enum pm_sd_config_type config, u32 value) { - return zynqmp_pm_invoke_fn(PM_IOCTL, node, IOCTL_SET_SD_CONFIG, - config, value, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 4, node, IOCTL_SET_SD_CONFIG, config, value); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_sd_config); @@ -1550,8 +1531,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_sd_config); int zynqmp_pm_set_gem_config(u32 node, enum pm_gem_config_type config, u32 value) { - return zynqmp_pm_invoke_fn(PM_IOCTL, node, IOCTL_SET_GEM_CONFIG, - config, value, NULL); + return zynqmp_pm_invoke_fn(PM_IOCTL, NULL, 4, node, IOCTL_SET_GEM_CONFIG, config, value); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_gem_config); diff --git a/drivers/soc/xilinx/xlnx_event_manager.c b/drivers/soc/xilinx/xlnx_event_manager.c index 86a048a10a13..adb875f89829 100644 --- a/drivers/soc/xilinx/xlnx_event_manager.c +++ b/drivers/soc/xilinx/xlnx_event_manager.c @@ -483,7 +483,7 @@ static void xlnx_call_notify_cb_handler(const u32 *payload) static void xlnx_get_event_callback_data(u32 *buf) { - zynqmp_pm_invoke_fn(GET_CALLBACK_DATA, 0, 0, 0, 0, buf); + zynqmp_pm_invoke_fn(GET_CALLBACK_DATA, buf, 0); } static irqreturn_t xlnx_event_handler(int irq, void *dev_id) diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c index c2c819701eec..0de0acf80ef8 100644 --- a/drivers/soc/xilinx/zynqmp_power.c +++ b/drivers/soc/xilinx/zynqmp_power.c @@ -51,7 +51,7 @@ static enum pm_suspend_mode suspend_mode = PM_SUSPEND_MODE_STD; static void zynqmp_pm_get_callback_data(u32 *buf) { - zynqmp_pm_invoke_fn(GET_CALLBACK_DATA, 0, 0, 0, 0, buf); + zynqmp_pm_invoke_fn(GET_CALLBACK_DATA, buf, 0); } static void suspend_event_callback(const u32 *payload, void *data) diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index d1ea3898564c..9e923e55f5d1 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -509,8 +509,7 @@ struct zynqmp_pm_query_data { u32 arg3; }; -int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, - u32 arg2, u32 arg3, u32 *ret_payload); +int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 *ret_payload, u8 num_args, ...); #if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE) int zynqmp_pm_get_api_version(u32 *version); From patchwork Thu Nov 9 07:00:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 163255 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp261101vqs; Wed, 8 Nov 2023 23:03:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IF01GW1WuVFW1Pynlf+Vp8rB27/ejZ9Q7kJxfhbT9apFgTWtBDVXheSHfzYbzeUL5YYMzXy X-Received: by 2002:a05:6870:e2d0:b0:1e9:96c6:e04c with SMTP id w16-20020a056870e2d000b001e996c6e04cmr4612277oad.32.1699513381218; Wed, 08 Nov 2023 23:03:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699513381; cv=pass; d=google.com; s=arc-20160816; b=rRt5A6zEWkeRGW7kZRLxlBcQurCcBvEeOKo8TY3ictvgavKmZnCzAk76SAOV5DTxDu 4lhu2gMcqUZ6/K/Z2StmuVxW+OGiihtie9Bt/+cUTLRTM5mJ7ZMilwLGe/KYycYQIGns 0jU7Dpme+OcQtjiPyF2vNfkAvHuZX3619h9PbYRRg7E9Ik5X1IWpcN4VD2w7HMeSSd5J 9EcDPzKanFQeXXBMq+tw0AZ2CUI81q/zJTRlCLuHG8T5/0MA+WFINeZWqhafYqG/psIs jBn2KTrkTW2X/CEy0LBZrMQ+zcPV3nLBCOjQf5IlweI/8B6qgnxsbfLkJkrZwi9yDqm7 7pkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MxkqeFYWT+9d00OQhGiCkRybMEENtDhaa69IFLGHMa4=; fh=POe1hCUPOUmu8SUXsX8lOFXIkl7L2D2vL9SkRTLEmpI=; b=RQa/iXB1hmaAI3DnTpR8ckRodeSCZZv6IVqJ3dtKe2NoMVJnsqatpHLyFpHgGujNIj gX/wsmGjGFUVToyTqpnz05LSZi35wkl92awUkgDYG8BiPEzjrBHYW8RRbcsBDZeV8/4/ D9V/K4qUwHXyBFZNI1NB/wSsAkAMQemWSNE/Z+g4a/mFqkmNSz0f3k/x0agLPdiNaUPl hlsc0poPNUDru025rm/AfjMV7BeqSZ0h34yIXscs105GlFZpqq60NwrBWIVi+ZCHMqOY 2lACYtBw7+QbpRYQrtEUuyUz0e4vVICqAHZLuvrgD/eF7Z2fGwqUFgF32mRl0qYAtjlD 1omw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ygXHksL4; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l2-20020a05687040c200b001dd615459fcsi5988965oal.329.2023.11.08.23.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:03:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ygXHksL4; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1B85E81373CA; Wed, 8 Nov 2023 23:01:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232670AbjKIHBF (ORCPT + 32 others); Thu, 9 Nov 2023 02:01:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232572AbjKIHA4 (ORCPT ); Thu, 9 Nov 2023 02:00:56 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2046.outbound.protection.outlook.com [40.107.223.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 206982D53 for ; Wed, 8 Nov 2023 23:00:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k8NI5sLgwMo36UmVQTmdyF1p1wSa3ULWCRXZos8k4EI4imb/NPh/t3XtkcSM2gu6awhsqpk1ettMDKto5BhRsGnApb2HzFjSHMPrG4O6aWja62TQsU6jWg4ytZuS4Ri4bEhj0rgg8Dz1Cu49JA1s0szxRC1uaWvO5mIJ0lhjyazklfvklxXAwHwdKIwK+BvFYqMeuiz5mv5Rjk9UN6YKp8fpcs9l2Si67zCeNROJG7dN2XjZDmqqXl5M5O9kS2qyYwpvzPWI770cqOt+xFREt08mcy8ik+w1mEZjBU/VVp/21Oyi+k7Rrk512U5QZkWcIRDAYBSZvwMH13zKOYkOqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=MxkqeFYWT+9d00OQhGiCkRybMEENtDhaa69IFLGHMa4=; b=JqVire9Vt29dJVCXeKCEuQE0AWdHLw6hWnm1lQkgNiMDx+rigaMgwIWHwniQK634o982VGKm+GbRtZ5TYW7rsvnIbeh9NYwCJ+fKIvgG2JP3nUXJ/P5ntO8GRlONZTCvRHMYhmO3Z3c6atJ5eAfhvc4IafbQQIXrvwii/aH4rEbO5/YdumPMrGWUViPNGcxJP+1RSZgcAGF8aVczv9Z3KGwYs8hRe8YWOg77x/KUFBS/tsqJ7RCVNwFMZf0FAcoWOsWZKI7ljkNYrHn0rGzRa7O1NFdgE97RTZVbQnNEEANUoei7FR4aUhbJNo7yxbYNTs7hJ+kXx8/Hbe1Y2w/w1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=MxkqeFYWT+9d00OQhGiCkRybMEENtDhaa69IFLGHMa4=; b=ygXHksL4RHm6M3RJaQe/tLYwj5oqb57525DBPs/2gaZi9Rg4QK/mxH8L6Ognrsjhq+1Ddvk4p2fZFfLtgfnUjpLKSIOMjqGaPHElUb/Zh6mX94ovNNKx4B+MBwZpWfgcuo3pnB3Edf58WR57aTtwx5hGl0rylb3mJ46o1lahe3Y= Received: from MW4PR03CA0067.namprd03.prod.outlook.com (2603:10b6:303:b6::12) by PH0PR12MB5436.namprd12.prod.outlook.com (2603:10b6:510:eb::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18; Thu, 9 Nov 2023 07:00:49 +0000 Received: from MWH0EPF000971E5.namprd02.prod.outlook.com (2603:10b6:303:b6:cafe::c9) by MW4PR03CA0067.outlook.office365.com (2603:10b6:303:b6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18 via Frontend Transport; Thu, 9 Nov 2023 07:00:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000971E5.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6977.16 via Frontend Transport; Thu, 9 Nov 2023 07:00:48 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 9 Nov 2023 01:00:47 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Wed, 8 Nov 2023 23:00:47 -0800 Received: from xsjarunbala50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Thu, 9 Nov 2023 01:00:46 -0600 From: Jay Buddhabhatti To: , , , , , , , , , , , CC: , , Jay Buddhabhatti , Saeed Nowshadi Subject: [PATCH v4 2/5] firmware: xilinx: Expand feature check to support all PLM modules Date: Wed, 8 Nov 2023 23:00:18 -0800 Message-ID: <20231109070021.16291-3-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231109070021.16291-1-jay.buddhabhatti@amd.com> References: <20231109070021.16291-1-jay.buddhabhatti@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E5:EE_|PH0PR12MB5436:EE_ X-MS-Office365-Filtering-Correlation-Id: 009b6875-6960-4bc9-1c66-08dbe0f19ab8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sdOG5YaQvaqcyQxgLyk0a8W4bDroT6Qk+EA/TIqTR+uBumf7UdFxGP3YxS9Ym13lDpUkaZkigYmRSWMsscEcCmeDcHkT73MsOZ5SPGnREnvaaspdKV08I3Jb6qRAb9G3aR4nJ03ngU4AOgDDZyk9mcZj6od1UFQgZFa7Xbbqqf3d0PAHNDChWSNFjXuya3faSPSyg4Q906HNRbCg+19kCMTcRlTkNrEGfEqjSxDSkfN8oK9QI9PFEe9b/MPtXlBRGIp2hAbaCDRjDmEV3jQanOS+DZSShra7XDU12iZyztaUB+NFZTnx93m36qPre+bF+GvqOVcIG+/5n+pQ3lCQmFSyyD88mfiZalWR1EhwjM/w+WqBeUHlT4OCqXFCGKibsSTut9x4xrQrQW4h1ACeVIjSgFVr6U+3Oqqbnxnyy6FjmOU1ccfDbUf4J99BNU55NDzaXNcdeAiqDzqspw3ZHxlNZOP7BCw4B9l3jPLtau1R8yJpdV1dJdJZKY8kX7d4ZSHVQ/oQnKUROxJwZOh8wwewajO4flUWqgJuoIrV7AZ0Dx8dTJbKFBBCqghyGYgkKf1kv45UO8HaKm9+30JxhbVCSP91AGcrq2CRVtmQQS/kYzTLnsXETuED9orBEsOyjlqxlwixo6t/tT8L9R9BtJ6FIggZH37R/9e9nHM/peXB4j+9FMcgvlzK6PddqMIuWLUcDmGmFfoipmgerzOZfyB0U4RQo4hSzYml7W72FkaK93z1/zrcfky8PPaVdMryLYMvpNw2zAROg03tOoKOt3W7ao2K8zUu1+qGM4auAPGxWYQ+hp/HmozRBjqtUAPKpggxN1lItuo1KZr9zGY4HA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(136003)(346002)(396003)(39860400002)(230922051799003)(451199024)(1800799009)(82310400011)(186009)(64100799003)(36840700001)(40470700004)(46966006)(2906002)(44832011)(41300700001)(8676002)(8936002)(4326008)(40480700001)(5660300002)(316002)(6636002)(70586007)(54906003)(70206006)(110136005)(40460700003)(47076005)(36860700001)(36756003)(26005)(478600001)(2616005)(1076003)(426003)(336012)(356005)(81166007)(83380400001)(86362001)(6666004)(82740400003)(921008)(2101003)(83996005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 07:00:48.8991 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 009b6875-6960-4bc9-1c66-08dbe0f19ab8 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5436 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:01:37 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782068942921209743 X-GMAIL-MSGID: 1782068942921209743 To support feature check for all modules, append the module id of the API that is being checked to the feature check API so it could be routed to the target module for processing. There is no need to check compatible string because the board information is taken via firmware interface. Co-developed-by: Saeed Nowshadi Signed-off-by: Saeed Nowshadi Signed-off-by: Jay Buddhabhatti --- drivers/firmware/xilinx/zynqmp.c | 41 ++++++++++++++++------------ include/linux/firmware/xlnx-zynqmp.h | 11 ++++++++ 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 7cf056451a26..c1c1abe9c4e5 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -199,9 +199,29 @@ static int __do_feature_check_call(const u32 api_id, u32 *ret_payload) { int ret; u64 smc_arg[2]; + u32 module_id; + u32 feature_check_api_id; - smc_arg[0] = PM_SIP_SVC | PM_FEATURE_CHECK; - smc_arg[1] = api_id; + module_id = FIELD_GET(MODULE_ID_MASK, api_id); + + /* + * Feature check of APIs belonging to PM, XSEM, and TF-A are handled by calling + * PM_FEATURE_CHECK API. For other modules, call PM_API_FEATURES API. + */ + if (module_id == PM_MODULE_ID || module_id == XSEM_MODULE_ID || module_id == TF_A_MODULE_ID) + feature_check_api_id = PM_FEATURE_CHECK; + else + feature_check_api_id = PM_API_FEATURES; + + /* + * Feature check of TF-A APIs is done in the TF-A layer and it expects for + * MODULE_ID_MASK bits of SMC's arg[0] to be the same as PM_MODULE_ID. + */ + if (module_id == TF_A_MODULE_ID) + module_id = PM_MODULE_ID; + + smc_arg[0] = PM_SIP_SVC | FIELD_PREP(MODULE_ID_MASK, module_id) | feature_check_api_id; + smc_arg[1] = (api_id & API_ID_MASK); ret = do_fw_call(ret_payload, 2, smc_arg[0], smc_arg[1]); if (ret) @@ -1904,22 +1924,9 @@ static int zynqmp_firmware_probe(struct platform_device *pdev) if (ret) return ret; - np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp"); - if (!np) { - np = of_find_compatible_node(NULL, NULL, "xlnx,versal"); - if (!np) - return 0; - + ret = do_feature_check_call(PM_FEATURE_CHECK); + if (ret >= 0 && ((ret & FIRMWARE_VERSION_MASK) >= PM_API_VERSION_1)) feature_check_enabled = true; - } - - if (!feature_check_enabled) { - ret = do_feature_check_call(PM_FEATURE_CHECK); - if (ret >= 0) - feature_check_enabled = true; - } - - of_node_put(np); devinfo = devm_kzalloc(dev, sizeof(*devinfo), GFP_KERNEL); if (!devinfo) diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 9e923e55f5d1..96f3d949afd8 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -32,6 +32,7 @@ #define PM_SIP_SVC 0xC2000000 /* PM API versions */ +#define PM_API_VERSION_1 1 #define PM_API_VERSION_2 2 #define PM_PINCTRL_PARAM_SET_VERSION 2 @@ -47,6 +48,9 @@ #define FAMILY_CODE_MASK GENMASK(27, 21) #define SUB_FAMILY_CODE_MASK GENMASK(20, 19) +#define API_ID_MASK GENMASK(7, 0) +#define MODULE_ID_MASK GENMASK(11, 8) + /* ATF only commands */ #define TF_A_PM_REGISTER_SGI 0xa04 #define PM_GET_TRUSTZONE_VERSION 0xa03 @@ -112,6 +116,12 @@ #define XPM_EVENT_ERROR_MASK_NOC_NCR BIT(13) #define XPM_EVENT_ERROR_MASK_NOC_CR BIT(12) +enum pm_module_id { + PM_MODULE_ID = 0x0, + XSEM_MODULE_ID = 0x3, + TF_A_MODULE_ID = 0xa, +}; + enum pm_api_cb_id { PM_INIT_SUSPEND_CB = 30, PM_ACKNOWLEDGE_CB = 31, @@ -119,6 +129,7 @@ enum pm_api_cb_id { }; enum pm_api_id { + PM_API_FEATURES = 0, PM_GET_API_VERSION = 1, PM_REGISTER_NOTIFIER = 5, PM_FORCE_POWERDOWN = 8, From patchwork Thu Nov 9 07:00:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 163254 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp261098vqs; Wed, 8 Nov 2023 23:03:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuAxpjczlRHiXnY5gjvtA+bf8Vj+UfThEahegDGSuHREeY0DYegicZgqPh1+p84BXPRz/D X-Received: by 2002:a05:6808:1491:b0:3ad:fdfb:d384 with SMTP id e17-20020a056808149100b003adfdfbd384mr1081295oiw.53.1699513381193; Wed, 08 Nov 2023 23:03:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699513381; cv=pass; d=google.com; s=arc-20160816; b=lZNkh9c/me2Ect/Qlhr2OdHJgXZELUqLJ/1LveOxMdjjqrJrOfVxEeXJJLuNppUj1z 3Ts2GFpIKDcRJfAzJGkyFe3B3rHMgMfQilUzFsbEB7o4usOh9J83/d6tMgI9x+9e1DCF 83xEVQi3sYRohjb27vdXj8o7fhTYp4GuOw2bKOxWnuh9VLc1hMKQtjepxEglB1PHogpn Rr4v83I0szql1hyt6mJiI4iVv3i/AQKF1mcgXyMwPf+eW7PlgZjgWFre5o7d3xJdtmDn AUq6kjshsLokTikW+Mfn1UU8VR/gf5QN29MX55HVWYOe38fm4FlIhib6L1YyzeyRL0Jh ACrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=57H4E/1nShYJF3zSB+xtsx3ivtwtysaVDIn145Z+luw=; fh=gIKhFCW+0NmdG2LebzHvjDHcvHM1Ww9t3Fi1XhubRNY=; b=fXhm87+pbIS1YL3vGUgSYQe1LlAlDs/8gjhib0N2EIVEURavalW537sGm4vTJSJSQl 6JwOg7HyKeejI3HTOdgU66tJiHTJ+dvVFReGeb7F5S1T8VmSyISleZIGo6VAxbiby5Sl 808NIWY2Shr6YsfkZsYyQa5H5ibsv59n5kI9wr7KerinhIHDAhdt+22DVfVnN0jpGHYT XNrOItIdFWYn4nwtgJ09mKwBQ94prsR8pU9PT8RCxqreqaBS2Qb0bKotb1jCVBHYFRca gi2rFcTVcLxzPnflHmIJfiUYaRfJO7f/yqZVbykY091RbicHvUG1hjGDkcC/8qGnKDIv dOWA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=z39KscQs; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 8-20020aca1008000000b003af609c3e28si2583592oiq.275.2023.11.08.23.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:03:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=z39KscQs; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1BAC780DEA7B; Wed, 8 Nov 2023 23:01:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232651AbjKIHBC (ORCPT + 32 others); Thu, 9 Nov 2023 02:01:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232571AbjKIHA4 (ORCPT ); Thu, 9 Nov 2023 02:00:56 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2065.outbound.protection.outlook.com [40.107.223.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D86DB2D51 for ; Wed, 8 Nov 2023 23:00:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ERWMM7IhMzcytIgAZfvJIuKlYHyyRQ+QgNfEQlQSTMFDzvQ9j7hXshIYgNVSoz1Lr60a5OghX6JtQuKFCyxC6YeXwdOlfeiIFt7pfVAQYfieIR6OvQb/hxvYbkVM0yG20LfZyExrpLuVGlaaQsQLCeVLWfqQ6cBjlVIxu65rYCEZneFIRgl6N6vlme8SMs7izUm3OsvF2e1VqnIcXJxBKWgh3cVSBco7eyajYf3S2ZJAbZ8oYyyhDJWzqiQA9CooMzMDV9YMmq/ozJn3bYHX0loT/z61KsHEF0cMM4L3FawSb+n29nO+6WjhWE62/5hYfN4RQZirGj65t7K1j+6rPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=57H4E/1nShYJF3zSB+xtsx3ivtwtysaVDIn145Z+luw=; b=WChGQZ6M7Z5yW4aoAXI47fWCbuFZlAV4kmfU/FaEV1/4Thjbcyt2/IYTOjKq6WqjEDiQwFgvo7W5VhnTIjcPI6+V1iQt0/uD5jB9GmhQeeCS4NBUahuAbHYylItrOJqc3TdOJVPP9NHI/LcbO3R7yMXrxUX1zusf0jYX9YQYPPa4buaCwcSX99+Ac+b3tkwj07wQGCClYkcnKNkNUP+Ue/FShhORkxpJsLsOFllCH5z/ceOhCgbc4W8d7UcrLqkMIa0NaujucXafRWuI0okuzoA43ICHKvAPTHJYFXfOtzOT9JfoYDyzct7dKH2XEOog07h4cbMG3pHPT6f43i2fhw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=57H4E/1nShYJF3zSB+xtsx3ivtwtysaVDIn145Z+luw=; b=z39KscQsh3Jxsm0Avj432ssDqK9eo9gBAqklmLmLlcnGrTR1yM4bP8lBAdrudivsOdIMzJoDE4biLHZ2tX58a/oaMH3di40lug9dMFRreYzSABocMeTRcuVic2Vt9wPdKPSoFOSubHHmiVr2fnHixGCZ6dA4jOOcu0zvtabJayo= Received: from MW4PR03CA0074.namprd03.prod.outlook.com (2603:10b6:303:b6::19) by MN0PR12MB6320.namprd12.prod.outlook.com (2603:10b6:208:3d3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Thu, 9 Nov 2023 07:00:51 +0000 Received: from MWH0EPF000971E5.namprd02.prod.outlook.com (2603:10b6:303:b6:cafe::1b) by MW4PR03CA0074.outlook.office365.com (2603:10b6:303:b6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19 via Frontend Transport; Thu, 9 Nov 2023 07:00:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000971E5.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6977.16 via Frontend Transport; Thu, 9 Nov 2023 07:00:50 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 9 Nov 2023 01:00:48 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 9 Nov 2023 01:00:48 -0600 Received: from xsjarunbala50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Thu, 9 Nov 2023 01:00:47 -0600 From: Jay Buddhabhatti To: , , , , , , , , , , , CC: , , Jay Buddhabhatti Subject: [PATCH v4 3/5] firmware: xilinx: Register event manager driver Date: Wed, 8 Nov 2023 23:00:19 -0800 Message-ID: <20231109070021.16291-4-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231109070021.16291-1-jay.buddhabhatti@amd.com> References: <20231109070021.16291-1-jay.buddhabhatti@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E5:EE_|MN0PR12MB6320:EE_ X-MS-Office365-Filtering-Correlation-Id: 249a7e4c-e456-4096-af5d-08dbe0f19bad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UzCGSgrDPhVC0w5O/NvH+PK2RSdOEYD4Zlf19xkJyxdf4WpTUHaks6LAn/dQN+rJQjsPGGbxJke7DwyY44W+6BAkJXg/vqAYXI2nSTtv+tAjLb4fO7B4IQeqA6LGqK20IF2HwNIB0wQXrt/d4mVnaUTG5e3q2u4v/f8KPu4u5kSPqJurUHts5KbQRimvhxkXS7nW8egrk+h1077Kxu6BC72kxcq0OMi0cD2xYFg27z3rtacLkuHiwUazmHYItS2HugWM1ytmjO0/fxVx6Jmn7xcSsz6E4Ad+RshTx0hWbEM7A3iXt/mYZXOgEog+j6tfNvQJ8ruiEAxfaUXnzPbhtdlTS4hok6P2oZ5PTZKV/EoaaW+Ik3kdwhjEabVwmWtjmFfgllqA1YP1b6r1jPyHx9cp3QMPmbOAUKDof/YI37XC7x/98tlxrleUls9Sy5gSCyOyRS+tQfx8hO7XjV9gDpCI1Bsypeso4fsSrFNpOtBvp9w3DBjFdFDWEdvYpBDIy/nwnH1/dJVn0WeCwr9+GoGrPIkoVLvVZwPomjybSt+qsQhx4bVEd67j+xjXxWnqk5/O+5ZYixUx66MjwhzsHirwELb37W6DOISNMcqNVqS9rFxMEk40WjPkeOlSaDVr4JRsSrwRzxaj1yTylbrhPhnc/cMegwDmtqxnKQVdYEFjqNPPR3bXlFUhPNMQCExyP52FE6+XqFBPtGTeuiO26XIfo1l7NWQru1kF2ihXn4Ga3p/O7XBT5SSDKTxqN4ny3Mr0IuE8C7+0LEDXdI+uqr8ToRoQmlE8+ZPuaabGO/jQPmAGuynqqECZwOxD+LyxhdUNw9A4FWduV0NldySCIA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(39860400002)(396003)(136003)(376002)(230922051799003)(82310400011)(1800799009)(451199024)(64100799003)(186009)(46966006)(36840700001)(40470700004)(110136005)(1076003)(70586007)(70206006)(2616005)(26005)(83380400001)(336012)(426003)(478600001)(40480700001)(8936002)(4326008)(8676002)(316002)(54906003)(6636002)(47076005)(6666004)(44832011)(5660300002)(36860700001)(40460700003)(41300700001)(86362001)(82740400003)(81166007)(356005)(2906002)(36756003)(921008)(36900700001)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 07:00:50.5085 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 249a7e4c-e456-4096-af5d-08dbe0f19bad X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6320 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:01:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782068943323327331 X-GMAIL-MSGID: 1782068943323327331 Use family code in order to register event manager driver for Versal and Versal NET platforms, instead of using compatible string. Signed-off-by: Jay Buddhabhatti --- drivers/firmware/xilinx/zynqmp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index c1c1abe9c4e5..125bf6ad28bf 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -1916,7 +1916,6 @@ ATTRIBUTE_GROUPS(zynqmp_firmware); static int zynqmp_firmware_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *np; struct zynqmp_devinfo *devinfo; int ret; @@ -1979,14 +1978,12 @@ static int zynqmp_firmware_probe(struct platform_device *pdev) zynqmp_pm_api_debugfs_init(); - np = of_find_compatible_node(NULL, NULL, "xlnx,versal"); - if (np) { + if (pm_family_code == VERSAL_FAMILY_CODE) { em_dev = platform_device_register_data(&pdev->dev, "xlnx_event_manager", -1, NULL, 0); if (IS_ERR(em_dev)) dev_err_probe(&pdev->dev, PTR_ERR(em_dev), "EM register fail with error\n"); } - of_node_put(np); return of_platform_populate(dev->of_node, NULL, NULL, dev); } From patchwork Thu Nov 9 07:00:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 163253 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp260946vqs; Wed, 8 Nov 2023 23:02:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEdHOoafUrQciZGsIZARfYLYsXb48HpAe8/EKqMCabqmGEr5EPY+CGCD7y3P/ZMibunEvb9 X-Received: by 2002:a9d:6a82:0:b0:6cd:179:f80b with SMTP id l2-20020a9d6a82000000b006cd0179f80bmr4406286otq.30.1699513364287; Wed, 08 Nov 2023 23:02:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699513364; cv=pass; d=google.com; s=arc-20160816; b=XaMBYvw3P+KbPfqVnYdr1S69VKFnCB84GqvETixitwxKgV9CoFST7LOISzfU9i/9sY 2pKWRYphxw7BRCWc44bwRgkyFrotIYtpUN5ZUS/WiE97t68DmBE7Y/Tk0a6aH69We7SM 5IqTwR724DA0DRwVQvVkXLiXhN+/NgMXOg46NA+MVT9Up8mIdTsT8LPaxybOvWav+QWp cE1Oligs3kcn/dHIL5KmtgZGeOy5k5M3Qp3OHr5IjoEOKsVF1mQwVV2nXcRBXbhQNQlW +wb6yyailjf4TgpOJFQxpntBEy2V0Opz2zzh8s3+FHZwxhiLvOQDttDO8QZdp1oiyCdj eUKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Zi4pLIJ3WcTHcbA19OTh+HnnApBV0zhe5s77UMw2zoo=; fh=gIKhFCW+0NmdG2LebzHvjDHcvHM1Ww9t3Fi1XhubRNY=; b=TtRNrBOq775VEDzzTwiy3dRGIXWYj1ByRkRpUTI6fC51eII7xiyv/VMqlePwfVdNJK ZP1iizTbOu5Ar0Qh96b4KTMtRhcxFwUTGKO+QeFfeVwss4H8BaRH8WDMSuQ46h3XlITP rb51Ypsix54V9qjSwXfnGt06Nr4r9A5xvlLARGn+zhJUDF+R+cEICix/9MvJVNAddQSt soj5uJs2GColXjPBSXF8z7hJV6NsDk2Lph6/uX1iEY9Zcyn5doNHGL+Cs0xePxWRQWv8 dWBGcFbyXZNGGB0oggN0RaXGL4mAOr5pnO6yAohwN+ZV/ydLm2AYHjzJelVoawRKx5MM xPww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=1y9hrVi8; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id b7-20020a056830310700b006d635beae0fsi213342ots.94.2023.11.08.23.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:02:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=1y9hrVi8; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0806A82CC45F; Wed, 8 Nov 2023 23:02:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232695AbjKIHBI (ORCPT + 32 others); Thu, 9 Nov 2023 02:01:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232592AbjKIHA5 (ORCPT ); Thu, 9 Nov 2023 02:00:57 -0500 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2087.outbound.protection.outlook.com [40.107.96.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 397622D55 for ; Wed, 8 Nov 2023 23:00:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bbx6FDmrDyRPwGkxNwwrLU35eAxQnKfEvoywHktQsbc2w6Gtv2+IRb8PXhWEEIRF+YW4NUg0Xo9TC5EzGsrktMl9+1rQuvsp4Wn8nEhxqp44bEP46ScDdi/ndria61Mi3r4rBUoXVIlyKWurXR4vOk9J3RsRGtq94+X1RmrUV5FI0EB12wiCMQISPHFmDeoG397C88T3XvFzbHpFbdVBHQVazW8J2gk4+9HQUkBmiOEHrECWpp9AJFlWbm7TYLvQLGXQVjl5yRbCGdIx0F6IyUD9p5HCZpWwSxVyIi8sOPSGP3fmuSNCJ5me6ooNSVYDHepwdS1sBel5S0u5qnZknQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Zi4pLIJ3WcTHcbA19OTh+HnnApBV0zhe5s77UMw2zoo=; b=BhJtmeaQAoWKLpIPuyxZyrLuZW5LM6T6Fg60txNDEk1PwPqVqq8daQeid81FjyqvrHB5TOIZgrluagbAPViaITuRVkgK/FW0ZtcNJmzD2pLqMfuz5q/nGo9eQkZIvvNMCEPPdLVskgR+TSLn5GznXLvoL0KmZ0wcPEN5fHrRImRVOq9irvZtyvtWAPRSNTeCVP9BZ56h+VATMd0DiRnptAptITliZ2ePVqoygVju18hJizQYqfxISbwFyx17o5PpZNP0DDWcx8qwJQPKmrDoIMOVOu+oymu6nC7DCSqVrv9OvUwu2Uge2u4TCZdvUIgg2GCGiH4/pJaQf74Yj/4fog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=Zi4pLIJ3WcTHcbA19OTh+HnnApBV0zhe5s77UMw2zoo=; b=1y9hrVi8oerAHrfPjMzQgiRdHKzkMRpeQKKBIUnN6iOoOnTXFfJOnPYsEyEmMagirMjBvKUkR9XEZssYzY9+My5Apo5zEL18+FaHpziosZL1Sf06iuLVMXNr5w1Yt5X/Yis4p2xTYGuxo/Ozl8xWTUZHJVhP94aApNPDdpq4NXQ= Received: from MW4PR03CA0082.namprd03.prod.outlook.com (2603:10b6:303:b6::27) by DS0PR12MB8246.namprd12.prod.outlook.com (2603:10b6:8:de::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Thu, 9 Nov 2023 07:00:52 +0000 Received: from MWH0EPF000971E5.namprd02.prod.outlook.com (2603:10b6:303:b6:cafe::26) by MW4PR03CA0082.outlook.office365.com (2603:10b6:303:b6::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19 via Frontend Transport; Thu, 9 Nov 2023 07:00:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000971E5.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6977.16 via Frontend Transport; Thu, 9 Nov 2023 07:00:52 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 9 Nov 2023 01:00:50 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 9 Nov 2023 01:00:49 -0600 Received: from xsjarunbala50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Thu, 9 Nov 2023 01:00:48 -0600 From: Jay Buddhabhatti To: , , , , , , , , , , , CC: , , Jay Buddhabhatti Subject: [PATCH v4 4/5] drivers: soc: xilinx: Fix error message on SGI registration failure Date: Wed, 8 Nov 2023 23:00:20 -0800 Message-ID: <20231109070021.16291-5-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231109070021.16291-1-jay.buddhabhatti@amd.com> References: <20231109070021.16291-1-jay.buddhabhatti@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E5:EE_|DS0PR12MB8246:EE_ X-MS-Office365-Filtering-Correlation-Id: e4c77f09-82a7-4e55-18f0-08dbe0f19cda X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PBSP5SxqVRISGghTpV0jaW8OUkyVNY4DzQkiuq2lw2AJpsKCHiy3Y/jis+kD9HOElfBfNtHnGHMmFv3KxwvQp1fI2xtvuJKP4D+syUae3g5+liTDKGrzISwymVIzcO3Y+VuwI/GLx1ejjpZQ2iTzt1FBuax5iePPo8Ajv1WRa3iHDL8bIKSTR6mJRF0cXfzGFScU1c1BAdlF0Hm+0lm/P2wIT5TomCRbf8vZGjAdyNPO4Zcr/BPujnLEcBdQ2ZO/xH3m7WRjYwEkqarnrl983qAmBWkIq18Aa33epOKGvqhPdDozcKWxZMS+A2pnwngq2cqej8qhLRiFaqDa1eG3cvEl5Z++WU2c35VKqo7MU18ScaJevKG/oqbf0/GnkDqybFIoOm9WLlaYVQmMKHiEYJ7gX2tarOd1RfQHooizRTv+CV81O8hVbIMJug5OqrqKH11AYhQHRDTFaOsggL+5fmajfkfsVdI5UsfnWLmYKrWLa2cFD13MiTOEb+UV6wTMC123zXWdCclq0hrtRsMrlU9cS7rZEtC64K6eohWTmdRgM/JBuCA3YEwjbX4zaDqMwh12rkR80sE/7llMV7z6gWuWEcjsttH9foph1RKyPxXTUL6qz1a/1PVUb5x2IM+kwD6FGOMpBHvpVB9BYdpq/Cwmfso83OMBggYp9cJ1+p1p//5/7RU6TIDsR4J0sKhnI7rGaKUBj4tAYYZ8UFn+i6+NJFU6qP+QiN4qNYJLifex3wvZ1tSZx5LuvkR96uMb97EFD4qlPFIZoyfyZwr4fv5yoc/VUp4n4hxKvpAXz864WXNFyRG65yk5vrkrKnOYGZiTO7L/9N4NNpjq80EZAQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(396003)(136003)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(186009)(82310400011)(1800799009)(46966006)(36840700001)(40470700004)(40460700003)(40480700001)(478600001)(921008)(82740400003)(47076005)(36756003)(36860700001)(81166007)(356005)(83380400001)(86362001)(2616005)(110136005)(54906003)(1076003)(2906002)(41300700001)(70206006)(26005)(70586007)(44832011)(15650500001)(336012)(6666004)(5660300002)(6636002)(8676002)(316002)(4326008)(8936002)(426003)(83996005)(2101003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 07:00:52.4773 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4c77f09-82a7-4e55-18f0-08dbe0f19cda X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8246 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:02:19 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782068925373853704 X-GMAIL-MSGID: 1782068925373853704 Failure to register SGI for firmware event notification is non-fatal error when feature is not supported by other modules such as Xen and TF-A. Add _info level log message for such special case. Also add XST_PM_INVALID_VERSION error code and map it to -EOPNOSUPP Linux kernel error code. If feature is not supported or EEMI API version is mismatch, firmware can return XST_PM_INVALID_VERSION = 4 or XST_PM_NO_FEATURE = 19 error code. Co-developed-by: Tanmay Shah Signed-off-by: Tanmay Shah Signed-off-by: Jay Buddhabhatti --- drivers/firmware/xilinx/zynqmp.c | 4 +++- drivers/soc/xilinx/xlnx_event_manager.c | 6 +++++- include/linux/firmware/xlnx-zynqmp.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 125bf6ad28bf..ff57dda669c7 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -92,6 +92,8 @@ static int zynqmp_pm_ret_code(u32 ret_status) return 0; case XST_PM_NO_FEATURE: return -ENOTSUPP; + case XST_PM_INVALID_VERSION: + return -EOPNOTSUPP; case XST_PM_NO_ACCESS: return -EACCES; case XST_PM_ABORT_SUSPEND: @@ -396,7 +398,7 @@ int zynqmp_pm_register_sgi(u32 sgi_num, u32 reset) int ret; ret = zynqmp_pm_invoke_fn(TF_A_PM_REGISTER_SGI, NULL, 2, sgi_num, reset); - if (!ret) + if (ret != -EOPNOTSUPP && !ret) return ret; /* try old implementation as fallback strategy if above fails */ diff --git a/drivers/soc/xilinx/xlnx_event_manager.c b/drivers/soc/xilinx/xlnx_event_manager.c index adb875f89829..27a8d89a0a09 100644 --- a/drivers/soc/xilinx/xlnx_event_manager.c +++ b/drivers/soc/xilinx/xlnx_event_manager.c @@ -653,7 +653,11 @@ static int xlnx_event_manager_probe(struct platform_device *pdev) ret = zynqmp_pm_register_sgi(sgi_num, 0); if (ret) { - dev_err(&pdev->dev, "SGI %d Registration over TF-A failed with %d\n", sgi_num, ret); + if (ret == -EOPNOTSUPP) + dev_err(&pdev->dev, "SGI registration not supported by TF-A or Xen\n"); + else + dev_err(&pdev->dev, "SGI %d registration failed, err %d\n", sgi_num, ret); + xlnx_event_cleanup_sgi(pdev); return ret; } diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 96f3d949afd8..815bef3f0bd9 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -172,6 +172,7 @@ enum pm_api_id { /* PMU-FW return status codes */ enum pm_ret_status { XST_PM_SUCCESS = 0, + XST_PM_INVALID_VERSION = 4, XST_PM_NO_FEATURE = 19, XST_PM_INTERNAL = 2000, XST_PM_CONFLICT = 2001, From patchwork Thu Nov 9 07:00:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 163251 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp260571vqs; Wed, 8 Nov 2023 23:01:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwKDlo9SBBPx7278Gpjc0tSYHzQHyGfdbVE33oRLqzmRMP8RzXnhNxF21LJ8lCd9WbsbrQ X-Received: by 2002:a17:90b:38cb:b0:280:1cfb:f7ad with SMTP id nn11-20020a17090b38cb00b002801cfbf7admr782164pjb.4.1699513318453; Wed, 08 Nov 2023 23:01:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699513318; cv=pass; d=google.com; s=arc-20160816; b=i3xjQyj+vb0EohU8awQ+XZ7326DEgMGxaQ/vUSVQBPqlCEcusj7XKlJOjRJWU9/iSc AUlxndNY6Ri3heyg+IW5JQUlC9/TAkPMzVBnT7y/YHB55nvbKJg3tD55XsME8+5pGNcS t4nTdhnVV4kFdyiu6pdfIvbC/iiKUyYxG1UFt42wx48iQ6yCCG7UgVatcPEMWb8b8sMH CPQaJo49feq7g4vMO0DNli+NDAf53IoUibg3WGZTL9RZCWordYy9Ma5wZAGw6qUn9x+A zrVSy8YLQMSa8OOFwEPxwbgevw3QUvW7W1SW+9dR8pKe7DXoKlQp23eFG1QC1dSZvoDS +6Jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=37obLtJuRuEK9Xro89Nvw7nk7OgxJeR4+EnjoDg44Sw=; fh=ldUTls7kdfvWLd5kt+UGieqItqp/DqvzE/tibs1zBL0=; b=WSGoJk0ms+0swbY0kf1882siHpVMKR/DFtLRZ1RY3To2NrrxXPDifdILhsraaMfqYF me+Vr3z5IfHFJmmqI+F1dXf2gKyWQdMi4HwrjxYhR1CSvbOn66vRYYzDRdyPSuKT4rDc WvpsqNnrFZUFSXkiJxlkiILwe8DnO4x0cqbIHtL6WSXX9kYGEgb3KnmuIlA8Ra28V9EM 3c+SVLgxpamhQika6Qj5QcBqt9J57hqKtRInH3kOrNpcdBzy5ci+L59PHvARJPKwXLjn TEFNTx3ZjSdMpQ3UQPibYkM9nZRYuSNk/eQD1faVBsKb/W134gRvI9loFit6/Sswvd4A sjuA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=fWsW29sm; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h10-20020a170902f54a00b001c7388413besi4568454plf.529.2023.11.08.23.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:01:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=fWsW29sm; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9833E81DEED9; Wed, 8 Nov 2023 23:01:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232711AbjKIHBK (ORCPT + 32 others); Thu, 9 Nov 2023 02:01:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232613AbjKIHBA (ORCPT ); Thu, 9 Nov 2023 02:01:00 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2080.outbound.protection.outlook.com [40.107.94.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1263A2D51 for ; Wed, 8 Nov 2023 23:00:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J69Wt9Lp1TSzC5yMvgDfPUcUclzil1s6qqxccuANlNpMaL5KnJ2HY1nKYfjkWr5tCuHUvGhdWouHE0+27fyTF7xsZuaFZx7dfNj4sHKY3vOeidJMZAP7g7W7wAex1IpAbJF+GJ+onnoAaLzaHpU1bfy6jOHHJAO6gCduZZ6p/XTvgrtu8yzjn8XKzH0+N1qpjMY8Ae9YaSv2h6ETMFntitZ4wUU2LnQPUNIWmlrA6tz0LQe8jRk6m4FPuYk1BYES+8G7HyMk32INYWUz+vY39V+ALWEWdxzFnnKG8VcaRvNL9sRa+TccBaWnQHtD9Qn/7a4bpSTO2F0dUaOwHIejmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=37obLtJuRuEK9Xro89Nvw7nk7OgxJeR4+EnjoDg44Sw=; b=TGELslSe68VWtmLyVuCfK+44ma2hzOAjO6nMujWvxvXP4F1rWO71+eIf1KavQxPd83iDlmTgrqnREKIlvSJgYEiddaya+90j8ObGnhbYdf6YU8lMfcPqvpHn3G32AowX9Po5tKnCXeo4z3gDSNsS6xl8EZ+LrLUOHpSSmIpvnmo6fGUoQvjm8lV/osHVT/FywD7DHTv678LJu4TD5+JoIykrnn1nnvDvMrE0KhYZl1vNCWjllZCsJYgs8jq8jkQ+FYqc7oz2yxZCvG2L3zu6t3kmOVbKza7YxWb6YuY52m5/D59yieeFc7vXPL5uiE0Fi4tYoeWJ0/qVj20c+fvKMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=37obLtJuRuEK9Xro89Nvw7nk7OgxJeR4+EnjoDg44Sw=; b=fWsW29sm0k/fyX/HeQUn/q/luaISdqdYPBfhJy/tUgNJshYp/xhRk4IJyDw+MgFGDHFwdD7kYzCucC0THfrOwmI9F80TgQTG03GeD1Sbp/o9FA6YEDnAlMYuth+CQwapIgM9wjvFs4OFImnI8h0gPPpUkbfnRVpearXbYxOlDlE= Received: from MW4PR03CA0082.namprd03.prod.outlook.com (2603:10b6:303:b6::27) by PH7PR12MB7817.namprd12.prod.outlook.com (2603:10b6:510:279::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Thu, 9 Nov 2023 07:00:53 +0000 Received: from MWH0EPF000971E5.namprd02.prod.outlook.com (2603:10b6:303:b6:cafe::9a) by MW4PR03CA0082.outlook.office365.com (2603:10b6:303:b6::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19 via Frontend Transport; Thu, 9 Nov 2023 07:00:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000971E5.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6977.16 via Frontend Transport; Thu, 9 Nov 2023 07:00:53 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 9 Nov 2023 01:00:51 -0600 Received: from xsjarunbala50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Thu, 9 Nov 2023 01:00:50 -0600 From: Jay Buddhabhatti To: , , , , , , , , , , , CC: , , Jay Buddhabhatti , Naman Trivedi Manojbhai Subject: [PATCH v4 5/5] firmware: zynqmp: Add support to handle IPI CRC failure Date: Wed, 8 Nov 2023 23:00:21 -0800 Message-ID: <20231109070021.16291-6-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231109070021.16291-1-jay.buddhabhatti@amd.com> References: <20231109070021.16291-1-jay.buddhabhatti@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E5:EE_|PH7PR12MB7817:EE_ X-MS-Office365-Filtering-Correlation-Id: 9566ae2a-46db-435d-5077-08dbe0f19d32 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5sB7/Id1b25GEUIDe/tnuzdoDyhWK99qqOSL/xTM6TTAKJbl6aTjj/Fz4jDvIDDeygDFkKSZoA1a50bBjkI06M45KFBJhj4t588Qww2YRf94c5MS7tpCGNGB7e4ynuoTvbaQsE5/4O4iCdKSpsTjgHThqO9Dw9nkaBEW5OeGW4LX0ev06YG5bA3I1Kdjqj7f6gbD+I5+Clfn8qxiT6iwxTPIt/fokTlTJ71rzdLGej4IU/bixW/DK7X5g8mJ1hqIwdsOHrrdIPOpvBEslgC1OYdqGDdl4kBwxphrDuiGT1fLo0GVaT/z4F0MGgK43bxPs1S8Z9m5osEfPu2vFvbikyfHjVZBxTmhfVLv1a6aAaziXwprjMM4Zf/9ig8CuLcwtjEVNaFqHkKQa9uE3YZpdLkxB8Q4cV2R0nVkW5rNgk2W8NrkKaFibpu4BfqB4a28Ki3UKq2h5F8Kn+Awv3SjtvyBvEEPNcHUqEggNgfqmuzmobXUNXF2Z3+IPQ8ykjyPUiicoBEFu6q46WkPrRC7vXFes0ntd8/LazIc1W2XewGqizg5HDYf5UNjbhCuzxjRSiIMrAmxfyd/XMyniwY7Ee0Z6prloAO1rqtv0t/Xl9wlN37dNjTYFYmSnP0Uu8NRcKXeopmiVEBJKaTeZ/ePb9503Yb3U7IAdevb5rQbB2VMsvjXgg/XOgCFcCKih0RFeuQnJUYyTFVo66wZ5hyjYsDovZwEyfEfpTjbwkm+pJIWUdBPa6uUwZazZ5BOXjyZv91toEcY0PbRK6xysvPx3JTIi/1ZfX3deTvvh/TfU1RrPEhqNomYv/pnHh5brF/ukLpb9JNPyzYKb9ZwQaEH7w== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(376002)(39860400002)(396003)(136003)(230922051799003)(1800799009)(451199024)(82310400011)(186009)(64100799003)(46966006)(36840700001)(40470700004)(6666004)(110136005)(2616005)(6636002)(316002)(1076003)(70586007)(54906003)(8936002)(40480700001)(4326008)(8676002)(40460700003)(83380400001)(70206006)(26005)(336012)(478600001)(426003)(921008)(36860700001)(36756003)(5660300002)(2906002)(47076005)(86362001)(81166007)(44832011)(41300700001)(356005)(82740400003)(83996005)(2101003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 07:00:53.0555 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9566ae2a-46db-435d-5077-08dbe0f19d32 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7817 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:01:46 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782068877773093457 X-GMAIL-MSGID: 1782068877773093457 Added new PM error code XST_PM_INVALID_CRC to handle CRC validation failure during IPI communication. Co-developed-by: Naman Trivedi Manojbhai Signed-off-by: Naman Trivedi Manojbhai Signed-off-by: Jay Buddhabhatti --- drivers/firmware/xilinx/zynqmp.c | 1 + include/linux/firmware/xlnx-zynqmp.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index ff57dda669c7..06116a1cc62e 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -103,6 +103,7 @@ static int zynqmp_pm_ret_code(u32 ret_status) case XST_PM_INTERNAL: case XST_PM_CONFLICT: case XST_PM_INVALID_NODE: + case XST_PM_INVALID_CRC: default: return -EINVAL; } diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 815bef3f0bd9..f9af5ddface5 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -174,6 +174,7 @@ enum pm_ret_status { XST_PM_SUCCESS = 0, XST_PM_INVALID_VERSION = 4, XST_PM_NO_FEATURE = 19, + XST_PM_INVALID_CRC = 301, XST_PM_INTERNAL = 2000, XST_PM_CONFLICT = 2001, XST_PM_NO_ACCESS = 2002,