From patchwork Tue Aug 22 08:13:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360316 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18E6CEE4996 for ; Tue, 22 Aug 2023 08:14:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233744AbjHVIOW (ORCPT ); Tue, 22 Aug 2023 04:14:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233716AbjHVIOK (ORCPT ); Tue, 22 Aug 2023 04:14:10 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2075.outbound.protection.outlook.com [40.107.223.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1C04199 for ; Tue, 22 Aug 2023 01:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aDyHFs7bZV4kuwr/EHo8y7Vk1JrjqCqhK+XlCgQ2hguHrlaHmJmek42/MjgqnY39KnLgeTf0IE3Srmqqfgrro4UXHYf+zVEqDfAm1W4FSm8xHm7rcyiGYhi0bheVpGe2hRfYFIh3Gu+lXO9dJjbNA2Typbqgi26lgXBQnENAUCTcoJiHKrhZYigKKT8NtyE3DvE8YH1JMosNElkfeiUK3uMb6xjfsCz1SjpIfYQfygf8/WIGlB6WbVfvGofR9agN3uTu/Oz5pO1BFJvgwqnWtsbhu5Pz+TjMtagSEOgu2XZmZFh6pRYFQx0PZoY0gRbU+8u8pjDZS2v8N+W34Kdqfg== 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=GIZeYryx9TDCKKacvg6wm86AGK8SKK5J7KIELI0D4hc=; b=Qm5C+LW8wQfIdcXGpYEuKgxAI0Uh+riaJpM9Bz058/j00BW2K9OZO5TCGK36RWhszPKMgLqhF5gMoEsQa7wv+2yXNqmZ6oSibjrk5I5ZOjP7WLLLXbnC3/gCj7WHV291Fn5fCPSxitQpLqO1BmV5AHCfuT4CrVK8BWVuY1G+mFSy5+Ca/P2Vz51J0Zly8RzxXhY9KFxD6wbPKkeQZqs1JfZrb3DhLQvtBlZzJUnlRhv+nOIeL5ZAeteprPfn5i0fyRw957TAI+KZVSWrrJFyXJKYi9FqXPGCC0f3dmeZ+5Rw1oxmYTq+OA0kMxTjhA+rCuYfLdn97U3JTZbYWgPFXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GIZeYryx9TDCKKacvg6wm86AGK8SKK5J7KIELI0D4hc=; b=aC9L+vF07aIYYyq4cawRHsTdXMbX/a0FqUz/YkbGwCVVZDHXzoC0weHlS30m1wlwNWfh/smlPrcvbishbOqCHrsoxiBpJlplFOrz6aj7GsvQwwHVIokV5MVDPVipRbRDcgZnUEFiqqH+DeG1ET9EDB2UO3PsFBQTqoqRp8Lu4uLijZ8S3ZQhIaTQBU9rUCfZVrPWIg/8oyg08YYjsG7noPVO1bk414qwxAEqbKI3xZzWGOZTAt3Hfa3ZdZtmHq/wiNZkkLIMyPLEVpyBu8wKI/sIkF8cK1+MbDNGfT1bLQdifjB/0JL7Y0dNwhsZr/d/UT1YODkSITMuNPtUAJTKAw== Received: from CYXPR03CA0047.namprd03.prod.outlook.com (2603:10b6:930:d2::8) by IA0PR12MB8974.namprd12.prod.outlook.com (2603:10b6:208:488::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 08:14:06 +0000 Received: from CY4PEPF0000EE3A.namprd03.prod.outlook.com (2603:10b6:930:d2:cafe::61) by CYXPR03CA0047.outlook.office365.com (2603:10b6:930:d2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:14:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000EE3A.mail.protection.outlook.com (10.167.242.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:14:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:13:56 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:13:54 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 01/16] platform: mellanox: Add new attributes Date: Tue, 22 Aug 2023 08:13:20 +0000 Message-ID: <20230822081335.64344-2-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3A:EE_|IA0PR12MB8974:EE_ X-MS-Office365-Filtering-Correlation-Id: 67c4a82d-a72d-4160-8382-08dba2e7c105 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2AD3HqfJ1/nQpTSg2PIe3YQxoVI5XGppbFwz7iXGJOh9tEqfcEmPzbWDWuDDHnfmGP1DS+j15K5s/oZQxKzXks7pPb6tgyH29b+g29r3A/eDzQHpsibXwgrMznC03EYeSO5isbq4ScQ87x4MWfyubepk+LrYGavgdXOOLz/aKn91coWCXZlDJmuFaaq54LA+KycmVqgl8D+0di886Hbl/QNoQFxqtXnhm0VELF8ywSLoXPzgKErBB6xipBDG4RVEtCJe/y84lin/0oQIkZ6niMIr1I9JjI0ca1Xa6b+G9hbNQw0TIkrOTwDld6tp8jlWjAXruMF9Vqr+aUGCsY0AWXaKsNW69EQjOUhNWrpPNZ5t1WJxqvIph4QN7a9Zj5iK6SQongay/r2guhsq/nixF95GXnRQJMr/9Zr1YtU2XZFGDzO8TAhlJ4jn7yUxKzuUWB+cVA6arPMtCvKafrPBgaI48sa5hHzfGbj5h2+WRlP2IgDt5UWiHF0hLrc2AjfaVfjZyVUXY+x3/uw1oIgilb8jRAMm/AzGOPU64srBYaSsJLYJRmmt8/z4PJVvvCk52wVIORIDnaVfabg80NUwbA5z2pIQelzgM+WWJk+C6Gx9ux055WWQ0vSlPtI77GMQz6OZ1j3P1oxhAB9IsG16h5i0S2G+mBE1bjkULfNGQFD5DqX4yIE2JJPMlVcb+ZQuwpf5hAeOkKx9EtK1jA9Z5EESeJ5ufqda/VHCrrW885Vvs+8QDq4QVR7HszehKnQM X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(83380400001)(5660300002)(336012)(426003)(16526019)(26005)(86362001)(36860700001)(47076005)(8676002)(2616005)(8936002)(4326008)(107886003)(70206006)(316002)(70586007)(6916009)(54906003)(478600001)(356005)(82740400003)(6666004)(40460700003)(36756003)(1076003)(41300700001)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:14:06.1472 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67c4a82d-a72d-4160-8382-08dba2e7c105 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3A.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8974 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add new attribute: "lid_open" - to indicate system intrusion detection. "reset_long_pwr_pb" - to indicate that system has been reset due to long press of power button. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 7d33977d9c60..26748c285ddc 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -3792,6 +3792,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(1), .mode = 0444, }, + { + .label = "lid_open", + .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(2), + .mode = 0444, + }, { .label = "clk_brd1_boot_fail", .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, @@ -4431,6 +4437,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_chassis_blade_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(6), .mode = 0444, }, + { + .label = "reset_long_pwr_pb", + .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(7), + .mode = 0444, + }, { .label = "pwr_cycle", .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, From patchwork Tue Aug 22 08:13:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360317 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66C22EE49A3 for ; Tue, 22 Aug 2023 08:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233748AbjHVIOY (ORCPT ); Tue, 22 Aug 2023 04:14:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233722AbjHVIOL (ORCPT ); Tue, 22 Aug 2023 04:14:11 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2057.outbound.protection.outlook.com [40.107.94.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFAAA19C for ; Tue, 22 Aug 2023 01:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CNerq0UJIHy6lvo9gbckggO32Ur/+k21cvmDLuwvntqG6LvYvn7uRGFF9JhEW6WatfA3BgkExiTy8JAXy6WwNwTMLt5Usg3K7eqATL5POTdLrb8w+9s44S7hEklH5i66PQkxoXjQWXPuX5Y82ZJrbOgHbBVf4MC9mK58i6Uh6zxtD6s4R5ckbSnzyXXR5JCbQUAwasqSWL1w1JqBCzo7WEizdbkkR7mykm+Ud3j2IZcbjaEof2wan79VD8ARScJCI6wEh3mLJbxrLOHtaGsFjpeoMgy9UGv6pJPd/fzKOwj9N0LGNQMnkZxhOQGy7w3vWQERpF/vge0Cp4SakuKP6Q== 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=pPek/w+qNoYF1pEJtXSb7pmfguD08PdEQsM9mbykCaE=; b=oGEr+1d22ivG3EoV940Qjra3XRQqdzzH5HObA+4Bd+4I+h3ovQjCNrE4kkoTU2shgQQ6qn0+3F/EmZjrqAQoJczJPbXRiR5gUj1oNjStCAgP0yrUrrZpoKOyOYyJLoohAR+g2HUKLne+rDWEjFZFu2IW/MPI5pfV/evGKYW20RlHnb9pGoHoG96osIDgA+re7ydNkkJmteD5ppLc7f0P/aHmh/6UocsfyIOdRK2+4sqOHV6Azlfi2P+SLjh4O5K+TrXMoU1+IlLdtMcgcDS6iSM9/PXKAs6N8Hk5War0dgLm64paIOQ3Hlo5PUreRWPNhfpAAOXZ6f2CF1iEleXzZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pPek/w+qNoYF1pEJtXSb7pmfguD08PdEQsM9mbykCaE=; b=b7nj0ISMDp+TSPdOtjJaExR+3Dx9SPStCSnB2rLcXNE4a784ljcMtZybKR18nlONfWBrhLnCjUGPwWfwgTzNAgwN0XQjRYcm6wRYJdWKdKEQiBpVpCUCzzNX55/osCChtHMCs6iLo1KYyCTNAXMaeOF1eNOz8G4BbqhoD6FsaqcW8OxawMuR5BbhnydZ6KCjyU8U1qVgYPHRg7ORw+bhn2hGQbSjudok1J9ZEpQLyvvjWGY84VnSMRDW2ZYDPgZCNAIefB3PLuZoEiqaJ3+5Rr9OLnIDvvo5drbRt0QhXLq7WaRRTVOmonvll4j/2oKKurZIp5ALF86bFqrek6YZlA== Received: from DS7PR03CA0023.namprd03.prod.outlook.com (2603:10b6:5:3b8::28) by DS0PR12MB8561.namprd12.prod.outlook.com (2603:10b6:8:166::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 08:14:07 +0000 Received: from CY4PEPF0000EE39.namprd03.prod.outlook.com (2603:10b6:5:3b8:cafe::bf) by DS7PR03CA0023.outlook.office365.com (2603:10b6:5:3b8::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:14:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000EE39.mail.protection.outlook.com (10.167.242.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 08:14:07 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:13:59 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:13:57 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 02/16] platform: mellanox: Add field upgrade capability register Date: Tue, 22 Aug 2023 08:13:21 +0000 Message-ID: <20230822081335.64344-3-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE39:EE_|DS0PR12MB8561:EE_ X-MS-Office365-Filtering-Correlation-Id: ce580244-430d-429c-8d97-08dba2e7c1c3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z4fXDvF70ihlukL44TsLFQlbzwideJs63BffGOclGVSNMWqtyP83+0hh9JnikQlVzw2wadNdLPzLJEIIQry+kPp9uCjDvnd6VSGutzOfaSQjs8r/FwhabWKt5ogJsGoJ7oseDqfJ22cY8AeZm6KUTX5FKt0kjY9aYCcDORC3sdBZ9kxOhffJqUZ8EXDFzUfuwsbc1fXGi4oolHGrzyLOs0/io2EvG1DzZiLc6V5Yjfb92c6FRWTSuMubzHni9d+a0z1+Ll8/c36AgIbNAA2vcK+RW6M7gHECyvB0c8okG0sQtTydqKpURhmSDBWRXPSyQ7M0gbDRqcv+gXrFwHgYfEkpHzO0BmeCw+vPauWu6tnrLowEkeCS5rLbRZ3GUxdCmu6iI6BQS2EWjaKiLq99Vk8tzgV/tbUu2eUJ4Y7C5t6i3w0uC6w9/2kgJ7eO54a3Wdv1vEBYTn5q02qpmbdKz+aK2HausQo3EhBNCXCc7pjyuimktm4DJrG+uyECktL67Z09e9DcP/Jp0Na7H5P24fKHeUmeSkAtecn8CfDoVAsV0adkxuRJJ76n3iaygXJmoOplzOHVGaQP6TQ3pIRPx40zGTaF7On0erMHoENy8VuxmGRV4FYe2qOGZhxADcMdHA7wzLyblrIjKoX5ZhW04XTrsxi0a759mK/0b7ZN6Nsf6V4jTGKTjzPQSPVxwxSoYm9Vxi7VKN+1W62B4qWG/OVV7KipGLIeG73Ut+1yxoL7DWQHdTTORAAIDuS8R6qw X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(136003)(376002)(39860400002)(396003)(451199024)(82310400011)(186009)(1800799009)(46966006)(40470700004)(36840700001)(2906002)(54906003)(6916009)(4326008)(5660300002)(8936002)(8676002)(316002)(41300700001)(70586007)(70206006)(478600001)(6666004)(1076003)(107886003)(16526019)(26005)(336012)(426003)(2616005)(83380400001)(40460700003)(47076005)(356005)(82740400003)(86362001)(7636003)(40480700001)(36860700001)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:14:07.3926 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce580244-430d-429c-8d97-08dba2e7c1c3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE39.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8561 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add new register to indicate the method of FPGA/CPLD field upgrade supported on the specific system. Currently two masks are available: b00 - field upgrade through LPC gateway (new method introduced to accelerate field upgrade process). b11 - field upgrade through CPU GPIO pins (old method). Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 26748c285ddc..647a10252c2f 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -62,6 +62,7 @@ #define MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET 0x37 #define MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET 0x3a #define MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET 0x3b +#define MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET 0x3c #define MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET 0x40 #define MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET 0x41 #define MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET 0x42 @@ -236,6 +237,7 @@ #define MLXPLAT_CPLD_VOLTREG_UPD_MASK GENMASK(5, 4) #define MLXPLAT_CPLD_GWP_MASK GENMASK(0, 0) #define MLXPLAT_CPLD_EROT_MASK GENMASK(1, 0) +#define MLXPLAT_CPLD_FU_CAP_MASK GENMASK(1, 0) #define MLXPLAT_CPLD_PWR_BUTTON_MASK BIT(0) #define MLXPLAT_CPLD_LATCH_RST_MASK BIT(6) #define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3) @@ -3680,6 +3682,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(6), .mode = 0200, }, + { + .label = "jtag_cap", + .reg = MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET, + .mask = MLXPLAT_CPLD_FU_CAP_MASK, + .bit = 1, + .mode = 0444, + }, { .label = "jtag_enable", .reg = MLXPLAT_CPLD_LPC_REG_GP2_OFFSET, @@ -4935,6 +4944,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_SAFE_BIOS_OFFSET: case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: @@ -5046,6 +5056,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: @@ -5203,6 +5214,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: From patchwork Tue Aug 22 08:13:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360318 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F014EE4996 for ; Tue, 22 Aug 2023 08:14:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233734AbjHVIO2 (ORCPT ); Tue, 22 Aug 2023 04:14:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233735AbjHVIOT (ORCPT ); Tue, 22 Aug 2023 04:14:19 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2048.outbound.protection.outlook.com [40.107.220.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBC37CCC for ; Tue, 22 Aug 2023 01:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qwy4ODH25axeCtHhgvrRH6WKQV+tAaY0OMkAsObQd6PwH5g0fDS/Nzahi4t7yajX4SgQ7w36ry9na5XfYb2Si0DJTmvryKtIitunI3mwcDCE5JRIrGthxdAYGAFcfGXe0ds6zePPoV2FmJ/Yz20pbbDHp8QjPFHh25DSaIAWAoAfBm8k+9+P5CKX6ApSnsAR6XXRPdP85VxCHDnzwnRvPe2Rd6/C8ncetZx6trk+TCWm+1ztjqB1ESdiaL4LXM1T7CVNgws7jIaJ+A6gVn4Q0VbYADcQKs0Whi3A7MTyEJC2o7hi8HUfFbLXMS7nTkXwbESUpDTaGKjoJD/SXJinbQ== 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=vYcbPxarzm812viRsh5O9v8hBIG2TPrCpgsalrgI0/Q=; b=aNnGtmLkumn3512I1NES7Queh+miMoe9u9kKjY74a3dYOhMz2aZZK13cF7Uvut5GYotRjhHuCud6rWQlzLyE/umzs5MCHiD2CcmyL6yy+HwB693ZoxB6UvydY+i+rbyUM3p4IqnCQqvnyk5QwjO/jLbEYLJtsWOsLKY8Z+32OMvhIZeCgrLvVo92+a2NEiW70oSxfb8MhA9EWGFPE6ducemrOM6BSK1jmcOm90SllM52YgW5SOBWRWeXeTGGvaVKErcWLI8AWaI/IR5z6LCiScXnVOkJQ9lTLSsqxg1YjBm0pkvReOPWWZfhp16UH2OgL5N/9MkW4z849Rx9R0ZVcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vYcbPxarzm812viRsh5O9v8hBIG2TPrCpgsalrgI0/Q=; b=o3gXNeHd/IVe3lMsjXRQ3ui/SeBZTyxKGLt7SO6Vk3Kk7J50QABqU7G/+bOt+6Tc/XRxia1JFYPkfgL67mVFr09Hj7M6PTopMLUz06Gcm6XL9nnZqNI/suuKBUcfu2kr8+5onOIbbV2jlPVFk304K0NBbt1HDnoK3IjiyKFPu799Be5VcAOzX5C22Vy6D8KkWvIc1HXx7fRTQxZQM0x+yOlccwAbvDb83cuXxDvVtAMi8uxQwngWxquXKAbdg4bNkUvAuyTSiugLFq0v8IkPwL9S1JqETKa6HG1FKQ2azk2cOCUybINaMvrBysqngpX2Cp8mQpFiMjoiz24t4GBYjQ== Received: from SN7PR04CA0151.namprd04.prod.outlook.com (2603:10b6:806:125::6) by PH7PR12MB6394.namprd12.prod.outlook.com (2603:10b6:510:1fe::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 08:14:08 +0000 Received: from SA2PEPF00001505.namprd04.prod.outlook.com (2603:10b6:806:125:cafe::b6) by SN7PR04CA0151.outlook.office365.com (2603:10b6:806:125::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:14:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SA2PEPF00001505.mail.protection.outlook.com (10.167.242.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 08:14:07 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:14:02 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:14:00 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 03/16] platform: mellanox: Modify reset causes description Date: Tue, 22 Aug 2023 08:13:22 +0000 Message-ID: <20230822081335.64344-4-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001505:EE_|PH7PR12MB6394:EE_ X-MS-Office365-Filtering-Correlation-Id: 10eccb6a-2b2a-4c7e-59e7-08dba2e7c214 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3P3f0jlyDav4HfGizmoJ3AlMEzCLDBN9tIMDnC3CFfN4+L73hOVB9HMKEIsyRHaWHjECFkfnKMH2ymWTiEMlUIl/uIn0wUJehDsNd0pbMT6Q9WEK/6w8t9Ns1TGE+TjzLI+AcfH4km0kKxoRuT+sJTPx2RZXUyHQnNqkBQetLg8ruDnSw08dFPcN3AJzSvEbIH0JJd920Mw2QrvPYFMhHIc0tETv4VBC7oYwso/HHTzK1JS6YBfPK7J1WPGSy/kfRXyfA09shUyMI2g9VBuntulMXS5ljvd9Aw1uhWAlzSFDmaKdO1P6rGF6pz6OBrygAJSLBT0+f6iq+A7JqYodKGV6qcCA79Kkfj7PFhTFzQCBe5CJuUqO91joz/muWfG0hJHqL4SQSctkFped0Ctk3k/tAJ8rFrZeIQtyh61aXDwCLLzvtU1QBaSu5BnpHblFIuk49nactlwaOHVFXbqge66y5rw4oudLW+HITPu7R/pS1IgUJ3Upo3X/UO2aU5UFY3uaBQQ1n5ecBzkS5HuLwUrmdqU/wUsR4FGbN413LBo89Sk/3dg3OidZSHN2Qs2EYtYxSBMWqyNeysgIOayRqIKUgCydb+xlPeqMb2C7/QSUvoUHbH9GCtTs5ofIZCl7KUDFOHo3E80etqzcFUsFbK4poGjBAfXMuQErxSPlcBv2aNU7X20bRP2glU5Z9YpqcbuSy0QzArWtLxOcqJiwYZy5x31SupxAy0781QVReSZiwqu1yK/PLYn+VbAALlE7 X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(83380400001)(5660300002)(336012)(426003)(16526019)(26005)(86362001)(36860700001)(47076005)(8676002)(2616005)(8936002)(4326008)(107886003)(70206006)(316002)(70586007)(6916009)(54906003)(478600001)(356005)(82740400003)(6666004)(40460700003)(36756003)(1076003)(41300700001)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:14:07.8753 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10eccb6a-2b2a-4c7e-59e7-08dba2e7c214 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001505.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6394 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org For system of classes VMOD0005, VMOD0010: - remove "reset_from_comex", since this cause doesn't define specific reason. - add more specific reason "reset_sw_reset", which is set along with removed "reset_from_comex". Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- v1->v2: - Comments pointed out by Ilpo: - Fix misspelling in commit text. --- drivers/platform/x86/mlx-platform.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 647a10252c2f..5b0579752afb 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -3556,12 +3556,6 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(2), .mode = 0444, }, - { - .label = "reset_from_comex", - .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, - .mask = GENMASK(7, 0) & ~BIT(4), - .mode = 0444, - }, { .label = "reset_from_asic", .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, @@ -3580,6 +3574,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(7), .mode = 0444, }, + { + .label = "reset_sw_reset", + .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(0), + .mode = 0444, + }, { .label = "reset_comex_pwr_fail", .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET, From patchwork Tue Aug 22 08:13:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360319 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88E08EE4996 for ; Tue, 22 Aug 2023 08:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233716AbjHVIOk (ORCPT ); Tue, 22 Aug 2023 04:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233753AbjHVIO0 (ORCPT ); Tue, 22 Aug 2023 04:14:26 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2089.outbound.protection.outlook.com [40.107.92.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA616CF3 for ; Tue, 22 Aug 2023 01:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cc2BZSvAX0Y0X8Fypf6C6cfp3w2J9ub+sNUVd1qtrUUwXUu/hAXYtiJiX+Y3Q22xTyNzo38wLkzBNf217uSL92Zo1kh3UQ5wDKadgTy2ksGKHMZf+sK/ui2+qNDX1UWMXYRHFlae/gMljczF8w8vdBGEjFY5Edbi3N40GSqDHDjnGonNjEtQwL7LzHNWLhAeOL4Tuh9T63Mvn98jYT3aGyABQkbSgO4twcaN/RvyFiXHX6P3o1X/CNu8eIm8O781SoyNMKy+uW32ML5A6c1ccLN2JwFxlLVKI42eY77ngMsEV347wdIFeBT2hhtf5CT6xolUqgON3ah/x1sR6toEOA== 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=bLFg3Srs+amfX5Ias26CS0Q8pmtoQ1AC/8eFDwVKMzg=; b=dXkfvJl1HMbGENt7PENUW1EoNZfUnmvPjh1riP4hLqI1ZmgvJPhNvzyZMkXJlfjqG/R2xVbV5FhGtSrlqi1af8FicY4fAkLB+eWGse89DUFvQ4fxzR7p3Qs+iWqy2NVPLhi+SjC1Hap/Iio0lpQLvp7zPF/4ftbg5LW9mwIJhrpCssnemrISt8rjqNc7DN0FzJT3+WuhUvpScRX93fVI0NHFMirCR9wlXGFQQkrawRiYPDXywPl1Jrs0r167Z7TjtIZU9UC/PD4B2o49mpKscD1JHcIl44DBUBVVIBuxglyDOyLc1onKegFt/PEPY+GRG8P9fuL1He2qVJAoj9wU/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bLFg3Srs+amfX5Ias26CS0Q8pmtoQ1AC/8eFDwVKMzg=; b=ZU9JfPRKz3fqdwqAXfFTFq3bgsF/tBTK0hXUDZL91bE090jTruDqlILC1jVcFHqaZrsbx646zHtp2Q2Q+al7pP69Llod+/8+BAHYe2utks2hGG0Qeb7aBLWyasNDbWAl6Gpk7aIw71x0ySznbhKCeP5EbwEyZV9inQca90mg1cuWWrgHDsFQhjwYGsa/2ZlWu5+ZotRrSr8K+68TtUPiiBcvkqqP12gbYiQz2gszpqK4aq7zRTh4kuadHM2F510u9yfHfSAEFCcPKyndh7PGlloB/Dq7EtFHFfWCWnRULESGsMK4Ct1h96K783YvdRei2Xy0lXoM+3UMYRWkrpP2vg== Received: from DM6PR03CA0017.namprd03.prod.outlook.com (2603:10b6:5:40::30) by CH3PR12MB8481.namprd12.prod.outlook.com (2603:10b6:610:157::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 08:14:15 +0000 Received: from CY4PEPF0000EE3E.namprd03.prod.outlook.com (2603:10b6:5:40:cafe::72) by DM6PR03CA0017.outlook.office365.com (2603:10b6:5:40::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:14:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000EE3E.mail.protection.outlook.com (10.167.242.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 08:14:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:14:05 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:14:03 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 04/16] platform: mellanox: mlx-platform: Modify health and power hotplug action Date: Tue, 22 Aug 2023 08:13:23 +0000 Message-ID: <20230822081335.64344-5-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3E:EE_|CH3PR12MB8481:EE_ X-MS-Office365-Filtering-Correlation-Id: fefcd0fa-d726-4447-d4a4-08dba2e7c680 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: piJ29cvqbcghZ0UI5pK4WGXJMCubrlxDi9B5rs5bgnHpuesvQSN9at9Nczf0+U7XxiDc46Eeg3SdutLMnDPT48phCh0fiJdzG+snzt+Wg8tJjAfr1156y6m3cse9zjJgwp6/zxow/RAhrvB+hUWy6Og9sUzFQ1bqpiki8SeEYbVS+lyhYtZR0+H4/iH8kjJarmpx5aBIBDDSsaayOXVcjUSQoxFvERufsbqbwZM1qtZZqM86ixwf5Yr5HhtDlZhOw+rXzmjR8y3pK0rjPlmwSkcuCtpfwbNwKyQC/uLblCPGaZsKo3FJ/gz5ZxNNt3HRMH4zZ1N63GegUuEr3MSaWqpWybrDP8zrf6vC6i5SK4KJn7x/ZSzr3oURv3irYS3eZQ0zsZ5D/iBtGR5seHRsrLMxHiPGCmJnvEzbQuJuopgaXLURyNXMKyTrt9nqrraVDzausH4oA9mZWfhXVODTnEFZrz5PNXiKrr7IJMDODH3HDrdG314Ej7AUu25AhpFS0GzU3q85Fitfc4CV5AW6gMqUJD+JH9fQqGSyhX5LOuZTedtF6MVH9jN+rF8BYmPQvQ/tuxkBQG02gcdDtv1gTCTJBwTx2aVeIX7jXMhRreweEAuQ1QQf4oJkY43ADY8gqxYrMh2Xe6pkI7ZjPFMH8H8bfeUC7X5WL9WdCYVLG3puuw8bhd6A95XI0eUNLpqhiw+2/g3bJaaARENmpcMfl9Rhws+NUmO/4QBHVTjIwncoKTgkmCeHyVBD9YitrLtcOcT0GNyJ6JBLmltgao3CeA== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(376002)(136003)(396003)(39860400002)(82310400011)(451199024)(186009)(1800799009)(46966006)(36840700001)(40470700004)(83380400001)(2906002)(40480700001)(5660300002)(426003)(336012)(26005)(16526019)(86362001)(36860700001)(47076005)(8676002)(8936002)(2616005)(4326008)(107886003)(70206006)(316002)(70586007)(6916009)(54906003)(478600001)(82740400003)(356005)(6666004)(40460700003)(36756003)(41300700001)(7636003)(1076003)(40073004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:14:15.3440 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fefcd0fa-d726-4447-d4a4-08dba2e7c680 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8481 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Set explicitly hotplug event action for health and power signals for L1 switch as "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in order to allow processing of notification callback even I2C parent bus is not specified. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- drivers/platform/x86/mlx-platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 5b0579752afb..648b27eff0b0 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -2373,6 +2373,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_pwr_events_items_data[] .reg = MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET, .mask = MLXPLAT_CPLD_PWR_BUTTON_MASK, .hpdev.nr = MLXPLAT_CPLD_NR_NONE, + .hpdev.action = MLXREG_HOTPLUG_DEVICE_NO_ACTION, .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_pwr_events_notifier, }, }; @@ -2433,6 +2434,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_health_events_items_dat .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, .mask = MLXPLAT_CPLD_INTRUSION_MASK, .hpdev.nr = MLXPLAT_CPLD_NR_NONE, + .hpdev.action = MLXREG_HOTPLUG_DEVICE_NO_ACTION, .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_intrusion_events_notifier, }, { From patchwork Tue Aug 22 08:13:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360320 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE3BDEE4996 for ; Tue, 22 Aug 2023 08:15:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233719AbjHVIPr (ORCPT ); Tue, 22 Aug 2023 04:15:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232154AbjHVIPq (ORCPT ); Tue, 22 Aug 2023 04:15:46 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2057.outbound.protection.outlook.com [40.107.243.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBD8712C for ; Tue, 22 Aug 2023 01:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f5LMvjJn/SL7ch1qUuwamI6Fz1oPEQOuhPxQp/xE9HPLB7QwoyPQRYx8rP7qmfCA+z8G85FcUvczDqj7Y8GjJDDz7etcLiByq+Rh5OqbPlvO+yFifiNudiK2V5JhexO8dS1IhDINPpF6FlAWL1HmzWYY/rqlkbr6Mvnl9B5u0q9rvoWJ9Y4ZkP+Rp/Q1kpyH86omd0g8o1lnyD5h/KmrhNJCgZDQrYsioLvIuvud5LFYCM55ZLHqvUf6DAUPUCMjz4zybeatg8VESvXs4fZSZJniF59Q/oeyVjtnUx2b8UiztB1GOCLB7rlPNmBGrwZQQdUzkJISakw3A8pHEWH0Ig== 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=O1dw01myy66sB0/SglKw/bYCIpKnDSFN0xnNxCn+IdQ=; b=gLs8OfxcX+4ftnJv73eOetUGJa4W10kxk3kV8m2eZu7hvSQxBYmczJPqJU0nB87CruVLKNalx7ELqN92bfC1KhmzY8BFJdmw2RHb7N0bIGq1n2KUwO0YuffPCQjdLQiCCisMHhA3jIgopcOaxceyxn8/r65oIpeBH0InL+2gjH2+TFjqXubxle61pSUup6dbKMQZhbRygHxHUBvt/l69lb/iaCRdynP9hzNZksjiUU+zxJz+7Kt9ddNqMG5c/qXnbDSRr+1n5Y0NRjAUfgQEi23RLASdFxIpeQLpSVBzxWPje6tA8Kuzx7l8bmwnNMAbe9MzARyslP6+wOVXOCiueQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O1dw01myy66sB0/SglKw/bYCIpKnDSFN0xnNxCn+IdQ=; b=pab0BJFs8uOWNAk8cJA+ysM0nZnMCJZutpqclDBtmioeCf2Ld4+YEsFsbN/VO4UxeRFsZFf07DBQW187FjeQsBXNUvLA/p0m/5NO2JGFanYVE7KbNF8qDSowcflr8J8+5QhvvUbr6jblErCUVSxzfBLcpsJLaKPc1hN94rNNnCcqnBBy/dmsxusboy/mY76XFNzUfGtW8A2suRC/wBmbpmCT0aOfACZ4Zm3ohiuzsr8mtpFwp8rgUDsxa2I0zSqWSi84lCNMS4edibq8zSTNY9ETUNVSILxGG49KnJ4xm6vE2YX4T93K5t2apGSP+YN5aYzKzHloYv9oq+w88szBOg== Received: from CY5PR10CA0001.namprd10.prod.outlook.com (2603:10b6:930:1c::13) by DM6PR12MB4959.namprd12.prod.outlook.com (2603:10b6:5:208::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 08:15:41 +0000 Received: from CY4PEPF0000EDD3.namprd03.prod.outlook.com (2603:10b6:930:1c:cafe::6f) by CY5PR10CA0001.outlook.office365.com (2603:10b6:930:1c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:15:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CY4PEPF0000EDD3.mail.protection.outlook.com (10.167.241.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:15:41 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:15:28 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:15:25 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 05/16] platform: mellanox: mlx-platform: Add reset cause attribute Date: Tue, 22 Aug 2023 08:13:24 +0000 Message-ID: <20230822081335.64344-6-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD3:EE_|DM6PR12MB4959:EE_ X-MS-Office365-Filtering-Correlation-Id: 070ca8c1-3a18-4113-3d4e-08dba2e7f9e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4G3l7H7Na+Tc/1+NvrOQRfp71I6Fg++zW7Uf9ZhOfhInNIHm/kTY4Sh4rx8uc+wIQ2rCto+aKae9DUk/JOpetn5pHSSr6axYh5Giv1viqpkTsBzoY5O1AN8imrq4ID28giNUHvOt77eBUlZoPkaVXFYTjjG7XMMiuVNqmrF9R7dFvABGLQXt65GCQ0e25sptGLH+Zc4GbEf/ro8uWQZBs2G6+ezwJrk8EO8QaRDzB+UQMQYuhBW/eBVDe/D5q4aYXQ0SiXYjMwa2iB2rhPwoFca682eDy02KOMWo+uo4ts9+di75pJ8Kj/vFISXUFe58Ke3Nq9jdkwRF++J0a9LsJDdi9fFia13CAKKzjmSgT71VfI4DG0KkMsdrUE1SsLrUDOiB9fnaacjmjaKKP0kzYv0QCaV3klmmf6kMe6pUKT5pMNyu2v0DviKud0FImM539KnsQHoeaDfSpkKvJ7CF1gQjrdwwX7w17+SGkuLy6zy6PddzoLDhXJEO8SOu2jIUKwlatxaQJj3n4mmx8vWVVCtlvPf8d/gSq0fsjxz1q5vYAkGAbzMAlfpfgtChlrFj8dMI9HxBhAJnVxCbyzKu40zfqhTkK2GAVHu/VBaelAHWPevbCZaat98EkYpJtxV7HRUkeETwl84ZeRY5d5TZfktc3KCWoHnasPNtIAFEr2GHpvbzvPX15gsgxQ2dGCpUMDmJ4FVLrADfEoFlMEzFCdfaaZNU3wwcjCsbMkBnGsVfcwQUS85xTXyCshF8HxUm X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(346002)(376002)(39860400002)(396003)(82310400011)(186009)(1800799009)(451199024)(46966006)(36840700001)(40470700004)(40460700003)(426003)(36860700001)(336012)(16526019)(40480700001)(107886003)(83380400001)(1076003)(36756003)(26005)(356005)(7636003)(82740400003)(47076005)(41300700001)(2616005)(2906002)(6916009)(316002)(54906003)(4744005)(70206006)(86362001)(5660300002)(70586007)(478600001)(8676002)(8936002)(4326008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:15:41.5945 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 070ca8c1-3a18-4113-3d4e-08dba2e7f9e7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD3.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4959 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Extend IO registers description for some system types with reset cause attribute "reset_swb_dc_dc_pwr_fail" to indicate reset caused by switch board DC-DC power failure. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- drivers/platform/x86/mlx-platform.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 648b27eff0b0..8e07ed3dc552 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -3558,6 +3558,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(2), .mode = 0444, }, + { + .label = "reset_swb_dc_dc_pwr_fail", + .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(3), + .mode = 0444, + }, { .label = "reset_from_asic", .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, From patchwork Tue Aug 22 08:13:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360321 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83A86EE49A8 for ; Tue, 22 Aug 2023 08:15:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233721AbjHVIPu (ORCPT ); Tue, 22 Aug 2023 04:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232154AbjHVIPt (ORCPT ); Tue, 22 Aug 2023 04:15:49 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2083.outbound.protection.outlook.com [40.107.93.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D87510E for ; Tue, 22 Aug 2023 01:15:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A2iawt+bX1293hAMXBEiv0QcbO9CY3UpNsZflv+1Ui5m4l+uKwgrl4GDteiMzqFs6NcZI2IwgbcvnXc6/raMBKaREwNofAS2tXWbxNzWNm8hpTphZo8vtufOf5YNNEjJpAJSiabqkYazvawuvt0NiIktcaGNQ2GJZvDBvHONz5L+GqMNOHDP4N3XSkcqRv1fBDTZfs4geLOH+8z3ur9owaXDPQTvCsbrcGqHucpe/ETqPjv5sGw3zzhwLVHl3ud0XHsCJZ5DJdUjDtlqJeWwvrzQC5XWwf+aVuqXm0WYGnRBypB0tTuD33TqyNIqLCKyFScx1IPph/e7H+1aSOyX5Q== 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=LvihbpPlhgjNgxL51Yi0rZV4VivxBKEAIqcSqmgLVzM=; b=F3hAFhBJKRyUBIcFdPM3zYH8RFqgKl77AGNTtTy3i2XdiTnQHV64Ohmj189c+8orXs87h9dGJRY3kam+6nQe6nA6Xxte3ovXiYy5vri7WNaRXhGX3gB7y1spzcXYUKpK2ajd+NKox0pAryWk2HOr2TGfUlJJ4sP+i7CJX7xEoLcp6bm3a1zsgS/wGKFM3xOAoTWrq8H3x1agRRx5jLaq3Q4hqqpApmm3BwEiJCNHF/0XUwmruFHEr6JylgktE24fIYtaROAtNeAIg091HnW+04AMkBNQ8oUStqDxMXd6iNt5qYYHLCfvo0ogyENHCbaQyghq6iUpxxKDmPchpPyJ6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LvihbpPlhgjNgxL51Yi0rZV4VivxBKEAIqcSqmgLVzM=; b=lvtmRe4ZvwoC12hi7X8q384S5PL9U8RuzEtYKT5MNXMwLZx22yskHNKgVYTZtpjgiINWWulM9i15aLl9Q+bojyFHgPATYd7oXzZmHHiAj/f2lBeG6QKxwqB6YktOPLDLK4D9aVXwiiW5hJuGPS5+cPh5V4pycqFW06GXfIgsfcOTGmDm1sAKQchzI1Uxj0Pg/DXckjreRBrnkygnwuAWK0PpbsJQYRo3nl7SGL/MVy4NEQclQrzV7NDF9A8d/ZuliPr/uaDXPUu8eSSOZ8DSnUpbQXL3orqmoQoYHXWgIWpgrHFkaV94Taec+nrBd59PNTdJdtiUZFsRjOgzhj4xNg== Received: from SA1P222CA0160.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c3::6) by DM4PR12MB5199.namprd12.prod.outlook.com (2603:10b6:5:396::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 08:15:45 +0000 Received: from SA2PEPF000015CD.namprd03.prod.outlook.com (2603:10b6:806:3c3:cafe::67) by SA1P222CA0160.outlook.office365.com (2603:10b6:806:3c3::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:15:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SA2PEPF000015CD.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 08:15:45 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:15:32 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:15:30 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 06/16] platform: mellanox: mlx-platform: add support for additional CPLD Date: Tue, 22 Aug 2023 08:13:25 +0000 Message-ID: <20230822081335.64344-7-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CD:EE_|DM4PR12MB5199:EE_ X-MS-Office365-Filtering-Correlation-Id: 4616f590-9f7b-470e-b298-08dba2e7fc49 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 231aN1NbybRStEfd9Jm729HsMCj8uBRubbHTeyOhRqV22OyBE3KfCD6EeuzZoOjI4/RAtTW3fDj/zS3Qg+jODqHHv/y/Dt16j8g1WfeZbE1SZ9zgMQSvcj0dHCrL0cfYnYD7PkhLt7ZaQT9ixrzOgK3vmPgDK4P4xxPmTL6whNXn5VuhseoCtqBrP4fEyHam72pHonnGTpzna5hazLx03B+t2d451wFZZH8mEMHBNO8guxcfhVNHPvuO9mHXY58qQR5VVC7i7lHMC/b5jowlRBTj1sNKyx67IgV00eF1g1CEj7X7SXLYMqn3tVcGBYc6qGdL6fKCoDwAF87akvDB4DAP6jE+vHX2v4SlSZmFy+YS3BUGpIQlc5xiM08yyKz4DA1A5qHfp0iORA4aPRQRvGLFeSJzQJUCVCCtGnlQm81VlV+a+sOJ8GIg4vjdxJ3cs5Umlj4wY+RJNGlmxhAKH5FNvCuHLO9CET3QQWL8fDrWx0QJNBcHFbT/imcavixhcHuxo5yW7ln34o6bevanoM22rUR0aBVQI38r17zehhWs3pFYbT2fKn1es+/HK+Y7sm2MV3IAb7KCLzqgIvIMAbyqiFNaSN636N7pd0plGeZ9YTMaTj+4HBvkzxx9S9Lb5PmZM7ZRNGHzSOQUpV+/fMw3XahM03TH/u7ZjJ8J5qYVhqpcwhV46Y3Di3ITc1FGXziyfcEU7jhExik7PrcjvS4Ho5HHoz3mmzd9+wH3vonGPdDHkorYQnroIzFoaRwd X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(396003)(136003)(39860400002)(376002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(70586007)(70206006)(6916009)(316002)(8676002)(8936002)(2616005)(107886003)(4326008)(1076003)(41300700001)(36756003)(40460700003)(7636003)(356005)(82740400003)(478600001)(6666004)(40480700001)(2906002)(86362001)(36860700001)(47076005)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:15:45.5328 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4616f590-9f7b-470e-b298-08dba2e7fc49 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5199 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Extend to support 5-th CPLD version, PN and minimal version registers. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- drivers/platform/x86/mlx-platform.c | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 8e07ed3dc552..dce35934cc37 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -95,6 +95,9 @@ #define MLXPLAT_CPLD_LPC_REG_FAN_OFFSET 0x88 #define MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET 0x89 #define MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET 0x8a +#define MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET 0x8e +#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET 0x8f +#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET 0x90 #define MLXPLAT_CPLD_LPC_REG_EROT_OFFSET 0x91 #define MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET 0x92 #define MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET 0x93 @@ -129,6 +132,7 @@ #define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0xb9 #define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2 #define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3 +#define MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET 0xc4 #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET 0xc7 #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET 0xc8 #define MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET 0xc9 @@ -3431,6 +3435,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .bit = GENMASK(7, 0), .mode = 0444, }, + { + .label = "cpld5_version", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET, + .bit = GENMASK(7, 0), + .mode = 0444, + }, { .label = "cpld1_pn", .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET, @@ -3459,6 +3469,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mode = 0444, .regnum = 2, }, + { + .label = "cpld5_pn", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET, + .bit = GENMASK(15, 0), + .mode = 0444, + .regnum = 2, + }, { .label = "cpld1_version_min", .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET, @@ -3483,6 +3500,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .bit = GENMASK(7, 0), .mode = 0444, }, + { + .label = "cpld5_version_min", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET, + .bit = GENMASK(7, 0), + .mode = 0444, + }, { .label = "asic_reset", .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, @@ -5031,6 +5054,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: @@ -5039,6 +5063,8 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: @@ -5150,6 +5176,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: @@ -5191,6 +5218,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: @@ -5199,6 +5227,8 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: @@ -5302,6 +5332,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: From patchwork Tue Aug 22 08:13:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360322 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3992EE49AB for ; Tue, 22 Aug 2023 08:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233722AbjHVIPw (ORCPT ); Tue, 22 Aug 2023 04:15:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233720AbjHVIPu (ORCPT ); Tue, 22 Aug 2023 04:15:50 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2046.outbound.protection.outlook.com [40.107.102.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0464B12C for ; Tue, 22 Aug 2023 01:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VsAU6Q0RFIozK/TrGVaqdkknwcGcyjA6s8I13pXKrsQRgzYw45oVFIPCTojIb4wiyi4YrqxJatPxP6qAqNafbaHNx9GF7w5Ksm4QuDyAJtW9WVVaga/mnE0HnF9XqKqRUAAlJyJpGA+YEoKrqqYhzdRpKUuJbfqNYcD7smkrcOiafeNSAC/6mDIAWDVbwEwP9YeWS74jX2HkzLyApmP0uvjDwiIKAC2OtlbfCydSgH4syzs8OpTRXFxZ3DQ1jpst+g+qGlBYRkrkGJbzEShpC4Gp79waMkSQmTVZieigZBKUbUGbPqI2/1oDlIETkxu0wwV8vt854FqfZBq6ElrW6w== 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=jhf70Y+7uHbaKA8h7tzYQl+oxuaR+na5dnDH9e4oOqM=; b=foJQHu13reloNqKeD+DI+TgzT1ZvsDf0A0WL+2Ga0sA79wwvnt21OPYTIefhcZoUuP3+OnAThZGv+mnniJTwdneP2zQs3BAGJ1hro79svYSeiIENodChloBi4T+rPfNsPlfjQ36pJEWggxaGeCsNCIQeQ7QWpuPX1hGtr0BX75TBTtDM0HRgeervfV4i7x8F8gWVqTlDbDNN5uY4xYN2MIOgOZweFsc58xfLyL6i2pFAPZHGoUdBtOUOLkgfqtMJVfOeZwALSRNyWy7x4g8jH7mbrDwlKtDmJbKKPu1+0ze6tNIerzuYMvKJM4jFdaKgxdyX6/RVEY4oUNZrE3bHuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jhf70Y+7uHbaKA8h7tzYQl+oxuaR+na5dnDH9e4oOqM=; b=rfQl7MmL4JGaagmYVSgTVL6wIyVbAOxWjPJ/7p3BSeBHKySPvzpDk0migDSCTndhwIt10e9OJ0n6z+W3Tox9rmKAgSkI1Ni4NMdkx3MzfAJSOTf6hFBm456HbWZZ0+EyMzEogtO+NIShe8VYLp7GzZm8nXrnTHB8IORPGEJ21XzkghwZXO9iDLsN6vWdhjMoT6jKVZ7nYPDnz4ZW0gC2noXQUezYbuqwwO3Fnausf0zqEcdzrPNEFQUj1f5Jc4k0VnFpXaamKpqAnd4vqjD28NeXbfHJThZNKBG/em2zQkuZQJHH4c+AwdtVVgayInv6iQpJisRBsobIqe+kRtoDig== Received: from SN7PR04CA0053.namprd04.prod.outlook.com (2603:10b6:806:120::28) by DM4PR12MB7621.namprd12.prod.outlook.com (2603:10b6:8:10a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 08:15:47 +0000 Received: from SA2PEPF000015CC.namprd03.prod.outlook.com (2603:10b6:806:120:cafe::27) by SN7PR04CA0053.outlook.office365.com (2603:10b6:806:120::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:15:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SA2PEPF000015CC.mail.protection.outlook.com (10.167.241.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:15:47 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:15:35 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:15:33 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 07/16] platform: mellanox: mlx-platform: Modify power off callback Date: Tue, 22 Aug 2023 08:13:26 +0000 Message-ID: <20230822081335.64344-8-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CC:EE_|DM4PR12MB7621:EE_ X-MS-Office365-Filtering-Correlation-Id: 74fb647a-fd30-4e3a-1533-08dba2e7fd29 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cY9+IxdHJMJ5uyxwKlxgZzKi5XeTRUM6Ptui+RKnB+NCkaR2ciqVOgEhIGO/i9XA8pRM+2BkpPvpG8mrBRxx060gL7enhf/+i5iAn3MubPR0MobE8lJ/EeIir1oR696X9dW+xL/Qo4fbT/yQXvQmtgdzXAgmnWhNxy2xrSK/ft9XoptTDG/ZxiHgcDT2r6aZ3U4mgGzSB9yWA6fZIpS6b/WOtoAAcbIea2n1Jh3vMgdlSwwbcBl56jHiwwMuyaRXLh1mabxlIkeY4i1zRIAXNL6UG68Cgt+s3jh6LiIW3xthzex0z50kQHG7eyPr+++6T6gx2oXj/diNeRFvVV1VqcQpwH7RyKuNmcqolHqGl3RxyCqzmBfXVkqnQhAqu180xIjuTgc4YJydjdRpnltHmzXh6k05tWYr2MCwuNe0OZbE7ZOZmX6nRm6UejFiYIGUXsbCJVvUa2SSUaK5gshR8bCfopc5UiXVUFrWH4KBjuCn+yP5jtyD9l9kzla6DA32Kljz2W4LiOoewxM47CyWxdgGrQm8N7cGmJv/tvhqF9kVd1rxGx52oJkazh+PsF4qsSOnRbp6G1Fvm6I3iEM8oAc9rrvxDY4Uy3nHzOjccwR244fTcbhbrfMf6UQCc5Lye2dvHr9KjJ3xUJyhQt4H8VYWnP0VoeX9MksDTII0teZq8WMYvAHm812napVazWqYvZxicLQTROdTCBWxmbF5grnFT0aClc+ZltzzAzV7FFH2G+bTevX3cQfY8ekJeoCK X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(396003)(136003)(39860400002)(376002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(70586007)(70206006)(6916009)(316002)(8676002)(8936002)(2616005)(107886003)(4326008)(1076003)(41300700001)(36756003)(40460700003)(7636003)(356005)(82740400003)(478600001)(6666004)(40480700001)(2906002)(83380400001)(86362001)(36860700001)(47076005)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:15:47.0280 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74fb647a-fd30-4e3a-1533-08dba2e7fd29 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7621 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Extend platform power off callback with kernel_halt() call. When powering off, the process involves setting a halt bit in the register space, which is then activated after a certain delay and power off auxiliary power. By invoking `kernel_halt()` within this timeframe, the intention is to facilitate a clean system power-off sequence. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede v1->v2: - Comments pointed out by Ilpo: - Amend commit text. --- drivers/platform/x86/mlx-platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index dce35934cc37..a505f619f337 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -5539,6 +5539,7 @@ static void mlxplat_poweroff(void) struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, MLXPLAT_CPLD_HALT_MASK); + kernel_halt(); } static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) From patchwork Tue Aug 22 08:13:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360323 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E913CEE4996 for ; Tue, 22 Aug 2023 08:15:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232154AbjHVIPy (ORCPT ); Tue, 22 Aug 2023 04:15:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233720AbjHVIPx (ORCPT ); Tue, 22 Aug 2023 04:15:53 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2052.outbound.protection.outlook.com [40.107.220.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B83DA12C for ; Tue, 22 Aug 2023 01:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a8FCO+caSTy1YBZHXq9JtQVjO2h5t0ooNpw52qqsjwZ90W17kql1GIxnh6wrL8ipOO3hwSKobN/3JZ61Q6AtLGhaOrL8XLzaJBdSSWV1IEXNiZUNLtdRZvcrPmYUB5LAiPVTX04DECR+R7AzHfjMrdWU6hcppmhMfWSnx4cEN3EMO63Fl+5FbcF6HZ8h51580Bc7jRPNkov4ZjS6CRgEON4ORdWYf/hm70uAv0stqEXwuiFYGlmkrjNZ9MlQ992fiFHpW1KFV7wNew7U6OcdcXO2j0pVGVMllFzIqMArEwcHbwJgnw0gbMvhg80t5nxTGgCbYBQYjJdk/8h/NukbbQ== 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=Owwl2VJqecHKjgR/LGsMJW9EO1lVXpmQaSTds+JS5Bk=; b=ZX6pDBa19nNMSSz7M3ox37ZW3qP8hgM/zunjqysCMEs+XfKsYoNVtBdowKE0jVLSDFGXiq+6dEXLFSOi1e41tocNiUlaIbrdVy2ssxskw0k+9LY/dHLBWG7z7MlGUmtOh7GSD/sW23puIjOpm++C9ckiwRYVs0D+g7tbRv3cjIeTeXN4slWhOgPR84OumHCB64YTv/BC8zEyVLuImKc1N/Lw2ZQDGsK03L1JrWVuOzJ22XaZW2PQEIMfPjY5LpXOztEObq6lslUva7VSybp5MkmPJ+Ve8Du+2GOiEj5Ak9gJnVVFrDEA74wZaW5ng8xzgCEcwkMPw1XTIL+GsJKDDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Owwl2VJqecHKjgR/LGsMJW9EO1lVXpmQaSTds+JS5Bk=; b=in+g7aBTNYsimBfFbmnX8ib4yMSMPgIVlW1B8Kb2Ksf7uzLoLIGYZr8XFohFlsVzOBrR3AmR0YqZDyYFaG31rK4Qq6FI4srzEaN2nC0RxmzimkevcnW1suhnpFooZagizArArUi4zZptYSqpwbFZ5erIYmmzZ/KltvHPffqpwIWmR0XXkWzE1QpKw7/1/oR4VQIp3reMPYsdkcOQAvBuoY7U5zIVUK4z3N+6PcKxYbcbqvYur58owJtuf5j/YLOTexAIIrDW7yJuH+V4JpucImftS8cBNcvKwVsk/iyTq71+zer9o7Qv8u/7zu8dFMh9WwzKSEr4NSeyxs/s5SwiBA== Received: from SN7PR18CA0023.namprd18.prod.outlook.com (2603:10b6:806:f3::16) by SJ2PR12MB8063.namprd12.prod.outlook.com (2603:10b6:a03:4d1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 08:15:49 +0000 Received: from SA2PEPF000015C6.namprd03.prod.outlook.com (2603:10b6:806:f3:cafe::17) by SN7PR18CA0023.outlook.office365.com (2603:10b6:806:f3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.25 via Frontend Transport; Tue, 22 Aug 2023 08:15:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SA2PEPF000015C6.mail.protection.outlook.com (10.167.241.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 08:15:49 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:15:39 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:15:37 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 08/16] platform: mellanox: Cosmetic changes Date: Tue, 22 Aug 2023 08:13:27 +0000 Message-ID: <20230822081335.64344-9-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015C6:EE_|SJ2PR12MB8063:EE_ X-MS-Office365-Filtering-Correlation-Id: dc663402-9c5d-4904-0d77-08dba2e7fe92 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2O3u8St9Vex/KOkzEgWZvuDTo33jgZi6+PQFeNRtMzMjjJ1ZUc0FTwdYoxcfezlDReX/Y6SeYf8GlXbfe4DuOA+qkxt8bx4t+DEsqRuHKkbESOjCwM2GiOJg6/6s74a1I7QVbHST6O0Vfqm9RIttb9VpSdSKDggJm0pIyfr8JDY6WUkSzzoERHPIRNij3DT6mMSk8r93PuRdjD7QTbpRtpokNARYdBLhlE59BTzxIZXhAJ02COa3HHTVYgE60pv+2IIvaacefIwOHMcP836viOg1gVSJGzbxi3ZSA5xEw62ls3X2yUo3d4lP5tTTVfX8rsdSWnzYQyPo9ZNaQHjinc6HX/GIYRdN1/xmFDLgxN9rEx01NaqQTXswynwjo8Ohf1U1UVbGsfm+ScLAcRgLL0IGdckfqpmLRNZWPo35L7hCFYiHXMLpkFHI16XBMSK0y/DRXngl/NwWUKpr9tOq43XS/iJ5xYQJCUgefGp52wsa88QwyDeD2s02Ao8/Bd07aqvh7av8sAcujxLPbrAvdpCQ+COJXY6Cqs+dxM9octb8kDr0Oifunhy7pTW6JbfjFF2Q8+f3Xmvx3QSRXmcj9uqmGKzQLT7nUbdsv4zmMz650diJVGfV2M3Q9IdZlhweXiTce1VL9F4EAA1mFdwTsA4sk/hZ8AH6gAVF/BZc8VdTX2hbBO7ADkPxe+NskuOkvKF/vqBQQ32ixxqsXSFrjj2SMKXk0AXrFEGFhvlSO9X0UmFf2RmiBAA2wyADVNfg X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(83380400001)(5660300002)(336012)(426003)(16526019)(26005)(86362001)(36860700001)(47076005)(8676002)(2616005)(8936002)(4326008)(107886003)(70206006)(316002)(70586007)(6916009)(54906003)(478600001)(356005)(82740400003)(6666004)(40460700003)(36756003)(1076003)(41300700001)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:15:49.3936 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc663402-9c5d-4904-0d77-08dba2e7fe92 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015C6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8063 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Fix routines and labels names by s/topolgy/topology. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- v1->v2: - Comments pointed out by Ilpo: - Fix commit text. --- drivers/platform/x86/mlx-platform.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index a505f619f337..1010064d54e9 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -6265,7 +6265,7 @@ mlxplat_i2c_mux_complition_notify(void *handle, struct i2c_adapter *parent, return mlxplat_post_init(priv); } -static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) +static int mlxplat_i2c_mux_topology_init(struct mlxplat_priv *priv) { int i, err; @@ -6294,7 +6294,7 @@ static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) return err; } -static void mlxplat_i2c_mux_topolgy_exit(struct mlxplat_priv *priv) +static void mlxplat_i2c_mux_topology_exit(struct mlxplat_priv *priv) { int i; @@ -6308,7 +6308,7 @@ static int mlxplat_i2c_main_complition_notify(void *handle, int id) { struct mlxplat_priv *priv = handle; - return mlxplat_i2c_mux_topolgy_init(priv); + return mlxplat_i2c_mux_topology_init(priv); } static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) @@ -6336,14 +6336,14 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) } if (priv->i2c_main_init_status == MLXPLAT_I2C_MAIN_BUS_NOTIFIED) { - err = mlxplat_i2c_mux_topolgy_init(priv); + err = mlxplat_i2c_mux_topology_init(priv); if (err) - goto fail_mlxplat_i2c_mux_topolgy_init; + goto fail_mlxplat_i2c_mux_topology_init; } return 0; -fail_mlxplat_i2c_mux_topolgy_init: +fail_mlxplat_i2c_mux_topology_init: fail_platform_i2c_register: fail_mlxplat_mlxcpld_verify_bus_topology: return err; @@ -6351,7 +6351,7 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv) { - mlxplat_i2c_mux_topolgy_exit(priv); + mlxplat_i2c_mux_topology_exit(priv); if (priv->pdev_i2c) platform_device_unregister(priv->pdev_i2c); } From patchwork Tue Aug 22 08:13:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360324 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0F5FEE49A3 for ; Tue, 22 Aug 2023 08:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233726AbjHVIP5 (ORCPT ); Tue, 22 Aug 2023 04:15:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233724AbjHVIP4 (ORCPT ); Tue, 22 Aug 2023 04:15:56 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2056.outbound.protection.outlook.com [40.107.95.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3F3912C for ; Tue, 22 Aug 2023 01:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UeDxu8x5LXKsiig7JFSq+Y8D/Vamw/9un0L9WbBSiQ20jB4hstFoyXCLvpdiDy9QIvtpklB6lGEH3Lhcr6f8EhEuJwGhr7329VfoOM7jUEY6opvq5dJi0L1R1ppeYhhulEgLcdF0+Cat28EHLBrX6BeEKCOWJCgCWe8RrRTIpt/wBFqRlD7SJSAKy6ntCxCh3gVGr9xvfJYalHBWEL/0QCSiPQOCcX14/yh3rO4T7tJ+IUUV2QC0y34vKwwQYSLKKy7jpz7N+wmHi9hVrWX09t4P1LlO5dYonC5iTIrJaw37fLOLBX59GGiWycY5ZL62e9F7v2eTyM5wGG0OX1JP0Q== 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=QaBstP60muus2eRPJaftO9yWcezhX3/u+gwj3DMAmZ4=; b=KCDLOrqIF+Vc+hiIKrz9biOxzIc0bvpzS1dI4vEzmT712geBRgOs+CTv7LYi6QDM8fTkTl4WZbJ1GIx6GrTar+hsrwOAWETHQnEHHBHaeFSMkn6JV9vA0elGD+64K8SC82CRxhpZiKbW3aLglUNxPqUtGxuCFHI6bmKIpRbxtgjkqdYB/BAMAaVUgdQSG5B0FlnM2pdEBK9Irq2U6MSSk091zh6PnqYKLh0fDQezBofUnMH8orRDTiriNhgB9cpbu589dFHecgOnY81nOCGsadJMQQ7gjhVEUGQswUvFhm/hmEnRoUO9lFWycq4BAuFNIdPawUHoKFMuV2vSyE2DKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QaBstP60muus2eRPJaftO9yWcezhX3/u+gwj3DMAmZ4=; b=I8xtkBPZlKMxMm+Jl7ytJLrnfFgILX+IZb7DRr9m/4kS90Q5SpZBC9Or/6X+qZV6Yl/xzO26i+Gk5B0DNMf9nyrjy9JHayOXv134npR4BxTmtiLwQc55C01CcZROHVJI/9DZGx65WbkFmem6YVU3JDzhHXBC88K/YtytephOhwFC6Uc+QOaHQGPUcIUI3h/+rM/9GaawggxSkmO8TWcCC/JORdgsk7KAtquGeG6eb9ymMGmWLpswUyu1H/4MKkQKEAiygfWkTjk67CZJM0Ptv5hakJXFEQ85GNMBPKIbMEQlhG60iCJdAxhYlS/t2xa9SUbSICsnCF4o6tIGNshGYA== Received: from SA1P222CA0171.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c3::8) by SA1PR12MB7344.namprd12.prod.outlook.com (2603:10b6:806:2b7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 08:15:52 +0000 Received: from SA2PEPF000015CD.namprd03.prod.outlook.com (2603:10b6:806:3c3:cafe::fc) by SA1P222CA0171.outlook.office365.com (2603:10b6:806:3c3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:15:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SA2PEPF000015CD.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 08:15:52 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:15:43 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:15:41 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 09/16] platform: mellanox: mlx-platform: Add reset callback Date: Tue, 22 Aug 2023 08:13:28 +0000 Message-ID: <20230822081335.64344-10-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CD:EE_|SA1PR12MB7344:EE_ X-MS-Office365-Filtering-Correlation-Id: d85e8d18-9902-4b8f-fd76-08dba2e8001f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BavUloEE+LmMqRNJKGzGMMhnPvWFW7x2c8Lj58VdJQp3KMz+3FGLmLTq5w1bE6xL3Lk764GhTcWRLFy06rlAx0i3RHWHw6CyRYVD8sCtnU0uvPoAl2zfMXfb+CUu57nhG5dPOAvig0/n33UcQiJ7PgERTlydgvz1SPfU2ddm7AdsHyIXVZIN1R4y8X8qWjIEMw90ICryXS3XvEmBUOdqFdcYk1FtH7U04ITsHB1vX6PLlNEA0TA+/pTDF22h9jalCdGKEDE2GUkscEhqPTYVmQzsSfIrjecO5YN0xNrFZky1sWyMCnG6f6YnslVT4uTfh4xhd/M5UqK4sPNmM9G036wz3CRn8t8BxPUX5Ic0ZXwHMLJfj8XmILzM2Mo9j509UtZoXto0ygiSx3v7c+tn/zA4YUsO4kqfbN/ewv/wQI0xWkajDiaH7tChUJyyKyQnF3RyKRPk2WL8ngjCsSNiGMB+eiYz3yJh81EAJvd5t9mbq3PjkP8eKhqQF9yNg8d1UilzGzWpmsRdRr+xPv5WvuMnaMRVOtLuKZ5O/tAMera3xnvhv6rAweCkW+CyWwMjaeGd2rECLOozT/h/rk5efEsdY6buUXVPNxhmNxOIk4/YV4AVbdEb3CcuXV78jNpV6BQtLoQRpPvGZ3sxx47XvXiLZjuxZVd7FnppczWBp0AF83jHLf9ol09WgnviEJWl17vFVaw56TbsQVEVyI7YQfn8y1LSRTZqe1wkuo9UFhWij0CIashbdoH/wzG0W2LB X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(83380400001)(5660300002)(336012)(426003)(16526019)(26005)(86362001)(36860700001)(47076005)(8676002)(2616005)(8936002)(4326008)(107886003)(70206006)(316002)(70586007)(6916009)(54906003)(478600001)(356005)(82740400003)(6666004)(40460700003)(36756003)(1076003)(41300700001)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:15:52.0016 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d85e8d18-9902-4b8f-fd76-08dba2e8001f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7344 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org On L1 switches reset should include special actions against CPLD device for performing graceful operations. For that purpose, special PLATFORM_RESET# signal should be indicated. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- v1->v2: - Comments pointed out by Ilpo: - Use GENMASK() for MLXPLAT_CPLD_RESET_MASK define. - Use a named define instead of BIT(0). --- drivers/platform/x86/mlx-platform.c | 46 +++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 1010064d54e9..296569492a71 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -35,6 +35,7 @@ #define MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET 0x09 #define MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET 0x0a #define MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET 0x0b +#define MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET 0x17 #define MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET 0x19 #define MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET 0x1c #define MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET 0x1d @@ -254,6 +255,7 @@ MLXPLAT_CPLD_PWM_PG_MASK) #define MLXPLAT_CPLD_I2C_CAP_BIT 0x04 #define MLXPLAT_CPLD_I2C_CAP_MASK GENMASK(5, MLXPLAT_CPLD_I2C_CAP_BIT) +#define MLXPLAT_CPLD_SYS_RESET_MASK BIT(0) /* Masks for aggregation for comex carriers */ #define MLXPLAT_CPLD_AGGR_MASK_CARRIER BIT(1) @@ -265,6 +267,7 @@ #define MLXPLAT_CPLD_LPC_LC_MASK GENMASK(7, 0) #define MLXPLAT_CPLD_HALT_MASK BIT(3) +#define MLXPLAT_CPLD_RESET_MASK GENMASK(7, 1) /* Default I2C parent bus number */ #define MLXPLAT_CPLD_PHYS_ADAPTER_DEF_NR 1 @@ -441,6 +444,7 @@ static struct i2c_mux_reg_platform_data mlxplat_default_mux_data[] = { static int mlxplat_max_adap_num; static int mlxplat_mux_num; static struct i2c_mux_reg_platform_data *mlxplat_mux_data; +static struct notifier_block *mlxplat_reboot_nb; /* Platform extended mux data */ static struct i2c_mux_reg_platform_data mlxplat_extended_mux_data[] = { @@ -2361,8 +2365,11 @@ static int mlxplat_mlxcpld_l1_switch_pwr_events_handler(void *handle, enum mlxreg_hotplug_kind kind, u8 action) { - dev_info(&mlxplat_dev->dev, "System shutdown due to short press of power button"); - kernel_power_off(); + if (action) { + dev_info(&mlxplat_dev->dev, "System shutdown due to short press of power button"); + kernel_power_off(); + } + return 0; } @@ -4957,6 +4964,7 @@ static struct mlxreg_core_platform_data mlxplat_mlxcpld_wd_set_type3[] = { static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) { switch (reg) { + case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_LED1_OFFSET: case MLXPLAT_CPLD_LPC_REG_LED2_OFFSET: @@ -5065,6 +5073,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: @@ -5229,6 +5238,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: @@ -5533,11 +5543,33 @@ static struct mlxreg_core_platform_data *mlxplat_wd_data[MLXPLAT_CPLD_WD_MAX_DEVS]; static const struct regmap_config *mlxplat_regmap_config; +/* Platform default reset function */ +static int mlxplat_reboot_notifier(struct notifier_block *nb, unsigned long action, void *unused) +{ + struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); + u32 regval; + int ret; + + ret = regmap_read(priv->regmap, MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET, ®val); + + if (action == SYS_RESTART && !ret && regval & MLXPLAT_CPLD_SYS_RESET_MASK) + regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET, + MLXPLAT_CPLD_RESET_MASK); + + return NOTIFY_DONE; +} + +static struct notifier_block mlxplat_reboot_default_nb = { + .notifier_call = mlxplat_reboot_notifier, +}; + /* Platform default poweroff function */ static void mlxplat_poweroff(void) { struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); + if (mlxplat_reboot_nb) + unregister_reboot_notifier(mlxplat_reboot_nb); regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, MLXPLAT_CPLD_HALT_MASK); kernel_halt(); } @@ -5861,6 +5893,7 @@ static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_rack_switch; pm_power_off = mlxplat_poweroff; + mlxplat_reboot_nb = &mlxplat_reboot_default_nb; return 1; } @@ -6410,8 +6443,15 @@ static int __init mlxplat_init(void) if (err) goto fail_regcache_sync; + if (mlxplat_reboot_nb) { + err = register_reboot_notifier(mlxplat_reboot_nb); + if (err) + goto fail_register_reboot_notifier; + } + return 0; +fail_register_reboot_notifier: fail_regcache_sync: mlxplat_pre_exit(priv); fail_mlxplat_i2c_main_init: @@ -6429,6 +6469,8 @@ static void __exit mlxplat_exit(void) if (pm_power_off) pm_power_off = NULL; + if (mlxplat_reboot_nb) + unregister_reboot_notifier(mlxplat_reboot_nb); mlxplat_pre_exit(priv); mlxplat_i2c_main_exit(priv); mlxplat_post_exit(); From patchwork Tue Aug 22 08:13:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360326 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED23BEE49A3 for ; Tue, 22 Aug 2023 08:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233728AbjHVIRZ (ORCPT ); Tue, 22 Aug 2023 04:17:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233701AbjHVIRY (ORCPT ); Tue, 22 Aug 2023 04:17:24 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2046.outbound.protection.outlook.com [40.107.220.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 272F1196 for ; Tue, 22 Aug 2023 01:17:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GjCXr2IPsZEzeXs3RrnSvAC77Sj07vBfw8I0cOfcvPo0X4sLeY7Y6BiLAqj7RQCcW/VkcDE2ztMHMyTa3UT1TMBFw6r9m/glyHOvGTCHiOKL8TRsyt3rVZK7psuYXSG84wrPIgghuWidb4Q01N6I5SAKBrP/j/HF/jOAmErphzj2AjGtwKxCKOVcqfvf9PoFnOLZzl8fE3ORHINxseDQnjNWTJHiT/uIxNXbpFXtWH1FpiGhAJHC6ALLiq3Q/wkyzGPLj3x9ZVBLIF17jHT7kZ8GD3QEBPGF3/WRlKSbHJvZidb1Is96kwFSblkk+lqZ02ahSp3kIqdw5KQlMW6hzg== 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=XYfDRWBP+PJN57L4JsMwH/gMwl9QvV+/wgy7hH0pHtw=; b=IZDjAvEcdJ3NxeMq6k0mNv+5CEIkGwBrEVG9EgDbVxFJZAHFH0cXF/F6M9O38UImRTALp9OjifHxW+e6u1TN2LtbekZp+EfQ9DAFkfQJzlBh+IAZF8IjU0B2zRRoj5ZH+WKqKniKg/Gsz+vwH91Tx4W7qNTAgxRtlPELXecKzi8Z3QK6acPii7EEqIyqCdsLPZlBmUMQdx8e4ziFay/7+E3dLqdxtVjdAbaox07DgqQJ9TMV53Id1IvVXsFqoWsQQNgCHVPSjg6x1VrmdycQv2kQESLZAxI+tUR8XkOb23rVbNkNGGjfgvuscaxGvAILmLeUkTdex1KriVx6i+RYTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XYfDRWBP+PJN57L4JsMwH/gMwl9QvV+/wgy7hH0pHtw=; b=Q53qvatVsoHG8rOKTc/X6ouneNzYHVNjPqmAzuEOkj2jAx29A7iIQg76nph58nU30TL+cRVJjS3/vMbe1ImZUtOfQzh6VkV/sIKikxVJ85P1Vhg/3DE/773DJElGtlbEGeLGBxLcU7v2iuI3itMZw38qNIH6DWrnZRxxJmehQbiuwqmC6k0lCP7RQHIAI+fANKXKqSbkPDnOi4zmRj73WyGS5ZwomuUN4nh3exWGDyrb3RtMIWwlzjCxHpJP9tF0f1KGk5AY+edkB/dPYw30JJcaRruwdnkgxRM7eZHYXwAUNcs1yzdxe8DBt+BWqOp5b3wsxmVNbL6uvj5dg3dJaA== Received: from SN4PR0501CA0056.namprd05.prod.outlook.com (2603:10b6:803:41::33) by LV8PR12MB9407.namprd12.prod.outlook.com (2603:10b6:408:1f9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 08:17:17 +0000 Received: from SN1PEPF0002636E.namprd02.prod.outlook.com (2603:10b6:803:41:cafe::95) by SN4PR0501CA0056.outlook.office365.com (2603:10b6:803:41::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:17:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF0002636E.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:17:17 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:17:05 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:17:02 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 10/16] platform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infrastructure Date: Tue, 22 Aug 2023 08:13:29 +0000 Message-ID: <20230822081335.64344-11-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636E:EE_|LV8PR12MB9407:EE_ X-MS-Office365-Filtering-Correlation-Id: c900bef7-95d1-4f5f-38b8-08dba2e832ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qb4rJdBnTAv0m52tEP36XviHrycZJWwd2h6QKqkJeL9LyNAugqbTZamdaYCJxTblwT1YAhsh04xTRxpgExyjDpCByRlYUH/AY/HJLwFBlaH3UwF86oqzBZ8PVjKXGDl1vPOYiYgp0P5NhN2HJTYadorPWhu/o0lVVaVvQVtkiCakMQkk9+mbOnBcN/PH//wFjNAkk3WnJb25B1bf8VtQAO5eylDogqBlKqt2FoMtVp6l99xMILiDJTvz/j5VHNit1R2Pn0cRi6FhmrYcXayR0AQpz/QeC12tUnc02CADuWjJv9sOhUp02ssV6d00IiRjb1duBdczqECgnIvWEQotmeRNrBy0ghXfmgBAcAssKAGaHUMk36ti2pLOpSdr7CQnGXKiK5IsiPGAO3XS9EX81TVpk9FmhBSsl923CxuaOPh7UL0VNPQKZWQ02n3OojaY6AEwT7Y87jjd4vmGiz9LzPPZ85DptUgMb2Cmv/XhTv1CHQrxX9g30xT2NDfOnkDFzVpSoVIaSMagLUWmz7d9g441gGrUC3EywNH6Stx3WgUDHi2+b9cMTEXlAtAtST1ElfHGaTTTXrFQzqBgUxHjB7bivsd3oDkjAkgsnLdWqRDcA803qM1ZYRsBdK7ciEc+0pVPKaQO6w04qPz6rH5Rkc9tN53UdRcN87mKNnOETyBt4iEzNFmeixc7rFjfs4DUjMa/yIYHOtNZ07TF0ryr2wo5Zm44wYyaMlCVYeAgXBc= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(83380400001)(5660300002)(336012)(426003)(16526019)(26005)(86362001)(36860700001)(47076005)(8676002)(2616005)(8936002)(4326008)(107886003)(70206006)(316002)(70586007)(6916009)(54906003)(478600001)(356005)(82740400003)(6666004)(40460700003)(36756003)(1076003)(41300700001)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:17:17.2105 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c900bef7-95d1-4f5f-38b8-08dba2e832ec X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9407 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Currently driver is activated through DMI hooks. Prepare driver to allow activation also through ACPI trigger. Modify mlxplat_init()/mlxplat_exit() routines. Add mlxplat_probe()/mlxplat_remove() routines and "mlxplat_driver" structure. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- drivers/platform/x86/mlx-platform.c | 91 +++++++++++++++++++---------- 1 file changed, 61 insertions(+), 30 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 296569492a71..73f887614e04 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -5574,6 +5574,17 @@ static void mlxplat_poweroff(void) kernel_halt(); } +static int __init mlxplat_register_platform_device(void) +{ + mlxplat_dev = platform_device_register_simple(MLX_PLAT_DEVICE_NAME, -1, + mlxplat_lpc_resources, + ARRAY_SIZE(mlxplat_lpc_resources)); + if (IS_ERR(mlxplat_dev)) + return PTR_ERR(mlxplat_dev); + else + return 1; +} + static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) { int i; @@ -5594,7 +5605,7 @@ static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_default_wc_matched(const struct dmi_system_id *dmi) @@ -5617,7 +5628,7 @@ static int __init mlxplat_dmi_default_wc_matched(const struct dmi_system_id *dmi mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_default_eth_wc_blade_matched(const struct dmi_system_id *dmi) @@ -5642,7 +5653,7 @@ static int __init mlxplat_dmi_default_eth_wc_blade_matched(const struct dmi_syst mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_msn21xx_matched(const struct dmi_system_id *dmi) @@ -5665,7 +5676,7 @@ static int __init mlxplat_dmi_msn21xx_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_msn274x_matched(const struct dmi_system_id *dmi) @@ -5688,7 +5699,7 @@ static int __init mlxplat_dmi_msn274x_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_msn201x_matched(const struct dmi_system_id *dmi) @@ -5711,7 +5722,7 @@ static int __init mlxplat_dmi_msn201x_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_qmb7xx_matched(const struct dmi_system_id *dmi) @@ -5737,7 +5748,7 @@ static int __init mlxplat_dmi_qmb7xx_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_comex_matched(const struct dmi_system_id *dmi) @@ -5762,7 +5773,7 @@ static int __init mlxplat_dmi_comex_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_comex; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_ng400_matched(const struct dmi_system_id *dmi) @@ -5788,7 +5799,7 @@ static int __init mlxplat_dmi_ng400_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_modular_matched(const struct dmi_system_id *dmi) @@ -5808,7 +5819,7 @@ static int __init mlxplat_dmi_modular_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_eth_modular; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_chassis_blade_matched(const struct dmi_system_id *dmi) @@ -5830,7 +5841,7 @@ static int __init mlxplat_dmi_chassis_blade_matched(const struct dmi_system_id * mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dmi) @@ -5851,7 +5862,7 @@ static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dm mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_rack_switch; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_ng800_matched(const struct dmi_system_id *dmi) @@ -5872,7 +5883,7 @@ static int __init mlxplat_dmi_ng800_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) @@ -5895,7 +5906,7 @@ static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) pm_power_off = mlxplat_poweroff; mlxplat_reboot_nb = &mlxplat_reboot_default_nb; - return 1; + return mlxplat_register_platform_device(); } static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { @@ -6139,12 +6150,6 @@ static int mlxplat_lpc_cpld_device_init(struct resource **hotplug_resources, { int err; - mlxplat_dev = platform_device_register_simple(MLX_PLAT_DEVICE_NAME, PLATFORM_DEVID_NONE, - mlxplat_lpc_resources, - ARRAY_SIZE(mlxplat_lpc_resources)); - if (IS_ERR(mlxplat_dev)) - return PTR_ERR(mlxplat_dev); - mlxplat_mlxcpld_regmap_ctx.base = devm_ioport_map(&mlxplat_dev->dev, mlxplat_lpc_resources[1].start, 1); if (!mlxplat_mlxcpld_regmap_ctx.base) { @@ -6158,13 +6163,11 @@ static int mlxplat_lpc_cpld_device_init(struct resource **hotplug_resources, return 0; fail_devm_ioport_map: - platform_device_unregister(mlxplat_dev); return err; } static void mlxplat_lpc_cpld_device_exit(void) { - platform_device_unregister(mlxplat_dev); } static int @@ -6389,16 +6392,13 @@ static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv) platform_device_unregister(priv->pdev_i2c); } -static int __init mlxplat_init(void) +static int mlxplat_probe(struct platform_device *pdev) { - unsigned int hotplug_resources_size; - struct resource *hotplug_resources; + unsigned int hotplug_resources_size = 0; + struct resource *hotplug_resources = NULL; struct mlxplat_priv *priv; int i, err; - if (!dmi_check_system(mlxplat_dmi_table)) - return -ENODEV; - err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); if (err) return err; @@ -6461,9 +6461,8 @@ static int __init mlxplat_init(void) return err; } -module_init(mlxplat_init); -static void __exit mlxplat_exit(void) +static int mlxplat_remove(struct platform_device *pdev) { struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); @@ -6474,6 +6473,38 @@ static void __exit mlxplat_exit(void) mlxplat_pre_exit(priv); mlxplat_i2c_main_exit(priv); mlxplat_post_exit(); + return 0; +} + +static struct platform_driver mlxplat_driver = { + .driver = { + .name = "mlxplat", + .probe_type = PROBE_FORCE_SYNCHRONOUS, + }, + .probe = mlxplat_probe, + .remove = mlxplat_remove, +}; + +static int __init mlxplat_init(void) +{ + int err; + + if (!dmi_check_system(mlxplat_dmi_table)) + return -ENODEV; + + err = platform_driver_register(&mlxplat_driver); + if (err) + return err; + return 0; +} +module_init(mlxplat_init); + +static void __exit mlxplat_exit(void) +{ + if (mlxplat_dev) + platform_device_unregister(mlxplat_dev); + + platform_driver_unregister(&mlxplat_driver); } module_exit(mlxplat_exit); From patchwork Tue Aug 22 08:13:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360325 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60E1BEE49A8 for ; Tue, 22 Aug 2023 08:17:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232055AbjHVIRZ (ORCPT ); Tue, 22 Aug 2023 04:17:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233714AbjHVIRY (ORCPT ); Tue, 22 Aug 2023 04:17:24 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2082.outbound.protection.outlook.com [40.107.212.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7161810E for ; Tue, 22 Aug 2023 01:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TssNprlbov2bfUQc8bYByg18BIeC8J5CzYyRPQpJWtnByRyaosllPyoLV3TCXcf9xxHww00T7X3IpW6gI8XEyuXodQFVpfOlhJyW4dsfctleBwP8VZN3eQy3dpxkI3hRy7GAsqv55gYNmcB1NMopnwevIGgRdBPPkyYRKCaUiElzo0gJB6bHMe1nCoiyO8IDBp4n7oxHSAbAPCX9+vA4K0Fxav2mBhBd7clCl6xQcsjq6PrPmKzLy3vQv62ey/yr0VWEDmaRWanEAlEyZWsMMMgzEMort04MfYcAiDfBQbaku8AUQ74DTdh/AIsyPjKXIrW7tWa8BZq7OS9iZ4cXVw== 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=n0pTie1WPeJf0lSX5yfdg5lCqSwBmNseWpocTJVxQUw=; b=RV3lXQZ4P0v2/z2jEEkmzqn9LCoRfxRlZ80psrxP+f8ca9wdRxQ2/B3sbc070H60rRJuY3869zPeEP5Rzd3AUtyITR4oavm1RJtz6go8u00n3wT5Z6m0+UCTY1YyAckgP3Na2+OZXYgdib9+O1MhxfZS3XRNzBUvwvWXqXHeZdUKFiKx05FK7P5xbcwE4KS097fvo7LsamSmByU/a/7JE69JqkUWzRZpjQzUcRpy9HETPDdbKipmofN2tieoHtNw674cKOFbA1gA/PkBSBwvjGTn4JLmrnOV1j67quyzLnUes/zI9VH1JCHUsrkOs3jeB0HPOy1PO8PYGFo/ZYiA/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n0pTie1WPeJf0lSX5yfdg5lCqSwBmNseWpocTJVxQUw=; b=Mh1UcCrPdIGwD0nkJAn3cUBzjEn8ETpLWQWpkI3imZR9DijwlRBWjo82UiqW8RLv+ryvvuah7K25DsRlxQ5tW9/CAGxYa4BkB32VfUsNduwg0NwgFGg2U+mNzz7HkqihNkSCjWegrk/FGysIkLLDnkyIksKJSyAMqAtbJZfZmSmUzqPSUqkppstskmC2sHDh1kLIf651Zxkj2np7AgbhXwNehcsCBjqCmrCVVkFqeZfse/Unp/bJA1tYN9PHiSUW4AGde48ker0FVivDJUhLmqBN8BhXFMrFoavEvErx8YJDHG8FuNl+8I96Wd7b5C/iZAq6h97prdyBTo1zOSdL/w== Received: from PH7PR10CA0015.namprd10.prod.outlook.com (2603:10b6:510:23d::17) by DM3PR12MB9415.namprd12.prod.outlook.com (2603:10b6:8:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 08:17:20 +0000 Received: from SA2PEPF000015CA.namprd03.prod.outlook.com (2603:10b6:510:23d:cafe::9f) by PH7PR10CA0015.outlook.office365.com (2603:10b6:510:23d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:17:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SA2PEPF000015CA.mail.protection.outlook.com (10.167.241.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:17:20 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:17:09 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:17:06 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 11/16] platform: mellanox: mlx-platform: Introduce ACPI init flow Date: Tue, 22 Aug 2023 08:13:30 +0000 Message-ID: <20230822081335.64344-12-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CA:EE_|DM3PR12MB9415:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ee6e1ff-cd44-4b17-0c97-08dba2e834a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mSKvNw1gWZsNn5EjDaEZyKQJWzZIb2tkGpsqZFRLCNi9i83EtigwX94CpCkcX/W7sirQtEqjkxuRL2eRwd6ToAfzXGzzS70zhDfpJa7hzjW8GNKhDyh8BTiQk1haUsg08l92+TBFVHRfbZUlIQ/3GHecfyEZ279d2oz59ElzN3lg5zUEofnav68OshvKcHGEx0catey0LaY/aIfwuUQU1diJVBINqVrQS2vo0cinyzOCyzgjMUq33b6VdTPkq2YqFVc5Qyb+KkjxShooYNiDidYSwLZzgNwMKpVGKOS0RBrp5Ale+oNu/PEcoRLkzluLPA1Fbl+LhpQn9ZBG0ZzdOzCoZ7Izl+Xw62/+yBhfBLAw2pEkXn4/RvOCRmdwkyKe8EKeI+I8e4JGC3Ejc+0u9BCwv77cnLkJnpQ0adywz7MnlrT12FSgQ/ftNrOBaBspTGRSRMtQKH/NO7Ik4cNqOwmkFhaL9PvOTkqS6KC0BKE/hX0GnqwMdx+R7Tbm1dram4s5H5DAI84fuHEzLyTG5v4sm6FX8laGIwNhpo072IRqtvpP3pbgzmkrxUp8Hk4LWfrSH94SXYzn0nAwIksgY+4ryKcA0k9Maiyi9HNGV5S9aQWMb7kB8Dc/hTOhjg6hzbFncaidILCGKg5bhhHFf33G6GLoXmiVGn/eg60VsLVvoIcIpDJdOSRpn9hyOnJ7cGTneg3mK1nXtMj4lfUvbbbGHH7GcACvsktoFQaYM45P3LJY+BIjMj+2gi9pusyi X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(396003)(136003)(39860400002)(376002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(70586007)(70206006)(6916009)(316002)(8676002)(8936002)(2616005)(107886003)(4326008)(1076003)(41300700001)(36756003)(40460700003)(7636003)(356005)(82740400003)(478600001)(6666004)(40480700001)(2906002)(86362001)(36860700001)(47076005)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:17:20.0667 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ee6e1ff-cd44-4b17-0c97-08dba2e834a0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9415 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Introduce support for ACPI initialization flow - add ACPI match hook. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- v1->v2: - Comments pointed out by Ilpo: - Squash few lines from the next patch to this one to have less churn in next. --- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 73f887614e04..feedfba0acf3 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -6396,9 +6396,14 @@ static int mlxplat_probe(struct platform_device *pdev) { unsigned int hotplug_resources_size = 0; struct resource *hotplug_resources = NULL; + struct acpi_device *acpi_dev; struct mlxplat_priv *priv; int i, err; + acpi_dev = ACPI_COMPANION(&pdev->dev); + if (acpi_dev) + mlxplat_dev = pdev; + err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); if (err) return err; @@ -6476,9 +6481,16 @@ static int mlxplat_remove(struct platform_device *pdev) return 0; } +static const struct acpi_device_id mlxplat_acpi_table[] = { + { "MLNXBF49", 0 }, + {} +}; +MODULE_DEVICE_TABLE(acpi, mlxplat_acpi_table); + static struct platform_driver mlxplat_driver = { .driver = { .name = "mlxplat", + .acpi_match_table = ACPI_PTR(mlxplat_acpi_table), .probe_type = PROBE_FORCE_SYNCHRONOUS, }, .probe = mlxplat_probe, From patchwork Tue Aug 22 08:13:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360327 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFEF5EE4996 for ; Tue, 22 Aug 2023 08:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233714AbjHVIRc (ORCPT ); Tue, 22 Aug 2023 04:17:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233701AbjHVIRb (ORCPT ); Tue, 22 Aug 2023 04:17:31 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2040.outbound.protection.outlook.com [40.107.223.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E4DF12C for ; Tue, 22 Aug 2023 01:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mWzxcX6byXV//ieGC8V03hGzH9JUcBfo0eZ5c2Gpjq3InBxoXphplnpGIgbbYKu1L9YYo+2VcdWLxYithgZeeeKrD5VaCgZAhfzdxHaIeJORFKlmhw28RdGrSH0M0Sp3S1T24mDbeKyteRCzmwUPzPoSeBbeCM61G85lk1j33tqkHbrQB7GCzotKQWAG86Z7NDslkotjb4gqyDIpqsB8etbNnw8YsATYE/C0Ib6lJAAMz3t6mbVurtrucK7E85EXVs0IpTKhQkhSk5jqai9fpojNKwcCsteMEh4O8hjRJqkRvdp5QwKhwNywZaHPvaMIerf2e2omCUZeoIguFOg6yQ== 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=xistev9Izxumc/W/GhwYaxs0jjZdP9ECFVeYZwHFSjg=; b=i2QeK/B37R4C9Mz8Q/Gpm3Xx4xwNLXhVcWmehVYY7+uO3rQ902v25h0Gy+5rqVFWJ/JpZ+z8t54xjItueOpeg4tblW5YPC3zkKO0wPNHYUWPUu+OfLL6h+J/XmDUWgxHYJckiLuyTuSVi6FjtPM+M4/w8BRT6NMAEsz/Yh7RNcErhBmtZ0cv1gS2zjckpPBZSuJh7N7LF56LPtRMJavffbXTae8Ph9461t/3/P+9qPXjAFLfT42jeyVzPmKRmA1/JC4b4KbMOLN9VT7diWsF0MU1Sp9/MWsDOl03YWaDDNUWSWPxaaf+MLBGLSplpcQ2CwhIzc/Z9WON104tAfLYEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xistev9Izxumc/W/GhwYaxs0jjZdP9ECFVeYZwHFSjg=; b=BxsiQPE0Gb5DAdsnKcWBWyVMjDlSVI1LbJWjmUorwOc1gVwOdiAGp5o9NCslj7MOyaFj7SoYSYPBQfhu4jUAaSDOufgfQsFHlaaPpdZvCODMfkWoNsJoa4lKE2lZvXkSb3M17aavaJinq7mgxjhdNNkb7h0n15+1XbCuVvamTnpCPGfXZELguPBz7jFibpWYRT8xB3uFOGxugoQs+YIVX3FGMQ24XUFVu+UcoBlh4ozp+Esx0RBZzGHC075imLxkSRTt9CsiXpe7gHIzYy6iiNj8/vwoCKq2sOPNPS0OA7DFtXFOgopns3J+xbmJW56LoawYFCs60qoWD0Nv8z0+cA== Received: from PH8PR20CA0019.namprd20.prod.outlook.com (2603:10b6:510:23c::25) by CH3PR12MB8331.namprd12.prod.outlook.com (2603:10b6:610:12f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 08:17:28 +0000 Received: from SA2PEPF000015CB.namprd03.prod.outlook.com (2603:10b6:510:23c:cafe::a) by PH8PR20CA0019.outlook.office365.com (2603:10b6:510:23c::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:17:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SA2PEPF000015CB.mail.protection.outlook.com (10.167.241.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:17:27 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:17:15 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:17:10 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 12/16] platform: mellanox: mlx-platform: Get interrupt line through ACPI Date: Tue, 22 Aug 2023 08:13:31 +0000 Message-ID: <20230822081335.64344-13-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CB:EE_|CH3PR12MB8331:EE_ X-MS-Office365-Filtering-Correlation-Id: e7ca304d-56ef-4251-f761-08dba2e838e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9dXOC5jr+3LR1bbN8MAphgwB2B3yaRLznWjCCOXy6XHawPuFwlS0df4HfzYY3nrcF2w1WEbae5KkbZ0KR/Xur+WosEH3vtmkbFqCfM6N4jKPgBCoZTngVUETWoERqf0zn/4s8hkdBfpqxFiry2fupTpvhz4+HCka7Rx5C92DjmyfpZwdvkoAorz/8c+B1yByo73b6VJGI/eeefx2XEPjY3v2ECDmCRY16WJnHFAI1+j4h7cBFIkAmSwu6gTWxsiNHmmKN9vwN3hnJKI7CgCwoRRrDwxru2E0jdGIlfwpzgxUQUV3Xl6qGc9KkBEHuKGk4CGPXPH60DTne+j9t9llN/pE3y7ayYAhUi2Ws+0IisWSOqNP8JHYbNZ6+Cspk/Wm2VRD0XNj0Z2zX/YWCU0d/yKuQAnNVCwRwHyrrjG6cRI8hhWZrIX8ZWXy2r4Vtf87j3rlN9dBVYZtmJ0hw7cfGt5nDv52dPJJsUM6g4v8NSN/kovb1VcmvZwl3mINQdWykMD77skByM63wZDsWQDnZg2jh2evqofDO4qbmJER3oN4UaKcQPKRP+yxK36AO4YhhilPkIfRieuu05rLcREcfiR7h+E0rwRu/kyyGAZ5ftK4LKT6ysnXy48IN/oQZ4Cuxj+AZoIAkCloUAIPzL4BGqeS0JcpQ3HoWtdh/Owhr5BZPeQTUX4ksG2TXqWqNEYSb1X4NIzqz0v9o34YYi9OkC9nTfLGo0xK8Hpb1FXN7X/90T07WqqEjj5czVIOFCkb X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(83380400001)(5660300002)(336012)(426003)(16526019)(26005)(86362001)(36860700001)(47076005)(8676002)(2616005)(8936002)(4326008)(107886003)(70206006)(316002)(70586007)(6916009)(54906003)(478600001)(356005)(82740400003)(6666004)(40460700003)(36756003)(1076003)(41300700001)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:17:27.2645 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e7ca304d-56ef-4251-f761-08dba2e838e7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8331 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add support for getting system interrupt line from ACPI table. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- v1->v2: - Comments pointed out by Ilpo: - Remove ' acpi_dev ' declaration, move it to the previous patch. --- drivers/platform/x86/mlx-platform.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index feedfba0acf3..3eccb6628ccc 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -343,6 +343,7 @@ * @hotplug_resources: system hotplug resources * @hotplug_resources_size: size of system hotplug resources * @hi2c_main_init_status: init status of I2C main bus + * @irq_fpga: FPGA IRQ number */ struct mlxplat_priv { struct platform_device *pdev_i2c; @@ -356,6 +357,7 @@ struct mlxplat_priv { struct resource *hotplug_resources; unsigned int hotplug_resources_size; u8 i2c_main_init_status; + int irq_fpga; }; static struct platform_device *mlxplat_dev; @@ -6188,6 +6190,8 @@ static int mlxplat_post_init(struct mlxplat_priv *priv) /* Add hotplug driver */ if (mlxplat_hotplug) { mlxplat_hotplug->regmap = priv->regmap; + if (priv->irq_fpga) + mlxplat_hotplug->irq = priv->irq_fpga; priv->pdev_hotplug = platform_device_register_resndata(&mlxplat_dev->dev, "mlxreg-hotplug", PLATFORM_DEVID_NONE, @@ -6398,11 +6402,15 @@ static int mlxplat_probe(struct platform_device *pdev) struct resource *hotplug_resources = NULL; struct acpi_device *acpi_dev; struct mlxplat_priv *priv; - int i, err; + int irq_fpga = 0, i, err; acpi_dev = ACPI_COMPANION(&pdev->dev); - if (acpi_dev) + if (acpi_dev) { + irq_fpga = acpi_dev_gpio_irq_get(acpi_dev, 0); + if (irq_fpga < 0) + return -ENODEV; mlxplat_dev = pdev; + } err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); if (err) @@ -6417,6 +6425,7 @@ static int mlxplat_probe(struct platform_device *pdev) platform_set_drvdata(mlxplat_dev, priv); priv->hotplug_resources = hotplug_resources; priv->hotplug_resources_size = hotplug_resources_size; + priv->irq_fpga = irq_fpga; if (!mlxplat_regmap_config) mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config; From patchwork Tue Aug 22 08:13:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360329 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CA94EE49A3 for ; Tue, 22 Aug 2023 08:17:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233762AbjHVIRj (ORCPT ); Tue, 22 Aug 2023 04:17:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233701AbjHVIRf (ORCPT ); Tue, 22 Aug 2023 04:17:35 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2045.outbound.protection.outlook.com [40.107.93.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23491193 for ; Tue, 22 Aug 2023 01:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SvrUYl4dhmpYUeHHikz+nifw9iwI9nBlUvidCdrNr0cvh68baL6E3LXeiH9EEa3EloYG4q9qaNHHzuUVewEnH6O3wfesA44IMpz3yBvzN7UbM345rbLdsNjj0Z6M9ieaN5qqu8NOuhYxzsil7GFaA4wA1E4rR2dUlopT0oa6trZ4MPJtSl2VeO5fPibzxxADyySDAv3QRT8j9crts7r54Y5QRp2kIVs2ZMyYvjdVw4GC4a/KWAaWXD3f+4wMZmbbKeamuCbbwHQEWZbHuXa3Y1uJBmqPVhTEWr1m8vfptMHxXJcCzSiT8RmeCEIcsg/i4O2D3/4rC4pKlvNUtiTiUQ== 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=DshEXWTk16tr4K/XnMIMrFCUzJG4WwmKG/W2+00d+qc=; b=dZlxm3M9uPJwu6KJet6OCJDa+afUkolHQqTEml5+P2kb24pOoKozq8oCo3ypxmO/vTimOatehUe6ay9S9VPn/2mj+5CdhY50+StrQ7LAMXDNYtH9L0NBHHLoJkYxz9UXcR5XIWI31TF122CbWprzs8MwZ55MnpBoQ11sCocNOPYJSrV/81LrndwbigUIfGfS2dGaODoYIHIHx4VlA0ZrDDFP5k3Yscu6+2mD+c4glLAdQ39LfUMRsM0xQeVEVr3JD6pEqX0dLSC9de4bXnqVR6SeNTLbUID06GGneq6NfD6nfMCDCNZmt66HDTv/xi7SindAX5HKDPzq5eM7NcMx3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DshEXWTk16tr4K/XnMIMrFCUzJG4WwmKG/W2+00d+qc=; b=EX4cjF+W2Gt/aP2wMarSxFv1IGJwTNpmbvHLtUyX6Y4/I4HZVMkgcnTuNFxwcPjINp30mYiB0S7smwV/TgfxscxU18XI2PZ0FiaS+tiJl9Wue33wGMv7IcOMYHyBLUYhr0jdY1Mi9TvSQxvPzqnx7eVxH+go0iF7AB6L1CVMfrySj+NcGm50rruLhVna8ausYreU6xi/KSGzFYwevR0oweK++JZDqTOhe0QonXjnqTvhH5pC5Tc7rShG6ryOPylQ+1IwWkML4d4LKtH0CqG6lbZ8a5uxuNVlZpsZ5ZofXg7CyrMIx79+cfB1s8QaGU0SuA2X+nvzAddyrJWkdHbLZw== Received: from PH8PR20CA0004.namprd20.prod.outlook.com (2603:10b6:510:23c::12) by MW3PR12MB4364.namprd12.prod.outlook.com (2603:10b6:303:5c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 08:17:31 +0000 Received: from SA2PEPF000015CB.namprd03.prod.outlook.com (2603:10b6:510:23c:cafe::2a) by PH8PR20CA0004.outlook.office365.com (2603:10b6:510:23c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:17:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SA2PEPF000015CB.mail.protection.outlook.com (10.167.241.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:17:30 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:17:18 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:17:16 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 13/16] platform: mellanox: Add initial support for PCIe based programming logic device Date: Tue, 22 Aug 2023 08:13:32 +0000 Message-ID: <20230822081335.64344-14-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CB:EE_|MW3PR12MB4364:EE_ X-MS-Office365-Filtering-Correlation-Id: 0efab694-607a-4a0c-9186-08dba2e83ae8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 45/q9rZPNA4b5tWr1pIM1/BdDPi7ZWWjWCvzpx1ggpax7vP/2w14DkOVDgVqWF+SVQkDEA6cQWBPGVa1yF+yU41JOVgpL+uVD/orcyzsRpIiGl+YqGVS4T84Ob0NXOelFU/9ytRB2ypmycYf0FaAuOzS3I4IIx7CkWlZXVMxWZs8mVG52xVl7l0v6vjAhjqcdX93X+kz/dswnbn7+wgzLMYVEGhk2+YsWIbigd0kZwT39tWNoIczb1lR+quxZMILefZF2b0eFSXc73KXo6Wdy2EiIAQgX0aOqfiOsLpQwXYR3N046U1aoJ39VYcV0ArW2R3eVUHO36QZ28TXynoh1GF4s1DAAl7xkw37zuVn0Uftp0SkXGkBM6DwpPkXk1/4bjT5WKVruzhqv3elkQwAAeNvsbHap/kA4HOAWDIBdSiTP7/56iaKtS6jxAiR6qcI1QXIBedW/X6G7yzJhkVn31/iiv2WglILLKdO+lV6qOTHA+0CqofUU8PJ4SOGswCzs5ofkjjb1p10sl1AVvT04pG5qW4Ne4aCp6dzV6rKNyoj4uYlTBLwc91qd0hwchRtYnCAPHMULoebVkdGf0AeBBgFwdkGQOoPJShrosoUEXZClTbCSPUxsmBFUBcf+4onhV5K2DnA5TsOzH2eE3FHNXs1x+0S/pdKOCwypy2oyES614G5zq8KoZAXzGplNiGAkLPkgsy33Z5ZytTMHWIfHSxVl9qnOn0ctVrXW7tDUvVN/n5GVzN27XbZquyI5CCW X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(83380400001)(5660300002)(336012)(426003)(16526019)(26005)(86362001)(36860700001)(47076005)(8676002)(2616005)(8936002)(4326008)(107886003)(70206006)(316002)(70586007)(6916009)(54906003)(478600001)(356005)(82740400003)(6666004)(40460700003)(36756003)(1076003)(41300700001)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:17:30.6239 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0efab694-607a-4a0c-9186-08dba2e83ae8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4364 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Extend driver to support logic implemented by FPGA device connected through PCIe bus. The motivation two support new generation of Nvidia COME module equipped with Lattice LFD2NX-40 FPGA device. In order to support new Nvidia COME module FPGA device driver initialization flow is modified. In case FPGA device is detected, system resources are to be mapped to this device, otherwise system resources are to be mapped same as it has been done before for Lattice LPC based CPLD. FPGA device is associated with three PCIe devices: - PCIe-LPC bridge for main register space access. - PCIe-I2C bridge for I2C controller access. - PCIe-JTAG bridge for JTAG access. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- - Comments pointed out by Ilpo: - Suggested to use common label name in mlxplat_pci_fpga_device_init() to avoid labels duplication. - Vadim: I would prefer to follow the convention we are keeping in the driver to have consistent code. --- drivers/platform/x86/mlx-platform.c | 134 +++++++++++++++++++++++++++- 1 file changed, 132 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 3eccb6628ccc..44f107965832 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -331,6 +332,12 @@ #define MLXPLAT_I2C_MAIN_BUS_NOTIFIED 0x01 #define MLXPLAT_I2C_MAIN_BUS_HANDLE_CREATED 0x02 +/* Lattice FPGA PCI configuration */ +#define PCI_VENDOR_ID_LATTICE 0x1204 +#define PCI_DEVICE_ID_LATTICE_I2C_BRIDGE 0x9c2f +#define PCI_DEVICE_ID_LATTICE_JTAG_BRIDGE 0x9c30 +#define PCI_DEVICE_ID_LATTICE_LPC_BRIDGE 0x9c32 + /* mlxplat_priv - platform private data * @pdev_i2c - i2c controller platform device * @pdev_mux - array of mux platform devices @@ -362,6 +369,7 @@ struct mlxplat_priv { static struct platform_device *mlxplat_dev; static int mlxplat_i2c_main_complition_notify(void *handle, int id); +static void __iomem *i2c_bridge_addr, *jtag_bridge_addr; /* Regions for LPC I2C controller and LPC base register space */ static const struct resource mlxplat_lpc_resources[] = { @@ -5544,6 +5552,9 @@ static struct mlxreg_core_platform_data *mlxplat_fan; static struct mlxreg_core_platform_data *mlxplat_wd_data[MLXPLAT_CPLD_WD_MAX_DEVS]; static const struct regmap_config *mlxplat_regmap_config; +static struct pci_dev *lpc_bridge; +static struct pci_dev *i2c_bridge; +static struct pci_dev *jtag_bridge; /* Platform default reset function */ static int mlxplat_reboot_notifier(struct notifier_block *nb, unsigned long action, void *unused) @@ -6172,15 +6183,131 @@ static void mlxplat_lpc_cpld_device_exit(void) { } +static int +mlxplat_pci_fpga_device_init(unsigned int device, const char *res_name, struct pci_dev **pci_bridge, + void __iomem **pci_bridge_addr) +{ + void __iomem *pci_mem_addr; + struct pci_dev *pci_dev; + int err; + + pci_dev = pci_get_device(PCI_VENDOR_ID_LATTICE, device, NULL); + if (!pci_dev) + return -ENODEV; + + err = pci_enable_device(pci_dev); + if (err) { + dev_err(&pci_dev->dev, "pci_enable_device failed with error %d\n", err); + goto fail_pci_enable_device; + } + + err = pci_request_region(pci_dev, 0, res_name); + if (err) { + dev_err(&pci_dev->dev, "pci_request_regions failed with error %d\n", err); + goto fail_pci_request_regions; + } + + err = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(64)); + if (err) { + err = dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(32)); + if (err) { + dev_err(&pci_dev->dev, "dma_set_mask failed with error %d\n", err); + goto fail_pci_set_dma_mask; + } + } + + pci_set_master(pci_dev); + + pci_mem_addr = devm_ioremap(&pci_dev->dev, pci_resource_start(pci_dev, 0), + pci_resource_len(pci_dev, 0)); + if (!pci_mem_addr) { + dev_err(&mlxplat_dev->dev, "ioremap failed\n"); + err = -EIO; + goto fail_ioremap; + } + + *pci_bridge = pci_dev; + *pci_bridge_addr = pci_mem_addr; + + return 0; + +fail_ioremap: +fail_pci_set_dma_mask: + pci_release_regions(pci_dev); +fail_pci_request_regions: + pci_disable_device(pci_dev); +fail_pci_enable_device: + return err; +} + +static void +mlxplat_pci_fpga_device_exit(struct pci_dev *pci_bridge, + void __iomem *pci_bridge_addr) +{ + iounmap(pci_bridge_addr); + pci_release_regions(pci_bridge); + pci_disable_device(pci_bridge); +} + +static int +mlxplat_pci_fpga_devices_init(struct resource **hotplug_resources, + unsigned int *hotplug_resources_size) +{ + int err; + + err = mlxplat_pci_fpga_device_init(PCI_DEVICE_ID_LATTICE_LPC_BRIDGE, + "mlxplat_lpc_bridge", &lpc_bridge, + &mlxplat_mlxcpld_regmap_ctx.base); + if (err) + goto mlxplat_pci_fpga_device_init_lpc_fail; + + err = mlxplat_pci_fpga_device_init(PCI_DEVICE_ID_LATTICE_I2C_BRIDGE, + "mlxplat_i2c_bridge", &i2c_bridge, + &i2c_bridge_addr); + if (err) + goto mlxplat_pci_fpga_device_init_i2c_fail; + + err = mlxplat_pci_fpga_device_init(PCI_DEVICE_ID_LATTICE_JTAG_BRIDGE, + "mlxplat_jtag_bridge", &jtag_bridge, + &jtag_bridge_addr); + if (err) + goto mlxplat_pci_fpga_device_init_jtag_fail; + + return 0; + +mlxplat_pci_fpga_device_init_jtag_fail: + mlxplat_pci_fpga_device_exit(i2c_bridge, i2c_bridge_addr); +mlxplat_pci_fpga_device_init_i2c_fail: + mlxplat_pci_fpga_device_exit(lpc_bridge, mlxplat_mlxcpld_regmap_ctx.base); +mlxplat_pci_fpga_device_init_lpc_fail: + return err; +} + +static void mlxplat_pci_fpga_devices_exit(void) +{ + mlxplat_pci_fpga_device_exit(jtag_bridge, jtag_bridge_addr); + mlxplat_pci_fpga_device_exit(i2c_bridge, i2c_bridge_addr); + mlxplat_pci_fpga_device_exit(lpc_bridge, mlxplat_mlxcpld_regmap_ctx.base); +} + static int mlxplat_pre_init(struct resource **hotplug_resources, unsigned int *hotplug_resources_size) { - return mlxplat_lpc_cpld_device_init(hotplug_resources, hotplug_resources_size); + int err; + + err = mlxplat_pci_fpga_devices_init(hotplug_resources, hotplug_resources_size); + if (err == -ENODEV) + return mlxplat_lpc_cpld_device_init(hotplug_resources, hotplug_resources_size); + + return err; } static void mlxplat_post_exit(void) { - mlxplat_lpc_cpld_device_exit(); + if (lpc_bridge) + mlxplat_pci_fpga_devices_exit(); + else + mlxplat_lpc_cpld_device_exit(); } static int mlxplat_post_init(struct mlxplat_priv *priv) @@ -6366,6 +6493,9 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) mlxplat_i2c->regmap = priv->regmap; mlxplat_i2c->handle = priv; + /* Set mapped base address of I2C-LPC bridge over PCIe */ + if (lpc_bridge) + mlxplat_i2c->addr = i2c_bridge_addr; priv->pdev_i2c = platform_device_register_resndata(&mlxplat_dev->dev, "i2c_mlxcpld", nr, priv->hotplug_resources, priv->hotplug_resources_size, From patchwork Tue Aug 22 08:13:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360328 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DACA4EE49A8 for ; Tue, 22 Aug 2023 08:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233731AbjHVIRd (ORCPT ); Tue, 22 Aug 2023 04:17:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233701AbjHVIRd (ORCPT ); Tue, 22 Aug 2023 04:17:33 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2066.outbound.protection.outlook.com [40.107.223.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC20710E for ; Tue, 22 Aug 2023 01:17:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q3bys1s3NdEUogLMI78NbTOLZrJGAwN0zigEACnvV4QoSwHUFEhTr8EizuZTB1rH2wZn6W+nuLrZO+cHYm48lb8IzheWefWBTwKH+4Hl/vUyqGNqN09JwbtwkDLu5mJV3sfL8+8Ceknk5j9LYaqTEFCtSwV2b1sYkMR823C+bBoPXXqotrDxfPWkefguplFwAb+XNxonlPhmV6kW9Wviyxiy1JtedsD9AEecuBdcn8QisVE+2DeTXM5eBLZmxhs4Ot/9xE5Bb49afCjFDOaorv9ao5Nz8SxUkZiftCWp6YVrNlx/w5cBksUcxOawIO7EjqepvaELm5X48zW8Af0lRA== 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=LhlRwecO+gIQSwIsobGreS+K+cgvj8WNPszsYzvV7Cc=; b=M52CU8L1jEY5Eco02xGu9721YauPvEva80NFSQybH6/T1SvemCyKxB+gCT1JVFxlU+9khVx4dkVI6h2Wnijtf4PqrVDV+t/kDdqdU8mu/Ao5Z6RGhKK+dw1ThUSEJbLtDGyQL0lKfcz8xtsjdwH54LG3FM4sfRqqBykprspThDqIdGJP3sHYItCo0SDRqsGJsAkWx63LpQsFqTXbdD9gUgolzsvaEvQktZxEub7zSgvrqk2YD1goZP9E3XHtcz7kU4+h/JdYMJ94k5ldsyMXJe+GwPy1+Ux2k38HazbDA2J7Dx79UnKcykFDNZNeLIGEdzq9jO7+TxSbkkQM5i+vCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LhlRwecO+gIQSwIsobGreS+K+cgvj8WNPszsYzvV7Cc=; b=KskUpbi5W643v1DPxhfuLPUuW+EuS9jIl9pSfqUj7SMly2OYAw+Yvkqa1hcqLN2MFKZRrhu3XM5rmrAF8aCCb/zQSTDbJHkmpvLdpa8y9alxami8AtpB3euJOk+LhMzyv4vJY6+dFHYJFv3SgyHZBedu67VsjpkUw4sNdo4RyUOpuIeJRjxu81WxL3zz3SUJtCiQLtOTz178SbiRZNsAIO8jXBr/hUr9RB2Bb5SpoSmO/Id9pawfknZlZ69PAG1KNbW9bhmoMXymu5a7sIhAMpKGHDSFfZ5yaBdM4Wu8b2n1vcX3MktDnJUNb61SZdo44c2yy44rNH/yJrpZph021Q== Received: from SN4PR0501CA0038.namprd05.prod.outlook.com (2603:10b6:803:41::15) by CH3PR12MB8995.namprd12.prod.outlook.com (2603:10b6:610:17e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 08:17:30 +0000 Received: from SN1PEPF0002636E.namprd02.prod.outlook.com (2603:10b6:803:41:cafe::85) by SN4PR0501CA0038.outlook.office365.com (2603:10b6:803:41::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:17:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF0002636E.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:17:29 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:17:22 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:17:20 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 14/16] platform/mellanox: mlxreg-hotplug: Extend condition for notification callback processing Date: Tue, 22 Aug 2023 08:13:33 +0000 Message-ID: <20230822081335.64344-15-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636E:EE_|CH3PR12MB8995:EE_ X-MS-Office365-Filtering-Correlation-Id: 46bf5b82-f638-4219-7122-08dba2e83a58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hfBQR6I3jC5w3hXf1AmjZ2o7Ba/fRXoJUHCleLRHz5expgMW8mbc8cS91UB5jSFUJ/nssOpXpcnESu8Dd6S4EEeQzQ4xeDvc7Gtc8IDbt8+4Isf8Oq+FVUgjO9vZcgXjpR/tATJ4Vh03CicsWEABFLIrIWA5vebzi0vaAHZDYDNkITBXfEywEfbHg8IFG57hD2v8DyD5vf4Xi17Ls5Av+1GvZ8uDfKLJA9Uu2NTCDOkevKn+3ogWOUzHUORpEfl/dxuG0bP/CouM1DAIVK8v2ZNnuTxIFzsyn1X9sfxzq6Xh2E2se0vJu2CdvDmGKwn6Le0FQml78ihP+NNUomB+BA0chIqRkOMRtmabMM8dHm2iBS3HkcQJ5nE5rjZ5PXOIcZ/2s9oBw9J4M0vd3rPV1s2xqjRrWDGnb684r1aKGgq1SoZCgBXKtC68OozeYMZ+/6baiROB33e8rnXiLkmJzROJrztgZ+JF02BMm2SHq/cIwaH1turrHnplEcNrBEgyGtTR2Pl+0ApvwyYu9Wy/nXszfB5iJWc9xOSWB9E23lLELGnbikxna8YzJBMryGE6gWoVK67fCVSkAmsfr/4zWOU3PZfV80YXf8nih/Fhx+C/ozuCD5HAdNtoG6noAzJSpjnmrJtpA2vM7bVcUHmcvNHGNUgQ1s8BXeqe+OW6oCk2g8nMp0NdlbYFhRd6Q8YBrFaVlYsv7cd4svdmxHENg3wiRz9F7zyab/GptvNZb53UHVtfKs741HAzJTiKUy5a X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(15650500001)(83380400001)(5660300002)(336012)(426003)(16526019)(26005)(86362001)(36860700001)(47076005)(8676002)(2616005)(8936002)(4326008)(107886003)(70206006)(316002)(70586007)(6916009)(54906003)(478600001)(356005)(82740400003)(6666004)(40460700003)(36756003)(1076003)(41300700001)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:17:29.6794 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46bf5b82-f638-4219-7122-08dba2e83a58 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8995 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Allow processing of notification callback in routine mlxreg_hotplug_device_create() in case hotplug object is configured with action "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in case no I2C parent bus is specified. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- drivers/platform/mellanox/mlxreg-hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c index 6ddfea0d4c5b..eb5ad35274dd 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -112,7 +112,7 @@ static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv, * Return if adapter number is negative. It could be in case hotplug * event is not associated with hotplug device. */ - if (data->hpdev.nr < 0) + if (data->hpdev.nr < 0 && data->hpdev.action != MLXREG_HOTPLUG_DEVICE_NO_ACTION) return 0; pdata = dev_get_platdata(&priv->pdev->dev); From patchwork Tue Aug 22 08:13:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360330 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCDC0EE4996 for ; Tue, 22 Aug 2023 08:19:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233732AbjHVITJ (ORCPT ); Tue, 22 Aug 2023 04:19:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233765AbjHVIS5 (ORCPT ); Tue, 22 Aug 2023 04:18:57 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2046.outbound.protection.outlook.com [40.107.220.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FD08193 for ; Tue, 22 Aug 2023 01:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fP29wJUlDlO0h277z130kpQATXxrYYliF1inlW+4zUJKWOpRNm8SBGuHUxdsev55OnRIA4xYCIdiwAtFrYrJYp6Bf7qe8bkkr0V8uIdLevqSvLWsPJv4mxTQ59l1dTR9tZZcP1dXyReaoGJvArT5VIkZY5/hSXWzLxsEqbR79Pj79t/K/dlAB2YypNu7cNMF8AdmbcQOsakWwbW4RW6aGefiYWiybMpjm9FHeFV9k9s3Okh1xD5osT/B3Z6/Rueu79iNUHlJMLhOmiARokft64WxRF92SPRD6qUKLNDHWLWm0cThZsTn42rdKUQtgaHy/+ia2GLgOu2gh7tdzPN6kQ== 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=9wXG5RkJIhJJs8RHNV1679nJ/6r5TITP5pa7tPmSdt0=; b=mBj8DgqVhnbWDpunNyqmVls+wwJy7k1JpcgTCBYez9S3TShDrjH/isoWQBJ0nU2Z3Sbon/wXN4aJVLoqANyLqL/KKK2ocOy6pEH/LtMT+XsbCDMKO0AC79JN+cm8xmVXOqPdKoq8ZJ0i3yqgwFQeDk1lAoOr01tNkx2E+Qn/kAvPpohF1vBql6NqtAr6QSt58llF+fqh9x8dSnmZSlpM0uJ/XoFrG7r4bAFdqw0jKv7eOjLOM7s4MSIHtfI7eg7S7dnNPgpQ2iT2izARMtAllJiZ4RdDFPb89zscMJJNScT59au8a6zs46H2uZibNb/01mvHHeI/qpa1sFr8ekO2IQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9wXG5RkJIhJJs8RHNV1679nJ/6r5TITP5pa7tPmSdt0=; b=eBeXvZA+nkLacjl8KEuDpE/Un/GPR61vbJYB2kFO6cu6oHm5pQPAV32q3y/e4IFWsXDIIsdH53mFIkwlYvy2JeM1bvrJ+4YOl7Ot/wVYKeMtXDxLBfiL/TBhZuXs0eKJHK0l6IUNograGFffUnoGkjPxGzABn6gccNkdd7aTZa840QYK/oRURTZIi8MlBWlD5qjXVVtxO6WlmzV4lOsTT/nj6dOw9sWXefpUyPVSDKj+LT4y6LG4UeERnSImwX9MhFGl/xcRqEDZ3KHBedJEJqHxFIajbZ44Y1j+61acyqpMIdaiekTVK1Slftw2kYAEDLbcJl1Vx9B5zW8J72wJvA== Received: from SA9PR13CA0010.namprd13.prod.outlook.com (2603:10b6:806:21::15) by IA0PR12MB8840.namprd12.prod.outlook.com (2603:10b6:208:490::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 08:18:54 +0000 Received: from SN1PEPF00026368.namprd02.prod.outlook.com (2603:10b6:806:21:cafe::93) by SA9PR13CA0010.outlook.office365.com (2603:10b6:806:21::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6723.15 via Frontend Transport; Tue, 22 Aug 2023 08:18:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF00026368.mail.protection.outlook.com (10.167.241.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:18:53 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:18:45 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:18:43 -0700 From: Vadim Pasternak To: CC: , , Michael Shych , Vadim Pasternak Subject: [PATCH platform-next v3 15/16] platform: mellanox: nvsw-sn2201: change fans i2c busses. Date: Tue, 22 Aug 2023 08:13:34 +0000 Message-ID: <20230822081335.64344-16-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00026368:EE_|IA0PR12MB8840:EE_ X-MS-Office365-Filtering-Correlation-Id: f09635b0-4ea0-4210-1121-08dba2e86c82 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4AWVdQ+blDHlsdVDVwVWuqcJBoXmgOpR/yz+9useyuQxasz+B26enKkGVesTDlZXpZzEK/Dr44QVMiDWlhxtOwmN6F2DY6xm4fzT1ciXvLOJ4gg7i6KGsLENVaQNuN5aPSfnMnd7EgHZDmIR0H60l3V1+kXJ/nNE0kgXlV8dxDoLeyqnSrL/vPFvUx6PvFVbBmww1UczOmcX+KV4dxhfLGCfOhS3153F+oSAz/ju06iuYi9PgUVa5LUgBzv1VGwwtMo+v/BeAOx0KFIGot1AYnRziTLntXuETZ09/Q65rUxo2WIuHYDTaSjzeBhK+eKvmEA7zkd4QrcLcKnTWBKusimcmjJWyZGERcf907bJalffKmr5UxH9NFO54XqWdsZLH57o1yiBHRtylILNd02wFK7ibyfMVeZ/rerLqGqpQri1EpLHd/WQW24WdpEBeVJBEAe0Q1CXizgS0/7PcjAhNZb+xybLTFl+6rDYlGdLfe0LcRu9RCPXLR6H+rGzEs+/qiuSo4Qihq+B5sDtHCcO6/GgLNw2f2CyDRzGIsz8cVN7qe97yDbMJosLZwBJ9SgdS4LlR84mZDTQKAKSPLMVZwq2ohn8l1L9RrS1H5gMcr/OySLgf4j9zPXTEYFdjo+jexEUz2r+fDkBe7/Wa68CiaB3CpyGG0SfW66pgJnUdx2lGbQ7qj9JDRdVjsIKz4Z1XJ9vZvVPbzrVYQmkG9SuYJrPZ4ZLGO7f5K/uMkHDx91bYGqqdpyUQ7BhYjXfXOfi X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(346002)(376002)(39860400002)(396003)(82310400011)(186009)(1800799009)(451199024)(46966006)(36840700001)(40470700004)(6666004)(40460700003)(426003)(36860700001)(336012)(16526019)(40480700001)(107886003)(83380400001)(1076003)(36756003)(26005)(356005)(7636003)(82740400003)(47076005)(41300700001)(2616005)(2906002)(6916009)(316002)(54906003)(70206006)(86362001)(5660300002)(70586007)(478600001)(8676002)(8936002)(4326008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:18:53.8382 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f09635b0-4ea0-4210-1121-08dba2e86c82 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00026368.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8840 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org From: Michael Shych Define the exact i2c bus (adapter number) of fans on the SN2201 system. This will cause fan's EEPROMs be connected already from nvsw-sn2201 platform driver and not from user space after receiving udev events. Signed-off-by: Michael Shych Reviewed-by: Vadim Pasternak Signed-off-by: Vadim Pasternak Reviewed-by: Hans de Goede --- drivers/platform/mellanox/nvsw-sn2201.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c index 7b9c107c17ce..75b699676ca6 100644 --- a/drivers/platform/mellanox/nvsw-sn2201.c +++ b/drivers/platform/mellanox/nvsw-sn2201.c @@ -84,6 +84,10 @@ #define NVSW_SN2201_MAIN_MUX_CH5_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 5) #define NVSW_SN2201_MAIN_MUX_CH6_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 6) #define NVSW_SN2201_MAIN_MUX_CH7_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 7) +#define NVSW_SN2201_2ND_MUX_CH0_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 1) +#define NVSW_SN2201_2ND_MUX_CH1_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 2) +#define NVSW_SN2201_2ND_MUX_CH2_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 3) +#define NVSW_SN2201_2ND_MUX_CH3_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 4) #define NVSW_SN2201_CPLD_NR NVSW_SN2201_MAIN_MUX_CH0_NR #define NVSW_SN2201_NR_NONE -1 @@ -425,28 +429,28 @@ static struct mlxreg_core_data nvsw_sn2201_fan_items_data[] = { .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(0), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[0], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH0_NR, }, { .label = "fan2", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(1), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[1], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH1_NR, }, { .label = "fan3", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(2), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[2], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH2_NR, }, { .label = "fan4", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(3), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[3], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH3_NR, }, }; From patchwork Tue Aug 22 08:13:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360331 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72E53EE49A8 for ; Tue, 22 Aug 2023 08:19:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233763AbjHVITK (ORCPT ); Tue, 22 Aug 2023 04:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233777AbjHVITE (ORCPT ); Tue, 22 Aug 2023 04:19:04 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2075.outbound.protection.outlook.com [40.107.244.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18A9C198 for ; Tue, 22 Aug 2023 01:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W7AA7G7ztsvngiP5915pym0sv/aai9QghUClL3Y8zvmpsHqh5P/BuiYgovhG5hr91sxP5kQaJmgkyLqjrGWm6PafvwXp7fzAw6am5p/9aXewTH5jZTNDMyVooR/UZOQKXelr93fSEewKygp6tI4Z9W0BZV1q9CYBlWU4sM6LPKy1QNvACc8b/QJtu2E2oo6kwOhO69BstnydIbBxYGIKTic/oe/ANC00zqpgsRGMRInigNduDZkZpJHK1O9gP8knPHDeM8sCIFLRZSvk0X1FSxdKvXCQ8rAlHtWG+3VX0acjQ5eovdkOURXs3dtl5aaGjYxSXDPdyEZUnwRoOMDNvQ== 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=J+bZZE/cViRYKMi0Yxni27AyWdHCktkJp4OHJffAcLo=; b=dZEFPJ9Bxqsm/idY3FgpkZ0JHrVvTB1K7Q3vnECp5gdB/PUU8Sznsl5Qi+GS0JMzhjAIl9R7Ajiz52qbdYOD0f3amD9O0RJ8fP6xJmOcxnKSYSJKNT0s9ltIHRrmq2GdP8c2P+aM/zJqtLX4X0cj6Rvz6DboEWooCXem4gjgBTWPB5/QCvuMjNF1l+EedghIL3agugz+ZcXu9QTgky50IFILPk1d/nesfBHrVVAzKp+yFDH29GaWQwHvl3nLxB99Tx8/UeXRu0/OZamXf/+xpXVo84Q0411KfFM9u41O+f8GTa8A74O+PdG34qzSNw/WRMuBFJtj1gKzdRs1+5BA3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J+bZZE/cViRYKMi0Yxni27AyWdHCktkJp4OHJffAcLo=; b=RK6TX+zdwxvyrZeYO1dpKz75PEREAVfdAKB849zFtxWoyjQf2ZuiQJMoNmiXZjXpInYaCFQb8uY714+7TpBSIZwjwxBHuK7v3NQ9dgjWois2NSnfzgilNPvnMftordVvNl1TvPsVrz/G0kksCQba6fp22vJXeLtRLrCqtNxggrYPUnUfCHT4bajGCX+/QmfM8nn9RGwX6AJ6rxHBx9qMQ+3wOhF7UfET3gW/VuW1tGjppLLvvWLuQxWNdAlYXnhHihZoHsaNZtkK/e5KaWS58eIR9EH54wI7IzeUCOxMtyWWbp2Pua0yuJvrI9op/PRxNKZ8Pgw+o52NZES7kAms1Q== Received: from SN7PR04CA0183.namprd04.prod.outlook.com (2603:10b6:806:126::8) by IA1PR12MB7662.namprd12.prod.outlook.com (2603:10b6:208:425::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 08:19:00 +0000 Received: from SA2PEPF000015C7.namprd03.prod.outlook.com (2603:10b6:806:126:cafe::57) by SN7PR04CA0183.outlook.office365.com (2603:10b6:806:126::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 08:18:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SA2PEPF000015C7.mail.protection.outlook.com (10.167.241.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 08:18:59 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 01:18:50 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 01:18:47 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v3 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces Date: Tue, 22 Aug 2023 08:13:35 +0000 Message-ID: <20230822081335.64344-17-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822081335.64344-1-vadimp@nvidia.com> References: <20230822081335.64344-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To drhqmail201.nvidia.com (10.126.190.180) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015C7:EE_|IA1PR12MB7662:EE_ X-MS-Office365-Filtering-Correlation-Id: c345b2c2-30c0-44fe-eb9c-08dba2e8700b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zs3/t2p3MsKUAWUvi+O2XhcUr2h8vEeHmubYDYmucudgKFsYK/W6zG7PhmRmeIwVuYcz0PFrR3IOxTQEPjdeK7m7jlbnd6nOxgfbi8L0yg5Ra6bf/AS1e3cxpg7HWjyHNFTTehuwkHt/bZL4cqtCAqj6D8gI9qC3Z/I0s1ecwjuc5VDb2W1qy4vstMeBPmS3uOyWgzZT2YMRFdIdlE7sDeslCzmwICYhXoZjS5FQJIIo0E5Ib7+d86QmdPof0QlrSseMg9Lb9noGX8Oc/D/3BANqUMJS4uNbYfGXO7ekU/z7vshKvFl/sON0aNHDETKZ9tVr+7Pn3VYjBf7Z+qMdLWT6aY2fIpDmKSNfs7CJWBrV39J5ZUoguXH5gyTlFMGKRH09UXso5TGdM+PZ3XpvZ+Ph4ZWZ8mB2dPoR7D1KbQ8rE24BMnMGt9zY5r/HJ4huyC/+jGi+Tv+3E2K10BWtl/NmLMra3s6iVsR9YxXORF6Vh4NRpVrcg1w31oDl3cHJ1b60iVoOUQLoYl7UFq0ZcvaWc8Bz6ctTl0cb4/BtyNTRY/T2O98wrRZ2QNBGZ1KZPjc2+XD7srsvlwzVzucYxRAAP10wOX90jtvWmMjkf5Ff5YZsjOh/U4NRICGIh9Eekv1BMRsU0DQPQ3i3TycGLIm2zKUSgsQNEEjao5s3x11MKtrb2+JGkkuQUVDi/dxmRCpfK8FUNkWX01XntNX5au+/Vwn16VWhwbv7rrUwZ6ys/DBNTLVuNpe+3RNVvQAg X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(346002)(376002)(39860400002)(396003)(82310400011)(186009)(1800799009)(451199024)(46966006)(36840700001)(40470700004)(6666004)(40460700003)(426003)(36860700001)(336012)(16526019)(40480700001)(107886003)(83380400001)(1076003)(36756003)(26005)(356005)(7636003)(82740400003)(47076005)(41300700001)(2616005)(2906002)(6916009)(316002)(54906003)(70206006)(86362001)(5660300002)(70586007)(478600001)(8676002)(8936002)(4326008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 08:18:59.7748 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c345b2c2-30c0-44fe-eb9c-08dba2e8700b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015C7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7662 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add documentation for the new attributes: - CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min". - JTAG capability: "jtag_cap", indicating the available method of CPLD/FPGA devices field update. - System lid status: "lid_open". - Reset caused by long press of power button: "reset_long_pwr_pb". - Reset caused by switch board DC-DC converter device failure: "reset_swb_dc_dc_pwr_fail". Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- Comments provided by Hans: v2->v3: - Document new attribute "reset_swb_dc_dc_pwr_fail". --- .../ABI/stable/sysfs-driver-mlxreg-io | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io index 60953903d007..7022c623075b 100644 --- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io +++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io @@ -662,3 +662,55 @@ Description: This file shows the system reset cause due to AC power failure. Value 1 in file means this is reset cause, 0 - otherwise. The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: These files show with which CPLD part numbers, version and minor + versions have been burned the 5-th CPLD device equipped on a + system. + + The files are read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: This file indicates the available method of CPLD/FPGA devices + field update through the JTAG chain: + b00 - field update through LPC bus register memory space. + b01 - Reserved. + b10 - Reserved. + b11 - field update through CPU GPIOs bit-banging. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: 1 - indicates that system lid is opened, otherwise 0. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: This file if set 1 indicates that system has been reset by + long press of power button. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: This file shows the system reset cause due to the failure of + DC-DC power converter devices, equipped on the switch board. + Value 1 in file means this is reset cause, 0 - otherwise. + + The file is read only.