From patchwork Mon Aug 14 20:33:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353236 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 0F4BBEB64DD for ; Mon, 14 Aug 2023 20:35:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232068AbjHNUep (ORCPT ); Mon, 14 Aug 2023 16:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbjHNUeo (ORCPT ); Mon, 14 Aug 2023 16:34:44 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2071.outbound.protection.outlook.com [40.107.244.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA6A510F4 for ; Mon, 14 Aug 2023 13:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UhkOnblyNpzEq7M2QRmuto0S5AaVAhC5AOy9u8utcRJwmQR2JNwIHu1oiDbNLf+AGYD8ey6YmMKX+GPwcIO8JDZn8ZBXp10VND62YqUGCLX079CKKnYqSgf8Do82Bj6SQRPjaeVaj2X99T8JTve5JR2sV2BWmRVnkQFSa+Cl27kSanfa9Wa3fAmY/kHZGh4mFkiawQ/460L7/Mz5Zc42q4qERyLsMNjh3FDo+I0p6oDaC/Y1iI9ysmHbk99kF7FEd/51uTZpzLqAU0NvkVYK1sm9gQRWq0C8s60Sd3WEjOKyJMBpCMQMWdS+kk1/x9vEBs0nufQY1rxmSGoGDDJIXA== 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=wIfvYpg0TpGqP3q8ijl/ltoshmSs0R0qAGqQrwDhAvc=; b=ZoaJ1H7lyL9p5s1ek3/2HfO5jqvZbrfW5sBhAx74ZYXL/LeFlYQ0oEgOZrpVyYA3Vo+G5qQNvjUV273JUJ2Zf2j4eMZRTppNyV1QP6ezKh3LvV4ptqisrVGCkHG83C+fIyD4zWWzTuDbtjVB7PUYYabZWE+TscqdY3hHvxIhfDBvLfIR8NTgx6pedPjAiY5YYvRBkCG9v+f5wUuPLfJ31wG4a0BOIeXIIFE0AacmPjQQIctrDPy3v7q8NZW9Xkvev92GGWIwy78XLwoLbcngADyQXfuI15pUaKDf4+wLqTGKYvbHzW7mRjVULJIWKs8EzC+xlLZVKJkaZycd+sFrsg== 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=wIfvYpg0TpGqP3q8ijl/ltoshmSs0R0qAGqQrwDhAvc=; b=Emk0u7F/kCYW0xjfKa58uQfKCMN+QKc3ggImw/RNWbNxOok/ENtRlucc/9U2OqxWYaUG5hxv3z/MNF6lzr15rtQM/ETpw4/W3rzDXzmpGw4mJz11KhyWULOpLbvLeX7r8xO2tnXyTCX4uQALMYO6JojWASuqY83KhXWFyEOjhpPxyo33Rm38a984XZQHYjitqmWBYkVTgTNNf+4OQPHbmLeFRvU0sOjHdAK3IJtWnLD+GaHE5p4wTHsPPD14wB7iKV2xyqjPBiJBqbE8qxjN9G6FX3t4mmTA5/AjCBN/jeRchwWNHBsRblDba9irsA/Hjf+4DMwKmltljqJVdCoaqA== Received: from MW2PR2101CA0012.namprd21.prod.outlook.com (2603:10b6:302:1::25) by LV3PR12MB9267.namprd12.prod.outlook.com (2603:10b6:408:211::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 20:34:40 +0000 Received: from CO1PEPF000042AE.namprd03.prod.outlook.com (2603:10b6:302:1:cafe::41) by MW2PR2101CA0012.outlook.office365.com (2603:10b6:302:1::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.7 via Frontend Transport; Mon, 14 Aug 2023 20:34:40 +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 CO1PEPF000042AE.mail.protection.outlook.com (10.167.243.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:34:40 +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; Mon, 14 Aug 2023 13:34:29 -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; Mon, 14 Aug 2023 13:34:28 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 01/16] platform: mellanox: Add new attributes Date: Mon, 14 Aug 2023 20:33:51 +0000 Message-ID: <20230814203406.12399-2-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042AE:EE_|LV3PR12MB9267:EE_ X-MS-Office365-Filtering-Correlation-Id: 4fe94aba-3524-4853-204e-08db9d05e2bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fHVfVJfjwW0gwAt4DWevxKZMkJw0BCWvt0EaHiFU3gPdBGGwtI+e+Cxq2rySPUThBZvJ9bLsDbXWez/TEBcecnHcSzSrGnlY9MMF0HJAXMQhEDgX/gQH8Wg/kSpFpX//h80uBBjLoI7YAnwC9oI4bppXx/OWEqhRscKbeyOc1ZaZwlViUNIY2TQF9IeF/F93r7dz9vsHrBqE1CQE7/bNwAz8ypK2zwnEP/0heUgAD0JNLPTfnv9EVLi5n+KzdvKUKsjwNwuCyQiR6ZNYbuUYZGUawt5ZPVjAAZyhmKpHPOPIRFw0IAL7tUSPiP1Xdd1iq1PeeXc+uoC5IzitFPebR2YB2/VLpb1/1xS/MOm72bsbmD+OTwnJj52lYNytS/iv+ajGcvIk8sO7EvOwC4td6kzEES3j7p2pLOmMlgawX1Cu5HMLsxcQKMFJWuAcNjldPzH51NaLtpwxnHWsm6/W8V6jn9Guu4Ee2dHW/Qr5a3jZv5ceuHruyNfB99e5nC5xnfs50BrRuvyDxXgo5PxBirrQ8iU0WrVD4sX6VdyMEs0CzagRo2ckLpVaym/oITAolzPJnDRFF7tufPI91FfMCWu7/wMuJB5kuChlRVoLohlZv3sMiNmsoyx9zjwA6rnh4M2j7YK38v0RyP1vgr9OIXi8C6zymdAagYjSj7gBLw+/ouCFV5epHjT+jgKoQO6l3V4x8Q6dedGeTDRs8X+mFPz7/gE2jZUf9y+8ogkcCESXnf5bLUMii3p4XspJ53t+ 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:(13230028)(4636009)(376002)(39860400002)(136003)(346002)(396003)(1800799006)(186006)(82310400008)(451199021)(36840700001)(40470700004)(46966006)(6666004)(478600001)(70586007)(70206006)(107886003)(336012)(1076003)(26005)(426003)(2616005)(40480700001)(2906002)(8676002)(8936002)(54906003)(4326008)(6916009)(316002)(5660300002)(41300700001)(82740400003)(356005)(7636003)(36756003)(86362001)(36860700001)(47076005)(83380400001)(16526019)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:34:40.6562 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4fe94aba-3524-4853-204e-08db9d05e2bd 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: CO1PEPF000042AE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9267 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 --- 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 Mon Aug 14 20:33:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353240 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 90E50C04A94 for ; Mon, 14 Aug 2023 20:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231499AbjHNUfR (ORCPT ); Mon, 14 Aug 2023 16:35:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232414AbjHNUew (ORCPT ); Mon, 14 Aug 2023 16:34:52 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2081.outbound.protection.outlook.com [40.107.237.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB7A810F7 for ; Mon, 14 Aug 2023 13:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=izdGFLN+HwfZe6AGnrFCkABnKpB+bfMh1xl4Dc4gP7GNoxFeTmFEj9hNzUJHokE6s/E23cjLf9R4dtTag8+9seq1UW8J5nOs2l20afiQGMy/eppKhXT5JM9TI5m5m14RaQHB8Idzkxu4LWXcv6rj9JS5XeTKJYuiPLjl39aek+Sbu7wH4Dl7Pn7HgaOwyMkPO9RGcL2a4wlspKa/gq7DKkDI8Ws5ACZXoUCnTIo9UnzROdP5qVNgAaeoCevQZ1o39aNrtrbDnJrXY39y435x4JhZDNbfTQjrUKdZJ9CxfOaafEb3CPj9ZwtpyZ+OEJXI/SJn9iYY67hEbeM/1CiVxA== 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=n3o7zjrxWmcBcgOJbtoazQjgaf0vR/PH1EprPS7AjO0=; b=bMP1XIWRNuIKNAhdJVbQASxXh4J9UGHKDiPNg6pgwKQrun4gTpBizsnWZ3EnzRUV71AtC5o1sYPV5eNZTFYHr+bWCAzusI6i2kl8RjO7zatfCxO81Waxxnv99xYrXd09UYTFcJIhkYKyJdJ5sGvYxdSRdZYxeTIo4wkRzhabsUTSCJHj5WPeRPaH24hkIdrS5HxbBGCb4d3xY3LmvM1dz3M8khywANR6A/sDfD/621BnUZjaAB8kHIxXSKyY7FsUyN3VKSepR0JOLAAZc9pHyvPefw04sEXbOWogy+gtYk4rgEp0QaeQaw5/Hac4iEoeQ19v009kHLf3HcrySEjgiQ== 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=n3o7zjrxWmcBcgOJbtoazQjgaf0vR/PH1EprPS7AjO0=; b=TnYbv9BRs6er130qVwz0th4UFdF2Om1X3H6mjKUUdOaKz+9+UsYts88fvPs/1CU5LAhtBD98bfx2dK7MWfScg+wv1B8R2RJ7jMFZoRBh42bLEBtNy9TVCuK3kz+jAKTL/vlmReheF5huIbEycIfmKTg57wPoBBaqqFx+BkvYS+ZDmnphC79K58W0fX9Q/DaEYAIZP8V4hJsE4uwrhvpD0H8jLFD2eIpTokrBgTMW4lPXj1WR26ZG+Gq9cx5wiYsvr1UGJd2+sonMuc5jFuOAlNJj9RwIRPqv+uYkG1nbCPnA3L7z8gAJ0DXy/6EV+DVqDF7L4OIdkcrmKpDYhmhTaA== Received: from MW4PR03CA0334.namprd03.prod.outlook.com (2603:10b6:303:dc::9) by DM8PR12MB5464.namprd12.prod.outlook.com (2603:10b6:8:3d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 20:34:49 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:303:dc:cafe::18) by MW4PR03CA0334.outlook.office365.com (2603:10b6:303:dc::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:34:49 +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 CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:34:49 +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; Mon, 14 Aug 2023 13:34:35 -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; Mon, 14 Aug 2023 13:34:33 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 02/16] platform: mellanox: Add field upgrade capability register Date: Mon, 14 Aug 2023 20:33:52 +0000 Message-ID: <20230814203406.12399-3-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042AC:EE_|DM8PR12MB5464:EE_ X-MS-Office365-Filtering-Correlation-Id: 5dfef072-9898-4885-ed65-08db9d05e7fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YoWjvc0oydFuTJBgvgwBli5DEZxtiDgOYEVzzzhDVdMd1QjZMgSnZ4KPG+M7Fstz48EW7BvfNmO1lZhpAnYspPH1qoKoMrDgVej+9jT68JRTUhdsX+Ki6sj+UFJjPKfAdUd+XLTAYWedkuiirRqFh4y903WjiXPY+PiFnTeoeIPYMzjqoxqUwBvxKF3V+DOrNQxsYgDTPs7Q/wlSkISrF8l7rmzGmjvPjdgTgCNBlY0S8Qdwbo02Sgy6z7wGOP2xjHzxUQY1fK9Fbigc1/fcro57eQcu4LvbhE1G/Ov/xz2eQda0U/gvjrQJaObYdwXCPejUyh3hN+KUryNplhjG+TUaMyDhYGqRX+dH8XTfuohtkTeRRifiv9D8mGMVt2zdxgT6q9aDdyYW3G0Jxk3QIfaM2GgvcYfJ2RO1Sw/TqpYrPHfu4fdVt0iNK25JfGa0kwlH/LIsod7c8QzHFlrPmoKuWHu4AQiMIRaCL+Kx1mrtcRPinfxzH5LDyKgQ1eTn9urtqKwynYKHOvGcRZgxVUBp6FbTB1OS29f0LYnZSjy3e1CtHTC1vjdBaaNK+FP5kxT/VHDC3kPHxMjEcO8nUSPUWDoaGVbLEa3RFmNQ/MdXKshbrUD+zHPV8zmV5S+dKko1NFcph2lXQlINEjAdqITj2jVNWm+rsTPIVova02fWdWAWW+uvasrS9LB6lXl+VK3EIeiTTY//yUV1jnRIw6+43fIu+6+DUY7e9L/pzhkWZ9qRBwRfEYemW3dB8OMS 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:(13230028)(4636009)(136003)(346002)(376002)(39860400002)(396003)(451199021)(82310400008)(1800799006)(186006)(40470700004)(36840700001)(46966006)(40480700001)(54906003)(6666004)(40460700003)(478600001)(7636003)(356005)(82740400003)(2906002)(5660300002)(36756003)(86362001)(6916009)(4326008)(70206006)(70586007)(41300700001)(8676002)(8936002)(316002)(16526019)(336012)(107886003)(26005)(1076003)(36860700001)(426003)(83380400001)(47076005)(2616005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:34:49.4029 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5dfef072-9898-4885-ed65-08db9d05e7fa 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: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5464 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 --- 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 Mon Aug 14 20:33:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353239 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 829C5C41513 for ; Mon, 14 Aug 2023 20:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231987AbjHNUfR (ORCPT ); Mon, 14 Aug 2023 16:35:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232420AbjHNUe5 (ORCPT ); Mon, 14 Aug 2023 16:34:57 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2055.outbound.protection.outlook.com [40.107.220.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F804E5E for ; Mon, 14 Aug 2023 13:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PvhvCSNggv7kdc4NfB+VhTYuW8HH0thFdaJWo2bDX09B8T3vGBxfqvXKyQq2V9D3Fddghl4lhIMzBH8Fiapl09u+XClAEuAORr3T0ouv9cvGG2KSN7O42wCdIfKtMZmb1WhRQtq47VvRmP0zC0sDcXBi5X8W4TNufz2yLE6WkSBdYDeT9Gjxy8tR3ZYziQLNGz6dJt4fl78j0LC2qK7w2IiOIbXfxbyhOd9b2Cbh242GFBXVaRjZydH87XWKkvVX7nSOk5/G1aZIm1JtrOYnweWfgXQvFo5tBc7Ki6ukRlPGG/+zUEcFJuF8mgNjEH/Wj3KMSNtqeJeSULd80h6AIg== 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=BbH3OpWQ/Ba2/foULmBl6D9UOhRd/lHXNh2M5Uj+Awo=; b=WnSiEA+TM4l1T/p51CCoIHPCm+8OmH2QZQqJWVb/uxTkd04U7rVtNWVS4Fx23t3AfoPYuxDCp2noEQImz3zWXv7+itrKVi2MMAPd6u1tgJMamT3Ahmd4UvlidIjgRIc9ZC6X6bm9XHuhvl6Q7aAIK8sXQZTlQWptCdbletvPPCle6Z+kGG5kj/24BYgxCBHURDYZwLCUfMxRUgLyr0ILH5zhXzct8DPq7PH/nF6DkQc/tgy0ABbQDLpotLBbeGtlcQzptFUmm2ViZjyyG1ptiQNQxDVsee7k599sNU0pmOyxUfCQS7bVYUWVXaNCcZKKvuLf/qcrMtNp10D/U15eSA== 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=BbH3OpWQ/Ba2/foULmBl6D9UOhRd/lHXNh2M5Uj+Awo=; b=LDOo3Jwtyij1aXPEQcsEfYxsauOCjOgD8O1wMzi/Pw3UR7S5lKQQAfNu1I/Cg6RYlBDzggdXTEF3QJJ4mvyOvvjGF9ij6Lsy1flr6r86SJxFChv7NacqXOgG+cr7a4TCXKUOTAavvNVRd9VrxsSpYz9sYK+DBfkjT869TE56uHHLzCrhHV8od/kIVXuAKnWuoNyz+NnJQ3f/58TxZV4mqg+KcRPkq8gmqWcmEbRgWTiz7f7pjRrdM1K1KtY+JlKkPx94sMshaWs0dffPgem2k0Dy14Ovqzb13Sujcx61O5QvZKsLrh3agGLWV3Uw8dVPVbXzCPhdd4HDQu6jHYiMOw== Received: from CH0PR03CA0402.namprd03.prod.outlook.com (2603:10b6:610:11b::23) by BN9PR12MB5161.namprd12.prod.outlook.com (2603:10b6:408:11a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 20:34:55 +0000 Received: from CO1PEPF000042A8.namprd03.prod.outlook.com (2603:10b6:610:11b:cafe::d0) by CH0PR03CA0402.outlook.office365.com (2603:10b6:610:11b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:34:54 +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 CO1PEPF000042A8.mail.protection.outlook.com (10.167.243.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:34:54 +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; Mon, 14 Aug 2023 13:34:39 -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; Mon, 14 Aug 2023 13:34:37 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 03/16] platform: mellanox: Modify reset causes description Date: Mon, 14 Aug 2023 20:33:53 +0000 Message-ID: <20230814203406.12399-4-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042A8:EE_|BN9PR12MB5161:EE_ X-MS-Office365-Filtering-Correlation-Id: 42e65e4f-19b5-45f2-4af4-08db9d05eb0e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LOq84BKHRw46V3sbZaqtJwxj80JlNqfqx3lugY06ZzhOMwLr4WFL8+YpM4puvi9LU4hY+7Z6DD4Yzrbbt1A3tzF5NKwoSK8YN5+MjoP84YDYPgZ7RQSWBmyWrhsAcPuHW8RayyeT5OAyQAX8VelMwX98F5QyzHccceQB06IeAXqPT1WXENiXCGKkS7X+XfafuLY9CPJsOas0Ejfu4dWtfn/16WqZ3TdFu9mc2uy0vPKxNBOaXaETQsWgpCsBQpjWjUW0xjIHzywqXQoQRFK2bo4eBAlXfycFjf/T4skJSApLzGyeKLSQqESwgNq4Cxip11WB1m4UzpJqst4xK9IiNusbHV++6GDLjHyc8iffCK/AudzKdPF1EeIEBAaPqYS5vfrcR1JnMbcysAZxX/q4b0iCB871DdBxsffJQ16J/BdKKoOqyXvctgUvXvWgES68hy/fpgnidbZBcgGCUfGbRoRTP8ssaT5mrc00BJHok0dLk1Ak1dCpSLngJnSqKfClCfe79X0DUMRalDFoxT0HgPBLa3GL9cogkbwbggxNi1YkFESJSKk3QrHst95o4e3zz8MPCNrY4s+RlSUGxalBzLnNrUbgriv/WOSyZb/RCeQU6YsijwfpK1SJuJLBkEiPZo9N0KWwVcTL1Uy524EsDALE79BbdPaDK+APR7f+75kPtWoqmsmKL2J3/KKNc3gzmtpNHdI8C+ZQA5/xb29elrddWhg/Qc0N2fh7tquXj0f8nxJSGZ/+BSbLvPMjqmBQ 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:(13230028)(4636009)(39860400002)(376002)(346002)(136003)(396003)(82310400008)(451199021)(1800799006)(186006)(46966006)(40470700004)(36840700001)(40480700001)(54906003)(6666004)(478600001)(40460700003)(7636003)(356005)(82740400003)(2906002)(5660300002)(36756003)(86362001)(4326008)(6916009)(70586007)(70206006)(41300700001)(336012)(8936002)(8676002)(316002)(16526019)(107886003)(1076003)(26005)(36860700001)(83380400001)(47076005)(2616005)(426003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:34:54.5630 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 42e65e4f-19b5-45f2-4af4-08db9d05eb0e 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: CO1PEPF000042A8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5161 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 --- v0->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 Mon Aug 14 20:33:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353238 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 73633EB64DD for ; Mon, 14 Aug 2023 20:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbjHNUfS (ORCPT ); Mon, 14 Aug 2023 16:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232421AbjHNUfD (ORCPT ); Mon, 14 Aug 2023 16:35:03 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2057.outbound.protection.outlook.com [40.107.223.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E197BE5E for ; Mon, 14 Aug 2023 13:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QM7IEA6OAqt9hq8qc9D0EzNVroHgqCCse1Ab7Tei40yj/wK4/p0H/9NYgZcOlob0CLRUkUJhgW8JUdZyNhV7bIt9Q+Rk8rjZ+lk9c9SWI5JNoyzSkvSv98QIl2jeLhBEnwYBjeSMq+SVzWjGQb7di2hYIZ81R6xSqPNvjeSgFO6R0dIgr9bA+8GkehhM3+6GXmTh0+WNU0mFl2FPITg41poMYNpiVJG1wHhUpGRs+qlTpl6VKm+yhkFM08sqI74ezlrZbsbthWFOFPHUcMB9TxbMZbD9xctiqWwp6HC3lPCsF9IXUcPTRnzu9tnBN0lGgiCRUVrSNahOCwQT7dXDAw== 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=JAi8Kkdm59FIWxf1eKWymBH92rg7i5TDcMGVZaqsMjg=; b=Mu8rLm8WNCe3yey82yRnSeyDm6QC6+XHeBJOwOnlzvMtekVc1o+foAy0a6/VKO31pU1YUwGiNG5t0nGX/MUGwLNzyaX8ywA1rreqqVvtca4aFvYI/cH7va/dfW8OknPdqA5XlNeHKT5z8GRVagHkGpbw4ApAxgUNki/vcZZu/ibW4L8OjLXkZzABVQ0wCU8GrFzF3NDC/1vusPWz8TLovPavU8/yvkjdTAU0Ld2lSaHGyXI49ZoVaNXF3qSbSbNxbqU3LprzeZJ2rRh1oHdXsjK0bFlY8qs4aNaIbVNIQE/iF+ts7gf/pEPKAklNQxIvmE4To1KQ45skSjNRUYbfLQ== 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=JAi8Kkdm59FIWxf1eKWymBH92rg7i5TDcMGVZaqsMjg=; b=iflvniwlmJ/uWkt+IhjNUHVcVxUqH2dAdD/qG+yegRpALPR1eJN0gjexK4RNLK+0hPxbRKZuahfuQKUTKwua4V57CM+E53WEZDB04yE+U/g0UBbyJ7XtTYKw16sE31SzfWt7G/h/ryUhti0Zd+PgdurDrzmQT3w2tf+ZtImpEwKWvB28a+hsNorCUT5jINUn8A3gpnA1Qu1JP7sHGiUZGjdzrKiiPG6gtgSsp8gg8/N+PasNBohBfOjJeQ+XWDFzQDf0iX05mtB3PZ9tECar05WTl+bo0wjbwNC4YqsE2ptdjo9J3nMSA9KFoNqsZvxHcOPlzaLgMwHDSbCT1nwxuA== Received: from MW4PR03CA0333.namprd03.prod.outlook.com (2603:10b6:303:dc::8) by SJ1PR12MB6049.namprd12.prod.outlook.com (2603:10b6:a03:48c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 20:34:58 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:303:dc:cafe::ec) by MW4PR03CA0333.outlook.office365.com (2603:10b6:303:dc::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:34:58 +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 CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:34:58 +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; Mon, 14 Aug 2023 13:34:42 -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; Mon, 14 Aug 2023 13:34:40 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 04/16] platform: mellanox: mlx-platform: Modify health and power hotplug action Date: Mon, 14 Aug 2023 20:33:54 +0000 Message-ID: <20230814203406.12399-5-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042AC:EE_|SJ1PR12MB6049:EE_ X-MS-Office365-Filtering-Correlation-Id: b5c0d515-b038-480b-4f92-08db9d05ed6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nFjlSem5yeyJYxyGkYMEsUi1e9JsKmhGKlW/pUmXg1nF1/9n3kmw39AdOizr+tKja3Awj0rV9k9TLCj1Foy7hMGwkDpLmCWC7GrBrdJd9ohcCBrO8ZWQ+qnJCAy6HFkiJ/tnIRnp3d6r3lc8IxzAI6TvgTP0TWeAyiCfG4LasqIwhf2lXJ78xUp+nYVtDr75LZrqAtsjCv/qji/LXOqgw1QSBuy5BJ5GnuOlWuPjmbHKG3bBMrn3Pu/GXEbHo+dnROlOLxzhXUGcgqdye/y/+shdfXMO1WNJWLSAMWVBMlkR0VhVyCRgobwjetthxxqD13QX2RFTLxfjfkB+SJ2VYiLqL8cL4G9XoXmVHN2aVCsxZmamqqG1W7hSkr2rDSnNfZG3BXHdgyJ7gZA2sjGm/2xzDu9padTTvK6aRIFUyD4r3ba195ffNx5FVVwvnJqP0yj+2nEN53trLjCMEbr2WDRDajaSfOhlSOIfvT6K6ln3OXuZ1rsgaDn2mLkdPYwgU1p+P6B/I0wsK03TFcOOSW5P9CCmoK3NcPZnfeSxPDW3IHqmXA0gWzdtZ6S+rW4D5puxCfCeMaBR4RpZ0qdwpTmPfkSzGbD/xkBO1h/uc3z90a+QhBqw9f9ocfD2gs3n2iL/B1p0JgNDn4U4oJAuCjcpkwTmxp1nuaLjGqtb0O6Y8B6czTMTEFgRw9X6cRAXj8xHkXOalEpEXwFLnbADN3OFyVlRedyUFVcCCudWTwDvYddJ59+qLmw0J4NDEsx/dHeAO0pLUuM8/upg+4ZOJg== 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:(13230028)(4636009)(346002)(396003)(39860400002)(136003)(376002)(82310400008)(186006)(451199021)(1800799006)(46966006)(40470700004)(36840700001)(4326008)(8936002)(86362001)(478600001)(8676002)(316002)(36860700001)(82740400003)(54906003)(70206006)(70586007)(41300700001)(6666004)(6916009)(16526019)(5660300002)(26005)(36756003)(2616005)(107886003)(1076003)(426003)(336012)(83380400001)(2906002)(40460700003)(7636003)(356005)(47076005)(40480700001)(40073004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:34:58.5124 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b5c0d515-b038-480b-4f92-08db9d05ed6b 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: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6049 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 --- 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 Mon Aug 14 20:33:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353244 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 13159EB64DD for ; Mon, 14 Aug 2023 20:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231730AbjHNUgw (ORCPT ); Mon, 14 Aug 2023 16:36:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231672AbjHNUgV (ORCPT ); Mon, 14 Aug 2023 16:36:21 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2061.outbound.protection.outlook.com [40.107.237.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF5B410F4 for ; Mon, 14 Aug 2023 13:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lFTBE82zbrYSSzpIP5N4711QjDwWCVCTzg7wifaql+Nhh0sXxYv0yGZ0+NzWpE5YsboT56lRTNziBpXxdrHKjfBnw+g5Xc8KOHOmCryqbmAdKzfg+iZBztVJ+iFD8ziABesnTEnObBlwrra59XrXAb2eVk5lAiHtx8AoUG33l6usMEpAinrq1pBQulee9wikL5EJpCkNFbwEGybiGLp96tF0xrwKqg9Mmo48/trdaY8NAeGrerJEh19mC7wZMuf8qqu3PmoXZAQxNFbSW2aOs/Ax+Hs3e3CE64ylg7VSia5G2plKzpzXbU3HDH6Li+R0gJC2xrJwlgsR05rgue67Cw== 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=/5lkbwuXaKYhnHRx76HIGr0lMKCPiw3Uu3qMe14L4FQ=; b=YwbWP9UjLd6f00V3L3PoPlyOamS+9mcEzOfsZv4184svVFquzvA9MrBJtY3y3QCEbU86E7I2Q+8UxUpbRZPNGPUkArAzROmChJjTCD720/0VPBtO1Q2A4Wz1zDDNehAvV0eloYGexj3+ao8lA7bCN7yUbLdPr9cZhr5re3eKWbkaLIVQ8lCY25CQxuzSEjb3l5JAspajhmHhZIBp8Ul9CVhCl/uFJxX3EV0at50+0EfLFHj0muK5S6ZEFSwYWdKs/ndBgI+1Fr2RDv3FNp5lFuHqVVCmxJVsH3uoLWjpFM8wH1WR5P3gXRrgCV4CAF95HfhMAEAQMkD3mAexLzFO5A== 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=/5lkbwuXaKYhnHRx76HIGr0lMKCPiw3Uu3qMe14L4FQ=; b=H8SPu/A/fvt3zNzuXLTFNMpChA700wAD+i0A8cyyqqmcc9jIe0I6LE8yemwXju4myToBkiYm2im0DfEPL5dCzV4mxMLvlNl8Z49UAVQVxo6Gux6J+8pHcPS0XVcY3Vh5P1dA7yVobFMSr38DgCFpYoNo5FSuUl58k5gVhXGZmJquLV1PosYCWlYbVs/rdja2bpM/mdARfMUVyig9LZh7RUTnJlzMakZCmJk2wscyuTd3ZhHJ3xG8u6FcCe1WXLvOSfqXR+gkvWkNQvOIpmY0vcf7+habitTLw8hhbcKLEjka3do9QQUc5qfdFIPdxA/t1J/aUYJstZ6wRivbl9V3YQ== Received: from SJ0PR03CA0141.namprd03.prod.outlook.com (2603:10b6:a03:33c::26) by DM4PR12MB6088.namprd12.prod.outlook.com (2603:10b6:8:af::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 20:36:19 +0000 Received: from CO1PEPF000042A9.namprd03.prod.outlook.com (2603:10b6:a03:33c:cafe::c3) by SJ0PR03CA0141.outlook.office365.com (2603:10b6:a03:33c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:36:18 +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 CO1PEPF000042A9.mail.protection.outlook.com (10.167.243.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:36:18 +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; Mon, 14 Aug 2023 13:36: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; Mon, 14 Aug 2023 13:36:01 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 05/16] platform: mellanox: mlx-platform: Add reset cause attribute Date: Mon, 14 Aug 2023 20:33:55 +0000 Message-ID: <20230814203406.12399-6-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042A9:EE_|DM4PR12MB6088:EE_ X-MS-Office365-Filtering-Correlation-Id: ee065ac2-c623-4236-a15f-08db9d061d2d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 03Yw0ZhJvl6198x7RilniB9z5hZH/3hhgSCN22oMvV5ysZwu4G6DJYrmxeM/KxPlP6pytsEx2cKtlvruOGHX3O/LsoSCUZy697eKdFFgy6HVYtJFbcp2/8rOtXFsqH8t91sJt+VDe0ewCq52r7+crr7n48WPqxZaB4Nxu6ORK26Ul7Kogx1YVm7YqZtNy5c3r42xHu0X75mBiD8FlHDCoxZdpinOAkQ8UlpnOzgEKpPTWdIbRGTXU7i4Cbosie9vCUvGTC/Nn7Taf5sNZxCzzzLnvYjHdUxEWAH+DalmrgOSrRz5rdDxDysiTECincFlTs73d0Mn04OxACGKaXW9Ym0KzXS9I/OEZ21iJE5JpKSLb5qBt8q6a6AuSuOcoxZe50HRPdx8vFXCC1yllKf2AcWaXyo6lY0vurGQgnfIDY4Z4MUKZu7wT2yt+gme63PzbFQcnrYNKaMBk1M6K/sD8GSmOpMLM824MNsh4x5Z2uxscdLMDlWT35qF3zn+05og2j5mxm/Abi/4qdg4+59vEDemsa4LYM10oi0zgbmOKLQEc52NnH6lyva83Eipm/ad0/gnlC0rpnMWrhoPSFXuA5m4NoSTISRuLP1p/o5ZFWhzFd1hYUke78DyCk8l/IdlvL+7324EY7oAY+o/jKtg6XGI6s9xfxzIOQoNgRo4G28adqoIP5fBVMMul3cvRSw3u0W4KaReHphVrTT//PnTG5anYiGjrOZF+Fb7EAV99EkQVtzUi+0kYsId+SYuHQd4 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:(13230028)(4636009)(376002)(39860400002)(136003)(396003)(346002)(186006)(82310400008)(451199021)(1800799006)(46966006)(36840700001)(40470700004)(83380400001)(36860700001)(40480700001)(40460700003)(86362001)(6666004)(7636003)(478600001)(2616005)(107886003)(36756003)(5660300002)(41300700001)(8676002)(8936002)(4326008)(316002)(2906002)(4744005)(82740400003)(356005)(70586007)(70206006)(6916009)(1076003)(54906003)(426003)(336012)(26005)(16526019)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:36:18.7014 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee065ac2-c623-4236-a15f-08db9d061d2d 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: CO1PEPF000042A9.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6088 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 --- 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 Mon Aug 14 20:33:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353247 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 326EFC41513 for ; Mon, 14 Aug 2023 20:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232259AbjHNUgw (ORCPT ); Mon, 14 Aug 2023 16:36:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232427AbjHNUg1 (ORCPT ); Mon, 14 Aug 2023 16:36:27 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2046.outbound.protection.outlook.com [40.107.237.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4FF410F4 for ; Mon, 14 Aug 2023 13:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EqeWDTLlGR3NEkMN1N+1QkIKhbB+PzQvKFrQF+js03ba9kS8jOn4WLHvD4u4IfwYH7qQbMg/md9iK2z028MWEvBVFnvKSUBhYE74UGiFmQHD9JbSBVt3pgmMnnsfPS3Tq5aby612fwcfQCLO2BuYNlWIQ3bpAb9gCCTYeudWo2IdgxRvGGpurX3vKZFk9Ej0v0LKX4ABXVmIEghA+ED6XIVyRu892aQHLYFZ4J2zyWQQZgkhTt9MQobfBZa8uGrCgVU2BPzou0Zr/s8Gq416bIm1LSDGT6Ej5V2nFgVOg+9CJPkbkkEsJTFd5h/pUzpf2h9Jitu0LY1E+vo2sJqIJw== 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=sj/48k7xmk1m/uzjsMFaYjUeKRCSxSITBMelJkeNCBg=; b=SJdZcNbBUf7QEjGEo+RZl3xPxSIRjMPVPnpda89CnhLmEmGWFSktU6uxVWxsdF3W2YDzbgYWtLkZsKbEMlDlpQpOV5pL4mE6kw2Xt6VcEOS1UKu557VAmjhGoZIhpM1BRF9CKqksFZveJREOxHDI2QAW/HoRN+Rfd0dcFc+CYwFu/uPVsSTR8Igr9cw5vSX6XBsxSaiBBVsCp0CgKU1LeYuaULECU5QNSWYqI4w+mJkIp76wrt8TJE6g7LmxzLCfL4H2ZaJQlcPh1ETTLb4Hlb/C5M21uCT8iewpkmo0GPrJWMc7WftObiC4CpcPUFWWE/TC2/91e93j7P005Ux9Tg== 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=sj/48k7xmk1m/uzjsMFaYjUeKRCSxSITBMelJkeNCBg=; b=Y1geJ/exXMEZ+0Xqp4bQ3re2LjN618JjkEBIjglryGRz9kGxVoFx4n5J3Qu0kwr6PH1fN7hxfm3A8pxpP/AFQ16tPp2KaUoSddh2vyJXHArvvAMRvh1J2ykgVkYjgb3/9sS2TJdOq0daoVDGoNRDxGVc5tmik311su+e5WAbIMwoFERo8ZZeDB/flX4ibhpNw/+/+tLaM1wFSKOcuzavdyKg93zZMnIz6fUDJeX5c0f0RZiNLoFMt2sF6sPJDFxeEv7R9uRx/U1HoFMKnxodzHD9qYQQDvK2ms2qXdcTCed9ipWBCYErqv3GnIMhq+5F/oPgsQ/WzHo+B9i9FstuwA== Received: from BYAPR08CA0033.namprd08.prod.outlook.com (2603:10b6:a03:100::46) by DS7PR12MB6239.namprd12.prod.outlook.com (2603:10b6:8:95::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 20:36:23 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:a03:100:cafe::12) by BYAPR08CA0033.outlook.office365.com (2603:10b6:a03:100::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:36:23 +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 CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:36:23 +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; Mon, 14 Aug 2023 13:36:06 -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; Mon, 14 Aug 2023 13:36:04 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 06/16] platform: mellanox: mlx-platform: add support for additional CPLD Date: Mon, 14 Aug 2023 20:33:56 +0000 Message-ID: <20230814203406.12399-7-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042AC:EE_|DS7PR12MB6239:EE_ X-MS-Office365-Filtering-Correlation-Id: 57db7995-bae8-42d6-8c6e-08db9d061fea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: udZwSHnhURcsVQ2X3kC8BSY+ZJnqZDIv15YxRzOKbp/lPmXchtxmoYt5wOySwUtGrW7bWPUmVeZn71cX80Bns8Uc7oJSHqCKMg9tziraXNSNQkNqFpjUK7ipOJ9+ePwYgVaVstdVfKNB6N9bkAtigx4Wmzsg64ZSJ1WpnbNEMMChoFriIPLn9D6I4cvGueCa0VAiSEWRg95tNlV/+2vhTbH82HVPeW8noNJydNOSnIaVllrQycVzgsXn7A2Ceuvp9Jfdsq0aouhVFcfzXPyaBpOb7k+dVl/Xg6tLLE3UvZycPMMi+YfBsHXcv2WVsteZ1CHfBSYbE7wKHSxJKxz0GUYm/ZQkRSU2ikpBFWQNibnKEtrbgXPRvBs52mQd8EGxvChDvNaKGpTNnOSh5tlD/cf4zHe9h1rT4JvDxq0dMZIneu8XbpVnMXuNNyag1qTdcpPXNed1SDhBtHFc97mGRE09sWyB7sUZsqOSi3la17y5HXiB//CoGokzMmp0MT3li5tXS/9sv8JNaYnuZXYBn8fUOpA/U/Qv7XgADlWPYxMe20fyNoexwcid3u6ARNYkmwGsafuPhuT93Edg+6galecb4HUFGwQ3QL85GOc7sNOqt1w5TvFks9wpSq11/EIvtG1ACyBWXz2/V7TUd1hEtok3d4igIVHhIOOsDyebk/+Rkh/Q0ocfeA842al9b0R1NJrTp0hIAforR/qnd68YlBoQ1mB58GAbKLHn/VsDEGm4Df2mqtbua+SwJ4+jkRdq 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:(13230028)(4636009)(346002)(39860400002)(136003)(396003)(376002)(1800799006)(186006)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(107886003)(16526019)(26005)(1076003)(41300700001)(8936002)(336012)(70206006)(70586007)(316002)(8676002)(36860700001)(2616005)(426003)(47076005)(6666004)(40460700003)(478600001)(40480700001)(54906003)(36756003)(86362001)(6916009)(4326008)(82740400003)(356005)(7636003)(5660300002)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:36:23.2324 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57db7995-bae8-42d6-8c6e-08db9d061fea 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: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6239 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 --- 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 Mon Aug 14 20:33:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353243 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 21E9EC04A94 for ; Mon, 14 Aug 2023 20:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232392AbjHNUgx (ORCPT ); Mon, 14 Aug 2023 16:36:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbjHNUg3 (ORCPT ); Mon, 14 Aug 2023 16:36:29 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2059.outbound.protection.outlook.com [40.107.94.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44035170C for ; Mon, 14 Aug 2023 13:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h6kVkTk/HX13AfS2QUvrkYmXI/T8kknO8wuOf2cd8KekEzuh3nP8jz5fJAhtJsQBoys1zyw9pP1j4YKHr3csZaM5GhjRYyUEucRdNFCFVLygcFHBP5Wvrd8RCSOHDErTjtvRbwhrR5BONNsBmt51277GpHfoWRTE8e+GFCUN2jzLxKXUhBALXf2/3tkGzXgVoY+mImUkFCtRj0lCQ3qGEXoumMEpSvfZCQhWWpNtAZf8xgiatiK7lvPAElKImGWj/ahN6uTg2UMUpK4kxEmphY2WjXkHg4fJ201GjmU4sef3/751GNLVsMjZu0X8/kez+BOdl3HIABBZfp1/Ug3hlQ== 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=7CKKGrcQfrKyBE0MRiV+0VBNQwq+o07X8knh32JM3nQ=; b=h5NW8cwrJVzBh4y4NU1Z5WougVfj4s6J2YNhuPlsmletumtHfQKeJBnRcjduRRdxzRg79nXn96ZEk5FxoEWPPWLy3ZpTU7gvbm4toC2+GtR/ceKPYvlXf2MSOH6eCiIxy2d2orklqjUA5XCZ1k6QROe1EJ8vTQ+FPAMRLMDdUNzKEDoqOMZRiQhDdAnW+3tuOFid75pJgS+WUZKIisfD6wv1avsVVVVos3P1wRlz5qSfgZl9Ej5Dhw16HT8FpKtL08hLU8byLUW4pjRNZGoaSk1r2iqqsdxLzO0veXLkbG5Mz7Zo2JzgfqKxHNx95+ZxxdPWJqIeMPsd6vzZBngIqA== 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=7CKKGrcQfrKyBE0MRiV+0VBNQwq+o07X8knh32JM3nQ=; b=EQRjQqhvQsIg6aRQfoU9AQuM/FJDsmN3IzCk2qI38qfy3bBTdD1ZH8TimkOBjjBFm1w4GvvqePtQXTVK4tjzAOVGCcy3Po8HgsSpbKTAAd3TCGnMZhuT4uso6rzHjzozTbFMMi4vzaPJg1VuAPtBx7wzy36XdegDG+Swl+zWrD1J2+1BCjI960971am52KF+5tkE7H0SFALa4pxDU2lHKtEEC9rfutQyA0nLKWrYxyMdxNBnXwwSMwl0Vpslf3EcWTU6HQGs4YRk9f4AoSajH1dbm46JN1wtq9GfCHOB2yD1Ejt26VO5+U4aDoU1gT9y7jmQcJQ9TOvTmxBSl5mZ0Q== Received: from BYAPR08CA0006.namprd08.prod.outlook.com (2603:10b6:a03:100::19) by CH3PR12MB8711.namprd12.prod.outlook.com (2603:10b6:610:176::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 20:36:26 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:a03:100:cafe::e3) by BYAPR08CA0006.outlook.office365.com (2603:10b6:a03:100::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:36:25 +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 CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:36:25 +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; Mon, 14 Aug 2023 13:36:09 -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; Mon, 14 Aug 2023 13:36:08 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 07/16] platform: mellanox: mlx-platform: Modify power off callback Date: Mon, 14 Aug 2023 20:33:57 +0000 Message-ID: <20230814203406.12399-8-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042AC:EE_|CH3PR12MB8711:EE_ X-MS-Office365-Filtering-Correlation-Id: 7bdae684-a31c-48c3-7f76-08db9d062120 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 92779rYFnV11tDBDG5jV5c9clSMi8TCk5X6+ALlh/w9wJjhu4+cr15xnLx1uBUcpAX/8TEWWMfCrkKqWNyJ8DBQn0Bws+xxgYnyTh3i5TlBauErfG7SERxzMXJVRjj4kBQXDFNfikmsqACyaTnzbR5FYTXi7iogGtQD6INlVpoikm/+0zbg/kzoftl6uaZPm9wC+MQOeFHHV+6qGRIkNbv0kxWFNmr4HrjM7RjJ2clZQ/unQubqsKthE2v7KJWnrAXISxb6fMdlWLXxvbNNSMPXGR4Xt5qy6RHm+OLap7Y6vY2eOaKgkuYH+Nl2CoInC3pCAtuTEXLvnmn48m1xeHO+0+8PCE+d3IZi2nzHvA58C0F2p68MYDQOzLBjp6E3HKNFsq5xucslGa5NdE5XjRw68tr/tRAWYgE9xZG3wbPimfoz2Ky75aZI53zxqi+sTQEgj/Hi8DQ7eemoTKPsoXhifVECSwCs8O8Llo2jw2FL7mJQW4bK8nZpXELgsoLu4n2YVvRzcj1tAUhEJtYR/LzsTmyvH9emvinEU5MwiHgGbaP+HXHDYnR2Z+vZhkZYmiTsfBGu8MqWsPwqBdIwIdi9EL4DoZ78mpOL7pU6GeAhGVzBsOdiWkqOLzMfxqbEPwCiYZYwKYhdMGI3QPsM1YM70a4pMIsx8a0gtqvYbyMxwi70+9C497CIQv3I323amlJIaQNR0uevJpRj8tMwR6RM+NmD7lrUjhWDY3vpS6+V8QjUmfk0gtOodtQLPadvs 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:(13230028)(4636009)(376002)(136003)(346002)(396003)(39860400002)(451199021)(186006)(82310400008)(1800799006)(36840700001)(46966006)(40470700004)(40480700001)(40460700003)(356005)(54906003)(7636003)(478600001)(86362001)(6916009)(6666004)(41300700001)(82740400003)(5660300002)(4326008)(70206006)(316002)(70586007)(2906002)(8676002)(8936002)(107886003)(16526019)(36756003)(336012)(26005)(83380400001)(1076003)(426003)(2616005)(36860700001)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:36:25.2793 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7bdae684-a31c-48c3-7f76-08db9d062120 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: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8711 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 --- v0->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 Mon Aug 14 20:33:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353245 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 57A51C04E69 for ; Mon, 14 Aug 2023 20:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232405AbjHNUgx (ORCPT ); Mon, 14 Aug 2023 16:36:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232438AbjHNUg2 (ORCPT ); Mon, 14 Aug 2023 16:36:28 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2078.outbound.protection.outlook.com [40.107.93.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E886810F4 for ; Mon, 14 Aug 2023 13:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DyX3WoHXPu0K6uPdiYF40FhaRhpVlBNScPsPtTIMSZjRiZ/ohgKn1/txq09nr9b4BBkeR+lQjoYu8ZAuXyJTfph8l6YYYT6f/FfLqbut9VX5cZRnlC0hduV3AHgCMCuSXwnxt0wIxcWhuh7Me8aXASlcXsM+xu7tqat7HhOEiAHaWqARKl9VUlAb7JcAIHaAZFJGGyw4JkYSDJ1PoioPUkSOk7XNKy8HbMKHY2Q8ZX9h0tQ8guq+FHad07DwqaXoYPHcyXWaSXwOK51kckfgUU8qKuKOjCXVnzGvCxq+pfYG1L9bVGvLiWCVXZ1awav2uVziIIMe+SiR6gfXGX40rw== 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=ji636jxjL2LkwgTIhU4OAzuVvW3LnruVY/RhpVmeJF0=; b=Z/0jMenrv6LidILw0Gvu81QzxIatVko6Oyl8kGO17YAI4NBU3l+GmEmzCgCNmcNJ8D6UWIf2YUVFaxzkqDnbLvBp69Qb9XnSMN7DIKeR88fHxpSUwA0LP1ILJwr6jyAZJ6MQq/ng14LPMUlXApFVd694n/2B4rTPBlayXbl3VTEpWsakkhScqYFvfmYcpcVPYpdZNKJhgwnRr06ge2EsVx7WV0XYFw/aGOilb/o7mBE757wpSBLISYvws+OSHqSyfifo2cd8AjV8rcDDonz0sY5PZLnRhcKzvzUvd17LLnTctT5A4BRLvfzbth4fE4yYsJPbshLpogwTyYizOMbzMQ== 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=ji636jxjL2LkwgTIhU4OAzuVvW3LnruVY/RhpVmeJF0=; b=StZFwEAUf2boJhbRJ7km/vimYdiY73vjnqlbXVF5vLNvSspN5az4/TuL9Lbx3n1unB7Bqqn3kVd+EQ4ps5YpoFLEeOAqv5P+lwyB+9EUHV8rgXAATYSf4T7SghswDC6aEkmUrZKzAnr9INdDkfG1FJipepOmFMJczMMuUP/Y1WETLPFrKiOT3VMS6g9bfCgxAufmBwpmUatyP0KjgwEnprdv4w3Eop11BgEWT0qOE22lYwhGGV5x69LvG+AuJvFRDS+2Jl/ga6i/ECbw1Yf4eR3EVRhzC/rsroH/RM7yS9mKnzj7QfC9GW1wnkcX3fiXb0uTRkN64xrm4qdVnxSxZw== Received: from BYAPR08CA0025.namprd08.prod.outlook.com (2603:10b6:a03:100::38) by DM6PR12MB4861.namprd12.prod.outlook.com (2603:10b6:5:1bd::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 20:36:25 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:a03:100:cafe::d8) by BYAPR08CA0025.outlook.office365.com (2603:10b6:a03:100::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:36:25 +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 CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:36:25 +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; Mon, 14 Aug 2023 13:36:12 -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; Mon, 14 Aug 2023 13:36:10 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 08/16] platform: mellanox: Cosmetic changes Date: Mon, 14 Aug 2023 20:33:58 +0000 Message-ID: <20230814203406.12399-9-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042AC:EE_|DM6PR12MB4861:EE_ X-MS-Office365-Filtering-Correlation-Id: 5fc5e85e-4de6-48b0-6c88-08db9d06210d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4ZcoDT1VGTn8HCtzvym9cJPMVKKCxkjasudMgUmaYm2hcp1S5srkXHxshf9HEkbZrS26he7fdQHcDrif1ea8RcQwwuWuZd1LN1RwHGEzKa/Nn7/qQNFndLCULCQUlDGDHXXJe6lULYFSMtD8KKy+F7ModqHA8/FtOG3J009y1iPSg/yrA9e3AwQnxnjQFYXvDTyzxj8gVeqTVvIVZUKXMzyHMh6WSy1tIF51QfMRgI0LU5RlCyjYJyMJ/oMoUOP2qARXZY3irFgn8FDWyF15coHmDCtVxBy+rcxYJIRbAxDlZlCQsFUUAYkTneEP64qAw7gC3QfXyLDxlVIGwRJldlo6gu7IFFV0ikV034YDUgJdx4SoKx43O3bT4vkoe5LCYl3U4LeMcJDTHlc/XuZOe2HAdq3UbKb7OC7ltXbpq0FxJj7W/ovSAtWCn6ngn3Ea1DSjH4fx4McB6vt6HIziZlBJS5CdLTu4BhK5o61VsIaK0gbhg4lGKa1Hrmhif2YzdY8rjjY5c9ZK0B8IEfUgfUGKvrusZBAb7nntYUaOBUwnR1aug7zkj9D+k1fnZTR8rIb7sM6+zjFAp55sRfMb31LyCSqQnJfsOaeWY7BMevql1YSneg3yvrXgvN5xK0mfBdQE1ISZd3EpxhokWE0DBbXKvTxPeZcvsDq8Dq3nXnDqTwECsMF5+AYpIL+FIuVv+bqz67vKMQURXznV/+6hxiAmNa6Z2Imn//L3ZkiB05otC/JWTb0G7QGnxsG1e5zA 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:(13230028)(4636009)(346002)(376002)(39860400002)(396003)(136003)(82310400008)(451199021)(186006)(1800799006)(36840700001)(40470700004)(46966006)(36756003)(5660300002)(86362001)(2906002)(40460700003)(40480700001)(83380400001)(36860700001)(6916009)(4326008)(316002)(54906003)(70206006)(70586007)(41300700001)(426003)(26005)(16526019)(1076003)(107886003)(2616005)(336012)(47076005)(8936002)(8676002)(6666004)(356005)(82740400003)(7636003)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:36:25.2012 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fc5e85e-4de6-48b0-6c88-08db9d06210d 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: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4861 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 --- v0->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 Mon Aug 14 20:33:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353246 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 435A2C001DB for ; Mon, 14 Aug 2023 20:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232414AbjHNUgy (ORCPT ); Mon, 14 Aug 2023 16:36:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232508AbjHNUgr (ORCPT ); Mon, 14 Aug 2023 16:36:47 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2065.outbound.protection.outlook.com [40.107.244.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BBF7E5E for ; Mon, 14 Aug 2023 13:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kK7+WxtAtuEJ6eMfv4dYZBRwO6wz/kbJv7tv/CN2/8iRp21nXyey40zcU4zFxnaYhmQRSeKUsWUlcKquFAb7cqhEHAYnNbMsIAsG1ZmBDQ6pRA8j9f3Is3oGR+sgAUMRFqc020KXPYGo1R6+rRkXGmtwA2QLXQAGJEB733TUp80LPXK7TkCmMq8MTy5RyPBlqT4znkcd1Wd+YDmx0g4zyPiDTOVlJVcki5XCs6JkjsUa0R2oB/NGkWk/1uSeBjFzew0BY+ONX4MUfvUY6WEcIoGxfUc/yBvUW6SNe2PO0AxTcVD2Q+TP613ZJ74aaNBWHCDPRtiP2W5PWUQFkNmiKA== 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=ArL6WqvJQKDjurQJ+hRn+ugEtBucHKKJObYmoU8WoHI=; b=mNQ23qZyqMC5BkBE8PEIf2Xe3lmuiiS/+X/dkfdBFNzZP/d8wik8gR97a/se73cJUJ/honptiRv8l6nOuWDdf2YYPHCfwmM5XFAqiWCctlvpyleM4uQ8eBdSBLl1R9FIRol58+yWTm7OnMtG1EM9/MlPzY4rnNFpJvGVz4xCXP8QPhVnTWckxc/RpPyTORIPhMaU+8DXR5B0OKMaq9kIjqAGwjWx3Lb3CNSwHMAx0al8xN6OGZIXvCX599YCf55ug5sSehIU9aF546Z6j/61a1F28NcbyhW2IVZMbn1BSUcNednwEl6WJivFBuAecK7vfV8KBbJ3n2Oq/MNpbGETpw== 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=ArL6WqvJQKDjurQJ+hRn+ugEtBucHKKJObYmoU8WoHI=; b=EkFKoVZ4GZjn9k1g8ulOZkiDqlAhYqVOrjae4HZLE36zu0cKuhA/kOLMxvM9+HktaCwr8jmBhqTf9kPScuHPcgkdcGXgyltQ5BkIw5JjxN3ixtWNa1NRzNiAer2IedOgWd+hiXb2uTYeUfrbuxPJXoOX7sFP1SOaiZJHvJvwNhwQSnwHT2AvmD7QkjLpwi9tu5Pi3dhBPK8mRO70WKiiwY67NhSBraxeX266+Z+SMOPLmYq/HV16GAouMghax/Gq9bQMFsU9JvZxNyh4IZDqbIuHPiLRWF8U4yFttCjYsJALOJ0u165lvM5nkEwnw4RRSDtrR29BWf1IGWXt7ljpKQ== Received: from CH2PR11CA0017.namprd11.prod.outlook.com (2603:10b6:610:54::27) by SN7PR12MB7936.namprd12.prod.outlook.com (2603:10b6:806:347::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 20:36:37 +0000 Received: from CO1PEPF000042A8.namprd03.prod.outlook.com (2603:10b6:610:54:cafe::e5) by CH2PR11CA0017.outlook.office365.com (2603:10b6:610:54::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:36:37 +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 CO1PEPF000042A8.mail.protection.outlook.com (10.167.243.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:36:36 +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; Mon, 14 Aug 2023 13:36:16 -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; Mon, 14 Aug 2023 13:36:14 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 09/16] platform: mellanox: mlx-platform: Add reset callback Date: Mon, 14 Aug 2023 20:33:59 +0000 Message-ID: <20230814203406.12399-10-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042A8:EE_|SN7PR12MB7936:EE_ X-MS-Office365-Filtering-Correlation-Id: 36651566-3326-4857-f689-08db9d062815 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cm7sg2RnDzP3hJIdtJhV6G10x6UegCR5qMpsgENfpJbFT+2DDffWicd5QqdQHiZdXt+8KWTqC5Z5p7U72/VrcRTn9Bgt3SBbrmrcNm5IEKEnpF4NOVB/KkKrzHF73N7UsDGOCQ65AoagbyXErRv2qLfcz57dtGnneqGpctVBEK0D3p/8vgSCua7aDnT26Do7L8QrUKJthjCcIiFL5dvpFm5c3wvM4NlzSH5HBgcX4YVLTY2zAPQYF6ghyzzmXZbx33DqfgZVtOU1E2FHCu3efxPQ28KyMOi2/0FIZ3p8x+SaoTj8YzpUQMVdK81PEq+Kvb8RQ+sh1fzjqEyz3DK1YcT+4tqbnb7k3L2SaKVMUwQxBgXQd/rmielQxXRmMYcoCNOsjPpevEGRopBTeN8vgHoTv70hv8k3X6fQVa73qRP8/YqAmw9LPRcLRRRJDTV16EiN9aO76OVIGPwgLAAVxtlgXUu8EO3113N85oEOlYec+nhs8r2dcq9NZ+yXFRAAFBJEQYMiZnALaj3+NH2kOL5fA0ObuVX4W55vZ1rx7CsUp6VfUXRe9MQ8NUhgF9QYUGrQmt7IDHjFz0IyBlnLZRtmCoA9OVY5O2J6RC+cpT6GMSGmDuKs0GR7srUhcK3HCcoUpgzXc3W71uLYoBnCpNIuJA9XTMJmUTpcv4lV9GD/wDXJMfDC8bvm8IQpf28/vaDvvYD2MEyBulZBBEsfk4IMTwz/4TG8zG3ni1CiQvICJlgArl5V9xww0Tc2REg/ 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:(13230028)(4636009)(396003)(346002)(136003)(376002)(39860400002)(1800799006)(186006)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(107886003)(16526019)(26005)(1076003)(41300700001)(336012)(8936002)(70206006)(70586007)(316002)(8676002)(36860700001)(2616005)(83380400001)(426003)(47076005)(478600001)(40460700003)(40480700001)(6666004)(54906003)(36756003)(86362001)(4326008)(6916009)(82740400003)(356005)(7636003)(5660300002)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:36:36.9543 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36651566-3326-4857-f689-08db9d062815 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: CO1PEPF000042A8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7936 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 --- v0->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 Mon Aug 14 20:34:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353248 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 B1E6DC41513 for ; Mon, 14 Aug 2023 20:38:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231672AbjHNUh5 (ORCPT ); Mon, 14 Aug 2023 16:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231569AbjHNUhz (ORCPT ); Mon, 14 Aug 2023 16:37:55 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4970E5E for ; Mon, 14 Aug 2023 13:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MIG1TrltHWR4L9gXlXk4hl9O+hFP7RbyxrxBJ/ywsyse0wQxIWVKfWFDFpDDebsbNbN/1p7H/frmTapkuMFbJWU7oFRjryzhsgzURmxHepxFoI7i8zfz5+RbZZOZJDMRARY2VQB2Jrw+9nrfdxD/r/g2i2/zPflzat0c5GLxalBxqZ6jk+Tg0dZKLTBDVqHBXYnhwjf/SmMMyiIKIJja+pA5l5af5k6jtgaKozGkbsfHk1aWVpfPO2UoOVeMbtlg+V7Wzl52nhFYu3nDV8BRqQJV8vi3BCJdt/wehk4MT64pNs7yp6QpyB7LQMkSokOiPjuGBS1cC9ZeEgaOgn94RQ== 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=AbL2bEezRmT8Qmzx77kE/UFMDx684YKbSX+v/z2iOuU=; b=PS4ze4/L8c4dbmCXrhMHaJ84WNucYt4r7Su8EIWddEh1i+y0enUcY7tGZ3E9ALw0C0f7K5EEzmutIFgb1qBDegFrr6COyLi+GuXaTjM25Ef54fThSAn1GO5KS76gXkBXmxWvIVzgO9U261kClpoDx0sio5eqRc1EZQYGBJHUt39vz3lE7FAf8gkRHDQDtiZPTHcOIg4pzNeZmksbBwmwYtXUmZcLiU+eZ+jGREA4lE4HqsxHPoIJVCfNAJLKN7tc0AyLli8uuvlww8LfNHH0E4K5MrR9HvxTo54KA1nWjYK+MEDo6TLwKg2bnLk1/f7Ke7aEm+6DcyrqmHldWujo9A== 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=AbL2bEezRmT8Qmzx77kE/UFMDx684YKbSX+v/z2iOuU=; b=ZCejIrc+M/sknNkGS+Y5AsB4yTaE+yrr2zF0b0e+YneBhcHRARnq3/D/jteuSwRHOWhOaMsiv/ckCaoUVIXdKAkqKNnu7bsWfA5mveFdzVK2wOHVTQ68OnQ3+4E6vsUn01gQZhR6mRCT3vw5MPF3FOUeQUtxHs8A1eSf5E0TQHkYmzVMDVLyipiQT3n3zdYkWg/Anfu1h9eMJDd8QT/UdpbbZ/M8OD6KKqQR/dhIlASakZIPZ4kgX3JqBfF49EkvgdytdVAm5oaJf/C+AryZf/JRhVYWiiYYev2kD26PKHI6Wt9NtR1g+DICielCL+sjDgCit4pNJNSQlE9ujHjS8Q== Received: from MW4PR04CA0367.namprd04.prod.outlook.com (2603:10b6:303:81::12) by PH0PR12MB8032.namprd12.prod.outlook.com (2603:10b6:510:26f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 20:37:51 +0000 Received: from CO1PEPF000042AE.namprd03.prod.outlook.com (2603:10b6:303:81:cafe::3a) by MW4PR04CA0367.outlook.office365.com (2603:10b6:303:81::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:37:51 +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 CO1PEPF000042AE.mail.protection.outlook.com (10.167.243.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:37:50 +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; Mon, 14 Aug 2023 13:37:36 -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; Mon, 14 Aug 2023 13:37:34 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 10/16] platform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infrastructure Date: Mon, 14 Aug 2023 20:34:00 +0000 Message-ID: <20230814203406.12399-11-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042AE:EE_|PH0PR12MB8032:EE_ X-MS-Office365-Filtering-Correlation-Id: a4f6e08e-e9eb-4790-a82d-08db9d065433 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 36tOxB5efA7tmZ/X3jKfPUxonG41EmNV1efynAbNn20c5G1sWvWtTl4bPk+DbW7DObkIEGAgRnJv1y88qaT8adq8IgR48uxsAexiX9GfwBBEgrkq19/nPZWGbtqwWXJAhVb0SkMAP4SJN2/hLgm/Mpqx4OdNiXUw7+h9JiBxnYYxIR4xfSsHq/gUzh/OwaeuErWuzp8qEi2q/NS4JbbBOVvtpdlTv6EVorZmH5eWqsT/UQo1jBcXzQTlQrog1Mcod0uw2ZJwAgxBHARKIcniRHUOLRIIOOttGYKJVLcQFoFX1EvnzpJuCAwuok2bPUe2Nwuh+f53IV+osyrGsDrpo8IOOS4c2JOGGFKJvC5ECM/Ptv66+V1HSz2UnqhdXBCn2CUSHA3u4tvniVgfRQdSwWaISkfeBLMLc4cRiIB1Pyn1Wso05ETgy7CU7B8lFT95j5xDuRrN5y4JKT1Wn/l+uBoLYjhJrB+y4wrIJJKc0DCYpedE+4OK7JpVzgHPtBKEjdPMAyvEbEdxev4ROGHnYHlitZTbyvLvRYYMmv/FVfG27U9IaQ/5j7PqHPKjpGyRyFwRycysW//EY6TjPE4Iwvg/zlUshVGHrA/7XP+yiy2tqHefTjPbATNBw+0WNXMixpCz9kjG7kK1MGM02KNACBpF20WrLA+OzHXw07WEmeIwqIWY2FGQdmn1zClttIU0kZdUFWylFf4oemU27KSxfBTxZbeMajrWyXWmYthQZho= 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:(13230028)(4636009)(39860400002)(376002)(396003)(346002)(136003)(82310400008)(451199021)(1800799006)(186006)(46966006)(40470700004)(36840700001)(6666004)(40480700001)(54906003)(40460700003)(478600001)(7636003)(356005)(82740400003)(2906002)(5660300002)(36756003)(86362001)(6916009)(4326008)(336012)(70586007)(41300700001)(70206006)(8936002)(8676002)(316002)(16526019)(107886003)(1076003)(26005)(36860700001)(47076005)(2616005)(83380400001)(426003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:37:50.9530 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4f6e08e-e9eb-4790-a82d-08db9d065433 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: CO1PEPF000042AE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8032 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 --- 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 Mon Aug 14 20:34:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353249 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 54970C04A94 for ; Mon, 14 Aug 2023 20:39:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbjHNUia (ORCPT ); Mon, 14 Aug 2023 16:38:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232449AbjHNUh4 (ORCPT ); Mon, 14 Aug 2023 16:37:56 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2089.outbound.protection.outlook.com [40.107.223.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9996CE5E for ; Mon, 14 Aug 2023 13:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g/I8EaeF21yZ2qk1SIBG4YGOYCQENA4mfMS/qWRoio5ELy8QqMAMr2siFn4DmiwUWaOXmkZLE8eWqfhyBOViuGU2yzDbDF/U5Vzak5jb91ZpLDxIrSy3cBsN1oip4yyqq5BoiwneXTrpSAerF3jkZX5IpTudE95W+X4eLFzlXuDrNaYb/xOQaUZT4g4e5S+DXx4pU6Xg5AAdzOreqQ14pY9ch7ngXcISvX1623Wf74Yug9b7+vGcnK/9GsykYAHcAu72XBrtPtfQVuAlHvbSLzpF1eqpKaeT6ypyawJvoK4KQFy5/2jr3gS/9xzdv7zZVkNyoUBcPnxzzq2aiKo/bQ== 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=shzwVEE24DAN7rR9AIqrQzmJs+Tj2qOaPzQDRSDtmVk=; b=OzOPjwd5ShT0kIKCdWNPlOSxU+HyyOg4ILC2zmgf1Yv6vCTYiFY1NU+v1WeHLKXyrFf/8Pl63cigOKS0aoDDNktI6a3xmhguecxqQ20lI8Uxo74x1+zkiqBsIynvbhbahJt4M2jzQDvFSTvHVxWvl/Dabb1HsEvSlLmvoKMrYeiqQ6k6xLxO5UZZzo7KzzxpVn/yeQbk+xbYFw7X9m3L6Bd6mRE5b7YvpfhZjGoE4j7MXm6Yg92JMIfdemcTA1D4dj20C3byJ10RmUG8wZZukypKvsvWgIcKeh8jrg6XVUtavT/lRJU1q332kvg5QIrCtZZM+LDq+hCGUNoSmi4lDg== 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=shzwVEE24DAN7rR9AIqrQzmJs+Tj2qOaPzQDRSDtmVk=; b=l04rYqE3aLA1Z6CrEiaBELnJqTkhfeUyEUrfrtOfEN4cvozn3YYW2y/Xp6twAdJmuDiMN29Uw8X25E7NawLCF8DjKKfbN+WUlLWdhrHMT3uqiGl3+27FPN8mA04WQVNr/bLFkBhXw1C5lFoU9JBgclZLhU8r0Cc+V9rPw1hIwlKIt7paeOuomDhEzwsZc4CTFTek3pF30LCHBy62EPJT1e4UeaVOCIuMRzJHS84k6JU0zU8Mfd+5SejUs8qc93S7InxHoe37asmOm3H/oNJPa56s78XpCy3kVsv2lELjdPIXaIXfk6s+zaKHU3n0lE3iLf6Sw48WmTqiGYjoTioQ/A== Received: from SJ0PR03CA0016.namprd03.prod.outlook.com (2603:10b6:a03:33a::21) by CH3PR12MB9100.namprd12.prod.outlook.com (2603:10b6:610:1a8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 20:37:53 +0000 Received: from MWH0EPF000971E9.namprd02.prod.outlook.com (2603:10b6:a03:33a:cafe::7c) by SJ0PR03CA0016.outlook.office365.com (2603:10b6:a03:33a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:37:53 +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 MWH0EPF000971E9.mail.protection.outlook.com (10.167.243.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:37:53 +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; Mon, 14 Aug 2023 13:37:40 -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; Mon, 14 Aug 2023 13:37:38 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 11/16] platform: mellanox: mlx-platform: Introduce ACPI init flow Date: Mon, 14 Aug 2023 20:34:01 +0000 Message-ID: <20230814203406.12399-12-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: MWH0EPF000971E9:EE_|CH3PR12MB9100:EE_ X-MS-Office365-Filtering-Correlation-Id: a4e73a7b-27cc-4f44-100f-08db9d06558d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hXJvO77ORZE7kY3RWv0VjRSAkaa3LNgLnBRCCR3Dc4WIvfkNPFD5QsX/U7Ob1bsFsj5v9BfseA+vhVMPTZKuyuE0KsAqUis/pc35ERN0hKUXtKVxqIG/bNChGXAtPUe7/9G+N1hqusDSRcgGz5e7OZyPNMqU90SKtjxb2sGY5ispHwEXcKzQHfCr4yjmPXuHznme0N4KMs/sk4gZqVh0jLOuW21f8BMjY1x18uNhFvBx7ULYLe5yBYDpriBxK+CvjO3+O9XSrmV9iQ1O+RTiLl3bK2EwJcu3QtE8M2bzRl0UAa4T3j+0rlh5nIUojgPV7pUFfjkWVB8IRhuDzBqcAPji0sIjBnOVycxu3ciEmi9nUb63GxlPTLJCUqO4V6ZGAjWnAfQsWmEtBMUCeyGWwYzymMBZBVM1RIRLZr33j1t7MvVzl/vsFrSU1Xg3moz3V4tIB42VqBVdlOoX9TOKKM/G/HrIZ6vxTQbs/2N44OdmOQtR+hvz52Wap/hnng6aLbD2J+zHUDc0X+Dii9Qc9EwFLD6q1d8jwO9x4oYf18QvURt5DxX3Nj2BulrvZPbf4yVR+XAaoMHgoF05mOe8VYELMDP4LEBin25RkTI7dq9z+nwX436kvRTXbkCU1gTnblXBtCgm9HVv96wq6ukXXbSyFE14jbcQznKigDUaqbywSL4O55TEqUtfi99sA8u0eL0m4JoyEtN5JoAcRW2VVRo97Fumx2BpxEyMrw2VYEQTBpLHwolX7rquzdGWB78+ 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:(13230028)(4636009)(376002)(346002)(136003)(396003)(39860400002)(82310400008)(1800799006)(451199021)(186006)(46966006)(40470700004)(36840700001)(36756003)(40460700003)(40480700001)(336012)(426003)(5660300002)(2616005)(107886003)(26005)(16526019)(1076003)(36860700001)(47076005)(2906002)(6666004)(70206006)(478600001)(41300700001)(8676002)(8936002)(4326008)(70586007)(6916009)(316002)(54906003)(86362001)(7636003)(356005)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:37:53.2792 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4e73a7b-27cc-4f44-100f-08db9d06558d 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: MWH0EPF000971E9.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9100 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 --- v0->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 Mon Aug 14 20:34:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353251 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 77813C001DB for ; Mon, 14 Aug 2023 20:39:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232449AbjHNUib (ORCPT ); Mon, 14 Aug 2023 16:38:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231496AbjHNUiA (ORCPT ); Mon, 14 Aug 2023 16:38:00 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CC2310F4 for ; Mon, 14 Aug 2023 13:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I3jMhje5IbfasGZMLWW1dBGCxeJ9JE5pLcVQd3Oe3x/uKi5gj6Z5CnGFv08h2AaYxy3wTWC+gO1W+HTaWuJLcajGeq+JSW8/b38lcznVua0037ZBSZqquamldX9XlFL+/dkFU+2/MAUThoTfewi2Lc1qEJNtpCX2TcskEFsoobYp7rcW9euaW0INWhSDCPcoMmC0dEn7VXL147EPMaz1waOOAHZNCkEWcuBmQkdNlgp1LErEhemnUg4QhgsxNDJZK4GbNoHMR2slJ+WrjKHU2XYwM6ewCHkoUxU0VPlxqohmedOhzjX6XHwHuPRwZyI/hcO1c72jzjs1j+/vF9N2vw== 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=H697fOHosdF2du9HPqI1Q1eHv9gKyw+7NQTJlNEQceE=; b=IOqi0rlJpSrJJh/TL352vGCUPpTa7lWSedrF4+c52yLQTv0+Ja73z6ID2eFpOcmikB1c7i1sJMCSg/Kck9zCJyp+89r0tVmmtscJNTL4/kImtNy3NtyrmE0Cs/QS8/WosX79mOzrub8E41jq85WH5+b5C0fomizE7tqbD0kIcZ8ZAGhtFhaisv4UgnZLSiLfTp1pTYh4r0TFN1EVSedZxZ4KnbzNGdLbA52vbEExvZqcu8UhsrHa/4zmDXEi7CX7jb0Wnt6P86h96GLicZz0QPyvMwOe9C0jxcD7eGx2ReygFbABWlk3Y7sKYiEqF9rLZL/371A5f8tjdMqxBpFbeA== 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=H697fOHosdF2du9HPqI1Q1eHv9gKyw+7NQTJlNEQceE=; b=d2aDV8q1mRnJI356BuUf0MWubW+5cBAGspaCLDIWAFYTE6LxAu3F8kPOgo6RX1EPNNTowWpsFh/B+hOBgZv+cyL59U1ybd3fM+jNOMRPYxg1iYB0vfkUGduT9ZOye9EXAdS2LXZ0VD0IA7+x5708RSLBLwcvP/xM5qCeU7Es8ZIYaUjLCOdEpUrsW0L8bRN/OpcOCb6eb8L+kwdrtL6MyL5Xy89xiEVZYUvuEoCMdQRUWTWFEOYLbqDJWjrO37LxJquq4DIsvrsny9057cRwtF6TPqY0+lUKsjqtoH6LMxbdPCYvSGgufW1fkqF1wWPwOWJhdx687z5C5srizxeXxw== Received: from MW4P220CA0022.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::27) by BY5PR12MB4228.namprd12.prod.outlook.com (2603:10b6:a03:20b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 20:37:57 +0000 Received: from CO1PEPF000042A7.namprd03.prod.outlook.com (2603:10b6:303:115:cafe::35) by MW4P220CA0022.outlook.office365.com (2603:10b6:303:115::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:37:57 +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 CO1PEPF000042A7.mail.protection.outlook.com (10.167.243.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:37:57 +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; Mon, 14 Aug 2023 13:37:43 -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; Mon, 14 Aug 2023 13:37:41 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 12/16] platform: mellanox: mlx-platform: Get interrupt line through ACPI Date: Mon, 14 Aug 2023 20:34:02 +0000 Message-ID: <20230814203406.12399-13-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: CO1PEPF000042A7:EE_|BY5PR12MB4228:EE_ X-MS-Office365-Filtering-Correlation-Id: db9f48b9-9348-4879-bf65-08db9d0657f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s17SHkiv5KwikCL78ousoF1b/6rWsM+FwFWXlic9+a5Sx1SqXcBOtZRVKIPA91plZzaBxo4cJxTOWGylLRLxJTTg2FUfC+yeiG82Xlxr2JqczzPlX/4JIBDwFMZFcKz1sFjc8kIkxuW2YkGvy0Ay9c6IIn5z72eMuNL5UdtvCDcWIY8tS1bnwhlYHWmvAhl+x3u9cDjeetKg6Hql1s6IRPPqkb3vHp+53D0rTB3kqdexN5OBAFFITKVJ/5/1U+GuHUYj8O8pBLO7XN70WHDiDkWqf+K1nmfJlJ5mlFsGd3GwxEDe57aGV4G1bw8ftCHzK6OWO4ZZbotRO8XNmQJ4HvDvOe3x/Xeu3xDHhJIUTC28TlLUWZK+EYWicqHxw9VI/d2InAOsPou2qbHUXkELHTbJuf4eyJ9awNFfUMhS9zCYNTiwS5W2LqQRn+LP1wxLlo7j8eOu0CZO8PqtTTdKQh4woedwaWnYxOFMV2bLOz2xRC/Goz/dMGjYex/XjQ1YAv3j5x3IicDjFM2T3KUyVWA77cBVYQQ95tMBhQx3TRoD1tOYGKF3/1hhVCGEWRB9vLO6N6ZYf7viKq5P7NeYhLeYtVaQ6Xc7D1J9ZssrBIz8x5U1rucKlDnKwDLYHAPf2G8MGjrWgpuWyMN5Uhv73kJCKgX2kT7WTNZ6ieUIirqFn+z0K2iq/FMxf/eE62c444OqdupUj8bw+MSPu1ieDRaz38Wih5gq22zBLyk0U1mLk6ONQYj6s0YNhqFvHpqZ 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:(13230028)(4636009)(39860400002)(376002)(346002)(136003)(396003)(82310400008)(451199021)(1800799006)(186006)(46966006)(40470700004)(36840700001)(40480700001)(54906003)(6666004)(478600001)(40460700003)(7636003)(356005)(82740400003)(2906002)(5660300002)(36756003)(86362001)(4326008)(6916009)(70586007)(70206006)(41300700001)(336012)(8936002)(8676002)(316002)(16526019)(107886003)(1076003)(26005)(36860700001)(83380400001)(47076005)(2616005)(426003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:37:57.2451 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db9f48b9-9348-4879-bf65-08db9d0657f3 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: CO1PEPF000042A7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4228 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 --- v0->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 Mon Aug 14 20:34:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353252 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 68DB0C41513 for ; Mon, 14 Aug 2023 20:39:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231496AbjHNUic (ORCPT ); Mon, 14 Aug 2023 16:38:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232435AbjHNUiD (ORCPT ); Mon, 14 Aug 2023 16:38:03 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2067.outbound.protection.outlook.com [40.107.220.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 163A7AA for ; Mon, 14 Aug 2023 13:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XPf/tu6buzlSESCj6HSOUXYJ8DwAX1jzgXxbDazPrTdotwcWouiqcKhoXGCKubLExn+xMRNP5jsiUukucZ+mupxRFs8ZOBDSbwBcva8/WAshsp/H1VwxT2h+MdRM20cuxgF423k7O5/K+0DcQlDeVDIQANfsFIZLl5SrqmjJ05n185J65txJgZpjXg1kMHhNPbmQF9dTvKgqVuVnItPPKYJUT0tKJxZ5i9MpAxy28zDMyt2h0/QRqoFRM3HF8SwtfvSs2qepGk924RDyBQs0QvK9zGHATAlYKZzCrmQWO/OnixrOlGgdbWwVa5YkX3s8GjjmbM1v8RfhAlRHNE83Rg== 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=eiyUzbLRS5ZQJYCHQ3tEhHF6vg02O5Ti/TKo1T3+m6w=; b=fiKdeMNr9gxNwNII1izh44AkPnf87PqIuITI3xkR5BTCKn/XfP0sI4oXQs9AIbW9rNjwJoupuWFsCOqKHhGQ7uxq68n1VVRj1ypTfph2bZCZYfSKGmM9eQoHA4CSwVl6OGJcDCYfqESgS/tX+R1nPU7Gr/fwsBRu5mCAnnGDleNPOGqHq/LRjGVVoqzIQ4GELBXsKV7pR2mL+WFwI6vOuDSaGEnG4bc7FLWvpsMbPjRWohr+3g+HyNdyXWBXSaNJ7OMtL/Yr6fPPgZHDu8gKLnCX0eMdDx078qba6AL7D1CMwDZOOtmfWIx6a44SIO1DITk5ctIbbi3cXMNXR+zn9g== 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=eiyUzbLRS5ZQJYCHQ3tEhHF6vg02O5Ti/TKo1T3+m6w=; b=co047Kg1R3bHYBmrXUW9AI+h0Ydh1PSRZZn4UYcqBUcmEw3EYYBKUoY2+4sAN1MT3Aifi/+BHXb13SfShmFx5BW0lWpAJE28BxNY9p7oEpgCp5YwEdd+ZgqMEzrfEu7KL4bGvFnNcWpxcH4Z/uOSSSAB3JgpIdqS3QmqCcqyQaUZKvmGOUvkXXDcKTbf5Fm/4rYiz30GRFKH22QSW65dofhzfMLWlWOnpHzcKtNDTh4vjlaflCobTpVP+PF1grE0SqLBRaqIEWnQzinVAtLNnD3xztffPzNcKrKJzWMw8j+vucEbEOePQgk6tdEkB1frlQNiVFoOQFnKWD34+ZJxQg== Received: from BY5PR13CA0007.namprd13.prod.outlook.com (2603:10b6:a03:180::20) by CY8PR12MB7436.namprd12.prod.outlook.com (2603:10b6:930:50::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 20:38:00 +0000 Received: from MWH0EPF000971E3.namprd02.prod.outlook.com (2603:10b6:a03:180:cafe::d6) by BY5PR13CA0007.outlook.office365.com (2603:10b6:a03:180::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:37:59 +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 MWH0EPF000971E3.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:37:59 +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; Mon, 14 Aug 2023 13:37:46 -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; Mon, 14 Aug 2023 13:37:44 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 13/16] platform: mellanox: Add initial support for PCIe based programming logic device Date: Mon, 14 Aug 2023 20:34:03 +0000 Message-ID: <20230814203406.12399-14-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: MWH0EPF000971E3:EE_|CY8PR12MB7436:EE_ X-MS-Office365-Filtering-Correlation-Id: 57553883-3b1f-4ece-3849-08db9d06594b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VK5yE0RwuNQSIWH1FbFheVPSe/419VeT04ylqw+rB6InlCI9EvuU/MONEDD48tC+eXWDkhYwZ0PMMVs7sKhlGDJiN/JLtr5pyxEakwA9nZxfbNgqKqcYJbYLsEbDJZ39SK47kkq87377DNqN1CjTX7eETvec7wjbQSrBvMxp1ycNA5Z/mBqkHZmbKNzcMTEhNZOQkV+n09VPljAicAgmF4Qk8PtrwKTUA6D64qlUs9AidzPApnZ0u7LxmDAUunLLoP/z5K1r1WBAvnvBr29Gqz90b9J1Akfr6gtE4rul4UeZxeJD8Tfpub/Ta3kxHTD2p7mSIbY3N1R7UDFHgvQ/ENO0owRVY2Vf6tSkOlE8lBmfJLuUiDFSTFirPNd+0dZysq2+/5x2gLFGPav/ELtZnpCTAzBvYChHztaTwMnZ2hVQsjQYStlqAkK8K6+01V+OY9lxFEWVD8z4I6tM811GEya+IGiJkqfuz+SN6dReHuvpVblN3lO6pqrCRzajSDj3IMpMiKoIZm/BKTB/X/QwJFyT2Y7DZ4BNlmDrm2LbsC8hzN4UrO0A9CJtv8+2JMzNBe0WoX+z66yd5WIsiD76evrWtnyu+OYptE+o2wQ8R4UOcW4QraaNJvajnZjSI5TTJ8qawP4Wm7oV3kIHyG5f4i+/869HuA/xBDEATRfU4EHQySi3wD/kQvU9hRk0msZmOV8dHw7tKJrFe6e+3t5pZzVKQ1ABXZEyAk2KdfZdvu35fekdNayqZLJOetqyhByC 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:(13230028)(4636009)(346002)(39860400002)(376002)(396003)(136003)(82310400008)(186006)(1800799006)(451199021)(40470700004)(46966006)(36840700001)(40480700001)(82740400003)(356005)(7636003)(36756003)(86362001)(40460700003)(6666004)(478600001)(2906002)(1076003)(2616005)(107886003)(26005)(70206006)(426003)(336012)(83380400001)(16526019)(316002)(54906003)(41300700001)(70586007)(6916009)(5660300002)(8676002)(8936002)(4326008)(36860700001)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:37:59.5429 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57553883-3b1f-4ece-3849-08db9d06594b 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: MWH0EPF000971E3.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7436 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 --- - 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 Mon Aug 14 20:34:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353250 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 8BE80C04FDF for ; Mon, 14 Aug 2023 20:39:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232435AbjHNUic (ORCPT ); Mon, 14 Aug 2023 16:38:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232459AbjHNUiF (ORCPT ); Mon, 14 Aug 2023 16:38:05 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2069.outbound.protection.outlook.com [40.107.220.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DA40AA for ; Mon, 14 Aug 2023 13:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OYLdeNZ9UaHuVCiwzAb6fyia8EnW1CR6HQS2BoDlsLyEMOV6ntrZ/Kjzi222VwnL2WZwcop+u6UPy9RUNRyGPPpgdK32It8T7iJRbqvB5OP/zBiw/6E+9hjoB5KeBNQ6WF2jYZc8VpdV4s4yoImNSRs1gx7tsE6LvSjeGVlwbNqfv3RpiYsLjgD5E7vaLUxK+qH1yt4TPobdKgvUN7GhrC6Ma9TcLZnzoeo7iQiohSeaPkVL/lmk4aiohwV/4UVYovyIGCJ0/1mDsZGDhxhozO+gLASIxJdwryRVBrpHQJXu3rQvw9z5Cdb/4bzCuhjfV4NWID0reQu9+2U4eVmyKA== 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=mv0S/XhvKsXZlu9CtjytXYXccCQ/UPrRPjuylW54Dpw=; b=mcEA2OhsvaolAgnTRvmcgFgi6niKaG4nCjsLa9caDkDyHmGyAgzKwfSds73ftpKXnwW1wUxlc4lKdjPYVrkL6J+93gQfqhTM5woagrtoQoYrUD/GkjprKNm8yDm+0XeXd03wko2qkwvZPYOskKDwgBo9n56fQkwoOY4wxLkcZXz8xku9aRPH0yY27GVIb6D2SwrmnVHA/k06x0i9YfskYBXKNe5FQG4KXV/UQXXpYVQOXZIDP1kd0nPUU1pjJnCNeKe3C7902wJe7U/ThXTb7KS/tGN0ibAQWejyVml9Rj+5t0yvdWbLv4X8qoGxJX3VtmRND4gOAnw5b1GyYJikng== 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=mv0S/XhvKsXZlu9CtjytXYXccCQ/UPrRPjuylW54Dpw=; b=Gv0D7gF7CQ557/rqzBmAj3ZNfoHruYu+JLWTVV9ukGFykhs0gVee3TbFartiX8foX7P1M6QXwALTi9j2kpecVJIKFcw3L/xpMUgXPGwNAxLVamDkh46jKudfB4GRgXuFB6NyLGtR9Rwsi+GP56rW+IrkPQWO7g9ApIN8wodo8kVwzI9UWGH6NW9PD5VmEMcjjVCR05JB0EYslcRFoHw3e+I3VUncxxRDh5PU1VKYUsrVtMKVa+BoAp+nRz+FgJ898PAgkY/g8lxdmKwKHwhZUQUsHT8Nuj2YOmYnvL24/fycpm5IWsc3WtYCs645GHr30SStbvo8x4wkr13xzYYXtA== Received: from MW3PR05CA0010.namprd05.prod.outlook.com (2603:10b6:303:2b::15) by DS7PR12MB8230.namprd12.prod.outlook.com (2603:10b6:8:ed::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 20:38:02 +0000 Received: from MWH0EPF000971E5.namprd02.prod.outlook.com (2603:10b6:303:2b:cafe::44) by MW3PR05CA0010.outlook.office365.com (2603:10b6:303:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.13 via Frontend Transport; Mon, 14 Aug 2023 20:38:02 +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 MWH0EPF000971E5.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:38:02 +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; Mon, 14 Aug 2023 13:37:49 -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; Mon, 14 Aug 2023 13:37:47 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 14/16] platform/mellanox: mlxreg-hotplug: Extend condition for notification callback processing Date: Mon, 14 Aug 2023 20:34:04 +0000 Message-ID: <20230814203406.12399-15-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: MWH0EPF000971E5:EE_|DS7PR12MB8230:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f47c070-c952-4c5c-bee4-08db9d065b05 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FkE3I1uRx1mqC4T/acFFeX569IlDdYQoyZcTc/IWqB74gUpEhBlbYTrHKe4wxtXt/Vl+sPljo9SgXuUyOJDxPxzfLMRybG3XhvrasTvUPVUEKMKKnPOThOslS4rEqSRukUcugnCu4hV29VnvO35oPT9FCANRwo7Jn9aiU7uONeABTIviEwGLliNeZxum++gPimSBl1Fv6ZaKk1Dw6sti11x+oaIAIDMF76Z1UbFC4oimN4MbRZy352F6Y0WKgjAL63rmWaFYdlDUJPwgD42uB9Xf3sxpnuntbMoueolKQEQZHu+p/srPvUKw8vNacut5zZq0Up+Nmp4Hpy+72zrKICWeJlnRB8FW3zp8mOQL7LREJzm0MECYtezN1ys9Qtb6qe/B4JeUoACubZRDNkj6jusNi3O4ru4xCFlCmHOUSYbNxz1inxifXOeilEp6T3RSrRDEVZEh87CdMC74J49VvAIrmzQLFjswoVDnpASFY6UKWRfS+/NomdNkJT5NW6pwtvc9hd+QmhUujspOPvnt/OWY5ygNqnxHST7dp4j+j1NLBwjtL/tgGgIgjCvlzH5N+skJx16Bi2x8CStB/tZBBqfM4x6ZAb1QMC5KPe9SngKicEpiGjTZ1nqixNcmYn0SEGc+20VbOepMHIC1x0Emm9qm+ICsyPJdiY5kjCYUfh0z+FtsBmz69gulFyAT8zRtRj0q3sbumHGOwT5boqtw4x1bPOUK4n3N9aeQjHWoG7VR/TlCyXptoGWWf/fxuDTV 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:(13230028)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199021)(82310400008)(1800799006)(186006)(36840700001)(40470700004)(46966006)(40460700003)(6666004)(70206006)(70586007)(478600001)(47076005)(36860700001)(16526019)(86362001)(36756003)(83380400001)(2906002)(15650500001)(40480700001)(426003)(107886003)(1076003)(26005)(336012)(2616005)(82740400003)(356005)(7636003)(4326008)(316002)(6916009)(8676002)(54906003)(5660300002)(8936002)(41300700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:38:02.4587 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f47c070-c952-4c5c-bee4-08db9d065b05 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: MWH0EPF000971E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8230 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 --- 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 b7dcc64cd238..c5abedd3514d 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -113,7 +113,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 Mon Aug 14 20:34:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353253 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 BD621C001DB for ; Mon, 14 Aug 2023 20:40:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230287AbjHNUjf (ORCPT ); Mon, 14 Aug 2023 16:39:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232607AbjHNUj3 (ORCPT ); Mon, 14 Aug 2023 16:39:29 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA7E810F7 for ; Mon, 14 Aug 2023 13:39:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YZfb+dMb2tuzNpa6pAeNiVcj1PPZOTtEjxjEYObogAId564bs0sb52E8Buf3PEpJxYg7xqdQdNb3LsuDW7r/7JKUcj3NuTrpibe1GfrfRneq+cjAeJ1mAQl2zcEjN/yQAcr9Szy2NkObXQ0RBaZ6XPhWUh8ehWxzyxMP9kihrfFVrfSOidhiV4A/OLFl4kE4heZRaUvGsHIhP94EJkbFNupp6YxpMYiGf8cRQGzdkPcfsXuhKKVTY+6+UDZl7u4viAlVOpTF/VQ7sK68GUOONokzKDHRGlQUd5USC6I5cqczjLc4GF7zElC/J+jAbOZWM79emOyEmQNtf7So0GhWoA== 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=yiI6U8wQcgnkhQB3bbIxE4I3kErVDwm8RWVfnjHWesw=; b=U03RUk368eqixTfyNIvvCAfchSogwNpXg10FZ01dpBnPi/sV5y1i4zGkJkA1SD5+O5Ch4N7Li3afdmTSsN4W766l4Ac3ieOBVfmcV5q1zz5IyICtSU8hTgClKRT520Sfk5H6+/SX8W1tIG05fpREIi0/vivlJk//A+et8kHaR6JnVGY8VudVEOl/cbYBEvkxKF2uSUHmLRq8HSwXptMhqRD2ZmykDgaxXfEWGER+Qqm3I1h0y5pToFiVsLQbsKzdpTRrktl/bJgKXxD34WOlULF4H3fRGdiKRMAwTBrN56rMr2aaGK0moq70CobVjKVmGKi+Awnt1jdNEwWxeXz9gw== 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=yiI6U8wQcgnkhQB3bbIxE4I3kErVDwm8RWVfnjHWesw=; b=X7FN5zRQW0xKlsLP/KW/UwB3c0Rh43NuLJ4skuYTKxQnkhXGUWqLouNGEL6gjO+fE36X6y0IoKhLeIT9OkaPQBPB+yS8XAXiezUqOBf97xuFXWZekvdEcLxdouhrFXITOXMygptJMZWEAaMXmwsWie4JRu8Mr7XxXCMQPPUXKMun0EV3Mj+wFOw+hok3CTRgwH/IdCj14N7DUL3DaA4D3SZfV+Rq97IqC/4Ay2ejTSN86ukSf8TIkd3DN9Oyq9sexS9HQkPLzN/nYETIUkl/vlXYaPtI9HPYctRNPyP91Qj8lnrTIaaAYG+n5NOe+76tjyAdR4dBb4e9LZCZ5IiOzg== Received: from SA9PR13CA0163.namprd13.prod.outlook.com (2603:10b6:806:28::18) by PH7PR12MB6561.namprd12.prod.outlook.com (2603:10b6:510:213::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 20:39:23 +0000 Received: from SN1PEPF0002529F.namprd05.prod.outlook.com (2603:10b6:806:28:cafe::e2) by SA9PR13CA0163.outlook.office365.com (2603:10b6:806:28::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:39:23 +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 SN1PEPF0002529F.mail.protection.outlook.com (10.167.242.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:39:22 +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; Mon, 14 Aug 2023 13:39:11 -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; Mon, 14 Aug 2023 13:39:09 -0700 From: Vadim Pasternak To: CC: , , Michael Shych , Vadim Pasternak Subject: [PATCH platform-next v2 15/16] platform: mellanox: nvsw-sn2201: change fans i2c busses. Date: Mon, 14 Aug 2023 20:34:05 +0000 Message-ID: <20230814203406.12399-16-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: SN1PEPF0002529F:EE_|PH7PR12MB6561:EE_ X-MS-Office365-Filtering-Correlation-Id: 46611018-e31b-4741-0acf-08db9d068afc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WHhWc/4Z7ql1xul5tGUGw+NUKK9d81W7sy01Hk0RwYeT9PL3Qce/VgkhMFtNCXJtnWniWGvIzAYSYc2Ze3CiGJrkuxWq97+wI7zyWX+KjXvl+x4OBDHVTP7nIFPk/+cKQpN536FeVndVeMnSEPkTGd05EpUYx9U7VOZcAlrkU/GB2euiopYOubXKm/jXVUOIkx7cbGQoCabLb7dvVHtaD8az6Rv/d044gYxeCfAYbA9DGJOgTLvxrzg5cMQOP0q3UdmeeUvw6gJpPHk0qgDT5GJ/snwqXCrqp37gVohulIDIxC5R+vFcI9EUwJ+xcZWzAXY+TcnNFPjprzw4F9slFMTIp36qZmZZELIrPpet6rYGbh0co9EPzTDLpDWg9Ww71uuMKbMXACnoBQrFt9eVwXEjpwSWB29xLLTtUoZdbr6xqaTpk6IK4kGG/6r7UjOmVg4LmNcskN2AXiA58IWaH/NsWjAMean/+jJC1l9DOo0wgVQy/w9BnCR0O2NKvi4VKS0ULJ3P3QjJzJdg/RYbqFATbFpJf7GuG9IfqH21GZW3+wrKb6n++nmiJ2caTWgnIS/N1jcBwz83THG7iM9XZ5ViILSO8I3MKsiDmvctwQVEh3ju0/bNFQYk6zRR7LN17lzEIXEpKQfQGaAwolaW6gXuy6jjZfbp3L/k47/iQbBMT2s89ohp8abr3h+N9386/kH7xqPu5sZTf+ExUOkpQ5CTEunc4gleJk3iZPAu6yvgpYuQemq2K6CMEiCtPBi4 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:(13230028)(4636009)(346002)(376002)(39860400002)(396003)(136003)(82310400008)(451199021)(186006)(1800799006)(36840700001)(40470700004)(46966006)(36756003)(5660300002)(86362001)(2906002)(40460700003)(40480700001)(83380400001)(36860700001)(6916009)(4326008)(316002)(54906003)(70206006)(70586007)(41300700001)(426003)(26005)(16526019)(1076003)(107886003)(2616005)(336012)(47076005)(8936002)(8676002)(6666004)(356005)(82740400003)(7636003)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:39:22.8945 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46611018-e31b-4741-0acf-08db9d068afc 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: SN1PEPF0002529F.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6561 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 --- 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 Mon Aug 14 20:34:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13353254 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 3F08CC001DB for ; Mon, 14 Aug 2023 20:40:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230518AbjHNUkJ (ORCPT ); Mon, 14 Aug 2023 16:40:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232626AbjHNUja (ORCPT ); Mon, 14 Aug 2023 16:39:30 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2047.outbound.protection.outlook.com [40.107.220.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19575171A for ; Mon, 14 Aug 2023 13:39:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hqwuUVDzuQH/I9e+VKTUAQlAcMgbzdM6xXIhKgqUBdC7aPIrZIL5EdniuzzLRD2pHVSzGPOeHbh3f7FG/+UHQUKKZoxyEbgG0Uyb+qwxM4jl44PzyP7NxLKF63/8SocIhfWbvz+/JPdcifZNYtaHxgZicm04IGxJgs1eXdBr71w3S4BGh3pWOXluvPB0RdOK2WtwJNpJqyX6+r6pDpXBmUqO5o/poEUoYobhnHoyV1q0BKCWkv0kAael+sMwd6KacbniFPtSH48sor9UbMGxgRLNOPdtbf9oGMhr/yk1IVxLv+U7LhEteZFMrEMkMpE8BQBizO0RZF3rij3qFiHxaQ== 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=weOk10MDBUQYhj0gbqxOz2vJzRheG88GF4qAUMkOjcY=; b=U9bteyAfKSMsaFBCpt/mW7YWqWea0ft+cvIlFAYrFwWwyuTO9ZZATmgN/gdf7U0HuxqW7OvVzg+NVGdZ6KyKUJPKRJZ9DwKluApjwDua90/TzN4gcwQ9MkWzvq0pfA9GajsjD+HOeNMVaCgrcjqURCPNh7YJhUlCAW0uP5j5CZzvcJ9MJCJUmTRj+PrtcgGyKh+K0ExT+b8wad0iWymPzkfMGeSUX+YjxAFpuEFLC0vsnjulSSABitp51fstdE1MvuX1gwnkrREz4zWbSF6fJZOXaM7GyUUN9LcZ7hGqB0LmwKZt30/vt/lqHVXJkWZkKUabi356zTyoYK5tAHgtSA== 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=weOk10MDBUQYhj0gbqxOz2vJzRheG88GF4qAUMkOjcY=; b=Pbg0b2q2dPwqhpkS54wgRPCF4lcRTYx7S5EIx1DW++/6sfD8/oaFbyCNCWHiaomp3UN5g4HT9tLfDRzSv0ND6zjQ/zKl6wHExk5zwfPJXc8wuuuUgNtzxs7IYw6rQLNsarOAYs8BGDH1InNP9mqp/2qc+K15GVN+bmTJtgrUkbfWczW1lcjdzcTbJ3QVTeY21aPautZBzFF2XwOhUu2lgRoLCyKMlnaqBNigl3G2ZkgbgzDxISGr56XO1YOeB3vQmsiG5VCviGCQtysflRev4WMPdAgaFkHRECuYsDYoKw/wWaCEYHMfQ7mFmi4M6EDZM2PiGKi0IGEkY4zyzpZgGw== Received: from BN7PR06CA0061.namprd06.prod.outlook.com (2603:10b6:408:34::38) by PH8PR12MB6892.namprd12.prod.outlook.com (2603:10b6:510:1bc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 20:39:26 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:408:34:cafe::14) by BN7PR06CA0061.outlook.office365.com (2603:10b6:408:34::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 20:39:26 +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 SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 20:39:26 +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; Mon, 14 Aug 2023 13:39:14 -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; Mon, 14 Aug 2023 13:39:12 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v2 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces Date: Mon, 14 Aug 2023 20:34:06 +0000 Message-ID: <20230814203406.12399-17-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814203406.12399-1-vadimp@nvidia.com> References: <20230814203406.12399-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: SN1PEPF000252A1:EE_|PH8PR12MB6892:EE_ X-MS-Office365-Filtering-Correlation-Id: fbde4f03-00a8-4201-39e8-08db9d068d0e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aoI99PQC0ric2hoP2K0yqlw6wRq2yw53fdS0KDu5bTHAeotF/zYxxOxVNJ1Z+4MtovvQroVN50Sjtw2ezxncKdc06xxAkhCuT+YU+2TH9TawaZaXQq2n1gGdblg3jQxqElJKzJLEguiHWF1vt3R19BbOsxZAlmF9cAo5kwLPKqYpzFtb9UZr7FWR9Pk3yNYvMAh+n8EKnjyDVEeMiLsBoUw0gQhmX4Oxw2YpI+/7uMjbRGH3X2y8RExh+AjcgS+2AgfEFgDh0PN2CVK7/3fXAWlKlToczMgTrVnJmuvakCunJ4Cr+f4Myc91N0iHacjdPDyezOSk4iLjOWAULi3cIyTWJoFe1eRv3cspma2WW5MTBwkXAShaYE2b3txJC0/gGU8frqxkc23M8+f7GYbYY1YO4TKYsrWF0SQw0kk/X+B7vDzbyoIuu5RiaMTQ84yNAr02ok7/cZd4ZaylA1VLDavwJcUI59uijFI1HvGyPs9CJf4DU7PdH58wuq544pcC2VOC0Lf2s0PePdDADNf5hHnHqyIpxO5nKB3zjFrdI/kPWhaX13E18Lp0AB3QmV7OJiGtxO60sS+023Y9XbL0xVNHeDMRdJZdYjurFOellMGntJsvfpQEj1S2qL6gInCTMPSPQMo9XzB4nVlIPsWzcZxYoO+gAWUJ97CeN7FA4Pc9/J1mQmVElGN93B6cxtct9Qqa8ZxLk1pmLTSbUBv4rIE6nnC9VZTwUjGpfC9kgqA2ksWr+7Da87aGZ2XpKWc1 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:(13230028)(4636009)(376002)(396003)(136003)(39860400002)(346002)(186006)(1800799006)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(83380400001)(336012)(426003)(36756003)(47076005)(36860700001)(86362001)(40480700001)(41300700001)(82740400003)(478600001)(356005)(7636003)(54906003)(70206006)(70586007)(6916009)(316002)(8676002)(8936002)(5660300002)(4326008)(40460700003)(2616005)(16526019)(1076003)(107886003)(26005)(6666004)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 20:39:26.3535 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fbde4f03-00a8-4201-39e8-08db9d068d0e 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: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6892 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". Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- .../ABI/stable/sysfs-driver-mlxreg-io | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io index 60953903d007..633be2bf2cd0 100644 --- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io +++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io @@ -662,3 +662,45 @@ 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.