From patchwork Mon Jul 31 09:50:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Potthuri, Sai Krishna" X-Patchwork-Id: 13334215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1307C001DE for ; Mon, 31 Jul 2023 09:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=20oIGjpaGgb5LytyQPK3EhHOTbJrtVQZDMI3faZX9O8=; b=ge2fKx4Wis2Nfz leeiKuAt0KCJkAd6yaPdNNIdAwdfedIAyuVx/Kl/oRvd0GI9KJCeL6EmIDysrOd7PHL3dfclrukVb qQzoHY7VIwL7/tlWykCeK00NKcALljNbAd2aV1E+ONt3GZS783K1WSfWorrFWaL+MKZp85qV4yA4b dH9z+5MqBfJVikOxViRM9i0d0/H2Qlj6Iv1no2qEVrCCvZcxgb3gvhC4YNHACoy+2SHpnLhYKkG3V 5d9Rn/tt+rvc4eWSkwK8v5NsaK5CvLxU+ll8DFvR9JVnS968RCCq+7LinlgStDEviFiRXcDE0LPMY eMNwtqZQWFGsSjyAGaQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQPYD-00EphE-0y; Mon, 31 Jul 2023 09:50:53 +0000 Received: from mail-dm6nam12on20603.outbound.protection.outlook.com ([2a01:111:f400:fe59::603] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQPY4-00EpfT-2u for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 09:50:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SbvNXN3rBwseUmk2wJBZvg24OcLuoROu1WDe9oZtuqqlHIKuZofEeGPc65xFvvC45VzBJuFRPwiesofMOanLp7La5FAO2YNGt44iZU4/uRcQX9qTfKLpYfyo3ZW9yxXo4J5GLFw3jUzwHtIrH+jevbzJa+u1UuA+0KTyEkGAq+pcEZ3kZcqZQOcuZIHtRNEnvF2EzwDDIkeIC4SNIA5wLps1ao7WtSsMDpJiN6dGoXRdikMugaN46T/aG5fDYX5BSvstL2qr/lZdMKFLHIHRLLhGBuow2H23kNgsurVo/hdweYukLaFlGkyw3pGb1E28L/wgiIyPj+vFhOsxOy8i3w== 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=OOvxlEc20D00TShqhr2K0fPNv6SMNlfnnyJNQTfF7gc=; b=a0l70FNKVyhF9nCbEA1KQ6wuKacZ5fJSW0yW/RBQWbJYz37New7nFv4BiItEV6zZ6VN+ymhK5jbR62fXBFdxmGMSVxXsklbFJOTtdCyFOlNI4W2cVRJmgM//UnDdDtpc5w+Ac1pbn5RBv1y0wG24ZQhFjCKCcziQlUmlLCf/UJMeVtoovhArugbHHZLgz3kKhROpn6ouNgA4rNLzE7q3Rw+IdJC/96Ln/DzFG8PY7YK9MN5ySf+Oqx8hrdb1ejrPXSNh3Wi1CjO6/f8mKeWhzENg6zf8n3TeZw2zHxjh8CWAr1WfPIKn4+sjo0JKkQqqj5rCZ8RZ5c1KjOivGUY1zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.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=OOvxlEc20D00TShqhr2K0fPNv6SMNlfnnyJNQTfF7gc=; b=uOpMQVYRVZCpv59YizTP+h9Ay2UyDLN+iIE/6OFcNmH0hIruaCpQJcySRKs/RyPwqaNKg6lBn+/ki0pbvp3XZE/pG0udWX30XgzIEkIM8WB0fZnIh8joIHZHljwXDzNpP1RQrBoEdP3VAnr+o7c6PgIXlJiITuwKQDyGlMQU0HI= Received: from MW4P222CA0008.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::13) by LV8PR12MB9135.namprd12.prod.outlook.com (2603:10b6:408:18c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul 2023 09:50:38 +0000 Received: from CO1PEPF000044FB.namprd21.prod.outlook.com (2603:10b6:303:114:cafe::fe) by MW4P222CA0008.outlook.office365.com (2603:10b6:303:114::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42 via Frontend Transport; Mon, 31 Jul 2023 09:50: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=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.6652.0 via Frontend Transport; Mon, 31 Jul 2023 09:50:37 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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, 31 Jul 2023 04:50:37 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 31 Jul 2023 04:50:36 -0500 Received: from xhdlakshmis40.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, 31 Jul 2023 04:50:32 -0500 From: Sai Krishna Potthuri To: Linus Walleij , Michal Simek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mathieu Poirier , Tanmay Shah , Ben Levinsky , Marek Vasut , Roman Gushchin , Arnd Bergmann CC: , , , , , , Sai Krishna Potthuri Subject: [PATCH v3 1/4] firmware: xilinx: Add support to get platform information Date: Mon, 31 Jul 2023 15:20:23 +0530 Message-ID: <20230731095026.3766675-2-sai.krishna.potthuri@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230731095026.3766675-1-sai.krishna.potthuri@amd.com> References: <20230731095026.3766675-1-sai.krishna.potthuri@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044FB:EE_|LV8PR12MB9135:EE_ X-MS-Office365-Filtering-Correlation-Id: fb9f08e0-4b0c-47f2-c0d1-08db91ab9823 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wlV4rwD9evf8HEWaORkDDCtCOrtvzMRAOdpvJDkXc4Zm8O3mBRxqqbKa4vkDfR0NJ+NcYOd86sLnQOH+wNLUPN1BAEZPbYKWcT7MAfGli5r8NnQQbIQZI0J4ejHPeDUgHGHmk6fostMq21Gu6MSs5mw31mjv77eKVA1npx/DS/Anxy3X0SBNfQ4Ct6gK8STEa0RlD3osnA5fEx6RKlz/FqQL5I9zziJcK2Z2f4jV1NqQXpqvgm5p61eZIm9+BKuT35W5PaiufmmmZ2hEs3wZ9k3Zf55YQvmouh0zPzB4NNB4dCpDjdN/rZHxnhJlo9Y/LoqIWKtizIuAm9X4zEwAv4kpZLDaToL8ICu9fLUpMJq1eFZDAvIAoNsP2LHT1UNCa82FcxXKIQRBp4Obv2DyG7fgJm7MH8uTN7FcOcPo6qLVZ8WRfmfCBrsKNfdSsyDqA6XFkwSvWJMGzVoWuRYwepdYRLRaDIEw2hwItw2Ts9z/w300oEY5I2gmpItTPHCGLrJncCXB3hkWw4juKoxxdnZByp3U0r51U6lQoDx1sQufORzfPfiJwRfWuZ6TO18sY8RnXQCJ7dmfARsd741djk21wCayznujv9WejezK6T9qljiv9dT7bV40SjNudSSYd4/LbfFRByj0L80Xd6iflMMu33ER3d/naIjtWvGY1xTamkYov7z4N18zapsr9Fk5ld33qa+flAeAUy2XNjfhZ0+cWD6vR+Al+vX5hSSB+9ahYWuVlY56uxnuiPnGMETXkh2bGyp5YgOdDHR+qxUqXNXv5/+RKiaoJSiY5B2cAOI= 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:(13230028)(4636009)(346002)(39860400002)(136003)(396003)(376002)(82310400008)(451199021)(36840700001)(46966006)(40470700004)(47076005)(36860700001)(36756003)(40460700003)(40480700001)(2616005)(1076003)(26005)(336012)(186003)(426003)(70206006)(70586007)(7416002)(81166007)(356005)(921005)(54906003)(103116003)(110136005)(82740400003)(86362001)(316002)(4326008)(5660300002)(8676002)(8936002)(41300700001)(2906002)(6666004)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 09:50:37.9253 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fb9f08e0-4b0c-47f2-c0d1-08db91ab9823 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: LV8PR12MB9135 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_025044_946027_305AFDB7 X-CRM114-Status: GOOD ( 18.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Dhaval Shah Add function to get family code and sub family code from the idcode. This family code and sub family code helps to identify the platform. Family code of any platform is on bits 21 to 27 and Sub family code is on bits 19 and 20. Signed-off-by: Dhaval Shah Signed-off-by: Sai Krishna Potthuri Reviewed-by: Michal Simek --- drivers/firmware/xilinx/zynqmp.c | 40 ++++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 11 ++++++++ 2 files changed, 51 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index a736db4a5825..e204e2866d74 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -339,6 +339,8 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, static u32 pm_api_version; static u32 pm_tz_version; +static u32 pm_family_code; +static u32 pm_sub_family_code; int zynqmp_pm_register_sgi(u32 sgi_num, u32 reset) { @@ -404,6 +406,39 @@ int zynqmp_pm_get_chipid(u32 *idcode, u32 *version) } EXPORT_SYMBOL_GPL(zynqmp_pm_get_chipid); +/** + * zynqmp_pm_get_family_info() - Get family info of platform + * @family: Returned family code value + * @subfamily: Returned sub-family code value + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily) +{ + u32 ret_payload[PAYLOAD_ARG_CNT]; + u32 idcode; + int ret; + + /* Check is family or sub-family code already received */ + if (pm_family_code && pm_sub_family_code) { + *family = pm_family_code; + *subfamily = pm_sub_family_code; + return 0; + } + + ret = zynqmp_pm_invoke_fn(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload); + if (ret < 0) + return ret; + + idcode = ret_payload[1]; + pm_family_code = FIELD_GET(FAMILY_CODE_MASK, idcode); + pm_sub_family_code = FIELD_GET(SUB_FAMILY_CODE_MASK, idcode); + *family = pm_family_code; + *subfamily = pm_sub_family_code; + + return 0; +} + /** * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version * @version: Returned version value @@ -1911,6 +1946,11 @@ static int zynqmp_firmware_probe(struct platform_device *pdev) pr_info("%s Platform Management API v%d.%d\n", __func__, pm_api_version >> 16, pm_api_version & 0xFFFF); + /* Get the Family code and sub family code of platform */ + ret = zynqmp_pm_get_family_info(&pm_family_code, &pm_sub_family_code); + if (ret < 0) + return ret; + /* Check trustzone version number */ ret = zynqmp_pm_get_trustzone_version(&pm_tz_version); if (ret) diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index f5da51677069..075a8f7f1706 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -34,6 +34,17 @@ /* PM API versions */ #define PM_API_VERSION_2 2 +#define ZYNQMP_FAMILY_CODE 0x23 +#define VERSAL_FAMILY_CODE 0x26 + +/* When all subfamily of platform need to support */ +#define ALL_SUB_FAMILY_CODE 0x00 +#define VERSAL_SUB_FAMILY_CODE 0x01 +#define VERSALNET_SUB_FAMILY_CODE 0x03 + +#define FAMILY_CODE_MASK GENMASK(27, 21) +#define SUB_FAMILY_CODE_MASK GENMASK(20, 19) + /* ATF only commands */ #define TF_A_PM_REGISTER_SGI 0xa04 #define PM_GET_TRUSTZONE_VERSION 0xa03 From patchwork Mon Jul 31 09:50:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Potthuri, Sai Krishna" X-Patchwork-Id: 13334217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4EF14C001E0 for ; Mon, 31 Jul 2023 09:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=U4aK+IULvxmxFFjrnzl59+zHovHBOnK3uaWoIy6dHbM=; b=XiUxdAc2+7MNvj EOgI4QRIxGSXzZUWMw2SOMWukr8lMzzczI5fPsVg27LsWiysaI4Zj/m4j22flZJYemxadaWgcVdb3 oZgSk5gD3AB7T8C/j3VRoycr97CE24Y9LN/RbNuHax9xgNrmw6ljuTxqn0J1i/Ly/bRlji4P+lyIx p5MHRv1mSn9MEMysHAnCb8BnayFB29ePISQCsL6QI0T0vmDhvK+BImKAwMMb1+FsXo4QH1ctuqTrM t1xdkn0VdcxJGbAxMRI/A/WKtrl0q9UR532kdtHmmc9RMXrvXd3ibjaBuuqBD5HYMXCuW/SwnsaC8 sIXrnMNQDlJPCu+i/sgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQPYM-00Epji-2R; Mon, 31 Jul 2023 09:51:02 +0000 Received: from mail-mw2nam12on20609.outbound.protection.outlook.com ([2a01:111:f400:fe5a::609] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQPYD-00Epgw-1M for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 09:50:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TDeaW6nco5q70xRlcyT8m7DXNazYF/YKkyl3RBgWcp622arFDdqgZ1DCGaSYf0efZapl1lkqbhNdo7/ISdpB4UkMCiqcJ1aTGL2wj42JJqIA0pt3np4ie5fPY9GkqmGGkjoTKoueEWh/O1oDxAIuOmGm147d39mEj+obtK6UQnmDYP1OLayxnxv1CogCdc8ScG/A5OtgwThju31FzRYyDEFtSJh4ywTD/nJM2bVoygGEnKiq+bnY7y72+XZgfaIqkVdYWv1e21k2qPPpcx0AEfivo4lHglZQdRfQmrqf1BzSkXOm5J1GP+vBZSl3LW0++gNsDqCFDVGwD0LrkwuVOg== 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=jGwcAkL9BtI4+6t1ChQx8LrlN43S64bw11xQYGFUdr4=; b=cJUwDlaxG766wXkaCgPau4zI7V0mgpDxt0xPLThjdrk31R3znAfy0DwJZR4ITTrQjuiV7OzvSLeHm8Cnce/GQ5xo0KmAp8jQDFyBR2PnOUU25ayJL3pd/FstO0hM8vB6YLiAiHzB9k4kcBY1OidIDT+SY2lsHE8VtzhanVu9lgWaXeRPdsixvGVhj2+oNjUMgxJbg1Vr2K+Nv97tEb6e5pVv6Qo78ivUuLmL9uJPjqBYwIkdHRlEJByz+StlVhH8KxOl0U4nPuGM3cslwtVRmlH0b1SR9U69rJerPgh5rhstcl2cyYMVlQvZF/K9BTtPSpbhvwrM8FRt3iw8qPlc4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.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=jGwcAkL9BtI4+6t1ChQx8LrlN43S64bw11xQYGFUdr4=; b=opIpJvc5rpcg3bIWL+khK7O1wP9Opg4DfuCm1N3ZuKUwzCtxvzdJ7kqmIrx3rzbZw6YJ3lA/oZIWxAmDoQJl1hBPYH0DFtb4QSZuJvTDhwyXG2oe2axZcPon1MNRckzB2kI2TC/X6EKOi7X8ch6WbtJyqZI2Bfj9Axk2UkNwc10= Received: from MW4P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::34) by SA1PR12MB6894.namprd12.prod.outlook.com (2603:10b6:806:24d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Mon, 31 Jul 2023 09:50:46 +0000 Received: from CO1NAM11FT093.eop-nam11.prod.protection.outlook.com (2603:10b6:303:115:cafe::fa) by MW4P220CA0029.outlook.office365.com (2603:10b6:303:115::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43 via Frontend Transport; Mon, 31 Jul 2023 09:50:45 +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 CO1NAM11FT093.mail.protection.outlook.com (10.13.175.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6631.39 via Frontend Transport; Mon, 31 Jul 2023 09:50:45 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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, 31 Jul 2023 04:50:42 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 31 Jul 2023 04:50:41 -0500 Received: from xhdlakshmis40.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, 31 Jul 2023 04:50:37 -0500 From: Sai Krishna Potthuri To: Linus Walleij , Michal Simek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mathieu Poirier , Tanmay Shah , Ben Levinsky , Marek Vasut , Roman Gushchin , Arnd Bergmann CC: , , , , , , Sai Krishna Potthuri Subject: [PATCH v3 2/4] firmware: xilinx: Add version check for TRISTATE configuration Date: Mon, 31 Jul 2023 15:20:24 +0530 Message-ID: <20230731095026.3766675-3-sai.krishna.potthuri@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230731095026.3766675-1-sai.krishna.potthuri@amd.com> References: <20230731095026.3766675-1-sai.krishna.potthuri@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT093:EE_|SA1PR12MB6894:EE_ X-MS-Office365-Filtering-Correlation-Id: 31b02021-a1e7-40a1-05f5-08db91ab9c8e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0KYCLz2U5pZGm8wnssZAZiz65RszDkhbCitO1oX7VelZJ1hy9dSS/90Uotv+SnIOuvWZEBQwVm22Flxg2ewWe92LD0oW7LJ5iJ36xLHSn77OkqvIu3YKkXXBOfyiY8Dud5MZ6qPNXeYrunhmc5M5jjAJ6sahzyDtER9LquD71OOdHrr7R/+bANlhdD6/ag/iPa5IBxFhnGmyhlCjzBbxTxUX8SlGfL8K9dQMhLzK/bYJQWitlJO9jA14PcTQfxSpoUnHgovjcbRuXFXKT0+qODi8N3bmxdZKET62Q5Ey6G4uWoqX4eT6CHpuZYVdph7+Lx2eSPeINzpgDj14oJTRUNmt2Qm3zO1zags276Bwu15DJOSvWiTiPFNz3RmT/QUrB+U0LiIzyB+5IWRVkcMuKVZoY6My4Eg0h9dgAPHS4Aam1rWW1NNk2txvrThU+cvA4/5QO33hdvC4CZM8H3Sa9iD3RSx22WswaroqIF9GlpEb3KQ3uPeqOQux5gwezBb6IKjNRPyc7ycZ3aaK1Os49CSuQ6fwXgTaXyO0cPmEicZXSZ3KqFwQkMRQIHjE4iIwzJTYUQOXCsc6S3tFfr5c8tja5u7+K8ZBu1lyhixDHdYS8/n66dxWXCOEjeOekpG6GKlrBOHu0ZnzQlapvbDU15+7+3HaVZdy2GgJ7qog9ZH+f6evmqg9NXJDvO1agGxQsBjuXd2e3RYErY5mt4lim3C6IJyC/yJnH9ioenFldQUhoOxhD5ERIucDLEosydTmNrPm5u5JHauZrGGMkQrPFfiU/v6dU4fV6T6JCd4T2vk= 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:(13230028)(4636009)(39860400002)(346002)(376002)(136003)(396003)(451199021)(82310400008)(46966006)(40470700004)(36840700001)(5660300002)(7416002)(70586007)(70206006)(4326008)(2906002)(40480700001)(316002)(8936002)(54906003)(41300700001)(8676002)(478600001)(110136005)(6666004)(1076003)(36860700001)(40460700003)(26005)(47076005)(426003)(83380400001)(186003)(103116003)(36756003)(2616005)(921005)(356005)(336012)(81166007)(82740400003)(86362001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 09:50:45.3639 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31b02021-a1e7-40a1-05f5-08db91ab9c8e 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: CO1NAM11FT093.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6894 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_025053_552976_E36CB0BD X-CRM114-Status: GOOD ( 14.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Support for configuring TRISTATE parameter is added in ZYNQMP PMUFW(Xilinx ZynqMP Platform Management Firmware) Configuration Param Set version 2.0. If the requested configuration is TRISTATE and platform is ZYNQMP then check the version before requesting Xilinx firmware to set the configuration. Signed-off-by: Sai Krishna Potthuri Reviewed-by: Michal Simek --- drivers/firmware/xilinx/zynqmp.c | 9 +++++++++ include/linux/firmware/xlnx-zynqmp.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index e204e2866d74..e93b12ad0ddb 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -1148,6 +1148,15 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_get_config); int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, u32 value) { + int ret; + + if (pm_family_code == ZYNQMP_FAMILY_CODE && + param == PM_PINCTRL_CONFIG_TRI_STATE) { + ret = zynqmp_pm_feature(PM_PINCTRL_CONFIG_PARAM_SET); + if (ret < PM_PINCTRL_PARAM_SET_VERSION) + return -EOPNOTSUPP; + } + return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, pin, param, value, 0, NULL); } diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 075a8f7f1706..ac50eb98b17a 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -34,6 +34,8 @@ /* PM API versions */ #define PM_API_VERSION_2 2 +#define PM_PINCTRL_PARAM_SET_VERSION 2 + #define ZYNQMP_FAMILY_CODE 0x23 #define VERSAL_FAMILY_CODE 0x26 From patchwork Mon Jul 31 09:50:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Potthuri, Sai Krishna" X-Patchwork-Id: 13334218 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 001A5C001DF for ; Mon, 31 Jul 2023 09:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Vo4UdeHgv50oLZ6P9Pw0DKqDPwVI2rcxkEsRRgPLWt8=; b=r3mq51/RkpZR20 NlQNrHpmkBW8O6YO2wbQrKfPEwl6WnxkI033+D6DEMG19wIp8l9y5dGxsOE7BxFlMHT3xtReiMsan 5A2+qIeCgvR5YQyi1qK/wmecTVJW2qtsyZ/xyjnw3nSXW7c3sVIKwvD4C7Yy+8CmjLMHyZXpk56v7 MbkpBVVjGmip3eCayD0wHcEDqEb3QlDPMnveoIlMYrTEjNqwdZXWREqQi0OKqyeoIgkNv/EBQL0V+ JkyI3YQZSyjFTqcYxDpGhaeyru7DHoPLI8ZNggvdVRqY+48NW7l6i/wR4p/o3USN/BPmm+7jlFbtm y+0b8xOvLBcfdmTKuMng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQPYM-00EpjU-0v; Mon, 31 Jul 2023 09:51:02 +0000 Received: from mail-mw2nam12on20631.outbound.protection.outlook.com ([2a01:111:f400:fe5a::631] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQPYC-00Epgu-2x for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 09:50:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gobcieiM1ikFi+5FZrlWTzc3fwEf56K4lxLtQJ4Kt+bjVOOPmxKBpBnzkKO7gi/dVkeKsqU2umlf0tEHeXnwW1ITJKA7WlMZSlvF3r2Iis6c+rjhecPQ8X2jrbDosfIaTYWMBUIN1fIN7l+DluzdB4LT0zRX4ULB6miVi1ymNqGCJxnB15PzuZazqnug++uQGSrEIxyKoT5TOBPrlvfFGGh1QQPmERLDE929rKYuVVVUPVCd++FcZ9qET22+xoZNDfxuhUV9+/AdKnWvndh8qGQqWjjSGdZD6BK/by7HA8vBhorEddQERLL+1pFNgJX4+8Lk/Cv1/ll2yVTeyV8LOA== 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=uOUXFZ2fh6HfnylylmEOHS+AdxbgHvY4dnmAq80H97c=; b=nop5xx8Ju+aaxtQ1CdXEapk65aI+x3c+WCf0RgI03MJibHm47MG7/EFiRHSirCXYnKGSBqaq90ACZOEchO0Nx9ve5wzoCPGcZ1/D05T+yMKCg6H9aQh3sSmfg/kSrbtjgFblmmd1/O2uedcQQYXIAaehWcgRKA/yEVwE0+F3TjwN7o99TV8hiBuvM2im7nzttzMDjTCQmgUXel1QD21bgM+rYX4gA5N9XiQOGhb7K4WldrS9ylZT6mGjD5CJ52SORLS1pfMKmSgt+V9ymGknK186TZuvEvDuy4XOG+UE21gzeZuutrbiS81HdSkfocNeEAZO7kD/V0uumqkHzBblLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.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=uOUXFZ2fh6HfnylylmEOHS+AdxbgHvY4dnmAq80H97c=; b=1OoTEjO1YvPDFbrW66TQIqEFVjuNfPlaUqaTzoCXhHzOes52yqEZRHLX6FfmR+HpcqDBaGWSLlvLHE/3SeYJkKMNHPfa0V4q2k+6UQu2taJcpU9qHf+VnfP//jJIQdXNRcJcum2rXeVd3wEHzuG35LH62DEh5ZBvAvcRN/AaMT0= Received: from MW3PR06CA0030.namprd06.prod.outlook.com (2603:10b6:303:2a::35) by SN7PR12MB7203.namprd12.prod.outlook.com (2603:10b6:806:2aa::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Mon, 31 Jul 2023 09:50:48 +0000 Received: from CO1NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2a:cafe::9d) by MW3PR06CA0030.outlook.office365.com (2603:10b6:303:2a::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42 via Frontend Transport; Mon, 31 Jul 2023 09:50:48 +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 CO1NAM11FT064.mail.protection.outlook.com (10.13.175.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6631.42 via Frontend Transport; Mon, 31 Jul 2023 09:50:47 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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, 31 Jul 2023 04:50:46 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 31 Jul 2023 04:50:46 -0500 Received: from xhdlakshmis40.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, 31 Jul 2023 04:50:42 -0500 From: Sai Krishna Potthuri To: Linus Walleij , Michal Simek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mathieu Poirier , Tanmay Shah , Ben Levinsky , Marek Vasut , Roman Gushchin , Arnd Bergmann CC: , , , , , , Sai Krishna Potthuri Subject: [PATCH v3 3/4] dt-bindings: pinctrl-zynqmp: Add output-enable configuration Date: Mon, 31 Jul 2023 15:20:25 +0530 Message-ID: <20230731095026.3766675-4-sai.krishna.potthuri@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230731095026.3766675-1-sai.krishna.potthuri@amd.com> References: <20230731095026.3766675-1-sai.krishna.potthuri@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT064:EE_|SN7PR12MB7203:EE_ X-MS-Office365-Filtering-Correlation-Id: 2eaccb49-806a-418b-a26b-08db91ab9e05 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1RVEUhVYrsBu49phAegynB6xmyx5ZRRN/iLouA1H3WcGe25Pq/UzaJw7ffozlyYpePEtZR0EIfUtWD23OJVIawQY9Yy3NzzdpYhEHY38iNMAm1/qyuLHvzczZwuKfQesPUh0yGBrwEArQzXGVywLB+xIGs8SB8grLmWv0gpLvEHrhNOotrnblNrsuU4vl40T6VTWuZ1SrQd//J/deM2DlUoLQOIPASpwwMZs+4if02OAxzT4ioHJ0zRKQD1rVJM3K8LPXcGpXcUx7sjfcmY/AQSFt5PWccgdTM5u0mVVDvmqugsbyU8lhIlIke00HJKwbg63oXvxb4gqIQS5KXSdf644dPVvbIZBXs7gJxrxyzguCGiy+1Sq5Ymfw9FMHDNWZoLurabz0bignvN7bsw077Ya9u8nX8yn2dJrY7lWb8rhkOpnxFH5BD09XHpu46Xi2oy0k409AjCmzkESKEy84+4HK//MjAyLhEw1NVqWnSkjN/aRCjzcORKaAkNAWe23TKZXxEwjnD0ag8FrlTnFugpU0O0fuUpS3Zb5z7zcHphsDgmBUSH9PSGrv/FfQJdEzIPW5oHEzb0/jHB1UU4OvOlZRG9RB5BYlSUGXtrocKN5UdhbWaf0cdBZfVMpkSLd4e9loGQLgft75oW0Kux2qOgoctQlXa8sUaEeoSS8FZRobSRzPJ+SRvJ7SwYrSHJlC9CgWNeS7BQ+CkJKbiESh6gR0GRlc1osc23+oCAKM5SktSkji8ddT824GUEiZ7elIxbPCp3WMD2R0IGpcu50TvYh8pJlAjkilfJmRAT+dPo= 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:(13230028)(4636009)(39860400002)(136003)(376002)(346002)(396003)(82310400008)(451199021)(36840700001)(40470700004)(46966006)(2906002)(41300700001)(316002)(86362001)(40460700003)(8936002)(8676002)(7416002)(103116003)(36756003)(40480700001)(5660300002)(336012)(356005)(921005)(81166007)(186003)(478600001)(2616005)(54906003)(110136005)(82740400003)(6666004)(1076003)(26005)(47076005)(36860700001)(70586007)(70206006)(4326008)(426003)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 09:50:47.7943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2eaccb49-806a-418b-a26b-08db91ab9e05 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: CO1NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7203 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_025052_951062_CB0F661A X-CRM114-Status: GOOD ( 13.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add 'output-enable' configuration parameter to the properties list. Using these pinctrl properties observed hang issues with older Xilinx ZynqMP Platform Management Firmware, hence reverted the patch previously. Commit ff8356060e3a5e126abb ("Revert "dt-bindings: pinctrl-zynqmp: Add output-enable configuration""). Support for configuring these properties added in Xilinx ZynqMP Platform Management firmware(PMUFW) Configuration Set version 2.0. Linux firmware driver checks if the configuration is supported by the PMUFW when it gets request for TRISTATE configuration from pinctrl driver. If it supports, then calls will be made otherwise it returns error. Signed-off-by: Sai Krishna Potthuri Acked-by: Conor Dooley --- .../devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml index 2722dc7bb03d..1e2b9b627b12 100644 --- a/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml +++ b/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml @@ -274,6 +274,10 @@ patternProperties: slew-rate: enum: [0, 1] + output-enable: + description: + This will internally disable the tri-state for MIO pins. + drive-strength: description: Selects the drive strength for MIO pins, in mA. From patchwork Mon Jul 31 09:50:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Potthuri, Sai Krishna" X-Patchwork-Id: 13334216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1D49C001DE for ; Mon, 31 Jul 2023 09:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PNPWtUYW0qGRDRupOoouo8Ig3hFb5XmUqacAWZ8UnKs=; b=IZ7OwMFiI5Wq5d YvQGJaEDBJOt63NdfqdnVQ++1YWnrLJ9B1B9m6b/p3yFSa+5XS0sl9BvKS7ZxgIyqLA4zyvGQC1eN 9j4V+V50SbryaPFzQJRPADP07aCwB/5zSx8lXYztOY43XmMHmpy6h6v9EuFf9Ec1uC2CqQQW0+v+p gxYanorPpgUKVkD9fPwW4Nx/K3oiUwaPyWaSX5K9VVeFhdVovNzqTgTW3yNyP8txPN5SW7wOhox2G 1ub2khwjc9FL8t2eTvW+EUwBH/nTCCbBk30CNWx9oD32t3C7O0laoi7opKmHduRUw+miYb0Sqxp+g 7nJxDdLAXrXd1ITMbcSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQPYN-00Epk3-0o; Mon, 31 Jul 2023 09:51:03 +0000 Received: from mail-dm6nam10on2061c.outbound.protection.outlook.com ([2a01:111:f400:7e88::61c] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQPYH-00EpiC-0y for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 09:50:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L5Pvy7VMDcOdl55ifHSnHa8EpSfR66BmMJNcQUyWyH1IkhlcIH/tFoEW//yKZ7czqFWUpyrEGbjL0sjbCgqvxitq1khx55FPBFbsoUu9gLYbOGSgPIEEg4/Ja8itx4R0H//whOjbKQK0N2woVh4XjCTOEDmCcou+bWkVgBBrFc5/QYObJoCiuH21XUbKctBa3QJUtnXkx2lKx8FlR4DebUKwCGu/NQLJM/J31xkR4Ol0fZIKM98dQTQs6cMXEInCiIXFXQwtNF3rJQ2qXvVYQNcuMbQ0cVfhQ8nhV/UvpcLExc8y05xeahuVGSex8gv1flyJeNr+y1/LemP4w33kOA== 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=L5a6QEmM2KX38lNQl1P6r/u3Q9DZVE0Zv8YABYsrNro=; b=I52/IW+mlhl55U3K7q9W5MB0YYzhnOXjCbLvNiLayoCyRFOQ49ZZunQG86tzCX8BDsoqfjDtXJK5e9XH8NEUfVTh/4BlyZEo4NbLOFJdHzFd0YDmBU2CsMvaJ7Xqg88GXoTKysW5HdOqPp2WfdYOkT1UxBszDT1ewnVUQipglPj2yYz4txls85s2HjH08TSn4z5uFGnMagMSvIryOB9YCXerEKnAMapFPN9+9UrrJneI3G0jmaSy9qkj5jQ/nvi1VVf5u3hx9CsUFn/pIYI6n6aJ4ip0NU8CUIpn/S7r+6CEvJCZWX+RdIgSu2ZcVj1znP7w/6zPKWGubGdf/l77ew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.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=L5a6QEmM2KX38lNQl1P6r/u3Q9DZVE0Zv8YABYsrNro=; b=0n8kVXNUcWA/wd8vfCZIrGC4CKwzpDCeTI1Lqelv1uf3ScuFeGbU5XJZ42VbZPpmIPtJHtWoXrmFsg6ReDlGqEYV0S6REAJH8+LXF4yoqkDD706pr/lAfbtONB3qNKVrMTYgDW7Wbmz2zPot0ijHHTjKOWficz0hm/8sX6ifnOU= Received: from BYAPR03CA0028.namprd03.prod.outlook.com (2603:10b6:a02:a8::41) by PH7PR12MB9067.namprd12.prod.outlook.com (2603:10b6:510:1f5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul 2023 09:50:52 +0000 Received: from CO1NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:a02:a8:cafe::53) by BYAPR03CA0028.outlook.office365.com (2603:10b6:a02:a8::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.44 via Frontend Transport; Mon, 31 Jul 2023 09:50: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 CO1NAM11FT041.mail.protection.outlook.com (10.13.174.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6631.44 via Frontend Transport; Mon, 31 Jul 2023 09:50:52 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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, 31 Jul 2023 04:50:51 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 31 Jul 2023 04:50:51 -0500 Received: from xhdlakshmis40.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, 31 Jul 2023 04:50:46 -0500 From: Sai Krishna Potthuri To: Linus Walleij , Michal Simek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mathieu Poirier , Tanmay Shah , Ben Levinsky , Marek Vasut , Roman Gushchin , Arnd Bergmann CC: , , , , , , Sai Krishna Potthuri Subject: [PATCH v3 4/4] pinctrl: pinctrl-zynqmp: Add support for output-enable and bias-high impedance Date: Mon, 31 Jul 2023 15:20:26 +0530 Message-ID: <20230731095026.3766675-5-sai.krishna.potthuri@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230731095026.3766675-1-sai.krishna.potthuri@amd.com> References: <20230731095026.3766675-1-sai.krishna.potthuri@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT041:EE_|PH7PR12MB9067:EE_ X-MS-Office365-Filtering-Correlation-Id: aa069868-fed7-43da-a2cb-08db91aba0d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1gt5yB0nxs8utSzAOu3MSzk6uS5NdmdXMowX72HPlSWHBm3g1Ta3emI6/PaFI9RfrvvGioNtBnAybnOBNNw0JkUTIqaqjnh+0ovbNqb9TO5pmj7Fzbq0maxw5pWaag2wqpv86SMryyoAFNRdRCo1R8NSsgGRj4rsxenEHPxw5s9SAKwXgnvRCJ32G7p/xiMz/HBrzIXeTuX3lReIZ6fmit7gDv+tZU/cXmNw7zmA2UMwxk8d0xxZtQ5lUZFIC2YJotPAI+GT8CRmMetK0NEo1eHHfFU+iNoB4UJkE/9L4RAfp6UWTuEPzeM1GdMWhQQI6PbKcJs7hMZjXSxAxE1iEP511cJjoLzuZ6XRIhdHLEPT/AR1p47Y2XU9M3QtxkoimjipogmpUm1pkVo0wLsdmsHn2QyyhCMlu2vXLYq7PyKOeGXANWBsL0vuGu9FdMP+tWschnP6fRvKR6nb8nq6t4415LuoP3Bkxm2GINcTWuhkHzq2soMy25ykAweMfvUVzBaXvl7maDbzmgeYaCERdMBC112WTijsVwwJCHfMJWVNGPt0D9FfJrUUjV/Xh2U54ZSnJwY42+wa/ZR7HC0oNZAi4dNUnslapTtvDJKyPhEKXZ4UC1U5hEkqEwt7rGX2FI2Xe/EK2QB74rBNqYpKH5CS6hU7eA80F2kiFd70moy23p9nVGiM0hVHlxBg8GAPY81i1Kejqx8AC5dphmRGSzI2qr+jaa8Qxk7/EXNJlDHYI6t32CvF9Remu1+na1XmvLTriXaqBRdy2f2d5k28L8RprkKk0zQ0841BIcmZT8k= 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:(13230028)(4636009)(376002)(136003)(346002)(39860400002)(396003)(82310400008)(451199021)(36840700001)(46966006)(40470700004)(356005)(921005)(81166007)(82740400003)(40480700001)(86362001)(36756003)(103116003)(40460700003)(478600001)(6666004)(2616005)(336012)(186003)(1076003)(26005)(8676002)(8936002)(7416002)(5660300002)(70586007)(4326008)(70206006)(2906002)(54906003)(110136005)(41300700001)(316002)(36860700001)(426003)(83380400001)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 09:50:52.5572 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa069868-fed7-43da-a2cb-08db91aba0d7 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: CO1NAM11FT041.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9067 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_025057_342224_F32C170E X-CRM114-Status: GOOD ( 14.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support to handle 'output-enable' and 'bias-high-impedance' configurations. Using these pinctrl properties observed hang issues with older PMUFW(Xilinx ZynqMP Platform Management Firmware), hence reverted the patch. Commit 9989bc33c4894e075167 ("Revert "pinctrl: pinctrl-zynqmp: Add support for output-enable and bias-high-impedance""). Support for configuring these properties added in PMUFW Configuration Set version 2.0. When there is a request for these configurations from pinctrl driver for ZynqMP platform, xilinx firmware driver checks for this version before configuring these properties to avoid the hang issue and proceeds further only when firmware version is >=2 otherwise it returns error. Signed-off-by: Sai Krishna Potthuri Reviewed-by: Michal Simek --- drivers/pinctrl/pinctrl-zynqmp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/pinctrl/pinctrl-zynqmp.c b/drivers/pinctrl/pinctrl-zynqmp.c index 8d2cb0999f2f..f2be341f73e1 100644 --- a/drivers/pinctrl/pinctrl-zynqmp.c +++ b/drivers/pinctrl/pinctrl-zynqmp.c @@ -415,6 +415,10 @@ static int zynqmp_pinconf_cfg_set(struct pinctrl_dev *pctldev, break; case PIN_CONFIG_BIAS_HIGH_IMPEDANCE: + param = PM_PINCTRL_CONFIG_TRI_STATE; + arg = PM_PINCTRL_TRI_STATE_ENABLE; + ret = zynqmp_pm_pinctrl_set_config(pin, param, arg); + break; case PIN_CONFIG_MODE_LOW_POWER: /* * These cases are mentioned in dts but configurable @@ -423,6 +427,11 @@ static int zynqmp_pinconf_cfg_set(struct pinctrl_dev *pctldev, */ ret = 0; break; + case PIN_CONFIG_OUTPUT_ENABLE: + param = PM_PINCTRL_CONFIG_TRI_STATE; + arg = PM_PINCTRL_TRI_STATE_DISABLE; + ret = zynqmp_pm_pinctrl_set_config(pin, param, arg); + break; default: dev_warn(pctldev->dev, "unsupported configuration parameter '%u'\n",