From patchwork Mon Oct 16 11:12:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 153339 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3382456vqb; Mon, 16 Oct 2023 04:14:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtNkyOc51fu758QagDyIVFPfAOPbNrS13K5W6CXhxbZ2+zvkGo7KGpd05eGkwIk1wgJx5i X-Received: by 2002:a05:6a20:daa8:b0:171:947f:465b with SMTP id iy40-20020a056a20daa800b00171947f465bmr23111465pzb.4.1697454878722; Mon, 16 Oct 2023 04:14:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697454878; cv=pass; d=google.com; s=arc-20160816; b=peX23ANlnDSQWkmJTnSlBFYYXiLCiLoZAzUEfxKW94Exzfgw1tHDrzDg/LsOBV3fa2 4rN1xLNXKbNLVZ6J/1nqL20KQqe7/3E3FM4Kw3xjTpXHfFiYhzDS3QiZJZMWWeVgmon7 qWBNClMilBge9JrOtIHQa1zPboNXPCSzIh+yCKJb1jvh4t9tPWK+wMtKHu8C43YGX1Wj T9UkQbGSNnB8D+h7HUf6RbkV41U9zmeDCZs56ZFk1gi7MQMCEg/tGTGFqU/qKHC6mdwv zvt36IdOYuqlJYT22tUY+BU+Lf7d7xwW8WIMQKa72x3pfy5r7FfF55MEfhPF0z8g3i2l UKSw== 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=b3VnqeEYDcFCm7NWLa6MTra1tc/EbEowVY0FMuyQ7Ro=; fh=j3U+pyfVxKdap00B/7zd7BOcygTLbSil8Ee1pH5W5p4=; b=jJUqgow/kd4QKZH6G+rcBRyRSThO0t5Sfg4BhHdJHGM3HkTW+ppIOUwPqmUCPT5yRA lKd2f2mp/agoDMq0kskbXI76/JUnjGoOO0Y6+oOQdzvLjz3ogg5VNo6Os6359CaPMvp1 vu4ThyLnDjr+R5+Xkx3IBPS0aNiqkh5yx+c3NlMzPq99Gi+FZiT8ML5Bp+THelNnjbXc 85aPWG12aGyrqr0lxlSSJXNnXb70TJAXLks+SDM9Rmx2QLGBMaSiOHhqLjHb5Ks9Qfmh E/lhXoPSues8wV6oYt8vTAODLjyEbRAiYgEEmuPdgVM7ijnCy0qtxzzLhwryrzVcxbH1 YSfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="uhXsdX/1"; 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.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id z123-20020a633381000000b00577516d9a0bsi10146896pgz.502.2023.10.16.04.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:14:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="uhXsdX/1"; 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.36 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 pete.vger.email (Postfix) with ESMTP id D5CE680A9997; Mon, 16 Oct 2023 04:14:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232745AbjJPLNm (ORCPT + 18 others); Mon, 16 Oct 2023 07:13:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232547AbjJPLNj (ORCPT ); Mon, 16 Oct 2023 07:13:39 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2043.outbound.protection.outlook.com [40.107.237.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 220A383 for ; Mon, 16 Oct 2023 04:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IyXRdC99XknicOhGilUFB3goauQgifql6bfPx3T0ogbJGWQC5OYcsvkBY0jIZprlxZ+ceMBR+X7AcD+ItPU3ypHf+G9EiLBRy3QIT6FxbRTpYfS5OXwggnQtGIpnrpRsMeKoaBljVhMd/VZEkmzM2GhBbkWr5lXZUf2NDwsEqr+ndxAZGan+fvoPPRpow82x93ErtdvIGTDQFwx2d4iqSOvODp1hS0eFVox7iXPtxb4ALrMz9IQsILaithwwG8NXHn5YxCO4wHN8ZMsIXpyZqSA/IrKdVVtAw+adwJv0YUNirRQ0XHGLFua3N07IGQwvwp9Qu3pn1xEYGrzyVndQNQ== 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=b3VnqeEYDcFCm7NWLa6MTra1tc/EbEowVY0FMuyQ7Ro=; b=jK+vLUZe/QZG4FWEe02uxZdILl4prf2aCGTIHbPGIkqQ6a2e6+RgwYXpnhciD7jxsROkEsAgzHfWO0qsrFzG/oxS1nECo3kh8smWA+dDcqKcUdTTXH+tq3tWeGQHjRaWF107DWuiYiwr+/wSik3PnexGLFgpbrikXsrrQBAssg/QINKJTvokBJwy6mgb32UwnMGwvPXvWcYEopB7Mo3HTdaF5PaTdaTxMhBot9zlrQwAPHSFer1nV6unsT0AoHhRXnEAVb7927YOBgtxMuWOIlMuBcQtS89PbyTT00auKAp/y4BVL5S71cYzLkXGpqROcSgbpO8Uc2jcxKQKLIt/Xg== 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 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=b3VnqeEYDcFCm7NWLa6MTra1tc/EbEowVY0FMuyQ7Ro=; b=uhXsdX/19QEjx9bMCEZw6qrEwjU7KwYGzoU9A0UdOM36JgNdgA9BfCtRDrExrhk2zBRu9bilNfhx68KsyC02sJ8sByewzLRYp7aMTBpyalgdPRM23OYAt921o/PqhBCcfAahr6+dOIy1qQ2pdq72dUOe0ZR0g2BbdmVXQTK4370= Received: from PH8PR20CA0013.namprd20.prod.outlook.com (2603:10b6:510:23c::27) by PH8PR12MB7026.namprd12.prod.outlook.com (2603:10b6:510:1bd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Mon, 16 Oct 2023 11:13:32 +0000 Received: from SN1PEPF0002BA4F.namprd03.prod.outlook.com (2603:10b6:510:23c:cafe::37) by PH8PR20CA0013.outlook.office365.com (2603:10b6:510:23c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.47 via Frontend Transport; Mon, 16 Oct 2023 11:13:31 +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 SN1PEPF0002BA4F.mail.protection.outlook.com (10.167.242.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Mon, 16 Oct 2023 11:13:31 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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.27; Mon, 16 Oct 2023 06:13:30 -0500 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.27; Mon, 16 Oct 2023 06:13:30 -0500 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.27 via Frontend Transport; Mon, 16 Oct 2023 06:13:29 -0500 From: Jay Buddhabhatti To: , , , , , , , , , , CC: , , Jay Buddhabhatti , Izhar Ameer Shaikh Subject: [PATCH v3 1/5] firmware: xilinx: Update firmware call interface to support additional arg Date: Mon, 16 Oct 2023 04:12:57 -0700 Message-ID: <20231016111301.13369-2-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231016111301.13369-1-jay.buddhabhatti@amd.com> References: <20231016111301.13369-1-jay.buddhabhatti@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4F:EE_|PH8PR12MB7026:EE_ X-MS-Office365-Filtering-Correlation-Id: ee47c35e-6b4d-4acc-0b40-08dbce38ee8c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DYVmk2whIBxpfQOxJLlyh513RVF6fzPzEoY+mwTreEg85d3H9wX/OWlwtW5g0VVnllX3un2WW6W3zsqnM+Cxff1aYF8GijmJLt6pdkp4prz6yn85xRTUgxWHvcvdAphcBfolRBbnX/s/dUYs9lP35CA3Ey0FT9Ad85H7XNUq126jUV4DETXWYzO/XC6jjxxsLye0NAdKYJs70gPLZL0bRnZmclJzb0XJXDzdCuLE9fbLb6gTHiCVlfCA7HxSxN/7odDl8G0zEN2bXJIDIKtBiHlpiIiyWSg7+UPDnJ48XKHDZaPtyHTHMs9h/QNkKhTAlEuFcTL9BpzZCHQFK7TgHJrmE6sm4DS8fJ93NHwTcGdBejVLQCEiMSbF4PwFF5ZaTRnyQQ3Z/cAFmFeq20iVOc0YZxSPhXVy1GkckCoS4e6scZfzzKGXNf39CubpYMLn8ZrXHs0AGKQmMoD1/Be3jSop13rmQOxqb0VWfALPNv3wZ9AMAx26J8l5icbnIJgKVscSYLMVslK184T976EoKVI/oP0jfgfJvFu/eRkEBmLZA7+KkVqaX4KHmr588cBFLBFgX/q8x8s228LVfS/Cm/xMVjzHpRC94KzAE5428aBkEVYmW8+ql2f7P6+70ssRP4JO3ZtLxTOuwEldLUy0Bsot1wc2MjXNfzcQ8If56eW7LtNyjUKcMxYIQ89YS4gU2KKtkYQtn0wSI38kY022YqWlWS8L3nHrwr3Z5Ndk7AdAYuVeib1BqhE790ALXBtI45dZ3FILLdx7I4r5MuSQD0gQiPW+dmqGv3pEvBDVqzo= 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)(396003)(346002)(136003)(39860400002)(376002)(230922051799003)(186009)(1800799009)(64100799003)(82310400011)(451199024)(40470700004)(46966006)(36840700001)(81166007)(1076003)(921005)(356005)(26005)(2616005)(82740400003)(110136005)(47076005)(70586007)(6636002)(316002)(54906003)(70206006)(336012)(426003)(83380400001)(6666004)(478600001)(36860700001)(4326008)(8936002)(8676002)(5660300002)(2906002)(41300700001)(40460700003)(44832011)(40480700001)(36756003)(30864003)(86362001)(15650500001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 11:13:31.8077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee47c35e-6b4d-4acc-0b40-08dbce38ee8c 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: SN1PEPF0002BA4F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7026 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Mon, 16 Oct 2023 04:14:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779910446517379727 X-GMAIL-MSGID: 1779910446517379727 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 additional argument. 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 | 217 ++++++++++-------------- drivers/soc/xilinx/xlnx_event_manager.c | 2 +- drivers/soc/xilinx/zynqmp_power.c | 2 +- include/linux/firmware/xlnx-zynqmp.h | 4 +- 4 files changed, 89 insertions(+), 136 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 4cc1ac7f76ed..d535ff46c847 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(u64 arg0, u64 arg1, u64 arg2, u64 arg3, u32 *ret_payload) { return -ENODEV; } @@ -116,25 +115,25 @@ 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)(u64, u64, u64, u64, u32 *ret_payload) = 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 + * @arg3: Argument 3 to SMC call * @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(u64 arg0, u64 arg1, u64 arg2, u64 arg3, u32 *ret_payload) { struct arm_smccc_res res; - arm_smccc_smc(arg0, arg1, arg2, 0, 0, 0, 0, 0, &res); + arm_smccc_smc(arg0, arg1, arg2, arg3, 0, 0, 0, 0, &res); if (ret_payload) { ret_payload[0] = lower_32_bits(res.a0); @@ -151,6 +150,7 @@ static noinline int do_fw_call_smc(u64 arg0, u64 arg1, u64 arg2, * @arg0: Argument 0 to HVC call * @arg1: Argument 1 to HVC call * @arg2: Argument 2 to HVC call + * @arg3: Argument 3 to HVC call * @ret_payload: Returned value array * * Invoke platform management function via HVC @@ -159,12 +159,11 @@ 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(u64 arg0, u64 arg1, u64 arg2, u64 arg3, u32 *ret_payload) { struct arm_smccc_res res; - arm_smccc_hvc(arg0, arg1, arg2, 0, 0, 0, 0, 0, &res); + arm_smccc_hvc(arg0, arg1, arg2, arg3, 0, 0, 0, 0, &res); if (ret_payload) { ret_payload[0] = lower_32_bits(res.a0); @@ -184,7 +183,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(smc_arg[0], smc_arg[1], 0, 0, ret_payload); if (ret) ret = -EOPNOTSUPP; else @@ -299,6 +298,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_is_function_supported); * @arg1: Argument 1 to requested PM-API call * @arg2: Argument 2 to requested PM-API call * @arg3: Argument 3 to requested PM-API call + * @arg4: Argument 4 to requested PM-API call * @ret_payload: Returned value array * * Invoke platform management function for SMC or HVC call, depending on @@ -316,8 +316,8 @@ 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 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4, + u32 *ret_payload) { /* * Added SIP service call Function Identifier @@ -334,8 +334,9 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, smc_arg[0] = PM_SIP_SVC | pm_api_id; smc_arg[1] = ((u64)arg1 << 32) | arg0; smc_arg[2] = ((u64)arg3 << 32) | arg2; + smc_arg[3] = ((u64)arg4); - return do_fw_call(smc_arg[0], smc_arg[1], smc_arg[2], ret_payload); + return do_fw_call(smc_arg[0], smc_arg[1], smc_arg[2], smc_arg[3], ret_payload); } static u32 pm_api_version; @@ -347,14 +348,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, sgi_num, reset, 0, 0, 0, NULL); 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, 0, IOCTL_REGISTER_SGI, sgi_num, reset, 0, NULL); } /** @@ -376,7 +375,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, 0, 0, 0, 0, 0, ret_payload); *version = ret_payload[1]; return ret; @@ -399,7 +398,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, 0, 0, 0, 0, 0, ret_payload); *idcode = ret_payload[1]; *version = ret_payload[2]; @@ -427,7 +426,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, 0, 0, 0, 0, 0, ret_payload); if (ret < 0) return ret; @@ -459,8 +458,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, 0, 0, 0, 0, 0, ret_payload); *version = ret_payload[1]; return ret; @@ -507,8 +505,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, qdata.qid, qdata.arg1, qdata.arg2, qdata.arg3, 0, + out); /* * For clock name query, all bytes in SMC response are clock name @@ -530,7 +528,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, clock_id, 0, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_clock_enable); @@ -545,7 +543,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, clock_id, 0, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_clock_disable); @@ -564,8 +562,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, clock_id, 0, 0, 0, 0, ret_payload); *state = ret_payload[1]; return ret; @@ -584,8 +581,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, clock_id, divider, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setdivider); @@ -604,8 +600,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, clock_id, 0, 0, 0, 0, ret_payload); *divider = ret_payload[1]; return ret; @@ -623,10 +618,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, clock_id, lower_32_bits(rate), + upper_32_bits(rate), 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setrate); @@ -645,8 +638,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, clock_id, 0, 0, 0, 0, ret_payload); *rate = ((u64)ret_payload[2] << 32) | ret_payload[1]; return ret; @@ -664,8 +656,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, clock_id, parent_id, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setparent); @@ -684,8 +675,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, clock_id, 0, 0, 0, 0, ret_payload); *parent_id = ret_payload[1]; return ret; @@ -704,8 +694,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, 0, IOCTL_SET_PLL_FRAC_MODE, clk_id, mode, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_pll_frac_mode); @@ -721,8 +710,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, 0, IOCTL_GET_PLL_FRAC_MODE, clk_id, 0, 0, mode); } EXPORT_SYMBOL_GPL(zynqmp_pm_get_pll_frac_mode); @@ -739,8 +727,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, 0, IOCTL_SET_PLL_FRAC_DATA, clk_id, data, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_pll_frac_data); @@ -756,8 +743,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, 0, IOCTL_GET_PLL_FRAC_DATA, clk_id, 0, 0, data); } EXPORT_SYMBOL_GPL(zynqmp_pm_get_pll_frac_data); @@ -778,9 +764,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, node_id, IOCTL_SET_SD_TAPDELAY, type, value, 0, + NULL); } /* @@ -798,7 +783,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, reg, mask, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_sd_tapdelay); @@ -814,8 +799,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, node_id, IOCTL_SD_DLL_RESET, type, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_sd_dll_reset); @@ -831,8 +815,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, dev_id, IOCTL_OSPI_MUX_SELECT, select, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_ospi_mux_select); @@ -847,8 +830,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, 0, IOCTL_WRITE_GGS, index, value, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_write_ggs); @@ -863,8 +845,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, 0, IOCTL_READ_GGS, index, 0, 0, value); } EXPORT_SYMBOL_GPL(zynqmp_pm_read_ggs); @@ -880,8 +861,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, 0, IOCTL_WRITE_PGGS, index, value, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_write_pggs); @@ -897,15 +877,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, 0, IOCTL_READ_PGGS, index, 0, 0, value); } 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, 0, IOCTL_SET_TAPDELAY_BYPASS, index, value, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_tapdelay_bypass); @@ -920,8 +898,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, 0, IOCTL_SET_BOOT_HEALTH_STATUS, value, 0, 0, NULL); } /** @@ -935,8 +912,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, reset, assert_flag, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_reset_assert); @@ -955,8 +931,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, reset, 0, 0, 0, 0, ret_payload); *status = ret_payload[1]; return ret; @@ -981,9 +956,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, lower_32_bits(address), upper_32_bits(address), + size, flags, 0, ret_payload); if (ret_payload[0]) return -ret_payload[0]; @@ -1008,7 +982,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, 0, 0, 0, 0, 0, ret_payload); *value = ret_payload[1]; return ret; @@ -1037,10 +1011,8 @@ int zynqmp_pm_fpga_get_config_status(u32 *value) 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); + XILINX_ZYNQMP_PM_FPGA_CONFIG_STAT_OFFSET, lower_addr, upper_addr, + XILINX_ZYNQMP_PM_FPGA_READ_CONFIG_REG, 0, ret_payload); *value = ret_payload[1]; @@ -1058,7 +1030,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, pin, 0, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_request); @@ -1072,7 +1044,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, pin, 0, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_release); @@ -1093,8 +1065,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, pin, 0, 0, 0, 0, ret_payload); *id = ret_payload[1]; return ret; @@ -1112,8 +1083,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, pin, id, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_set_function); @@ -1136,8 +1106,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, pin, param, 0, 0, 0, ret_payload); *value = ret_payload[1]; return ret; @@ -1166,8 +1135,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, pin, param, value, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_set_config); @@ -1185,8 +1153,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, CRL_APB_BOOT_PIN_CTRL, 0, 0, 0, 0, ret_payload); *ps_mode = ret_payload[1]; @@ -1205,8 +1172,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, CRL_APB_BOOT_PIN_CTRL, CRL_APB_BOOTPIN_CTRL_MASK, + ps_mode, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_bootmode_write); @@ -1221,7 +1188,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, 0, 0, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_init_finalize); @@ -1235,7 +1202,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, mode, 0, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_suspend_mode); @@ -1254,8 +1221,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, node, capabilities, qos, ack, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_request_node); @@ -1271,7 +1237,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, node, 0, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_release_node); @@ -1290,8 +1256,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, node_id, IOCTL_GET_RPU_OPER_MODE, 0, 0, 0, ret_payload); /* only set rpu_mode if no error */ if (ret == XST_PM_SUCCESS) @@ -1313,9 +1278,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, node_id, IOCTL_SET_RPU_OPER_MODE, (u32)rpu_mode, 0, 0, + NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_rpu_mode); @@ -1331,8 +1295,7 @@ 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, + return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, IOCTL_TCM_COMB_CONFIG, (u32)tcm_mode, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_tcm_config); @@ -1348,7 +1311,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, node, ack, 0, 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_force_pwrdwn); @@ -1367,8 +1330,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, node, address | set_addr, address >> 32, ack, + 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_request_wake); @@ -1388,8 +1351,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, node, capabilities, qos, ack, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); @@ -1404,9 +1366,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, src, lower_32_bits(address), upper_32_bits(address), + 0, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_load_pdi); @@ -1426,8 +1387,7 @@ 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), + ret = zynqmp_pm_invoke_fn(PM_SECURE_AES, upper_32_bits(address), lower_32_bits(address), 0, 0, 0, ret_payload); *out = ret_payload[1]; @@ -1456,8 +1416,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, upper_addr, lower_addr, size, flags, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_sha_hash); @@ -1479,8 +1438,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, node, event, wake, enable, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_register_notifier); @@ -1493,8 +1451,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, type, subtype, 0, 0, 0, NULL); } /** @@ -1506,8 +1463,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, 0, IOCTL_SET_FEATURE_CONFIG, id, value, 0, NULL); } /** @@ -1520,8 +1476,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, 0, IOCTL_GET_FEATURE_CONFIG, id, 0, 0, payload); } /** @@ -1534,8 +1489,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, node, IOCTL_SET_SD_CONFIG, config, value, 0, NULL); } EXPORT_SYMBOL_GPL(zynqmp_pm_set_sd_config); @@ -1550,8 +1504,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, node, IOCTL_SET_GEM_CONFIG, config, value, 0, NULL); } 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..38cfc161a713 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, 0, 0, 0, 0, 0, buf); } 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..52a868a09106 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, 0, 0, 0, 0, 0, buf); } 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 e8b12ec8b060..2bea1b6bfbd7 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -497,8 +497,8 @@ 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 arg0, u32 arg1, u32 arg2, u32 arg3, + u32 arg4, u32 *ret_payload); #if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE) int zynqmp_pm_get_api_version(u32 *version); From patchwork Mon Oct 16 11:12:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 153337 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3382288vqb; Mon, 16 Oct 2023 04:14:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkDX2wHA/CpByhYOW8VmFwYhM4ePKq5xWitSwgh1ZIGTLE90k+l6u5QnOnk1PBRLXveHHj X-Received: by 2002:a17:902:d4c9:b0:1b8:9fc4:2733 with SMTP id o9-20020a170902d4c900b001b89fc42733mr37060894plg.3.1697454863019; Mon, 16 Oct 2023 04:14:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697454863; cv=pass; d=google.com; s=arc-20160816; b=LMoulmuR1JrZ3vt18ZCiO9h6XPbqV/XlWf9BS+L2rzS/UFShRsfYqEf3Oexe857Igd Ad9ETO1ngSBMMfUiI9OWj+L/2mrYJmBQUH4SdutVLEFbN3tJfI+XFQ3oHGie/orjjay2 Qmant/0kg+bvDztpGkAlZ8yGLODiQp5HFhRpQ1cAILWuyC3i/nKBtju93iOZwblGq5oL s5vo1r0YMA3KjHLFYl8vUFNbpE6+YJbxKG63MB/Qwvj5gQqJzCooPf+pJeMvw9FGMvTi HBrp0S10LPgisFdygBIWUAfwkuTc1FpU0ae8yb8UHG//sBapPQXwZMaLY+V1EPdpS8DD YYtA== 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=R1cSlGz84WyrX8BBQZ0YVPFRMN9TkCstOXk3EpZ9UDY=; fh=Ozmzq9oNZ6jJ+EeVKwPNfuXOZkruvnxD8W9o6JRLBJ8=; b=r4T5Ld9ycw5Vucw9VHkqtykNpGqBUe+SvE8gd6CmYtbi+6JIyV8AQsYAYxioyPBAsf 2AOrSTfSAvuolfjEr20Pu9q2r/bneTVdcBAGnT07pRRz2iiW8yEqtq1/XeBZj/7xs5E4 +4He+5vNX6eqLSnLjMRnxOz2OrWh7aBXe7Q14afLYjsmqO6JnYeGeJGAiSUIr3ADalIE Qz2O45jUbwjkzyzM30FJe12bfuWKZTfPgh7ZWgG5i0LIsA5cKlsaWo5Ly55wB7kGsIww uO3q388d0V50NQnaRZ9gj2WSM0mYd2u9rr7ZSZ/A4Jasmjo55rjwinj7ZnMvHS/0/oJy Wkow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=oAgYKwKn; 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:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id p5-20020a170902a40500b001ca86fa1e1csi1029197plq.484.2023.10.16.04.14.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:14:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=oAgYKwKn; 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:8 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 fry.vger.email (Postfix) with ESMTP id 340D48026EF3; Mon, 16 Oct 2023 04:14:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233036AbjJPLNp (ORCPT + 18 others); Mon, 16 Oct 2023 07:13:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232675AbjJPLNl (ORCPT ); Mon, 16 Oct 2023 07:13:41 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2066.outbound.protection.outlook.com [40.107.243.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 866A395 for ; Mon, 16 Oct 2023 04:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cppqKpF9ZPZifLmrJ96gjoxf1HQCvpEwvdnIZuzaT+b8AiJ8J129ZJJfbKwfW/VeLlEjx50w32lw1vDgGLvAHhZGTjV97wY+1FmctCrDeR9uZDIDM+oc7D5VBFlRw/ZuTDfsNChaStNINfQ7iMv4ZoEvK+sizQCzrVzC09Ixfv3G4tAgba45Jb/in7Zz7rLG+f3NlIqAmShn35UMRebR5eonAQrdVRSdgVUGNdzFA4aGnQTnOII0E4ixrZZyapN6qML/1XrRcoGDGfpLPDRcm9dk5fQEY92FDD6dsj4gd0T+rzFToG3PRSQPCoCjyt2OXtRidjHUzqGRImIYjf9MHw== 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=R1cSlGz84WyrX8BBQZ0YVPFRMN9TkCstOXk3EpZ9UDY=; b=FTJMtofovlNPEi+ojMJjcIYhGIaj/eG1cjtFMJKNsFYvqvSiJBVFo/6CJOhFbVUTGnpNDGLkUoJaql2qNCQ5X4daZNt0NMf6hYKiIARxvdw0ftJ2CSqVrokfKogSefq5mx5rGWzZSh7OmYn9ny7kHcAeWv7Bu6mlVjBnuVs1NxxTs0ktGfNfRNwcvQb1NlxJbwkv3FJVE+M2wsPpo1xTgLZRL4prklzbpIcrLzGJ5eybf23QNW+/LBxIsZbz5TRaat8C/vGgOPp5ZpcAsyYyZjf5ZarBoNxv+J0lgRUGQQmdhC2BlNtgVB/FkTxjjwsFISFFortOgWLV4bnjRrKn3w== 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 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=R1cSlGz84WyrX8BBQZ0YVPFRMN9TkCstOXk3EpZ9UDY=; b=oAgYKwKnZ4wDGR6vw7WoXpqohSF9GSvXBwWaax3pvt03d75X3939OVoPfDGIlEo7v1yw+zQR6/7sLSSgPIKzi69xVLtPKJ2Ui2zv4kIPcMrD55WB2vIaqLXzFfmy/gC+vFoKEh+O1mp1uRjaOi4xQmvCuHXOD1ZD87UBNgxRkv0= Received: from MW4PR04CA0337.namprd04.prod.outlook.com (2603:10b6:303:8a::12) by IA0PR12MB7555.namprd12.prod.outlook.com (2603:10b6:208:43d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Mon, 16 Oct 2023 11:13:36 +0000 Received: from CO1PEPF000044F6.namprd21.prod.outlook.com (2603:10b6:303:8a:cafe::63) by MW4PR04CA0337.outlook.office365.com (2603:10b6:303:8a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35 via Frontend Transport; Mon, 16 Oct 2023 11:13:36 +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 CO1PEPF000044F6.mail.protection.outlook.com (10.167.241.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.6 via Frontend Transport; Mon, 16 Oct 2023 11:13:35 +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.27; Mon, 16 Oct 2023 06:13:31 -0500 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.27 via Frontend Transport; Mon, 16 Oct 2023 06:13:30 -0500 From: Jay Buddhabhatti To: , , , , , , , , , , CC: , , Jay Buddhabhatti , Saeed Nowshadi Subject: [PATCH v3 2/5] firmware: xilinx: Expand feature check to support all PLM modules Date: Mon, 16 Oct 2023 04:12:58 -0700 Message-ID: <20231016111301.13369-3-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231016111301.13369-1-jay.buddhabhatti@amd.com> References: <20231016111301.13369-1-jay.buddhabhatti@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F6:EE_|IA0PR12MB7555:EE_ X-MS-Office365-Filtering-Correlation-Id: 534ebaa0-40fc-4bfd-db07-08dbce38f113 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /SUao8a35RrMfoqEwXslo7m3pP7Vye8+dYDPOLnJeHqi9xiXM2HCJGaC/jHLEaxkDmnu2vT6gd3HvZWpbZA7E+koTT7gEjM7RdqfgmMn4e8UYp/mActMZUsnlCAeEYMeG6ulcdUjmSSmqvj8wLW+OPzQ1dns7x4PqyI7b8OieP1k3feNK8ze1EXaO44T3qTbBRo9T30kz5K4ZJ9EaJquvu0r3Z7mWckUO0gg0EoiqaoEVqtflywDJIEMQ1OFPyIQUN0FrDC1GUMNcbjPOroRtbn1Hmv1kYZMA4ZotPtUHUx7vGSIFzTqVjekkL+u8mlxGhqmHVKL+v8sx/fAIhpJIKJoqQed935eaYEwxz0xTgSck9277B8TXKMSgNoo/7x/KMjPvFMmdwsE3OO2mcmDQzfmD0Hk7gEIer3SrTitEdUmDVVgbPddI/Zl9OS0L/CbAHpC7WuSZW5he62gIWozKHWBo7IDANm3mBpHNPWGAG/s032LoBWY+0dSeVm2fAPVR3vvN3W5YKvgZPpfteAl9c+zXsFDeAqX7bIY0AgXTuM1bKwqxVeBC0I++3iB21u8s2TreikNEAOnGAXEZF0S6RhQWKkohuSUVtzakUPmjsjtRk0c22gYTVvrKvCbdwRuuSKDjImWHLf/Cn2vIuxa9+HV+IdFO5uioVLBl/DcOfqMzoCRZP9PwIR7SSRc9kHEDMKlcM/LVPMQjGNk2/UkAqXnjZothv3c0LwR3VqBM4GG4SzbGeDDBOCFoU0HcrleuGgirab93qNEoqDWyKrOWCBDpxWILfs8xyQlaVjduuo= 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)(396003)(39860400002)(136003)(230922051799003)(82310400011)(451199024)(64100799003)(186009)(1800799009)(46966006)(36840700001)(40470700004)(40460700003)(1076003)(2616005)(336012)(6666004)(921005)(356005)(82740400003)(36756003)(81166007)(86362001)(426003)(47076005)(26005)(36860700001)(40480700001)(70586007)(83380400001)(316002)(54906003)(110136005)(70206006)(2906002)(6636002)(8936002)(8676002)(41300700001)(44832011)(478600001)(4326008)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 11:13:35.9595 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 534ebaa0-40fc-4bfd-db07-08dbce38f113 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: CO1PEPF000044F6.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7555 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Mon, 16 Oct 2023 04:14:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779910430714586237 X-GMAIL-MSGID: 1779910430714586237 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 d535ff46c847..353c74aa244b 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -179,9 +179,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(smc_arg[0], smc_arg[1], 0, 0, ret_payload); if (ret) @@ -1877,22 +1897,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 2bea1b6bfbd7..93a77874a50b 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 @@ -100,6 +104,12 @@ #define SD_ITAPDLY 0xFF180314 #define SD_OTAPDLYSEL 0xFF180318 +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, @@ -107,6 +117,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 Mon Oct 16 11:12:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 153336 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3382206vqb; Mon, 16 Oct 2023 04:14:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJydnPNn9oqg1Twpe9R4i6mBNdfc7nQe376Q8gj1N84f/R95h0q3jnvxlmQA1w7I5OGQqm X-Received: by 2002:a17:90a:3da1:b0:274:60c7:e15a with SMTP id i30-20020a17090a3da100b0027460c7e15amr31076381pjc.4.1697454852747; Mon, 16 Oct 2023 04:14:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697454852; cv=pass; d=google.com; s=arc-20160816; b=N8vcF/rgJYtZuutOHiX/gNYnD1yp9j5qzNN0ofbCzz5MwhzpsVJF2T8JZUBEgJqTOa 7u4G318SvPkyz+vrgRp+TvZlnQn+0iBIIDcVj2nfEGrmSAkgQTzyRXeEqKofT0PJ3ZR1 MQh+/riUzoR3IV8hKr7qtH4PYIjMuLIuYTFHIacEuE8O9JWy23AIT9a37K5nkqe6m1Yn fPU8TbbK13+ixrqYYFZDqAEnUvM8hjt1fSB9kaMItcMw+mIJheQrggtMdLW2vvtBVnaa viBH+/G9eVth7tWveKfIaF40vwoNwsFF4P7OngtUJ57Pzz/NWCSi2SSB7NSOm7DRSDWs YrxQ== 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=/s8s0Y80gUYEO5j/O3lnjzAxZJcWz3OmTye41Q3uGbI=; fh=HEBPh2/J563Z1qzOoiPTODFIMIZHKGv1ZkAHJLy0l0Q=; b=i40/r8kUeglL1y87xDLutyT8qhVtfkU5WsTJD6V6fhImlWkmt3fxT3ceI+yo/rUjgM JDF6UvcyTbJEe1ASPlJzesnJR1maDtebLZj4shFEv3N7oOvRlWUPyOnHfy3zZsh+orGV IagGJPrTd96KsM6KhjdAvKobKH2cDpci+woEXTA3W1WJXTwgU9avmIZ7hm5eJhKqIJ8M KJycuCJJbhDijTNYZvoteX1SmEPysnCHJVJiby1Z80UG6QLwrNKxA3NZx/bh8D+g9DoR mC/jB7KpZvguPzIOW551EOjH+HVdqtCID8M52gJQGB0BXd7+4tKCwJnJ/ywBf2KJRuLX nMOg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=zEJQuWaG; 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.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id hk8-20020a17090b224800b00274caaa057asi6312759pjb.42.2023.10.16.04.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:14:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=zEJQuWaG; 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.32 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 41CC18051159; Mon, 16 Oct 2023 04:14:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233099AbjJPLNt (ORCPT + 18 others); Mon, 16 Oct 2023 07:13:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232968AbjJPLNn (ORCPT ); Mon, 16 Oct 2023 07:13:43 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E400DC for ; Mon, 16 Oct 2023 04:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i60mIQrwK35qrVpqRHkPxdGh0koFL7Gj9MKAjVEm3jHk4kcfryefXug79WP/wETZvmtd1dgCulhyYnS+KU5oe939k/UIlzJnU/lAJ235jzJoC6OK/mpV0YH5FH0vzJIj2KYKt5+x3YW6a9/Kbg4sbYYRVLZJNi8Z1dULHGhtvQgeNt0Nl3tuwkkpu9phPSqJxNbWXYx7omX0/VVqsWs5M9XzLq/vJA6mzD6m3AmTMGTICnppPLFkDg7YVjirNgZXpUcwNusNg4ucVl6M06MhPGYeIUiQ06obF3P0Q5O02kWRZVxl40Ph7VJUl08h0YJpKREfopVQ60q7Q6ZpTyWemA== 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=/s8s0Y80gUYEO5j/O3lnjzAxZJcWz3OmTye41Q3uGbI=; b=dVSCj0X/giKSDTduZn57Df1bsEy/WrKeSU+jowytlYoH+r2TBiHsxysWbEskj1lIW1K818SKZusO/5DR7WTxRJMRGahPTfgcbgSri3KFLf0shNtedFoQyJOcE1IH3c2jKfKfAnSSb86sF6SXvM/P8H1R6e/YiQq7gB1fGTOG8E/ZzzBasFcG0Os+NIg84gSwUdso7QQNaFKLk3hEc51OkLHe1oXNTvXPZqyBXotxHm4a7EZKsN7RtNHn/+IvAd8pt+4ZBMluKTIWS7v2xnv+yPU4Ef/pluaB3WOQyTJUh3OON/P0bYXSu3gs/O7sxLS7XIvNorbAYI2Xip9rVKUWgw== 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 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=/s8s0Y80gUYEO5j/O3lnjzAxZJcWz3OmTye41Q3uGbI=; b=zEJQuWaGLVVgUAUCiloqi4UUxFCQPwfn3e6C+5D4jwfwPSnlsD/9FFIF9phIZn/C4W8ppiFxgrE7LOuipAl8+2YieDAU7UmPtswB9pe/98Nzh5gAXqKwoRm6IHvtMsY6mKcFmZvkCfbscTOBdJe59uFhNzD62vdEMMPoP02PjNw= Received: from MW4PR04CA0348.namprd04.prod.outlook.com (2603:10b6:303:8a::23) by SA0PR12MB4592.namprd12.prod.outlook.com (2603:10b6:806:9b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Mon, 16 Oct 2023 11:13:37 +0000 Received: from CO1PEPF000044F6.namprd21.prod.outlook.com (2603:10b6:303:8a:cafe::aa) by MW4PR04CA0348.outlook.office365.com (2603:10b6:303:8a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35 via Frontend Transport; Mon, 16 Oct 2023 11:13:37 +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 CO1PEPF000044F6.mail.protection.outlook.com (10.167.241.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.6 via Frontend Transport; Mon, 16 Oct 2023 11:13:37 +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.27; Mon, 16 Oct 2023 06:13:32 -0500 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.27 via Frontend Transport; Mon, 16 Oct 2023 06:13:31 -0500 From: Jay Buddhabhatti To: , , , , , , , , , , CC: , , Jay Buddhabhatti Subject: [PATCH v3 3/5] firmware: xilinx: Register event manager driver Date: Mon, 16 Oct 2023 04:12:59 -0700 Message-ID: <20231016111301.13369-4-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231016111301.13369-1-jay.buddhabhatti@amd.com> References: <20231016111301.13369-1-jay.buddhabhatti@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F6:EE_|SA0PR12MB4592:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bc61656-7109-4db7-fb0e-08dbce38f1b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P7VxFwG5Vo35/gcNQf0NSGfru3FWbfMm4mNQGcdPmIEnYaB0Wmh7JEvlvLIlrJgFWKyuNu7HpH6H1nN9uXn1KFipqOi5PkcyLAJ9CalmsUx312PKSBD4jk1G+JXU+7cDHu+Q7IDcnjRssEsD4MVyOI/QdU74mjeMEUZvoP1lQl+ADxffdQM4iIfKfQWAvKN+DHWRypWKEp7flffUCAHL54J65N8YpoKkYWmfI1YsM129lrgHyrVtuSnCgPcyEXN22/GZxSPFVyINVrzUrj2vnZKgMF4pqH0LO7HTGMqFEytyTTG17VSLg8vMhn4zC7KCpu6ILXyzitSy6IJhIOU6z9WQf2GoXMCIp30VTwBYnJoAEr8O0IyDvS9mnAjXKHB4OoNemr7jKNRVd3qF1hNq+G1gQChG2+WGh4RG2BERqOutosF1/vF4M6J+VqPmkMIZilHQt8/JD4soIJXdiW96OHb3X8V+GQUs+7ox/XnTVSsEIVyMCSPvekjaJzRk7odL/0lBSWCbhhZwSBuXEJpjowfLbeuevIIFgx4IhIuSa9mNt3CKJr2Ng+Ep5xxGqpybXJKHopHounyhAzzhDpeX7FOZFiInyyi+QmT8YvGhu/0nHcG8fCiKJx9L4N8BjAu+cuxKu1y8HB3R33H9HwuCPDJ3I1ZEBNR3hBTi9qwhtglkhpYMcrudWS6B6cjG58QuS3SCD7G8keQ8LTvj450RiGmQs7BLSYHdoEPcfS0DHSJK0F5AdhnzOEl58d2Gr7+OrrrcuHEtNQ2zHzDPsozw61AyScBZdXZi/dOAYxQVmQc= 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)(396003)(39860400002)(136003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(82310400011)(36840700001)(46966006)(40470700004)(2906002)(5660300002)(44832011)(41300700001)(8936002)(4326008)(8676002)(40460700003)(6636002)(316002)(70586007)(70206006)(110136005)(478600001)(6666004)(36756003)(83380400001)(426003)(54906003)(336012)(26005)(1076003)(86362001)(36860700001)(40480700001)(356005)(81166007)(2616005)(921005)(82740400003)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 11:13:37.0220 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bc61656-7109-4db7-fb0e-08dbce38f1b5 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: CO1PEPF000044F6.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4592 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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]); Mon, 16 Oct 2023 04:14:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779910419607082091 X-GMAIL-MSGID: 1779910419607082091 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 353c74aa244b..83f3c60ee2f5 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -1889,7 +1889,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; @@ -1952,14 +1951,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 Mon Oct 16 11:13:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 153335 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3382189vqb; Mon, 16 Oct 2023 04:14:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFS9ksv9EuwPmum4bkEj7ibDr8FfnNcjsFGEFhbe7jNGLA2Kricr1p25IZQHGMe5GYqNOQA X-Received: by 2002:a17:90b:4d86:b0:27c:fd8d:164a with SMTP id oj6-20020a17090b4d8600b0027cfd8d164amr15446683pjb.1.1697454851304; Mon, 16 Oct 2023 04:14:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697454851; cv=pass; d=google.com; s=arc-20160816; b=wyORsMNgPAG7cwa8s4umJ0AsTQk9a1+q2KVVh2Ulc29pEMmZjQdESPCwGBIJZxHov1 7oP7Ii7ShUbM6Q+SPYKz0w6JQK13FNBoUyEoGHiw+o35hkT/C7oYrd0xl3vY3/aB15NU iZQIUkGBELIIYr9Ax4tC6sWYfUeiDUEXefP4kcmJSHFMT4hZonU6ki5CFrE0ys7JpWq5 HwlF+oTJDTw+uxYtcsoZh8lBIiePrsbx+M1j3bUFsrNPe5AWNpeMMDxiPWtO/gVAsX13 1nryfHrIgHPtNKGZXHbrfe4/yzU4gLjcCOO8S5UMgKFCF3s1ABo9McB1PZ8rz6BxtSpW oC1A== 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=qy854sDeDi7acYfgdIh0vhAfUC0IuZOuHnhoJtI/1Fs=; fh=HEBPh2/J563Z1qzOoiPTODFIMIZHKGv1ZkAHJLy0l0Q=; b=ySUrRqhLeFbdZ+vzNvd4taJt/cDD4p0mp8xOMCC6w7MBq7FWT3E3KAiAzGwBROTeGj 2mLEK0esqSZBL7juqJQfgJ1h/K5t3Z7bWO/l+QGE4jjZLp2ms8lwijTWv2nSSj/s4qjc l+B0W1clKEQL8ZojXOFieDPvZDsRfX4wuoh50wS4S0xjMyo9sW0IYCl4Sq2XCgEFbBlD RdenZIjZaCVKJxnYXDW3+Rs9mldfKl8b7CAdF6Q/2tziu29AFZ8XoerhIJrtYjBKBf3M 9PmHBbdybTPcC+tk5zJRIQDiGWNY7awSxKTZWUgn8gnlcReqBsNgOQntEsUyu9iTj3wy 4FTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=DUCjCKUO; 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 lt4-20020a17090b354400b0027d5026b464si5668226pjb.43.2023.10.16.04.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:14:11 -0700 (PDT) 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=DUCjCKUO; 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 E74D280BBC7B; Mon, 16 Oct 2023 04:14:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233167AbjJPLOA (ORCPT + 18 others); Mon, 16 Oct 2023 07:14:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232547AbjJPLNu (ORCPT ); Mon, 16 Oct 2023 07:13:50 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2080.outbound.protection.outlook.com [40.107.237.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB89495 for ; Mon, 16 Oct 2023 04:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AM0GAa4JQccHGV9I7jv9I9vBKn7RZyjPzco72g2X7q4oygcwfhi9fitoCByvH5y776xumAvj18aPhsEwGc/MrvRd8J72Yf6wbHHfMfNP24T0JXwLzFuSLZUMLVil1iAL3FpaEJ8+lHUBm3iKlXucRPaPbeFoRXP0ZLZN/8nWy2IfTYBWK5zK9PKDcpQuMZsFryjKNP6QVrbSxI0oL3tbrMjBwc/pQLVF5ADf92eFuIX1gC8cegSkJfEeHG/w6fLCCgXX+oAI/K+Zel3xZjq/4zxeGYfaZoDCVth8kOUnxo5nQJWxkWtP4Z77eXAVDZWvsXFgAIxiKZk2y6Cv/yKotw== 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=qy854sDeDi7acYfgdIh0vhAfUC0IuZOuHnhoJtI/1Fs=; b=Zx5QXqihi0Jyt/gi7mx4BpJMB/0OKAcRIdZF19alp9HUw6++1sx4i7BwqLRyRWBrbom6wODULTSn8InDKzxj+6dMOBkfxUER5+KGR6JLbk+oHkMEVdEsQuBw1xnk7Ap8TnsAk3lO+VSEu0qLE3vywOapYGpzccIE+Wdb/WU5JUrCJ1t/8As1+J2nlxYyjUd3oJJc2nUHsvOzhE7MRtuDduyEWJ4IcaQS2Fd6Gt5Dp+izd64AlagsClnqMICMdEyGTJa4+oIAkV0TAU2lAqGJ97+aEyxv0xFGHV8sm5RgyNg0KCWP7OKG3/m9rBfrf8BrJkprokc/J7NmHaDzvG8r7A== 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 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=qy854sDeDi7acYfgdIh0vhAfUC0IuZOuHnhoJtI/1Fs=; b=DUCjCKUO9/xQtJ/AgURMUn6VGD2aZWtNEb1Xb1yCsNnznSbbeI5wU/GDWMi7t5YCzTAYycN6msS3ZJG2dlLD1le2Zg48UX2Q8cDjQ7DyMhYwIM/6tQaGqBoAbsQrVj3vZ9Z9rceyWeYtSZ4e7Kh/dSMTcVmS97w8AYLzozNCTrE= Received: from MW4PR03CA0221.namprd03.prod.outlook.com (2603:10b6:303:b9::16) by SJ2PR12MB8954.namprd12.prod.outlook.com (2603:10b6:a03:541::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Mon, 16 Oct 2023 11:13:39 +0000 Received: from CO1PEPF000044FC.namprd21.prod.outlook.com (2603:10b6:303:b9:cafe::fc) by MW4PR03CA0221.outlook.office365.com (2603:10b6:303:b9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35 via Frontend Transport; Mon, 16 Oct 2023 11:13:38 +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 CO1PEPF000044FC.mail.protection.outlook.com (10.167.241.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.10 via Frontend Transport; Mon, 16 Oct 2023 11:13:38 +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.27; Mon, 16 Oct 2023 06:13:33 -0500 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.27 via Frontend Transport; Mon, 16 Oct 2023 06:13:32 -0500 From: Jay Buddhabhatti To: , , , , , , , , , , CC: , , Jay Buddhabhatti Subject: [PATCH v3 4/5] drivers: soc: xilinx: Fix error message on SGI registration failure Date: Mon, 16 Oct 2023 04:13:00 -0700 Message-ID: <20231016111301.13369-5-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231016111301.13369-1-jay.buddhabhatti@amd.com> References: <20231016111301.13369-1-jay.buddhabhatti@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044FC:EE_|SJ2PR12MB8954:EE_ X-MS-Office365-Filtering-Correlation-Id: ac6d4e39-91a0-4288-ebe6-08dbce38f29d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zMpp3hLd73SEMMOYlaOkHgP2yX8uOZosWjuAiI2C0IEZZ6/dOQegnckPSEsdo7fNzntd/tlmzAQjI0aReie2/FT0pT0AO95HbeWwTHiOTXW40qbWaDYqEazX62nB00QTF4vGk0eSUyiZ9V4oI2Uq9zVyuiKy+lu/c9eJC4hPyquW4kVwftAn5H6B7GXmZ7tuQBf+mrNRMbcQV7L6AUGLR67tRUI3GOqb1sPIACpNBXvjhLPA5x3bCX5Fsh8gsVpfnLHfLt0zE2oFA+dX5CRgC6dP0wFpcenNJZSFFavaTpsTdL6bDNuLi5+v2YB0yil84NgqPL0XRynvUE3u5WDbueolpFuRbEcyO7lWfZqze0Ccm+ASutt4WSNrlYrtA4uzfQhyDhdRVjNiBKPYbz2/Lv7A9n2yPnNRvaEcJnM0Ww2qtDSSOY0cGHKYOKXsO/AZE9bIYOtlnbQhw7PSg/fkIPVbXafF+BQoepwQ2ClGAo49Air4fki+8qGGL6sP9jKAsaUQQTIbk2j1hWqhVV4vVjqr9IFqmY3Oq5pHhVTQMD0X+lZZs3yamn5Qc8G/OCbTJ1s5GxBaCl4NeJHD1+ZhT7WD3urvZynVQDfhYzazYrMNnt1p2Nor5slQTcfDbXgSRcFoAHMe63CzYKsFksGm/8HusNneHvD1D04WUigHi0A7/4EO0YruhRc8Ge453FaaNCqCtM3c61ONfpyLY7qlDPt9Ipmx7fBp9wLN8bQ1JP1UlnVIfH4osj0BngxvzBGrzeEylHCTE4Ar2VDLvMOoAcBWmTXUlyneTJtFXLtXNoA= 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)(346002)(136003)(39860400002)(230922051799003)(451199024)(64100799003)(1800799009)(186009)(82310400011)(36840700001)(40470700004)(46966006)(86362001)(40480700001)(36756003)(26005)(40460700003)(478600001)(2906002)(6666004)(41300700001)(5660300002)(44832011)(82740400003)(356005)(921005)(81166007)(36860700001)(2616005)(1076003)(336012)(426003)(110136005)(54906003)(70206006)(8676002)(316002)(6636002)(8936002)(70586007)(4326008)(83380400001)(47076005)(15650500001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 11:13:38.4952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac6d4e39-91a0-4288-ebe6-08dbce38f29d 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: CO1PEPF000044FC.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8954 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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]); Mon, 16 Oct 2023 04:14:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779910418000872619 X-GMAIL-MSGID: 1779910418000872619 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 83f3c60ee2f5..eebd47d482b1 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: @@ -369,7 +371,7 @@ 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, 0, NULL); - 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 38cfc161a713..f80f4308a58a 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 93a77874a50b..7abbb4ab4490 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -160,6 +160,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 Mon Oct 16 11:13:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 153334 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3382153vqb; Mon, 16 Oct 2023 04:14:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFw4e6mYFwzlZinqFi1hjBzko0w4ns+ZcQPXcXJqr5dBtWWjrbe08aNaAR8sW83fP6/JHxH X-Received: by 2002:a05:6a20:8f02:b0:15c:b7bb:2bd9 with SMTP id b2-20020a056a208f0200b0015cb7bb2bd9mr39640392pzk.6.1697454845531; Mon, 16 Oct 2023 04:14:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697454845; cv=pass; d=google.com; s=arc-20160816; b=OPJ7x+7AYE7ETWeLiruYmkqGjYXRJhX5y7U4dFi1HvbDpXPIH1nWcjObYnnWm/aDFH aQcU2z31IOLJ/qUTCLwUC/5iblIQUoGDDmVOnx36pVbT/IHlce2cZePHcWyB3neir+IV CHDaFzrLUfU/zoRXvh8sqOwG1FEbvFqPO9q2Uav4BEFMkfpjZoPO+hd/qd6LzLzZvCWk F6FpyobAMLatmtVPA99CHQldW3zlX6c0rFtTGXNLbTvLzc7ti2PRfN2ew4x/5ZEfH9ff iXD2YOfn52FMVf9bDivMsW4Vi6G5N+5QTCBFmtATv5g2FKZT5I/r4x43v4BZUY3q57tt sblQ== 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=NXY4j9RBaywm4BtUACIAxxbEFr0Orn+oqy9voYofOf8=; fh=zbDNTDSU2RQ2UnYzkAQDix6yRfYAGiBS/NoAGAaY5Eg=; b=atzikl1U0+L9o34ctckGYsGBKKuvmhRCx5QsDsawgUoTw3W0g0GcVUqLL+DxQ/lFVg ULO7imgdS+D0MckweO9k7SrYis0VMwoFWgadg0WyPlPJD2/Llw7bRysI7h2A75BmjCeq p1S4aZmGeV7pB13zxrhM/uEqeQeQqQ+6mOPjyl5JtrCMcx0Vx9a882/5T27jqA+xF3mr a8qb7vj/hA8/BpLnwxSdJwqUS/WjRxplbtTVYW54Ym3sQGh0/y5YJ9I7WHov5/wXT74h Nev7ZbOeYAZeOh5zXQ10x1SgKpL+WwCIWOy7Ukhua5MRgUKtAXtw+YpgXagoNf6cn3CB XMTQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=3AE6eSGi; 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 cu21-20020a17090afa9500b002790c6760dbsi5726832pjb.70.2023.10.16.04.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:14:05 -0700 (PDT) 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=3AE6eSGi; 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 D27D8803E7B5; Mon, 16 Oct 2023 04:14:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233219AbjJPLN5 (ORCPT + 18 others); Mon, 16 Oct 2023 07:13:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233053AbjJPLNp (ORCPT ); Mon, 16 Oct 2023 07:13:45 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2044.outbound.protection.outlook.com [40.107.212.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD935E3 for ; Mon, 16 Oct 2023 04:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iAwYgz9yZ4IK68RkTunTYCJU3Bt6N19E+cG6/1/8amboyORosCLyTOdLqjQwZPkKGjhNKi36/t2jlyu01bF8Pb6j8DAbFWgiFh85WkDQ78gcDPZWhIxzZMu95/maKzAUXyqKUN3NPg/JMfOQ4UOphXgTLmgxLMnZS7Y2y9i/J4blWlLkWmhgvVA7vX3gaDXz3D3+vzyyIwkEvuf//NzoXVTlvEmOV9FA15mN+3L5MUXfGnAzOYfonEn0XRpF7U7UtyQMIFGjnJ4PMOxxBvmwEZoXa1AEBszLsSXnDLxzTHxQMYdAQv+gdyxnE010roxjavLoyk+CsWghBG7L8uyABQ== 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=NXY4j9RBaywm4BtUACIAxxbEFr0Orn+oqy9voYofOf8=; b=AfKAncLrztwNh/8c35qbnS+dvVlp+InJse2g9tBdbY7yh0p9p3Sk+RxAyaPAvdZp4RxR+SLdHLaNhWIqHF0YhW9TIKTiAgHx7uYIGWFOKgsUnzW60tOqb8FeEvjoRboCHpQvSHsnLlKqONIftkCkVj+Zo2NM6LBcX8bnBScZh6nNGgmpxWxwmOg/McZeTYkR3vju0kIzNhbezW1gWOGJ1OVGuR/b4rDzeEudBGMQ/Ywfj6asiKPu9hM/v/enccvFnzkb6cNyvjTVCDom4MS0GhHkU7wZTUBVvJCkgvxk/GnuJHYiP1K4BhGh4YQti3zFLQwbnIlf9lEx7uviFoveMw== 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 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=NXY4j9RBaywm4BtUACIAxxbEFr0Orn+oqy9voYofOf8=; b=3AE6eSGi9xpMdAM+AhtRFO8ZYYSBkHbnYMPRkIEYmupV68AAhzB82pY9wT5m0ec+4WuVLshKQHzIUeYSu/W5nW7xqU7yOI719z22KXxuV+xW6PAbxF2k9BZLBJht4bSjd4LKw/ExOHZQH2F6LQ4D5EBpjzYHKT0LicT4jSHXVZM= Received: from MW4PR04CA0356.namprd04.prod.outlook.com (2603:10b6:303:8a::31) by CY5PR12MB6300.namprd12.prod.outlook.com (2603:10b6:930:f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Mon, 16 Oct 2023 11:13:39 +0000 Received: from CO1PEPF000044F6.namprd21.prod.outlook.com (2603:10b6:303:8a:cafe::8b) by MW4PR04CA0356.outlook.office365.com (2603:10b6:303:8a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35 via Frontend Transport; Mon, 16 Oct 2023 11:13:38 +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 CO1PEPF000044F6.mail.protection.outlook.com (10.167.241.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.6 via Frontend Transport; Mon, 16 Oct 2023 11:13:38 +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.27; Mon, 16 Oct 2023 06:13:35 -0500 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.27 via Frontend Transport; Mon, 16 Oct 2023 06:13:33 -0500 From: Jay Buddhabhatti To: , , , , , , , , , , CC: , , Jay Buddhabhatti , Naman Trivedi Manojbhai Subject: [PATCH v3 5/5] firmware: zynqmp: Add support to handle IPI CRC failure Date: Mon, 16 Oct 2023 04:13:01 -0700 Message-ID: <20231016111301.13369-6-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231016111301.13369-1-jay.buddhabhatti@amd.com> References: <20231016111301.13369-1-jay.buddhabhatti@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F6:EE_|CY5PR12MB6300:EE_ X-MS-Office365-Filtering-Correlation-Id: d849cd7d-f714-436a-c84e-08dbce38f2a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pOh0WIHhWzCq8V5Hyyk4oS5Ud/DRi8yW7D5Ot6nxFQnst46Qul0mqA75dqG5Q+qX1Bm+C/pn7o1aLgcL+ntMi5Z46DKSYtRdGKVYw8t88Lw/OENMR4HY6zyorxPD97Oc7SSuxy0Kt/uCyul0yqvcTFAP883JCnDmcgbEiJRFXcSsXrKVyfkGTyT66g9UtPJW4+k72mepsa4STth2FI24Xx8YCjfe7JPj64Pizy4k0zAQ1gOQeFKeHBRagavRitbwAyzeDol8L+s3Yd4/QpipDLkkj0cyIQcv5zR/V+WyLptXQc8n/t/WRQsLGzH0g+vaWjS/kthpH7VYt0lrUxl56O3GFxNUQ7TUgTMpFDKDYJKyONCZq4zNYrcHgjrjP8CopdI0c+f9e6QSiS3OA6uuQkYpkySEnjFxD1qhqPIShmfzOLDdXzXnaeaEDDrh5dTrWkZtwMHsZTiBgY/8QYlXWYY4q8g13e3wPFl+iYfQvjHm+bY90owbxSKgGhBRgOE98DfwcG8vL2T4NBfUOSp0aA0UX0+xLhbkiKLvVo6nscEBA6+IZoXtipV2PMdUOq0N6E5fEBx2keAxGa7HsrtjYtUcaIfAbhIKM3sRnr2DdQG2EiyK0yWxO+F/1yEhFAyT1U5r+6QITe2IHhdqAH1F5lhd4MsnlnuUzc7f8YJ4xzkgiAptx03e2+xJlnvvThDkM7a/ekD9wwkUypv3stv5lDd3E39USmXctaTPLEz/oI5fF44lMpBpOHLqeigPqoaLz/ty8DG81gHaDUTBL+agum9l2CQNW+nRq25Bt2tqEW8= 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)(136003)(39860400002)(376002)(346002)(396003)(230922051799003)(1800799009)(64100799003)(82310400011)(451199024)(186009)(36840700001)(46966006)(40470700004)(110136005)(2906002)(41300700001)(40480700001)(921005)(81166007)(356005)(86362001)(478600001)(54906003)(36756003)(70206006)(70586007)(36860700001)(6666004)(6636002)(316002)(8936002)(8676002)(40460700003)(44832011)(336012)(426003)(82740400003)(26005)(1076003)(2616005)(83380400001)(4326008)(47076005)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 11:13:38.6001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d849cd7d-f714-436a-c84e-08dbce38f2a6 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: CO1PEPF000044F6.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6300 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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]); Mon, 16 Oct 2023 04:14:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779910412214604701 X-GMAIL-MSGID: 1779910412214604701 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 eebd47d482b1..7d79e6558835 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 7abbb4ab4490..453d6f54a6de 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -162,6 +162,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,