From patchwork Tue Aug 22 11:34:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360510 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 53AA6EE4996 for ; Tue, 22 Aug 2023 11:36:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234801AbjHVLgm (ORCPT ); Tue, 22 Aug 2023 07:36:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235004AbjHVLgm (ORCPT ); Tue, 22 Aug 2023 07:36:42 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2040.outbound.protection.outlook.com [40.107.102.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BBB6CD2 for ; Tue, 22 Aug 2023 04:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g4sbBo6dAKbvxh6Pciy9h7ajY9uA1riS5XXFRwbpI9nz3vD0UCc4WwsoRPEbf50DNDw+UwxhfFO6vyDRQJiwQAyj2O5lWAGPq7Dp1yoCemcMoEKqHLAQLDS1vLmxBBpWvdDHn8Rpvkr0Hr5l6+ZWy4AnBl1lKGd2rlRACSrfF+j7N4pxciShl2tcbuV9q0tPvUgffvwogfClQ1FjZgVNPQOr/HRqarAsskg5I9+6Ryidd3ImnFaQTkVqEqVFLUFoHKTMEeF9TXx74ohmZa2YSqhNQda6qXfzEMwhg1BrXlkacj3T1oZMa9YeXHvZj8A69prYUBcxfTk0r6sjeMOk0w== 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=tQPMzLhnLkv8wAiENCqlSSvYqlkNiqDypwFOEoqY+Mw=; b=AGKYfHQJ1NvvJLa0/O8JKXIOO/BqKB0JfZ159KDTdEVJkNCqtunBK7EY7TG07hFwVEiF44AiRTqSSfsQflQqAPlNfdOdRGM1QL/aXooGM1T+WPdtXgs6aCkgUaDl4bGGsN0PgkobDlhSs9xHtsopuadTD1rfem9GaSTUmTBR1+bMx3d0/sj8mGHM3krAranrJZB9bJBitnPkGEOeHHoaB0GY3l7r2ZxsjWaRy183AGFEXpjz5hFoNijsqKJMoJthE0s5NT3wFdNmXpOAuLEQdU/UBhld5ijsV7Tf2kFE8hzeNjhtpV9HCI0ISoncclFbIApzuMKYJpZU1kuNTqGfDg== 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=tQPMzLhnLkv8wAiENCqlSSvYqlkNiqDypwFOEoqY+Mw=; b=DVAV7SV8Rag2F9xgMax6QvdXSlMEXpmNWRvv6rLhdd1bwqAscufJu4FqZ56BCpjVsSfdIXT3mPUZrM8isWU1tZAj9jTwe8eQ5IAsXUxnldx0YgDIKnvav5XMcpc1sdghdoYYDJ1O/+/JSvCDZaPyTBv0mpSwfAUD2O38ZW2yYaDonUI/YwEWybaHLO5MXG3X61/LXP1VByHyTao2SQTvfDgIWy2XvdvbQORPU/O63fyqlClFEADcveb+7FTKgNNithre1LWuV5cPRWNB8mIh25K5OinFpNMj4YIWpldCjOrSzyWiFkYDqMDLwSMAUiF9ik1Z5zPEt7/SGYTxw/aNsg== Received: from DM6PR03CA0003.namprd03.prod.outlook.com (2603:10b6:5:40::16) by SA1PR12MB7150.namprd12.prod.outlook.com (2603:10b6:806:2b4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 11:35:26 +0000 Received: from CY4PEPF0000EE37.namprd05.prod.outlook.com (2603:10b6:5:40:cafe::7f) by DM6PR03CA0003.outlook.office365.com (2603:10b6:5:40::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:35: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 CY4PEPF0000EE37.mail.protection.outlook.com (10.167.242.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:35: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; Tue, 22 Aug 2023 04:35:14 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:35:12 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 01/16] platform: mellanox: Add new attributes Date: Tue, 22 Aug 2023 11:34:36 +0000 Message-ID: <20230822113451.13785-2-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CY4PEPF0000EE37:EE_|SA1PR12MB7150:EE_ X-MS-Office365-Filtering-Correlation-Id: bf819432-a3ad-4d40-6e67-08dba303e128 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ugozOyzlcGK81cFy1iV9PtSBN5BApuLsLXojH28kftF82hGx69+m/pvgs/y3A595CD9XOspw/BTS2LNhximsJpUILuOM6aKnJRPqsB/VNWcD/519C8Is6V4YDycII5hLoovKs59+SjtprZKzgLLkeJXRyNYYCDdUMg+/3uTbTYiFwKdUZcQSY5c6GzigP94Quz5dLzhUUZZlK+lq9Joh1TpA8DSPgEneoqdBAl+044hNn7Cd/kH8SXQxbk991yfRLbjsNW67m8VJXzQZNmLAcnySz0SIee74wMXS7GzdOEIdPEHJrmHutNI/4+kM9QT58hQqPt5+Haxz6h5hQemSzd3BX952W9YsmqzbjwkBpXgjuQuLp8AjS969Rp4D4srhOsLFezzmhVPPZYtyUi2xO+qdsgPq1beM7nUUNFsU+a3rgbeBUGFEluhx8NmmeaxvzBVO1+1f22f+erhjmErnbu5xbhLXk8taVdM9fsGg+MoPdONTeFQdodIFi6zhEdAUWVDoJ4qJW1QME8BhqYErM6wASdSm/bqQSMUQfJj74WBfjW5pb7YJYYZpCFXwvlvHPpgBjw96CdAj5kMQhwqKHDZr04tuI0ZxGV8YRP9LaItg8lyCSQxFEKdrA6klxQ6Ap+O8qtynajZdEEPtcHxXnGKomZmJPlE+tCwaHfTJipxdm/+pTUcxABGAwvYrSZgpmv2F+jiSWsfdZEnPhC+I834508+lj4egvz65pB442N2utX3cASUUcgs9qsolF+ev X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(316002)(70586007)(70206006)(8676002)(8936002)(2616005)(107886003)(4326008)(7636003)(36756003)(40460700003)(41300700001)(1076003)(82740400003)(356005)(478600001)(6666004)(40480700001)(83380400001)(2906002)(86362001)(47076005)(36860700001)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:35:25.9559 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf819432-a3ad-4d40-6e67-08dba303e128 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: CY4PEPF0000EE37.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7150 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add new attribute: "lid_open" - to indicate system intrusion detection. "reset_long_pwr_pb" - to indicate that system has been reset due to long press of power button. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 7d33977d9c60..26748c285ddc 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -3792,6 +3792,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(1), .mode = 0444, }, + { + .label = "lid_open", + .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(2), + .mode = 0444, + }, { .label = "clk_brd1_boot_fail", .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, @@ -4431,6 +4437,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_chassis_blade_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(6), .mode = 0444, }, + { + .label = "reset_long_pwr_pb", + .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(7), + .mode = 0444, + }, { .label = "pwr_cycle", .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, From patchwork Tue Aug 22 11:34:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360511 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 A2608EE49A4 for ; Tue, 22 Aug 2023 11:36:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235010AbjHVLgo (ORCPT ); Tue, 22 Aug 2023 07:36:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235007AbjHVLgn (ORCPT ); Tue, 22 Aug 2023 07:36:43 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2059.outbound.protection.outlook.com [40.107.96.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DA0EE55 for ; Tue, 22 Aug 2023 04:36:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NKt6n7YnPuG9ZrodUgcIJ9LUfgk+AzMNjCbJETms/4S3QFMDnth0wCzTjzjmYEYjrm1ULBKbx/gOB5sqD72f7G9flEkgwGdQboXM8WounY4fHd1Vo3xP+xaU+XeRM2vU60QMubjF4ZBWUnU8WcVTHrnBTnVrPMRIXhfVublbqQ75p3bsnO8gHoHjtnUz/yMBQrvSa05+bTRzlaLJehoyg75eYMHORhXSDSWVy/8xXU5faxryTOwHwo4tjXDFEr0wrzxLZGmsdMg+bYrgwvre1vskOD1bcDTkdhqhBx9oeBDewpHfluOXjPocyUBYL9v01VD0MFZIczRHCk5aIqgZWQ== 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=EYJcvvO5z7mtS4Aj+peji7SInmO4y4qh9GiO0d0Kqw8=; b=QOzmTqdH6jlQbqNYgs8+jM2+OKNbAVxXZ0WglnuGxAI/flLN1pKGWid4C7XTBqKz0MHF23NGBx6LInzZ75N1BE3W08LSQ5ygvPA8w01VnYBvDJHp24xWuoZp8v9fr69MDX+h0yYvoI2EshWdQmGI9YCIj/nQ0uv1ZAEQSj4OepMj6rCBKP5le3Ku6ekxPnC0KPOyMKCArhrkSHJprkiIVb1c3Eyq6Xh6AMu01oLA2Mr7unX7Wn3zSFHi9d7ty0L5U9oeI5gMQx8eKROLxDL98mCfq9WgdyiLkxezIQnRZz0tRoi/LgZ6K2gnyQeJqhDvnzLqvvBlCPG/ILzw/TOCYg== 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=EYJcvvO5z7mtS4Aj+peji7SInmO4y4qh9GiO0d0Kqw8=; b=e1clBn+gRNWmDmHTJtMZ+L1TO4SISSGjsXlD8pyatVMBIRfaJ1g7uL6NtFfOrRYS9xiKxt2X1Nfu6txcpRXdtcQmzHuhTtDd1AGlc+ViuYiClXzgNFyu63bwRHca3VsTdMfPmjiN1rfbipKyRxFDdsU77UTAe7Vm8g7NSdguN2gVVp9gMqJtgl1FWdEMUHYh89bNgqO3taI+35FrQDlui+Od1LTVF3hv95/G2zRUzf+30EAStzH+uwgUXNg/zccl+PlunAC1vKilvANqvtmAhnHbZNde4G8I9YLpLaKMPkhVmFxm7Ru6Za1W0Tz9WRR5ccZEmZCX8gw88gdo+Jy+Bg== Received: from DM6PR03CA0023.namprd03.prod.outlook.com (2603:10b6:5:40::36) by CYYPR12MB8924.namprd12.prod.outlook.com (2603:10b6:930:bd::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 11:35:30 +0000 Received: from CY4PEPF0000EE37.namprd05.prod.outlook.com (2603:10b6:5:40:cafe::9) by DM6PR03CA0023.outlook.office365.com (2603:10b6:5:40::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:35:30 +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 CY4PEPF0000EE37.mail.protection.outlook.com (10.167.242.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:35:30 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:35:17 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:35:16 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 02/16] platform: mellanox: Add field upgrade capability register Date: Tue, 22 Aug 2023 11:34:37 +0000 Message-ID: <20230822113451.13785-3-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CY4PEPF0000EE37:EE_|CYYPR12MB8924:EE_ X-MS-Office365-Filtering-Correlation-Id: 501adca0-c2ef-45e8-2aae-08dba303e3ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B9qHfpA8ErHFIXtWukfirXfs6qBVJNOE+g8WH7zeGei/cVKMR/KgBiVNACZgozAQpHd/ExpZva2EmDgxAY0MImwMjWJkL9/wo2v/2ZdrUaNGLzhN1l9Lpd8Krpd26ILZiyXUTo6SCF++HBzI0gE5i/6pFdCvHYhr5dLvaXfAKsIJuaBYYpH2VyT6zqU7E3qK+0nNAxzdolvI/jQXadV+Dx82wWsu8yRgZ0NHweNYxtgsnfUA+YlqsUJ+CyGyc0cq39jlVqdkh3ELAeWQ0bBnOVhxIdvFCilexYiMUorJZgkn7hJfrEEFFrfvg6R0DSTYl+yyMWsbF/8tH/UmlC5ze0sUK4iwopbyRFQ66WECmC7A8O00HLMVaeOI/Ox/P4TmijbW0x+BGL34PEEbRPyly7cakfAm5nsdeAfLRUOSzRKhZFbH4qQh07IzX/EBhj1CT7Ti8iWq+9UfFRiWVf7dU2xucSVsQlmjhdYHlSCHmTcT0FTSf8eJr8GCj6LauOTuAgCT5hmc3s1EyJDTMLFz5Zdr49+t1XsE3Z9BM0elQ6cvSVa8CzMjR0bp2aOnLYfs63oOnAesoHPmlQOpME70XCNZfuIs//FrpSSAUPVhbrqKidYGH8kCNOhccQYaXNsNsVyz3OXkeoB2yW3gL57WK49MjUVvSViS1M27SpJ1EDLw+AqZVc0VQIi/0hO0rClnQXEi937rME7/v48o25e4p1ldTlhDhZJ6Ft5s/bo8V3OZgehnGcwyron64V8I6eHv X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(316002)(70586007)(70206006)(8676002)(8936002)(2616005)(107886003)(4326008)(7636003)(36756003)(40460700003)(41300700001)(1076003)(82740400003)(356005)(478600001)(6666004)(40480700001)(83380400001)(66574015)(2906002)(86362001)(47076005)(36860700001)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:35:30.1903 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 501adca0-c2ef-45e8-2aae-08dba303e3ac 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: CY4PEPF0000EE37.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8924 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add new register to indicate the method of FPGA/CPLD field upgrade supported on the specific system. Currently two masks are available: b00 - field upgrade through LPC gateway (new method introduced to accelerate field upgrade process). b11 - field upgrade through CPU GPIO pins (old method). Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 26748c285ddc..647a10252c2f 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -62,6 +62,7 @@ #define MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET 0x37 #define MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET 0x3a #define MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET 0x3b +#define MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET 0x3c #define MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET 0x40 #define MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET 0x41 #define MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET 0x42 @@ -236,6 +237,7 @@ #define MLXPLAT_CPLD_VOLTREG_UPD_MASK GENMASK(5, 4) #define MLXPLAT_CPLD_GWP_MASK GENMASK(0, 0) #define MLXPLAT_CPLD_EROT_MASK GENMASK(1, 0) +#define MLXPLAT_CPLD_FU_CAP_MASK GENMASK(1, 0) #define MLXPLAT_CPLD_PWR_BUTTON_MASK BIT(0) #define MLXPLAT_CPLD_LATCH_RST_MASK BIT(6) #define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3) @@ -3680,6 +3682,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(6), .mode = 0200, }, + { + .label = "jtag_cap", + .reg = MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET, + .mask = MLXPLAT_CPLD_FU_CAP_MASK, + .bit = 1, + .mode = 0444, + }, { .label = "jtag_enable", .reg = MLXPLAT_CPLD_LPC_REG_GP2_OFFSET, @@ -4935,6 +4944,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_SAFE_BIOS_OFFSET: case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: @@ -5046,6 +5056,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: @@ -5203,6 +5214,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: From patchwork Tue Aug 22 11:34:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360513 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 B9A34EE49AA for ; Tue, 22 Aug 2023 11:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235012AbjHVLhB (ORCPT ); Tue, 22 Aug 2023 07:37:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234809AbjHVLhA (ORCPT ); Tue, 22 Aug 2023 07:37:00 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20608.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::608]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 973D3E73 for ; Tue, 22 Aug 2023 04:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mPTVw/etwisNdw+DVJ1HtVQQNePWGkRJxfwWIfDgqHt5/gk765p0qOUC5bxP0lBhZtTZO9ZaWqRpIexWQT1s+WL0wsehJvkvPmqRF2tyK4sOkOodSEc7+Ry3CJuhKRZEvQCwoJJR5xTqWN4cBENNbaKkMhf8IjaeMmQu67ZZBR1hK1E9Ck4OImYyOc79X+NvLm954soWquxDYPcGNGrIyOSe7jzWV1iMw1fzwSGO0Qr2518BJYOIvp7agZGPr9atmLxCvMPdLuJ4N1PFlnp+87hwaAcLihxm1fMtvaNyYO8B37zrl6awojbUe5WjkWwExo5pHS80lQBoJMdndN2EgA== 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=QhsmHShZVVLGS2kZ8IAd80RFBg4z6xPoLTucVxd14vQ=; b=GYuSnoLuxvrTslPEK+37VnPxDK/PX3d22oD+RyST7RDEM6joVD6/WQUYsGOWbsYEOD1Z+oCh8v5PsexjgG0m+NV3l2p8vr3V9WaUPPVNnLDZb3Kh00vhR+qcSSYcGsGwdDK9OY1rz/2mr7rXBi4burqtOnay82PLTOp24glTp4HuVxCxi3UYNp63nKxqof10m5IJsvtyci3ZMZHfDqH0sl5uAEUpqNlSP6e/VrPr5XhxbLumrtOJP3moMROogditDg1180J31U28h46Mgg+hLvYGDQgXcqsaqMtz6rfLL87U8J11e7e11UOra4m0rLgKbostnv/HUGWz661FcBjjDg== 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=QhsmHShZVVLGS2kZ8IAd80RFBg4z6xPoLTucVxd14vQ=; b=WKgG8BP1QORtRLmYnI3JUcib+lJg+x7z7dIfzMYIXCNn2WgMezNRjfHEron/p1HG6+FACTeSwL9Zyxe/63z8RupwWNYvQqkqcB+YDdXL6RV2JTy4A83+SmwVF1x5+nTbrspeBkrdYfgZ+0BZNJauSnhePn20oiVSdcnauGiIpYjrtPyFkt4v8a9m7WVYc9q3dFa1VZfuGPWNiSr/7lYk0Xdg1H9HRvjfuHlx1fGG4UfI+mkaHhZ4oLFMOJJTXraGrtlfxX3urxfYc2NIukkXLCLdSKaBpskPwV0Gr6JhLSsbLL0jM15ey+CUm/y8svZGtunGhCyFCCkVBF14wt0O/g== Received: from CY8PR11CA0041.namprd11.prod.outlook.com (2603:10b6:930:4a::13) by IA0PR12MB8864.namprd12.prod.outlook.com (2603:10b6:208:485::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 11:35:31 +0000 Received: from CY4PEPF0000EE36.namprd05.prod.outlook.com (2603:10b6:930:4a:cafe::15) by CY8PR11CA0041.outlook.office365.com (2603:10b6:930:4a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:35:31 +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 CY4PEPF0000EE36.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:35:31 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:35:20 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:35:19 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 03/16] platform: mellanox: Modify reset causes description Date: Tue, 22 Aug 2023 11:34:38 +0000 Message-ID: <20230822113451.13785-4-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CY4PEPF0000EE36:EE_|IA0PR12MB8864:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d5f9831-7abd-4c01-c3f4-08dba303e45f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NNmdU7ba+rDGnIgy2DVJI3OGtjhI+u66WY3aDyFbleQYGwapdCSVtoU1IXggC6Oj+XPII5fEK7ZVNBzogXwTO4sjyODVkKfnMY5+mlWtLnbRo0mwqjb3Ur2meVAKi0jo1yNNh7YcdZNMFz4hxLIeuKlqgQ0OhKto79gDOPFlZeoh1SKaUNSK6wQ6HAl1r5gCAOraaG8YjJrkbf26AcJb/tAorHmeAj3mELGT+nqi5j2gGdC2uxty9Rt9MnWn9BkXeEnRuhdOGB/XbiWdWK9I7hhi4c0XUTrOupeUcu9s+XaiKaaCFk/9tXJ15RsRmToPh7OvTTQD5as8HQW5uYmW06cP+jjUl4molAKVV/Q7Viz7yCjPoYQ/vmUpZfff8Xu8TsyoS9czkD8gKE0AkgHxzT8inZNZefMJC6dXGi2aJgVGdznzkdJ2SLu0eP78ghmNMNw9sQy4u49wIGpj0zcdHanPyIkY/x5Eja+IrvTkyhqMwgDbtaITPL7zdcZG/C+h6mks8KXRIMgn+UnyBWDuDletdReIcjaQ3BOA+IrPLBS4BD0zDJkgTbyUGrNvy81/po/O1K0qMtx/0iKuw0vBUKbw72+aLcvfkERzoDzVla49bEqb9NURrzUD2d9QSfMO2Jolgp6a+Vun9ikU8n4JqD9O50pW6n0l0+2XKo8gHFRNQQ/40rqG8teoi0rDOpAhJV6eRb0XC61S6M5iCqTPCYmO8f7vBNoMxRwUdfskmqViIk8AwyNLNONz6fd2jQ2G X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(39860400002)(376002)(136003)(396003)(82310400011)(451199024)(186009)(1800799009)(46966006)(36840700001)(40470700004)(83380400001)(2906002)(40480700001)(5660300002)(336012)(426003)(26005)(16526019)(36860700001)(86362001)(47076005)(8676002)(4326008)(2616005)(8936002)(107886003)(70206006)(316002)(54906003)(6916009)(70586007)(82740400003)(478600001)(356005)(6666004)(36756003)(41300700001)(40460700003)(1076003)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:35:31.3830 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d5f9831-7abd-4c01-c3f4-08dba303e45f 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: CY4PEPF0000EE36.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8864 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org For system of classes VMOD0005, VMOD0010: - remove "reset_from_comex", since this cause doesn't define specific reason. - add more specific reason "reset_sw_reset", which is set along with removed "reset_from_comex". Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- v1->v2: - Comments pointed out by Ilpo: - Fix misspelling in commit text. --- drivers/platform/x86/mlx-platform.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 647a10252c2f..5b0579752afb 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -3556,12 +3556,6 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(2), .mode = 0444, }, - { - .label = "reset_from_comex", - .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, - .mask = GENMASK(7, 0) & ~BIT(4), - .mode = 0444, - }, { .label = "reset_from_asic", .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, @@ -3580,6 +3574,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(7), .mode = 0444, }, + { + .label = "reset_sw_reset", + .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(0), + .mode = 0444, + }, { .label = "reset_comex_pwr_fail", .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET, From patchwork Tue Aug 22 11:34:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360512 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 2EF97EE49A3 for ; Tue, 22 Aug 2023 11:36:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235007AbjHVLgz (ORCPT ); Tue, 22 Aug 2023 07:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234809AbjHVLgz (ORCPT ); Tue, 22 Aug 2023 07:36:55 -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 4A413E56 for ; Tue, 22 Aug 2023 04:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IyG1hdmYwuv+Mva9D/LQH56TrcdHL4lFB6T1T7hFMYfqf6HWp3JouK/INOHiBpJ6R4bgEXstq1M2inHIQqSkbaFZ5wRLcDtJn1L85Btp6kwke/F5BjiTn+GgneG5eRjFtIN6A34JTsmFoTSvbj2Nx/FmQJUhjrf/t9ebE/vb8cBMfr0lUH+F5IVuLcyUQd86n6FQhbUMqJvJsOfqzEvq8O3DLEKLYHkfh/E7wW8AyBm101yczDAYw8IE54jV/mvR7bNLk8+G06ci7crCqNouxyGTNO3xZB27bq4Cyl0Q/T152d0+habkwSOYsLjhY55O6BS2a220CJKw30aXiWKVZg== 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=jZ7tEdcS0W7+vtocGTaJY/mgcdAIwdxJgcpY/YRFaoE=; b=G3rzrVtQICmfyuD7F/VY5CF5+WEzpdOU2FF+Fo7CN//ulUvSE5UPMM6/i+6EjgE8UeqvbSnc7qO8rxlNda8BqFZeeqYO0vytyF1JTc4sOyIEQ/GVaAIyyZS//2X05wqJ3bAgZG86TY3uXAUW1dJJxSyp5lyNVSNNUU6nhQD/bCGDL1uf3B3S5WVcKXNVJRVEeeGnNI3yij5Kd0j+gZwHGlZsC/NWcbyF+m06Ulpix8HvVAorMurYNvsQWS8ubRD6g9A7kXFLVnOZZzRC8L4oztv438GN2LHp5F/YC4J2epwhlZNduMW2VHwbkCluAL5piwpf1GyTgacr0o1qZNlppQ== 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=jZ7tEdcS0W7+vtocGTaJY/mgcdAIwdxJgcpY/YRFaoE=; b=kTfnHJz7/McOAaX8csG/K4LMeW0BVhoI3aOM7lt0MQth/nxI43mb5HrmPgPc+JkxRfLWRUpDUU+/MvY8Tczos42mtfW0ARnQqfy5cMJzENwVTMXFFg1AvSMmfweHE8zJUArmXqmpmVoMMwnya1TXQBz1jNS9mFCRW6W3GqjSeMktgG4hfvbWi7g4giRfJpCL40qjg74Yw+vQzgA/AMuLLyd4DaI2RnzNVoawBdWGjBBS661AqT1Op1C1lWmHMhTkcAQoOBpB6VyULerb7sDpX5lOKmYregOz6Lj1Il2o3yhfewaM7wu40Z8PDTHfUv9xg6TagcXbd72wTEw0slP1Sg== Received: from DM6PR21CA0017.namprd21.prod.outlook.com (2603:10b6:5:174::27) by MW3PR12MB4490.namprd12.prod.outlook.com (2603:10b6:303:2f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 11:35:37 +0000 Received: from CY4PEPF0000EE34.namprd05.prod.outlook.com (2603:10b6:5:174:cafe::e0) by DM6PR21CA0017.outlook.office365.com (2603:10b6:5:174::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.9 via Frontend Transport; Tue, 22 Aug 2023 11:35: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 CY4PEPF0000EE34.mail.protection.outlook.com (10.167.242.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:35: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; Tue, 22 Aug 2023 04:35:24 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:35:22 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 04/16] platform: mellanox: mlx-platform: Modify health and power hotplug action Date: Tue, 22 Aug 2023 11:34:39 +0000 Message-ID: <20230822113451.13785-5-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CY4PEPF0000EE34:EE_|MW3PR12MB4490:EE_ X-MS-Office365-Filtering-Correlation-Id: f4eb0af1-8fd7-4acc-1c00-08dba303e7a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VUbfNsX2T7c1oqHXTtfnRXybwB2qgs5k5Z47W8bdTHsZaWIoX8S1hPBoKEFGJAufxwbj0bQrLqKp/WtuJYqFNVhzC6wf/YeqbzhfSwi7oIUqr2uQY9kX7X4HcQglj4fXrromiiOD+Ao9B98pufWhS1LLxH5R8ZzVlIg5bo85MTAXzozidtMW+F8XfYqaIx8hkpICf6j0bI8hpER/hlbmDn4sw7YT/XAU1sldeiO7vtmi7MU0uXhg4UIxV1Ba8NPrUlfQqguwz3+NGmvVoUNPvdDQKL2tuCZ5xoA3GZ88LrVtKs5BB+ioY3cbAuzUor7Dq6r+W5wbPZZreRNLa6zwtDQKXyyYFWKNv2FevGpOHlvsKzHbHChncOllb6vKn4s24Kl/RLIkHnY2KWIPZqTDKIOnNte9sd8flsHU/tbxrLFex9Co0oNT4/3EHt0EJYq7dBibBiQxp26HXiC7gBmaMnea7mfckHbgMpQUl7INY7qJ7mqV78+WAvmBzhYlXHcUMCBGBA1JD+w70ZUJafwm0p2s0AKN6frf9odJG7mDnBTX/S/eZz+3FY4EaAoiebtYtwV/6NwqRriX0iyuXiZsdZnSu++bY3+/vHgRZhYByqFADzJK46Tou99PdRk2ZUYvqD+3St3auEfVCUMGm8TgDzFcnimokWYfvB4xvPLOltDBYaZY9vQamHl9B7uyrVbUCe2Icf456ELq8R+e/bSOitT4sSasYg4hHW1PHtMg5BY3JSS9OQF0AChLyFI0RDDuk8jBFrF8eRWaSonoKqbFWA== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(316002)(70586007)(70206006)(8676002)(8936002)(2616005)(107886003)(4326008)(7636003)(36756003)(40460700003)(41300700001)(1076003)(82740400003)(356005)(478600001)(6666004)(40480700001)(83380400001)(66574015)(2906002)(86362001)(47076005)(36860700001)(336012)(426003)(5660300002)(26005)(16526019)(40073004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:35:36.8550 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4eb0af1-8fd7-4acc-1c00-08dba303e7a5 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: CY4PEPF0000EE34.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4490 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Set explicitly hotplug event action for health and power signals for L1 switch as "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in order to allow processing of notification callback even I2C parent bus is not specified. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- drivers/platform/x86/mlx-platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 5b0579752afb..648b27eff0b0 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -2373,6 +2373,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_pwr_events_items_data[] .reg = MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET, .mask = MLXPLAT_CPLD_PWR_BUTTON_MASK, .hpdev.nr = MLXPLAT_CPLD_NR_NONE, + .hpdev.action = MLXREG_HOTPLUG_DEVICE_NO_ACTION, .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_pwr_events_notifier, }, }; @@ -2433,6 +2434,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_health_events_items_dat .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, .mask = MLXPLAT_CPLD_INTRUSION_MASK, .hpdev.nr = MLXPLAT_CPLD_NR_NONE, + .hpdev.action = MLXREG_HOTPLUG_DEVICE_NO_ACTION, .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_intrusion_events_notifier, }, { From patchwork Tue Aug 22 11:34:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360514 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 DC4D6EE49A3 for ; Tue, 22 Aug 2023 11:38:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232198AbjHVLiy (ORCPT ); Tue, 22 Aug 2023 07:38:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235341AbjHVLiU (ORCPT ); Tue, 22 Aug 2023 07:38:20 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2061d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::61d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE78B10EB for ; Tue, 22 Aug 2023 04:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a0R/zh+BhL+jfijD820c4K7IJezn4mbsZeayvG2GLT3+MUdSJxQTb5UOHdwstF1bgCwztA1jBxKZMVq8xL+lbFb0qtnUrzWbTJCAW4QhpVesa2R990meyjbhCtjGfmq3cKtQa5/wInuXNp3S7FcB1MY2imvecT+rkUQgMU4rtrdrFot67fjiM6BGgshxe9sj1Q3kD9pnriZEmYySYncPakRsxUCR4Ty79b97K7XACTlh0xSdsuJEuNbIoQsly76e4wAUcHqT8rNRb64CRYKHNzBXaPoOEUcA9s8rg0zg9RQ2SCvHvFu14MUOS+A1tTUN9E3Ya1+VrAJ9kx3K2K6VNQ== 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=E4yNlCOriH9zVe1v4p0DTxg4mvO4Mr6WJQPA+/WIcpQ=; b=aRWw0AZ54CpBFwL7vGmbyhWW5tzJmtvUZl3pYFKEkbxM+fB/+Fk7HFj/7Cj9Rya1bXYi/KVxM1tOvmKYReoRbDqE90GRxOwnops0nUQOosoMgZZl32bLf4qfJD5ZsojAyR1pEe4ll+q8UOydr5t77iu2wyLbJebAcTrA7TrUj0VSoguzMr26VfWLrDSjtdYEZ8gQ9cIzn3ZOwa6i036xlV5tHtM/5r4yqCzWatYghEapCExV//iN01ZpC/thCInxzFw0pZaFMTeK5H6GUgzM4oJbR7RTPWj5cpTq1T1vmoAW9K/ao1nbemugFLwwoBXrNK5GgHlbVw9dBaLzGwwD7g== 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=E4yNlCOriH9zVe1v4p0DTxg4mvO4Mr6WJQPA+/WIcpQ=; b=qjIMANFqclfxpehNjORk9O0j8ZvTgPLuINnvGWK5S84tDe/p9wXHQ8A4dkkekW2nNIqc6aL+bstug4gg265ZYwKBL6YxCD44bzLLdCx7DH8Qh/E9+lY02BqoNHeh8Xchki7KZhM4NEz4dhAD2uOGq5dcx3ymlQoDjJZnxNXYjyk86xzGkw4gaeGdIzJ9wao8pVJWkBF5SZiV1+LE5THFbo0s5ql0v3vHAN/Q8siTHhLNZrtPaPD9MkkaGc8uC/1TMX7Vwurudxp3uEnl1CjG4XK3qk3YpXtVifKzdfYJqkq41Fe/TSijMYfBibXXisEeaH1QfbQ9Ps+ht2EHDQf1pg== Received: from SN1PR12CA0084.namprd12.prod.outlook.com (2603:10b6:802:21::19) by DM4PR12MB5940.namprd12.prod.outlook.com (2603:10b6:8:6b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 11:36:52 +0000 Received: from SA2PEPF00001506.namprd04.prod.outlook.com (2603:10b6:802:21:cafe::8e) by SN1PR12CA0084.outlook.office365.com (2603:10b6:802:21::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:36:52 +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 SA2PEPF00001506.mail.protection.outlook.com (10.167.242.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 11:36:52 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:36:45 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:36:43 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 05/16] platform: mellanox: mlx-platform: Add reset cause attribute Date: Tue, 22 Aug 2023 11:34:40 +0000 Message-ID: <20230822113451.13785-6-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: SA2PEPF00001506:EE_|DM4PR12MB5940:EE_ X-MS-Office365-Filtering-Correlation-Id: c7067ae8-3607-4424-3873-08dba30414cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f55ee3h5oz0pvhWWq0H62UVbZ8jaa1RrmHjId+ObdgmEe82sx4U/BWGd9wG/70KcHIoImln28+WMGlJkfKc7NZrF++PbRtWx1nHSz5BKEW+zcwowDeqGAFc6gugetM0rE/cz9Wz0q8oYDlVh0hVlNtcaPbaSk+2Ki3VJGdn8Kk3wKVgQtBQ+vuGsY2CE0XSp/zWtj78XlwiY0kr/vDUWCcA+V/3tIRy5WQhMg72JRx4odunBkPyP7XRU2kZjjzURjrahu2YED3Yc0jmIkZnrGVXA8+kaFA4NkstVp7mvgDtila8yLK7aCdtRsRt/StvT63u6AaD7g7nl/A/gj5Oubl7pCLFeegGrk3RIfS24lubPoUipTQFJC0XOY8LaC6eDuj7Z1R6AIap5GxIS+pGPy4UHRtqUy3EXWaIfQ52n624o/zSjdX2lZGB7PoUzgTCWhgSgiz8+pqWu+KfQt5ccQCvv/loGVFpbamBZv0RzYbQj0eclFJx7/rDjTHShJ89N5gDzS4Fp8TzqwrJ1zH12+fvwU03BuaLrW7pyz/BtN4f4bGe/kkAypdTnjykZ8DsyAILi0KfgFalKDwv7eG/jSUeBXb8H/Rv9IO/njd8XjQqF/YpvAoML11aIT37xwKcGCLDiVpUqHPcIS3Hn9z1XITPdtxu9SvWFFSJ2+nmzu29kHFUFetSSpU3vBDxchbOrDCOmft9JZZuS2CKjdWvvYohofaN3H/HgK0xFulT2gVERPfZhxPoskwNArcBkkH7p X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(316002)(70586007)(70206006)(8676002)(8936002)(2616005)(107886003)(4326008)(7636003)(36756003)(40460700003)(41300700001)(1076003)(82740400003)(356005)(478600001)(40480700001)(83380400001)(66574015)(2906002)(86362001)(47076005)(36860700001)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:36:52.5775 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7067ae8-3607-4424-3873-08dba30414cc 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: SA2PEPF00001506.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5940 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Extend IO registers description for some system types with reset cause attribute "reset_swb_dc_dc_pwr_fail" to indicate reset caused by switch board DC-DC power failure. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- drivers/platform/x86/mlx-platform.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 648b27eff0b0..8e07ed3dc552 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -3558,6 +3558,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(2), .mode = 0444, }, + { + .label = "reset_swb_dc_dc_pwr_fail", + .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(3), + .mode = 0444, + }, { .label = "reset_from_asic", .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, From patchwork Tue Aug 22 11:34:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360515 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 CA512EE49AC for ; Tue, 22 Aug 2023 11:38:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235277AbjHVLi7 (ORCPT ); Tue, 22 Aug 2023 07:38:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235304AbjHVLiY (ORCPT ); Tue, 22 Aug 2023 07:38:24 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2088.outbound.protection.outlook.com [40.107.220.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC201CEF for ; Tue, 22 Aug 2023 04:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P7iUjxNme3XXAaldyl56DaOw8lTcLSTaaEb24nEGjHlpb+iJ834MvL69zJ/O4PFwjc3L7hILxMYoenvjHHrjzKTE9qT6yi9mQxffuE4X0m20z0pI6eXZ7ZiErGcfJBjIvUSCqylyWo8/4SSPYSSD4RMcwu7etPfBIsRegv//dVEpN9ZY0CW2vYNtRoCRligpxxM9YwUhAri3x064xhC2gGS9hrTkAWAOOIE2ECgGXI7GvOKyg2eHuk/WRPRB08yPBpuBfZZHblPUjNzkN4gVLX9VM9N3O+0Md9cD+m6iLSGU9aBiRhTRzxwfKp+14aYL5W2YK8V07cII9W+6ICNA0A== 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=oxO8cHGy4t5Zt+k+zkNmmlOWUYL0yAw5z/kJYd1cKgE=; b=Vuki1UoyupBU1SVH44QE/bxLtQ2dgfgYLE9kKDrW9sCbrhdoWG5/cF/mF3KwcsRSX4osBd9dRLPbkbXkbQtHCTh+Cl2fsQsJd5UYriZursN+dMy+TOZK6Aoe7jvdeVGWKmPMQIgSErL9udGiEa5eJ94Xq2fPtf55XvxUreoPIoV7Qsn4mRimEFyp8VMZM64esYhvR+NMSstDMufEfctPFCiawoIx/RSCg8gK2r9hClT+3FxKGrW9SVQymdHSniOTVAdoizfGM2TgD3IkGQ2tEy4lcaWpM8BxQAUFtVuTjQ5jC+PDLoSLpx+8bIvZbKfL6sI3cGgl7JLDtpB/a6VPgA== 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=oxO8cHGy4t5Zt+k+zkNmmlOWUYL0yAw5z/kJYd1cKgE=; b=qyr7zsiH6HrHwiT4G+F5vER+xus1K8HJpUF3EGSf3eVm4Bk7hQYCprvNPTMhMXwRF8+J6Hv7OsiMK1R0FgnyYBcUCohM56jiOacrjC0RzZucFCvPxluzlLHYzdkA/g4lwX0ovxRzwAGyt1C64Mk3lHRv7W+WNvN/MkHJWukFp2Etts9A7Km61jKnsq7VOLepPcpYGeEi34Pl3AnKbiQYWKZTT9cLdnE8fj8hOBabWkRasHAz0qKg1g16G7ourtv1jnpt8j+rnSHvj+S2RSo5C614u/Dzp8AUGYbwLVDO3jNBZN5BOwL6KYpXSKcDhS97FXNnA2WRR3IHbZDy4A11gQ== Received: from SN7PR04CA0084.namprd04.prod.outlook.com (2603:10b6:806:121::29) by SJ0PR12MB6735.namprd12.prod.outlook.com (2603:10b6:a03:479::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 11:36:58 +0000 Received: from SA2PEPF00001507.namprd04.prod.outlook.com (2603:10b6:806:121:cafe::3a) by SN7PR04CA0084.outlook.office365.com (2603:10b6:806:121::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:36:58 +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 SA2PEPF00001507.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 11:36:58 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:36:48 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:36:47 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 06/16] platform: mellanox: mlx-platform: add support for additional CPLD Date: Tue, 22 Aug 2023 11:34:41 +0000 Message-ID: <20230822113451.13785-7-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: SA2PEPF00001507:EE_|SJ0PR12MB6735:EE_ X-MS-Office365-Filtering-Correlation-Id: 47442d7b-0e67-483a-28e0-08dba3041877 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JN6oQXB3Wjw9+w0zdD1sC9xrAMh4X3VN97eiJa9eppqO/PMMM8NJDY2fOKAhu2rThctgbKZG8r3IOwn2lGXNzGrPbSy4/oArzpKIe8KjboWjz+gCMCIcHY6r24T+szPSd8s8Bh16PZsVq3zkHfD0qwx4l0XTIwyC7IqwZSJtq5uRY+ui03Y+ui/WZgwAhcdnvXjGzaa6udM2uu2lQhzhjFM9kOQtA13W95d8E/L8spZOKMXBPut2HXWmCZ8yuVv9om2IEprzCi20A98XUUpq5nCm8ZOsY5r9U/TFOInjqVJ9nij6HJcufKggQqf6ofdkWnjbsf5blMnB06PvmCdnM0WgX3htw7E4hHYymfOW1z+zMQZAvG18uq0yIISIIv24RMr3/XiT0QTZVRzsElJznLf0VSNMuglBRMEXQYjqsKutPVK3U4IczkEp2E+EvzE7R33J2ni4SqChyCEE+HVXHTjQ+YzSDQNc43tvdFJqOgs+yVOBk8il03Vni9bh15oC07nBR4jX7eAIHJndnee7A2xNLvDeo1DCahLNMfsuAP3tlVYddYigBk9/i3A63SQdheaoD/T0RIFhyUFeKDsWX/aId8udWi2kO6iYMxl1Q7jgvD4SQTptyoryFM3Xs718f/87XrfpM0f8ua7Adj9X0EoCTTWabu7EMVpXSxe8uoWYUURpGHD/C0V5itFuhpikHFSdWbLlDkpppLjEObRz1ziYL2a9kRcX4hQBpSLcuDtinD4E9hD5DLro0/JBplgq X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(316002)(70586007)(70206006)(8676002)(8936002)(2616005)(107886003)(4326008)(7636003)(36756003)(40460700003)(41300700001)(1076003)(82740400003)(356005)(478600001)(6666004)(40480700001)(2906002)(86362001)(47076005)(36860700001)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:36:58.7310 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 47442d7b-0e67-483a-28e0-08dba3041877 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: SA2PEPF00001507.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6735 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Extend to support 5-th CPLD version, PN and minimal version registers. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- drivers/platform/x86/mlx-platform.c | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 8e07ed3dc552..dce35934cc37 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -95,6 +95,9 @@ #define MLXPLAT_CPLD_LPC_REG_FAN_OFFSET 0x88 #define MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET 0x89 #define MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET 0x8a +#define MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET 0x8e +#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET 0x8f +#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET 0x90 #define MLXPLAT_CPLD_LPC_REG_EROT_OFFSET 0x91 #define MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET 0x92 #define MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET 0x93 @@ -129,6 +132,7 @@ #define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0xb9 #define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2 #define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3 +#define MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET 0xc4 #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET 0xc7 #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET 0xc8 #define MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET 0xc9 @@ -3431,6 +3435,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .bit = GENMASK(7, 0), .mode = 0444, }, + { + .label = "cpld5_version", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET, + .bit = GENMASK(7, 0), + .mode = 0444, + }, { .label = "cpld1_pn", .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET, @@ -3459,6 +3469,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mode = 0444, .regnum = 2, }, + { + .label = "cpld5_pn", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET, + .bit = GENMASK(15, 0), + .mode = 0444, + .regnum = 2, + }, { .label = "cpld1_version_min", .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET, @@ -3483,6 +3500,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .bit = GENMASK(7, 0), .mode = 0444, }, + { + .label = "cpld5_version_min", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET, + .bit = GENMASK(7, 0), + .mode = 0444, + }, { .label = "asic_reset", .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, @@ -5031,6 +5054,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: @@ -5039,6 +5063,8 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: @@ -5150,6 +5176,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: @@ -5191,6 +5218,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: @@ -5199,6 +5227,8 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: @@ -5302,6 +5332,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: From patchwork Tue Aug 22 11:34:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360555 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 9EDD8EE49A4 for ; Tue, 22 Aug 2023 12:11:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235585AbjHVMLr (ORCPT ); Tue, 22 Aug 2023 08:11:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235555AbjHVMLq (ORCPT ); Tue, 22 Aug 2023 08:11:46 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2078.outbound.protection.outlook.com [40.107.237.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9A7D91 for ; Tue, 22 Aug 2023 05:11:44 -0700 (PDT) Received: from IA0PR12MB7698.namprd12.prod.outlook.com (2603:10b6:208:432::19) by CY5PR12MB9055.namprd12.prod.outlook.com (2603:10b6:930:35::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 12:11:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OnUp128l8uHudwDHQ43Mo9qQP1y1epcO48Y+vnoBwqrjvmRnCGhFn7PkV/5edDcU2rVLL5vzWvCCsiy6s3HeRoT8qN/yR1j4bo94pKlC/ya1n+z7ODO2x1pyGoj0aZUciNAJiiwifXWnvDG1MnLENs/bfVPzHggNwCghOIoN0QVuM87f2YHkJ5Drn0R+i6pzHItXPPA9QRx4HDrK6UFudXfBYaPE9bTcUOoguHgnIQYxj3CeMnLXbx/HAvvb8s8cTRKdBYbXqiGUH1nSgRuxJSCpD2aMNSCFOdjDmu2GFwFg0IdcHHN0fSPH6xJADEtNNYEnffMfwvW7hLZJaSr4JQ== 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=zvpr2IDc59hz0gQH2/iltbvadC4ESEnI6NqVW7siIxc=; b=RQmZYiFg0QLcg9o3GOSDT74r4Tv0rxqth+ZkuRMdjxs5dP4vGnUN9bYrp727Rru4ixSeXt6fBAtDkoC9d+3B+HDzFG2TOdSTBFhjax639SK4Ne5UA5MipsNHN0Ek1U2/Du3uwN47Crplbzn+tomGEJ3AAmaJ+XzWyxOtW3KdSl9r/t3ZIQ9svyWlGFDJVIEx89aML1yVL8bWQH84WWwLpyVSdAIC0z1mgz8lw7S0W8L1GajHvGOCBFvv7qwwT/3kBshXJdsAc98KCUFYstm5d3nI+rwBrjciekb7ZrMG7cLOMNHn/qnb2URaC9sLQ0pU+UyXHzJvislLGb9f85ZpTw== 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=zvpr2IDc59hz0gQH2/iltbvadC4ESEnI6NqVW7siIxc=; b=KLNBJgg6MrjTsSfYan0hY6oK1yYFJZ37BLianwmfw+Er6ebtAYfnl7IjauGtJjDl79bDr19voLqNJzEa0dXpnTJAo/fR5JVfx3/EDMpotyaNwOU78YPRXx6g+TuVJBM2d/Skl6hLlQzyReaG0k+ZmdS/glNn7PQ/CmYf/Bp6D0JNlB0N2yjv1PtnBZPjpAhAAfOiEZqJze38pCaKLfchG8aRTH8tRqIQ1+Axo8H9SLJk3qxqzbXZlbqO7M4myQlKGfP+4Ruzo9bJrKoI79JLSnT8pvMKd1PANaqahROWl6Af77RF9jf2bHT150vLZPq9WIErL2C+6Kd1WeYfQFCbng== Received: from CYXPR03CA0056.namprd03.prod.outlook.com (2603:10b6:930:d1::29) by IA0PR12MB7698.namprd12.prod.outlook.com (2603:10b6:208:432::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 11:37:02 +0000 Received: from CY4PEPF0000EE32.namprd05.prod.outlook.com (2603:10b6:930:d1:cafe::c0) by CYXPR03CA0056.outlook.office365.com (2603:10b6:930:d1::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:37:02 +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 CY4PEPF0000EE32.mail.protection.outlook.com (10.167.242.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:37:02 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:36:51 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:36:50 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 07/16] platform: mellanox: mlx-platform: Modify power off callback Date: Tue, 22 Aug 2023 11:34:42 +0000 Message-ID: <20230822113451.13785-8-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CY4PEPF0000EE32:EE_|IA0PR12MB7698:EE_|CY5PR12MB9055:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a705bbc-8453-443e-42ed-08dba3041a76 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qs1IXz/ApY939ahbbD5C/baRhQ9jD6kuFm3RHVrA4fY3RRsaHlWn4R5HiD7FhiZ2ZW7FsOOBcmthBC4UDU9pDtK7hvbfu57H0TBi+QHjVaEZgv+7q6ooMFV5F/fifXjofbVZa/G4vVUE9HGyfhzGzqsg2mCLL9EJK8+Wwa2pW4ja+T8s4qQqbwwhNW4Fgme0Nv3tKBNLxkKtnrVtbCd/Sye/M9k+mWtp5KVsP63w8E66MmnyC1pe+GeKvEr44Bnhnp4sAxZdD2K5AZhFgfUmMJbMiev5y+npqnPAt0omJQqGrtJIQpIwNmlHE4i2R4SKnLqu0wHktlXOnW42b0R/LxgUGb/n1CmqYXEouHPwQG0d2ExjrF09kzT1mx865+K9ztzixt26zCQW/6S93yz2TcZMxfCKnLyBNPp5k2CLMUnHHjViDJV9SX3KFAZWNWmsaZMB55ma1zookXVn3G0k5KHmmuXZ9gQ65ewDz3ohHshIFD1SIa+42H12DCl+EkNwi3tmR5SmZrOJtkYCrsQSY3zZFBCMq6GB/jH7dDva7+xpr+vdTqv+7rblDqDm7Y56UmMyor6I1RTgMwM/XWRMxO70GJP4q+IkI85X4SeL6C1LYUfmQ5HqNUA2WDhJ2jB2zO5H3OxMF79C4JN4ggcrWu+AzRZrFYlgQ78yvN6DkfRCyj5f+QsNcbCnDKckLfscaumXirY5inRrqdZIEdE86h0aMol/azujq8H6mgk/JkdRrfYmgEPiTnAic7e/XiNR X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(396003)(136003)(346002)(39860400002)(186009)(1800799009)(82310400011)(451199024)(40470700004)(46966006)(36840700001)(36756003)(86362001)(40480700001)(7636003)(40460700003)(356005)(316002)(478600001)(70206006)(41300700001)(6916009)(70586007)(82740400003)(54906003)(26005)(2906002)(6666004)(107886003)(16526019)(426003)(336012)(47076005)(36860700001)(1076003)(8936002)(8676002)(4326008)(2616005)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:37:02.0649 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a705bbc-8453-443e-42ed-08dba3041a76 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: CY4PEPF0000EE32.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7698 X-OriginatorOrg: Nvidia.com Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Extend platform power off callback with kernel_halt() call. When powering off, the process involves setting a halt bit in the register space, which is then activated after a certain delay and power off auxiliary power. By invoking `kernel_halt()` within this timeframe, the intention is to facilitate a clean system power-off sequence. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- v1->v2: - Comments pointed out by Ilpo: - Amend commit text. --- drivers/platform/x86/mlx-platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index dce35934cc37..a505f619f337 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -5539,6 +5539,7 @@ static void mlxplat_poweroff(void) struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, MLXPLAT_CPLD_HALT_MASK); + kernel_halt(); } static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) From patchwork Tue Aug 22 11:34:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360517 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 3158BEE4996 for ; Tue, 22 Aug 2023 11:39:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234036AbjHVLjG (ORCPT ); Tue, 22 Aug 2023 07:39:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235411AbjHVLim (ORCPT ); Tue, 22 Aug 2023 07:38:42 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20600.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::600]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A88AF1724 for ; Tue, 22 Aug 2023 04:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ITgaCYvo9Qn7/+Xu7X+TfXFnMBrqX/p/c+6+C1Oh1KaJ0SeA5hZlRbsXgiWC6ToTkvsoI5EqKgHjoGsiQV5OyqHGBv5FLLCyE0CAec3NeMeNCV4Exb/5DKHTFIvWoFrnk6MKFA5M7BOm8s2PtgjcHroXaGPNj1udPiDOp0gGTbi5BdTwUX5X6apsDkDY8wI0A+wLTSe7a2p3PwcoGhXLtFfnEcOx3XgKhBsSxddQSGFUkNAQOGYw0O97MUDzFYXEvshbY1TV5ZHUhZ90W84Obwd2lJL1qPGGcF13ILy90En14CaY5Ejr9cyBdU+GnqfaqHTOZGSOkQHkW3JsJrC1Yg== 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=MaK3qdqlUi4zqlG7B8wSlmtP84T4L+Rz4DTwscou9Xw=; b=DxYGnykFPg4zOMrL72IapfZXTjcxT3CYvWtILW1emK6YN9ci8e7f6DXYjQYaZ3LRVXu+yIh9Nf/tnVna/G5qbVsCN3hp67kEi4XA+XDyvLRZPKUKzfjAEv9A8oANyCNHjdHlj8PaYIYnEMJCjpLh1x6wAzP8rzMb8pkRXIfMXFOyKfaWb8ZFkF1qdy16qOuR9Av6WSmCh/wtJAF/vdiaW5AM+jG6eYXbc7d5rnnwYTU5Tj7WLodmtA715dA6l8YL6DL0ImhX1461/ZIKj5RnKAfkobTlMJWzbZT91hB5f9XEohzPXroJEf7NQWEK56X4KbSOiy4bByaEXj8iqJusLA== 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=MaK3qdqlUi4zqlG7B8wSlmtP84T4L+Rz4DTwscou9Xw=; b=kn5qmBFgriMAmA95Na+J+IPxUItdC3DVvo7T6tXuuJcqDe6DjVskORkScyFnTeL5mVwRim3HwhRsjJPGxucdZ6OkSy1U8dxxza4j/uA3L25fMt1zCk2LB6VZVxPJp+/OCL0jI4vDvuQE+Hihhb22HE2LIwrF5Mm1e7Z42/nLUAbYQfEWIWbNHUvZbBkmdnKnjhhiXMqY8IAyt+FyMSjecLelv+eYo5gZJVMV/4tqe3qgi4XgkumhXLv81m1TV5lblm4G1oEDhCsOFIjb9HpV63CFE75IMyIsyd64wtI3nETuW7TGVTv5TZAIwPGKRGgBh4wuHBxy1V5POgb9Nla8vw== Received: from SN7PR04CA0084.namprd04.prod.outlook.com (2603:10b6:806:121::29) by PH0PR12MB5433.namprd12.prod.outlook.com (2603:10b6:510:e1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 11:37:06 +0000 Received: from SA2PEPF00001505.namprd04.prod.outlook.com (2603:10b6:806:121:cafe::b1) by SN7PR04CA0084.outlook.office365.com (2603:10b6:806:121::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:37:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SA2PEPF00001505.mail.protection.outlook.com (10.167.242.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:37:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:36:55 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:36:53 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 08/16] platform: mellanox: Cosmetic changes Date: Tue, 22 Aug 2023 11:34:43 +0000 Message-ID: <20230822113451.13785-9-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001505:EE_|PH0PR12MB5433:EE_ X-MS-Office365-Filtering-Correlation-Id: ded34081-b06d-4ada-31a3-08dba3041d21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7EKgFzx0fDDimeAnnbqpQwelISeWCbdiMR+Y6QELI5vjeY9kfH7y8KIlgt/Scqm69LpFQV6/tas0IE06gfvVu/B+lvUY9oeqZ0QlH/GK8y6QDHeUPUQbWF+moTygpyPzCCAPkvknGj7bnuhMITImdidv8AKOuwNJmhRV1388PNOrP3WozKDIo97WahObBRklIElXxCUqXlykNQTQTU/IHnOIvISkpuxrFJmgd2HTQWy7MmjNDtyy/iISlNdM0dDeI74jnGG8zEX4+l7QrThuSTvHtovX9smawL5wuBTksfMwGnUQ+1VmVRnqVxK5wpVhF3I/Q7NWBTOHzhOB0nVAlFgsDGBplNf4uorK1XKL3SRLtLXqYO32sCKN2dN1VxQlu+lqZwz48HuWmX9CdI66TTOf1W12wZDwtBvMd/VYgsBVAu2oJNcSjiiU7exX9xSjpG43SnNH/i2wE9B4miZ3E7wQdRGwHJ9i36hWI7aQFhjc3SKeHIir8aFv0NuavJKoRVj80tpGSe8m1fN3hko+IxBMIwBV4ywh8OrepJ2wyAVPMtknNT198krNcBGnzZRouTrzBOkLJ1k8l0ANfqIvD7HBiETaneb/n0TmJQYorpnbFebKKoDpHsZwf3DHJzmq/JjYZZhXVZdsuwldtDdnLFgcQ8gFGY1prGCADJumT1xWkf8p/4lZJU/NWA6MHS3HLChWJEBzgElgv97VcBoQXqhcQh4WfJT6iFV+ccSyVsWuMskf6/W2XFar5Ewz4Ppl X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(316002)(70586007)(70206006)(8676002)(8936002)(2616005)(107886003)(4326008)(7636003)(36756003)(40460700003)(41300700001)(1076003)(82740400003)(356005)(478600001)(6666004)(40480700001)(83380400001)(66574015)(2906002)(86362001)(47076005)(36860700001)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:37:06.5405 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ded34081-b06d-4ada-31a3-08dba3041d21 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: SA2PEPF00001505.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5433 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Fix routines and labels names by s/topolgy/topology. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- v1->v2: - Comments pointed out by Ilpo: - Fix commit text. --- drivers/platform/x86/mlx-platform.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index a505f619f337..1010064d54e9 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -6265,7 +6265,7 @@ mlxplat_i2c_mux_complition_notify(void *handle, struct i2c_adapter *parent, return mlxplat_post_init(priv); } -static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) +static int mlxplat_i2c_mux_topology_init(struct mlxplat_priv *priv) { int i, err; @@ -6294,7 +6294,7 @@ static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) return err; } -static void mlxplat_i2c_mux_topolgy_exit(struct mlxplat_priv *priv) +static void mlxplat_i2c_mux_topology_exit(struct mlxplat_priv *priv) { int i; @@ -6308,7 +6308,7 @@ static int mlxplat_i2c_main_complition_notify(void *handle, int id) { struct mlxplat_priv *priv = handle; - return mlxplat_i2c_mux_topolgy_init(priv); + return mlxplat_i2c_mux_topology_init(priv); } static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) @@ -6336,14 +6336,14 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) } if (priv->i2c_main_init_status == MLXPLAT_I2C_MAIN_BUS_NOTIFIED) { - err = mlxplat_i2c_mux_topolgy_init(priv); + err = mlxplat_i2c_mux_topology_init(priv); if (err) - goto fail_mlxplat_i2c_mux_topolgy_init; + goto fail_mlxplat_i2c_mux_topology_init; } return 0; -fail_mlxplat_i2c_mux_topolgy_init: +fail_mlxplat_i2c_mux_topology_init: fail_platform_i2c_register: fail_mlxplat_mlxcpld_verify_bus_topology: return err; @@ -6351,7 +6351,7 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv) { - mlxplat_i2c_mux_topolgy_exit(priv); + mlxplat_i2c_mux_topology_exit(priv); if (priv->pdev_i2c) platform_device_unregister(priv->pdev_i2c); } From patchwork Tue Aug 22 11:34:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360516 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 538B5EE4996 for ; Tue, 22 Aug 2023 11:38:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235441AbjHVLi6 (ORCPT ); Tue, 22 Aug 2023 07:38:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235277AbjHVLiY (ORCPT ); Tue, 22 Aug 2023 07:38:24 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2083.outbound.protection.outlook.com [40.107.243.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C06B6CE9 for ; Tue, 22 Aug 2023 04:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JYMVtXFpiH++9RrQA1enQHNC7NH3Z5DYVNNVcoPhLtuoppXagujpRcjUps5U3vOO3ZvSbhgPoog+J5rG5N8oHPtOQkSQHbTpNiG8ltRcNHG8mzNEjidW7k1+rh7RmmbbZBjqKcvsPuxIHsf2dUdsaPsVetwn8DKaGHDPFiRNdX4MoTf9+4Pw+SUAftbdRcOxWT/M1cgZ1IAKygSLsJAZAww9dkfmpCibQEp4qzHcAOlfTlGCidm6HQrBFuMNf94sDTipWkhM50Adl0UbB7IGNdrMgZnCNKYJQzfQ9dSbbaru2xLXEDDvGybwljeXokiT3Hkj5JUbSLkaT2YFSGVRCg== 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=ep+viDnettABcPb4R8dNWCwJ42Ux4DVO00iES3NiZWU=; b=eCTiili/9X4XvRLAQesyPINR5SorL5tip/c3SSDNTQbE8CjppnP+QZ0ojuekwpCzGAHPVa5zcElBAk85TKX3cfvzTZHmK+T/kVEHP8Q5zQ9QFd36zq9O3Y0Ny0FrZZvC1icYOqB6EVmIJ8HOxFpYZM6iMU4ZmUR+kMYvsi6nCvAA+na7oT30xhXW06ld2eEyuaAns3jL0FZiPpLCXu0zo/u+XJgBcgFK5OOo22iqTDnQo46xWPMw9tTOtXJAEHpAA3RNr+dqShmg9p93n+ytE69dXMor7ulgpfVSgsbIgSURp2W0zgQZ+IdC4xlfxd0IqyAbeatpMpwKpAPF7lotAw== 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=ep+viDnettABcPb4R8dNWCwJ42Ux4DVO00iES3NiZWU=; b=WQYiZfqGRBFugvzOsYTtJFZBDxhHJzo8995GELCxNT2QPTUykTE9mpNcQz/gn5K8Dpws+ZA5EFLj3FGRPEdjb9QZsbncHRGTBOd7C7b1ibGY47BpphGNfYKWCSL5etiNUXp7OINAp/h8nI9CyNEYSPOolKWeqQxix1o6PtTQlDM5nfJ8eL68GGPTgDcJCBVUdPQFtHc7zcwl0cQyC/A3yzcnFxARUvI3sNR+Bo3QKUtqdA4FOZru6DpLpc33ZfIxyZBXnCyYlitwxWYaSnda0XSGAzk9KUOb8foLhPgS/gfWsbcX3gaSRagm1M52x/gsU1N3WVJsVqa1OuanyZ2M6A== Received: from SN7PR04CA0072.namprd04.prod.outlook.com (2603:10b6:806:121::17) by SA3PR12MB8439.namprd12.prod.outlook.com (2603:10b6:806:2f7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.31; Tue, 22 Aug 2023 11:37:08 +0000 Received: from SA2PEPF00001505.namprd04.prod.outlook.com (2603:10b6:806:121:cafe::db) by SN7PR04CA0072.outlook.office365.com (2603:10b6:806:121::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:37:08 +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 SA2PEPF00001505.mail.protection.outlook.com (10.167.242.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:37:08 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:36:58 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:36:56 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 09/16] platform: mellanox: mlx-platform: Add reset callback Date: Tue, 22 Aug 2023 11:34:44 +0000 Message-ID: <20230822113451.13785-10-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001505:EE_|SA3PR12MB8439:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a68b522-9186-48a8-4ac3-08dba3041e5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1ssN6BqA5jVY2tVgztzsSo0IpRFrpShz956rZqAstpVgpCzOgHe1zHO4DF8tDQ9XJzCzKCIGWDkbbZtV7kQXlzJvHpB77pxFuTOnLKc0xe3RQDLSvdfEobrdDz0oyuZG48v0c8XFeJU0CCpGdsU1uvJM1hewNWScy3WhtlEAt1KFKGZDEBinA8CFPtbsQSuBHBoUDIirW4C49zxhbTH8QcoK5usH5q81mnBdPuxupob2pCvID+dwgrUnu2X9OX/+/dVX5hh1jUYTeA2H36GDu4KjaL8Y3j/KiVuKZyAaheJoAtwNQvxHZ8B+MiM952Un87ARSENj3PcPlGjLVx+frKavUmBB1GIBpOv2kqjZAiYGhKpApqfRZ5Lb+DmpFvvMiAjfjAK7Y/dL4uJcukNo3gxt/QPSaRgF551G579rcYWJSeN/eSjcb+aG9y//bBkMRbjdOFIXEwHPOOneEqZanr3XErsNJH9pGfnDzpguWMfrMxbEppMvZqUwpXxYv63v/cg0KpZM8JEpuifwBe27fsHFm6VVHbygGXpKM2fL3WYNhHX6C4qjYEJuQ/7akeAK9MA5YqWWcl9lXVmpXXlSzBv0PM9Oi+TgwHKUXto7i4hZYoeROn7TMpQFbSzz8gUNHP/Csem0ZavNnka7tqcGsC12WTHedYlQwM4KxtVY4H4RVGO+d/rba3lAz5P5Dsi/r1relW/hFpbH3dKwBVfjcGY+IDndzI5a58Y2gnp9XBRoji8BjM84Fg8nMLcwyobr X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199024)(186009)(1800799009)(82310400011)(46966006)(40470700004)(36840700001)(54906003)(70586007)(70206006)(5660300002)(41300700001)(1076003)(6916009)(2616005)(2906002)(478600001)(316002)(8936002)(8676002)(40480700001)(4326008)(6666004)(40460700003)(47076005)(107886003)(36860700001)(36756003)(26005)(83380400001)(7636003)(82740400003)(16526019)(356005)(336012)(426003)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:37:08.6343 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a68b522-9186-48a8-4ac3-08dba3041e5e 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: SA2PEPF00001505.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8439 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org On L1 switches reset should include special actions against CPLD device for performing graceful operations. For that purpose, special PLATFORM_RESET# signal should be indicated. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- v1->v2: - Comments pointed out by Ilpo: - Use GENMASK() for MLXPLAT_CPLD_RESET_MASK define. - Use a named define instead of BIT(0). --- drivers/platform/x86/mlx-platform.c | 46 +++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 1010064d54e9..296569492a71 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -35,6 +35,7 @@ #define MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET 0x09 #define MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET 0x0a #define MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET 0x0b +#define MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET 0x17 #define MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET 0x19 #define MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET 0x1c #define MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET 0x1d @@ -254,6 +255,7 @@ MLXPLAT_CPLD_PWM_PG_MASK) #define MLXPLAT_CPLD_I2C_CAP_BIT 0x04 #define MLXPLAT_CPLD_I2C_CAP_MASK GENMASK(5, MLXPLAT_CPLD_I2C_CAP_BIT) +#define MLXPLAT_CPLD_SYS_RESET_MASK BIT(0) /* Masks for aggregation for comex carriers */ #define MLXPLAT_CPLD_AGGR_MASK_CARRIER BIT(1) @@ -265,6 +267,7 @@ #define MLXPLAT_CPLD_LPC_LC_MASK GENMASK(7, 0) #define MLXPLAT_CPLD_HALT_MASK BIT(3) +#define MLXPLAT_CPLD_RESET_MASK GENMASK(7, 1) /* Default I2C parent bus number */ #define MLXPLAT_CPLD_PHYS_ADAPTER_DEF_NR 1 @@ -441,6 +444,7 @@ static struct i2c_mux_reg_platform_data mlxplat_default_mux_data[] = { static int mlxplat_max_adap_num; static int mlxplat_mux_num; static struct i2c_mux_reg_platform_data *mlxplat_mux_data; +static struct notifier_block *mlxplat_reboot_nb; /* Platform extended mux data */ static struct i2c_mux_reg_platform_data mlxplat_extended_mux_data[] = { @@ -2361,8 +2365,11 @@ static int mlxplat_mlxcpld_l1_switch_pwr_events_handler(void *handle, enum mlxreg_hotplug_kind kind, u8 action) { - dev_info(&mlxplat_dev->dev, "System shutdown due to short press of power button"); - kernel_power_off(); + if (action) { + dev_info(&mlxplat_dev->dev, "System shutdown due to short press of power button"); + kernel_power_off(); + } + return 0; } @@ -4957,6 +4964,7 @@ static struct mlxreg_core_platform_data mlxplat_mlxcpld_wd_set_type3[] = { static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) { switch (reg) { + case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_LED1_OFFSET: case MLXPLAT_CPLD_LPC_REG_LED2_OFFSET: @@ -5065,6 +5073,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: @@ -5229,6 +5238,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: @@ -5533,11 +5543,33 @@ static struct mlxreg_core_platform_data *mlxplat_wd_data[MLXPLAT_CPLD_WD_MAX_DEVS]; static const struct regmap_config *mlxplat_regmap_config; +/* Platform default reset function */ +static int mlxplat_reboot_notifier(struct notifier_block *nb, unsigned long action, void *unused) +{ + struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); + u32 regval; + int ret; + + ret = regmap_read(priv->regmap, MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET, ®val); + + if (action == SYS_RESTART && !ret && regval & MLXPLAT_CPLD_SYS_RESET_MASK) + regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET, + MLXPLAT_CPLD_RESET_MASK); + + return NOTIFY_DONE; +} + +static struct notifier_block mlxplat_reboot_default_nb = { + .notifier_call = mlxplat_reboot_notifier, +}; + /* Platform default poweroff function */ static void mlxplat_poweroff(void) { struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); + if (mlxplat_reboot_nb) + unregister_reboot_notifier(mlxplat_reboot_nb); regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, MLXPLAT_CPLD_HALT_MASK); kernel_halt(); } @@ -5861,6 +5893,7 @@ static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_rack_switch; pm_power_off = mlxplat_poweroff; + mlxplat_reboot_nb = &mlxplat_reboot_default_nb; return 1; } @@ -6410,8 +6443,15 @@ static int __init mlxplat_init(void) if (err) goto fail_regcache_sync; + if (mlxplat_reboot_nb) { + err = register_reboot_notifier(mlxplat_reboot_nb); + if (err) + goto fail_register_reboot_notifier; + } + return 0; +fail_register_reboot_notifier: fail_regcache_sync: mlxplat_pre_exit(priv); fail_mlxplat_i2c_main_init: @@ -6429,6 +6469,8 @@ static void __exit mlxplat_exit(void) if (pm_power_off) pm_power_off = NULL; + if (mlxplat_reboot_nb) + unregister_reboot_notifier(mlxplat_reboot_nb); mlxplat_pre_exit(priv); mlxplat_i2c_main_exit(priv); mlxplat_post_exit(); From patchwork Tue Aug 22 11:34:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360518 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 21854EE4996 for ; Tue, 22 Aug 2023 11:40:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbjHVLkG (ORCPT ); Tue, 22 Aug 2023 07:40:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbjHVLkF (ORCPT ); Tue, 22 Aug 2023 07:40:05 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20617.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::617]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FC90E77 for ; Tue, 22 Aug 2023 04:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q4kOYhIl1/WwwKGhKXo/MyEhmMU+vTJoOhp9MocvhACk32gfczXPQrfNj4YV0qqtgZW5vlsdRPbLqjn7M1X0m+R9OjEzaoZfDSrw9xFDY8kxQE6h5S5D7i0f5Vs7Jt/3KjjhrvTCIDSVD9ENbNnUWCLYPXiMHqAyHc65S/N8NLK2oQEWUVr521MfslORc/S75XIP+1BIJP513n5sAwir8tgRONOJXFoVH1EjjTqI4r9CH9KXyHAFT32RzOHcMhduk6w67BqFz5GgAkV5nmlLOKNT4Gqrvh5+Jyr5ijXC/9YhPiEQIbtPlP0x54Fx+SkWBv6R7j3UcnMr9+L8ZfQLPQ== 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=H3c5mI/r2oZ59kUZ1R8KC9cQnelkWenbvLZtoZDpODQ=; b=RoYL0gM8SjOndle5kb7drLn7IlMVl2zZh8ALGT6ryYDCLHdcDdFuwaFLtOLi3+AfkRChoSxVd/4Rrg0uI63+IVTuS5QYgr6sPHQCALAzcl4uCAys+ygWVhW+AnJYTlSSfXMqMmCFcyohqI4Fi0DKrIDnx0FKgbysH2QcQZ3LuhhHDPYU6zL8/4oLoOqavkzxaTx9yfcD+C2u2XuBsAAcltY8gKQtOlZlD+3ROnl8H/eBxSrbYo0315umhnPjHoLxJe8appq/gtY6moFQ26juU7P+oiu0S+Bu5JIu1b0hkbiI4+QKOGTpSBimcNZYQRYJrA8AwL7O/er8mzmN6iM+Dg== 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=H3c5mI/r2oZ59kUZ1R8KC9cQnelkWenbvLZtoZDpODQ=; b=qGb7XU5odbflG7/Jk2z7BVVxIHCQ5pzsKBxf5/EmoSgWuKDbMJIjRWUIruYllMppSLD8kLggR68NmEYyUYfIZ80d1L+j1npckNwqWnvlMf19hKXlzR8zkLW5k7NUWNuPXFnI5hs8OpU36FvZWg1D60V5aaoyHxxaxoQehYX/9D/rZWDGk/3O9Ekk496Ahh3M8u1LW1WS8VT/nZBsN2le47IXBZ2zdQ4ghT3EkiMG/qymmBHtNL5hvnCm8UQlpzCX0phqUkUvPXG03jOPKzfLnoKv1SQkoqDcVk2L7CUU9J53+0c7zFBrBo+CTbmLELXA+thpimfyCn0X1v8fqgVu2A== Received: from CY8PR11CA0041.namprd11.prod.outlook.com (2603:10b6:930:4a::13) by PH7PR12MB6667.namprd12.prod.outlook.com (2603:10b6:510:1a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 11:38:28 +0000 Received: from CY4PEPF0000EE36.namprd05.prod.outlook.com (2603:10b6:930:4a:cafe::5c) by CY8PR11CA0041.outlook.office365.com (2603:10b6:930:4a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:38:27 +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 CY4PEPF0000EE36.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:38:27 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:38:17 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:38:16 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 10/16] platform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infrastructure Date: Tue, 22 Aug 2023 11:34:45 +0000 Message-ID: <20230822113451.13785-11-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CY4PEPF0000EE36:EE_|PH7PR12MB6667:EE_ X-MS-Office365-Filtering-Correlation-Id: 14a54e8e-b4b4-4859-2371-08dba3044d96 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cLs08jEjm4dtazc2eMHnm8ZDPHqwh3zbgnfvyPOw2JSM34gFcJ1EqGcCpGaaGRxbZHoqQFvoKw5icFXYEJnIaYsT4i2I7N1IHuPimxJqZ30B52kjhus6XgAIWjyHqJ7A37wX65bSoxbrQT+0wCEEC5q9NV8V5THwRRQoHFmhu7snpzHoR/Mv6MTahvI96QN/MGIwDEbhUZVL75+GMGNv0LZSnEwfKXh3lBhw8AUyN54hSJ07TWYRVDU3X8MuDdPm2Wlcib1nbHkpvGdHhV09Y3abbfdv54hiwK1vtzpyFwm/V/D9J/iualcJqMoNpV5ENuJae2za/lmhf7oMANyP5YXQxgLXQBMfJjNF7ld+DlkdppR38m2YAx9KWoPHV8ErqGEirvgLRdaq6sxvW7XK93SnQWTBnzP1I7AVbrXzdX2WSsOXJNuebJGhukUm1eQAyI1St7hrLMjpojMEnprdIta3g3LBSfRta97Fs36hCbCXLnwYiiJNUjgyqWk5J+pB+BgVmrxrXeBKFCpc/jAPv39onmH6IaN1iaLKtjIEpP71DXzMYuzOWX1OkPd0mnqO+s355+owg/aus29jBCwwkBnNdyvaOMwsDvZ2t6fqtlfNmFvsrZQslduAa7eK5DX8rWqOZ1xMZ+sPQQWJ1BHfGNROprw4upkxI+rppaL82n0NFIk4StRkfM7abhH2h4YUp9S6453lLfm8MSGS0T2Ijp8c4oNOPWQhXA2tM966MLc= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(39860400002)(376002)(136003)(396003)(82310400011)(451199024)(186009)(1800799009)(46966006)(36840700001)(40470700004)(83380400001)(2906002)(66574015)(40480700001)(5660300002)(336012)(426003)(26005)(16526019)(36860700001)(86362001)(47076005)(8676002)(4326008)(2616005)(8936002)(107886003)(70206006)(316002)(54906003)(6916009)(70586007)(82740400003)(478600001)(356005)(6666004)(36756003)(41300700001)(40460700003)(1076003)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:38:27.8845 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14a54e8e-b4b4-4859-2371-08dba3044d96 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: CY4PEPF0000EE36.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6667 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Currently driver is activated through DMI hooks. Prepare driver to allow activation also through ACPI trigger. Modify mlxplat_init()/mlxplat_exit() routines. Add mlxplat_probe()/mlxplat_remove() routines and "mlxplat_driver" structure. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- drivers/platform/x86/mlx-platform.c | 91 +++++++++++++++++++---------- 1 file changed, 61 insertions(+), 30 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 296569492a71..73f887614e04 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -5574,6 +5574,17 @@ static void mlxplat_poweroff(void) kernel_halt(); } +static int __init mlxplat_register_platform_device(void) +{ + mlxplat_dev = platform_device_register_simple(MLX_PLAT_DEVICE_NAME, -1, + mlxplat_lpc_resources, + ARRAY_SIZE(mlxplat_lpc_resources)); + if (IS_ERR(mlxplat_dev)) + return PTR_ERR(mlxplat_dev); + else + return 1; +} + static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) { int i; @@ -5594,7 +5605,7 @@ static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_default_wc_matched(const struct dmi_system_id *dmi) @@ -5617,7 +5628,7 @@ static int __init mlxplat_dmi_default_wc_matched(const struct dmi_system_id *dmi mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_default_eth_wc_blade_matched(const struct dmi_system_id *dmi) @@ -5642,7 +5653,7 @@ static int __init mlxplat_dmi_default_eth_wc_blade_matched(const struct dmi_syst mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_msn21xx_matched(const struct dmi_system_id *dmi) @@ -5665,7 +5676,7 @@ static int __init mlxplat_dmi_msn21xx_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_msn274x_matched(const struct dmi_system_id *dmi) @@ -5688,7 +5699,7 @@ static int __init mlxplat_dmi_msn274x_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_msn201x_matched(const struct dmi_system_id *dmi) @@ -5711,7 +5722,7 @@ static int __init mlxplat_dmi_msn201x_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_qmb7xx_matched(const struct dmi_system_id *dmi) @@ -5737,7 +5748,7 @@ static int __init mlxplat_dmi_qmb7xx_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_comex_matched(const struct dmi_system_id *dmi) @@ -5762,7 +5773,7 @@ static int __init mlxplat_dmi_comex_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_comex; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_ng400_matched(const struct dmi_system_id *dmi) @@ -5788,7 +5799,7 @@ static int __init mlxplat_dmi_ng400_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_modular_matched(const struct dmi_system_id *dmi) @@ -5808,7 +5819,7 @@ static int __init mlxplat_dmi_modular_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_eth_modular; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_chassis_blade_matched(const struct dmi_system_id *dmi) @@ -5830,7 +5841,7 @@ static int __init mlxplat_dmi_chassis_blade_matched(const struct dmi_system_id * mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dmi) @@ -5851,7 +5862,7 @@ static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dm mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_rack_switch; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_ng800_matched(const struct dmi_system_id *dmi) @@ -5872,7 +5883,7 @@ static int __init mlxplat_dmi_ng800_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; - return 1; + return mlxplat_register_platform_device(); } static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) @@ -5895,7 +5906,7 @@ static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) pm_power_off = mlxplat_poweroff; mlxplat_reboot_nb = &mlxplat_reboot_default_nb; - return 1; + return mlxplat_register_platform_device(); } static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { @@ -6139,12 +6150,6 @@ static int mlxplat_lpc_cpld_device_init(struct resource **hotplug_resources, { int err; - mlxplat_dev = platform_device_register_simple(MLX_PLAT_DEVICE_NAME, PLATFORM_DEVID_NONE, - mlxplat_lpc_resources, - ARRAY_SIZE(mlxplat_lpc_resources)); - if (IS_ERR(mlxplat_dev)) - return PTR_ERR(mlxplat_dev); - mlxplat_mlxcpld_regmap_ctx.base = devm_ioport_map(&mlxplat_dev->dev, mlxplat_lpc_resources[1].start, 1); if (!mlxplat_mlxcpld_regmap_ctx.base) { @@ -6158,13 +6163,11 @@ static int mlxplat_lpc_cpld_device_init(struct resource **hotplug_resources, return 0; fail_devm_ioport_map: - platform_device_unregister(mlxplat_dev); return err; } static void mlxplat_lpc_cpld_device_exit(void) { - platform_device_unregister(mlxplat_dev); } static int @@ -6389,16 +6392,13 @@ static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv) platform_device_unregister(priv->pdev_i2c); } -static int __init mlxplat_init(void) +static int mlxplat_probe(struct platform_device *pdev) { - unsigned int hotplug_resources_size; - struct resource *hotplug_resources; + unsigned int hotplug_resources_size = 0; + struct resource *hotplug_resources = NULL; struct mlxplat_priv *priv; int i, err; - if (!dmi_check_system(mlxplat_dmi_table)) - return -ENODEV; - err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); if (err) return err; @@ -6461,9 +6461,8 @@ static int __init mlxplat_init(void) return err; } -module_init(mlxplat_init); -static void __exit mlxplat_exit(void) +static int mlxplat_remove(struct platform_device *pdev) { struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); @@ -6474,6 +6473,38 @@ static void __exit mlxplat_exit(void) mlxplat_pre_exit(priv); mlxplat_i2c_main_exit(priv); mlxplat_post_exit(); + return 0; +} + +static struct platform_driver mlxplat_driver = { + .driver = { + .name = "mlxplat", + .probe_type = PROBE_FORCE_SYNCHRONOUS, + }, + .probe = mlxplat_probe, + .remove = mlxplat_remove, +}; + +static int __init mlxplat_init(void) +{ + int err; + + if (!dmi_check_system(mlxplat_dmi_table)) + return -ENODEV; + + err = platform_driver_register(&mlxplat_driver); + if (err) + return err; + return 0; +} +module_init(mlxplat_init); + +static void __exit mlxplat_exit(void) +{ + if (mlxplat_dev) + platform_device_unregister(mlxplat_dev); + + platform_driver_unregister(&mlxplat_driver); } module_exit(mlxplat_exit); From patchwork Tue Aug 22 11:34:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360519 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 769A4EE4996 for ; Tue, 22 Aug 2023 11:40:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbjHVLkL (ORCPT ); Tue, 22 Aug 2023 07:40:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjHVLkL (ORCPT ); Tue, 22 Aug 2023 07:40:11 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::601]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90418CCA for ; Tue, 22 Aug 2023 04:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fu6DSuElzxu6Maf5zVQ8XAp5WxAoNxUyyklR+g9/T59YocBHxHTgf/3TovZd5L08Ot5zofAxAOHQJU1fZ7KmczO/u5POZGWiMJHikzO6bReM3CNofz+YNnI4P37ld4eGttSWzzpzw4i0ndIhvzKNdk/JNeCQtzwW0ocLg6MkUufrN+eRLK+J8+mqc4zHfwT62DCRsNDVTgVVb8RYlzXX1w9jdwE1hE3lQJNGMKNrbt/wUZY2OaOA1REJnivPUz7Uk4dOwoeBwP1vubGcYDGwBgaGt5OCbotS/GvuRcUutaYU/rgnJkAWOgUdL/3aNTATjSmrAK+D6TpCzRiUgDjmGg== 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=9ntpxKUPN2YmVfyhSpjAI84egtDdXhK0u3SMrGBdcAM=; b=AWKQzpIozQaJyjNcIxRSsyiTI3Ol9B3y2jE44h+wuYNio9Rcu5iBHTR0Lgx92bUIa+DwHaXBiVYIDkBFHV8B/yCWl1ATBlSq80dW/v9sqTwzgu4wjaA+MdkqEviqXrvYbnrNtbn28XcJlppcprVnqbQNsKtzS11wAWnhQMujjw98eJ2hH3m/oDAfk05kZi4srED8O1uRlwIH8j9gtL1UTtXDf62nPGOoq/1er4OQMydvOvek/A/i6UUDbTpM7uyPV8fMzrfGfP5cf7uLGeRrCruy6aiXFiaKYx1WHSY3WjtLxIDvfBf74JHQvj+pwh0lmzV2VDHjbOlPp3itjUgpJQ== 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=9ntpxKUPN2YmVfyhSpjAI84egtDdXhK0u3SMrGBdcAM=; b=kETl5vVSYILKWFl8aPMcFeRCYiJ9R7QbKaDkW2XbTj9/XkRDrdplIbe/op3RN6ClW96sbgKajlIge/4c7ivWtMTjCaPBu0qzp+Uibc4z6YDtR7fel5dPyRDHapPiAkw23i9ibsT/RFOBagRxXEESp5HcOaudA5fD/craWaCUOUZ/XvpndOWIMJF2u9HbqP8235o4dBJHi0v+nLJbBv4/fxgvUrgW9rM4IeYw2EvCT8NIrDGxUb3pxszNuZhDx6k5p/6gJg1Bus8ExjA5T+dl0v8JDNDdNhmvz+iaXqAHPEfx8hgsDlC2r2b6nnCQAvTnzaj75HAr92VqpONFsSb/qA== Received: from SA1P222CA0103.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c5::7) by DM4PR12MB5312.namprd12.prod.outlook.com (2603:10b6:5:39d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 11:38:36 +0000 Received: from SA2PEPF0000150B.namprd04.prod.outlook.com (2603:10b6:806:3c5:cafe::19) by SA1P222CA0103.outlook.office365.com (2603:10b6:806:3c5::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:38:36 +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 SA2PEPF0000150B.mail.protection.outlook.com (10.167.242.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 11:38:36 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:38:21 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:38:19 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 11/16] platform: mellanox: mlx-platform: Introduce ACPI init flow Date: Tue, 22 Aug 2023 11:34:46 +0000 Message-ID: <20230822113451.13785-12-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: SA2PEPF0000150B:EE_|DM4PR12MB5312:EE_ X-MS-Office365-Filtering-Correlation-Id: 758f0daa-88c9-4492-2f8a-08dba30452b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Itvs7YL0ZTKgBL9besHEfBTDCAHU/tm1ywHxbMoH6NZHqHh9gLanug9b/VOFC+z6gn6Syk/j0sp9X1UiN7AOknUwsHdRljsj7uHD2lVWBnzMtmVNZf6sQ4SyTIYFgHbkUFxbb8Bx+ujzt0MYPUPIkvrvK6uxtpGg4SD8Vxnm5UFRG+pTTs1B14W1DCnYX64SlqqPXBNSqHRwwb0mirX4jKyi6lDopsw54hAjzu8MI5/G3j3JpTbXsurcFv7x/XxujtpjwvyhGJXGjakHojbe+P5j9Rcw8xUNr9xiYLJvjPWlmpPsaDCnsC2EyCnhjnOLFONfun4yzTI/2LIGNKFNmxjWXq68Oh9np7Ws80BQARgYsAHYgN4Op0o2QYB2aB06bk/UCMTAnl+gqACD/AA8tQu1QA2+he3ieYDlhSlM2MptFjxQnLJQT6j8mqnCcCVgDHOZ2KLmRIBEzZvXrf5ZfQNbrslzjs2eeJ9kiS8+IQqtq57D8zFJCe7L3Y7u6yCP9LBcd1fwEAjLQd70/b29WT6RE1NAz6Cy1ibaDyEqHrna6zNl3TUF+JgTeFjVz6cqCbksW6slaTJugjibygE9BOmE1cRwe9F9xXkTJoFye00J6a6UhI8vuOVMxlUyZKSSZw3f+GoqNfFB3xCNeLUqOVWDoFZBceyzXPAxuOn0H8iGSIDW7CsyYWVDDGtTorQRLOcxcGXXeJ78Wy7OjFxmGCzh0nkXI51i6lAN81I22Yx+btNrKK1UFVWWkIxRKFPt X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(39860400002)(376002)(136003)(396003)(82310400011)(451199024)(186009)(1800799009)(46966006)(36840700001)(40470700004)(2906002)(40480700001)(5660300002)(336012)(426003)(26005)(16526019)(36860700001)(86362001)(47076005)(8676002)(4326008)(2616005)(8936002)(107886003)(70206006)(316002)(54906003)(6916009)(70586007)(82740400003)(478600001)(356005)(6666004)(36756003)(41300700001)(40460700003)(1076003)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:38:36.4347 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 758f0daa-88c9-4492-2f8a-08dba30452b1 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: SA2PEPF0000150B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5312 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Introduce support for ACPI initialization flow - add ACPI match hook. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- v1->v2: - Comments pointed out by Ilpo: - Squash few lines from the next patch to this one to have less churn in next. --- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 73f887614e04..feedfba0acf3 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -6396,9 +6396,14 @@ static int mlxplat_probe(struct platform_device *pdev) { unsigned int hotplug_resources_size = 0; struct resource *hotplug_resources = NULL; + struct acpi_device *acpi_dev; struct mlxplat_priv *priv; int i, err; + acpi_dev = ACPI_COMPANION(&pdev->dev); + if (acpi_dev) + mlxplat_dev = pdev; + err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); if (err) return err; @@ -6476,9 +6481,16 @@ static int mlxplat_remove(struct platform_device *pdev) return 0; } +static const struct acpi_device_id mlxplat_acpi_table[] = { + { "MLNXBF49", 0 }, + {} +}; +MODULE_DEVICE_TABLE(acpi, mlxplat_acpi_table); + static struct platform_driver mlxplat_driver = { .driver = { .name = "mlxplat", + .acpi_match_table = ACPI_PTR(mlxplat_acpi_table), .probe_type = PROBE_FORCE_SYNCHRONOUS, }, .probe = mlxplat_probe, From patchwork Tue Aug 22 11:34:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360526 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 821E6EE4996 for ; Tue, 22 Aug 2023 11:46:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235203AbjHVLqb (ORCPT ); Tue, 22 Aug 2023 07:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235194AbjHVLq3 (ORCPT ); Tue, 22 Aug 2023 07:46:29 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2062a.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8d::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BE69E75 for ; Tue, 22 Aug 2023 04:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SSzz9gsdfex9xU/rNOj/3c9XGkLBcbq/vIs4yryyoZZC+WYlpytpf5sT1q7IvGyskM7gQbCJ9egUDSz4wIT4H5Pt+A51Fy2Mv3Sb5LOldzOZPZ4dWNxXaob+LD50EPn8Ub5QTywOQ0TbnLwbZJJMbRVnBqBBREpu62ty3M5LU5C5WE3KW3h9cAeOMbUnYNdcGQe0bA5ubXoe/t7UVBDK0r3eW8QS4N40ZchN2zPD2SqGdHKmh9ISgaza9wQemyPVuYRmaLqNnhn9Z2V4zhmccV5T7RsPSRh6hqd6QfTQPvvdXLuL5HM9MubRQfGnUhrEYB/g6/zU4PFnwUMW9QrUxg== 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=sVaDH3l6YCmzGYizfZ3Iu2nzeQXcFo3dN7vfj2hhFQg=; b=erWcIl4Fb0LOSX8CrEVNoM/xsQv6uPTcem/r2QNGJHyJYxYLzwqan5+UDVezvm6pQGIiI78ffxkamdkjMY9pV+xGo6VkfnVsHt7bCOP7/skk5O6WAWkYZClbyRNGNOKSybD416/TCBYREvKwoU3g7IAcgdX7zb1Ry5QjWcFYieNX9A4eLORM3TRxnazZ1RLocYOpp1tNboHW1DgZ/XB/JJi9Z7zvXwMvCzfFJsR7UL0+/w5fhkDyVBZJ6tVlrkJANkZel2lx+uZzJcxWUIDThiin4xXky1WRYgpaTeR9FW7SX89E4d6HOyBB9lkbCflGcbi+AU19GToDgG4trXzNRA== 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=sVaDH3l6YCmzGYizfZ3Iu2nzeQXcFo3dN7vfj2hhFQg=; b=QiVz4evquYx0fnQAx7AzxTHUgMUuwu6bXbdlwHEBujKX31ODJT3CAFuKHW4ndW7kt8B5BxcJzIZBK01SyJxK4+NoNyuSNET1UpJ7P7DO2LtjS+UCdKrr3OW6DMOe+YArdJF7+kcbhtdRC4uapVQ9kCgnQYrQ2MNn5nh62LEVJFuFvKkeyj/IaWD1pBA++ULF2gIW2XzZIqu12BJU6ztRQ7Ymjf3q2tkK8h7D1KFg3OPnLtAYwlDwTTnnPt9RRNoC/l18Yeuu4CVK3MW5YxzvFYo7T+FINZFjIOXTdvHVl0NfZksZHvvbfk2gscq/A0cEn7D7KjG5xD0Vq0eaaVUTzQ== Received: from CY5PR10CA0006.namprd10.prod.outlook.com (2603:10b6:930:1c::6) by CY8PR12MB7121.namprd12.prod.outlook.com (2603:10b6:930:62::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 11:38:36 +0000 Received: from CY4PEPF0000EE30.namprd05.prod.outlook.com (2603:10b6:930:1c:cafe::1f) by CY5PR10CA0006.outlook.office365.com (2603:10b6:930:1c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:38:36 +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 CY4PEPF0000EE30.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:38: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; Tue, 22 Aug 2023 04:38:24 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:38:22 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 12/16] platform: mellanox: mlx-platform: Get interrupt line through ACPI Date: Tue, 22 Aug 2023 11:34:47 +0000 Message-ID: <20230822113451.13785-13-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CY4PEPF0000EE30:EE_|CY8PR12MB7121:EE_ X-MS-Office365-Filtering-Correlation-Id: 78e9f6f2-ebf5-4fc9-b52a-08dba30452c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RiuvXAdNZpEL+jZhm2oA0c38bmwmUSQEBMvuRaQbDwHMrcUnMYDxFGGNm5cqzBS6490SxNhRmFG3AhFc85oh1Mrfee6gzM65K3GaR/CEdRR8/wqNckdLKsqdngv50bJ22RGGFtivQtMrxhwxIuGDTNMnsVy3NrBGkxDIrb3Hxfw5dJChAxxi+UKvv3rKmBRiJq6mX+MwA+3FLahhUdUo9owMEElYR9n0CVAPQD5ud5r8jV5OY15tEvQNeKQCyCShlzilFqwkSZuGEnIf1GzISriQXrqdROsenzn6wYX5vnb5T1q0L7cfaMoZ+B8kHYZgorRqSepFQ5DEM+qM5T4IddG1D75rEc2XtMmYzCKuuCEsIBpT2tLQ+yrfBrw0uXq8YUyxA0M4kf5x7i07NQgHnockAkmD9PTr3SRgRLRZPS4q7ezdY4kH6JZsgzXfMpSbse5+gnTGdJNYqA2vVq1alSs47HjXW2NldmYN9qNsUd62coGfJC3AtwcHxx/qcW2GCki8CLG5nm1SnIhuTxE0Z9Dd4OS3icbQPBeXYFSv8lqUtlOrcaqE75Xo6Z1f9tIFZ/vj4pcSPITGy04Dczihc9LeU2WXwgFvHhQDoh+GYtCQuCr6otgPUkYomJ+ird9pruxqfgJqAtFXh2BWDILqVlfQ/fUOJFAU2nr4SyIQHYkdL3Qanxjhpod5Em9SuRQOn4065FiNlVy7iKNRoPOeXHkDOgH98Uv2W0jq7W3yuO6Hn6SD2NK+xJk79d80nUcc X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(316002)(70586007)(70206006)(8676002)(8936002)(2616005)(107886003)(4326008)(7636003)(36756003)(40460700003)(41300700001)(1076003)(82740400003)(356005)(478600001)(6666004)(40480700001)(83380400001)(2906002)(86362001)(47076005)(36860700001)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:38:36.5521 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78e9f6f2-ebf5-4fc9-b52a-08dba30452c0 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: CY4PEPF0000EE30.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7121 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add support for getting system interrupt line from ACPI table. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- v1->v2: - Comments pointed out by Ilpo: - Remove ' acpi_dev ' declaration, move it to the previous patch. --- drivers/platform/x86/mlx-platform.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index feedfba0acf3..3eccb6628ccc 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -343,6 +343,7 @@ * @hotplug_resources: system hotplug resources * @hotplug_resources_size: size of system hotplug resources * @hi2c_main_init_status: init status of I2C main bus + * @irq_fpga: FPGA IRQ number */ struct mlxplat_priv { struct platform_device *pdev_i2c; @@ -356,6 +357,7 @@ struct mlxplat_priv { struct resource *hotplug_resources; unsigned int hotplug_resources_size; u8 i2c_main_init_status; + int irq_fpga; }; static struct platform_device *mlxplat_dev; @@ -6188,6 +6190,8 @@ static int mlxplat_post_init(struct mlxplat_priv *priv) /* Add hotplug driver */ if (mlxplat_hotplug) { mlxplat_hotplug->regmap = priv->regmap; + if (priv->irq_fpga) + mlxplat_hotplug->irq = priv->irq_fpga; priv->pdev_hotplug = platform_device_register_resndata(&mlxplat_dev->dev, "mlxreg-hotplug", PLATFORM_DEVID_NONE, @@ -6398,11 +6402,15 @@ static int mlxplat_probe(struct platform_device *pdev) struct resource *hotplug_resources = NULL; struct acpi_device *acpi_dev; struct mlxplat_priv *priv; - int i, err; + int irq_fpga = 0, i, err; acpi_dev = ACPI_COMPANION(&pdev->dev); - if (acpi_dev) + if (acpi_dev) { + irq_fpga = acpi_dev_gpio_irq_get(acpi_dev, 0); + if (irq_fpga < 0) + return -ENODEV; mlxplat_dev = pdev; + } err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); if (err) @@ -6417,6 +6425,7 @@ static int mlxplat_probe(struct platform_device *pdev) platform_set_drvdata(mlxplat_dev, priv); priv->hotplug_resources = hotplug_resources; priv->hotplug_resources_size = hotplug_resources_size; + priv->irq_fpga = irq_fpga; if (!mlxplat_regmap_config) mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config; From patchwork Tue Aug 22 11:34:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360538 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 F1101EE4996 for ; Tue, 22 Aug 2023 11:48:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232037AbjHVLsn (ORCPT ); Tue, 22 Aug 2023 07:48:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235326AbjHVLsm (ORCPT ); Tue, 22 Aug 2023 07:48:42 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2060.outbound.protection.outlook.com [40.107.244.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4876E72 for ; Tue, 22 Aug 2023 04:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bpz4grliHpaMPE48+Ja0k/0sg44MRhG9UQCSq01W6GQlPMWX/5u9ekm24BBB+K6f5PGrTn7YEotgmGbJWdtntogx7yB3WX2AXq/tCCsGHnNuLJ51wG5H+CFoR1ZevS9Ic8dqpfVsMKDoOkwJaUHX5w1MmZMVYCTtqxZ4ZssDmWNPNWBYxcFOJSHcKapeBEBTWXotXeUVO5NxR7TPCaIwV8psIho9hKfGKs4ZmKveuQlxeERophlUCa9citFNuGh92xsvlNyHfFh0/4SS39EVqDggMu5gnVb/V/puIR7iHR3RU90+ySQw46UGtPCg1rEEHw7e3EOuarI+XJzaLNeX/g== 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=ty1oAnfeE1ymby9aStHD3LmVLTAPCGrj96L938BHIPc=; b=ZRYwzRY/xKxpgGwrv6dov2i/L4FDbjkpSZZjmGU9TnTgLD5dgU0Qj0Zf/jiojpiHvxGIQrIhsC6mFfh0j7qjai0c7gBFkKUcHvfes1sRKfIBoi1QXQdkYZRjPv2Ao4VzjZsXk6ptqKac5VrW5mCYOd7BF60uE4MAFG3tJiD1BW445QFcbvzkmtHIbd7ys/hUxTWSphlOHvKfhwIjEDfcw0l3yptpYLfsXJBQnASKHLkCVTZEP3f8eVLTB09TNdDFINwlUDw4t8r7mBTG93DtCWqyK3Acb9QUvWI8HFfOJB4yMJKErjyJSuTI/OMqWWVarYZEhzArCLwgi5/ARBR4Og== 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=ty1oAnfeE1ymby9aStHD3LmVLTAPCGrj96L938BHIPc=; b=YLKjI3EW3FzJaJHYo4/N8iUA8gaWx42pq8Opbm7TgSuvv5q8MiaxteFtzngRH1zTZR6StaZZnccs7s07iItW9sP6hbOzLVG3yOYnfgLnHSvepG919DVNxFDT+BtKf87iKJfyciL8LAIFRf8KYGb8jkq8O7/K33kfWvKbZZT7OxKSceAb4SRzE6YAJ4Mk7Gf+tPqsYhmnPDNilrpC3jNBpYDxVyEHxwckjF6bHh+8NupBa8p02vdCP+anqsHecS3rgHsoM8BsqlaWbmOpvDS+9S0ES4zatyKbU5mB7HTCbnOjHfCCwzYSkwoPQx0jTJgHcevaUKN8yNxYMhUGtKvNyg== Received: from SN7PR04CA0021.namprd04.prod.outlook.com (2603:10b6:806:f2::26) 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.6699.24; Tue, 22 Aug 2023 11:38:41 +0000 Received: from SA2PEPF0000150A.namprd04.prod.outlook.com (2603:10b6:806:f2:cafe::91) by SN7PR04CA0021.outlook.office365.com (2603:10b6:806:f2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:38:41 +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 SA2PEPF0000150A.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 11:38:41 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:38:27 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:38:26 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 13/16] platform: mellanox: Add initial support for PCIe based programming logic device Date: Tue, 22 Aug 2023 11:34:48 +0000 Message-ID: <20230822113451.13785-14-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: SA2PEPF0000150A:EE_|CY8PR12MB7436:EE_ X-MS-Office365-Filtering-Correlation-Id: 75d2a070-229d-453c-fd84-08dba304559d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gjz5g3tUuq08nZTHysy2/PR9e4Zd2nFPU5wIC8U5dvuMdc7EY4Sdk4zsVUrn8TKvlA3s+v9zol4pPXNrJSg/y+waTjymhUADXI4EjufJN4yE3UotdNNNSQ6GJepfx8MlMk2cMz0gbaeM+xKv6mtzRK8dEhshUIR0GQEoN8Ot04FHIuy528w2qZYa5ZQvpN3aa6pky6pD4+0Hyb8fzC7dEFI+YrD5R+ZSYvJ/NGSDCHo2cP/4FV6dVZsXGjr1/E7tx3cd2AruUaPLMu0BRAU7Ls3tU/Df106hMcVzNCruu5JAsuIfIhrqkjJfUtEbMXJjTpIvfrh7eQAj1znMCBsAG+5V9nR5GTfa3FfsdJ4rvoXaV0XGzEB4AkaBbh2O2bARXGgpUJ3dxAcx/jBqXNYBG0kD20+Ou+xA9COLjy1HLWsqBrWUSbBawb2kJ6e5HLbELR328BDWpqo0Y7QKiqIkD5SGZLcwwgb8qTDSHCW2LZsVusaHHo+LSQK6cXbK1nhhiLd1OXPQv++zZo9LfJPvhLMm5WOzR3RqaNb41irFvZXaeIUo49Q076CDGqj6F9eCuOmC6XDNgUe67yioH8Dn6BleJqCjkj0YxA26q1mUMyKiBw3HPe0VIpcqdXOk0oImfujEeF4V86uUhglzE9syj3ldHn/bvfKsVfgBD3IjAHyuS0Ypc0005Mfar7cINvH0EeO4sSLuQS3z1ga8ykYgUXPrXLCEgnXiLs0l6SalxAxvw0u6jyG4+rensRf/tdM6 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(316002)(70586007)(70206006)(8676002)(8936002)(2616005)(107886003)(4326008)(7636003)(36756003)(40460700003)(41300700001)(1076003)(82740400003)(356005)(478600001)(6666004)(40480700001)(83380400001)(66574015)(2906002)(86362001)(47076005)(36860700001)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:38:41.3265 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75d2a070-229d-453c-fd84-08dba304559d 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: SA2PEPF0000150A.namprd04.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 Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- - Comments pointed out by Ilpo: - Suggested to use common label name in mlxplat_pci_fpga_device_init() to avoid labels duplication. - Vadim: I would prefer to follow the convention we are keeping in the driver to have consistent code. --- drivers/platform/x86/mlx-platform.c | 134 +++++++++++++++++++++++++++- 1 file changed, 132 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 3eccb6628ccc..44f107965832 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -331,6 +332,12 @@ #define MLXPLAT_I2C_MAIN_BUS_NOTIFIED 0x01 #define MLXPLAT_I2C_MAIN_BUS_HANDLE_CREATED 0x02 +/* Lattice FPGA PCI configuration */ +#define PCI_VENDOR_ID_LATTICE 0x1204 +#define PCI_DEVICE_ID_LATTICE_I2C_BRIDGE 0x9c2f +#define PCI_DEVICE_ID_LATTICE_JTAG_BRIDGE 0x9c30 +#define PCI_DEVICE_ID_LATTICE_LPC_BRIDGE 0x9c32 + /* mlxplat_priv - platform private data * @pdev_i2c - i2c controller platform device * @pdev_mux - array of mux platform devices @@ -362,6 +369,7 @@ struct mlxplat_priv { static struct platform_device *mlxplat_dev; static int mlxplat_i2c_main_complition_notify(void *handle, int id); +static void __iomem *i2c_bridge_addr, *jtag_bridge_addr; /* Regions for LPC I2C controller and LPC base register space */ static const struct resource mlxplat_lpc_resources[] = { @@ -5544,6 +5552,9 @@ static struct mlxreg_core_platform_data *mlxplat_fan; static struct mlxreg_core_platform_data *mlxplat_wd_data[MLXPLAT_CPLD_WD_MAX_DEVS]; static const struct regmap_config *mlxplat_regmap_config; +static struct pci_dev *lpc_bridge; +static struct pci_dev *i2c_bridge; +static struct pci_dev *jtag_bridge; /* Platform default reset function */ static int mlxplat_reboot_notifier(struct notifier_block *nb, unsigned long action, void *unused) @@ -6172,15 +6183,131 @@ static void mlxplat_lpc_cpld_device_exit(void) { } +static int +mlxplat_pci_fpga_device_init(unsigned int device, const char *res_name, struct pci_dev **pci_bridge, + void __iomem **pci_bridge_addr) +{ + void __iomem *pci_mem_addr; + struct pci_dev *pci_dev; + int err; + + pci_dev = pci_get_device(PCI_VENDOR_ID_LATTICE, device, NULL); + if (!pci_dev) + return -ENODEV; + + err = pci_enable_device(pci_dev); + if (err) { + dev_err(&pci_dev->dev, "pci_enable_device failed with error %d\n", err); + goto fail_pci_enable_device; + } + + err = pci_request_region(pci_dev, 0, res_name); + if (err) { + dev_err(&pci_dev->dev, "pci_request_regions failed with error %d\n", err); + goto fail_pci_request_regions; + } + + err = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(64)); + if (err) { + err = dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(32)); + if (err) { + dev_err(&pci_dev->dev, "dma_set_mask failed with error %d\n", err); + goto fail_pci_set_dma_mask; + } + } + + pci_set_master(pci_dev); + + pci_mem_addr = devm_ioremap(&pci_dev->dev, pci_resource_start(pci_dev, 0), + pci_resource_len(pci_dev, 0)); + if (!pci_mem_addr) { + dev_err(&mlxplat_dev->dev, "ioremap failed\n"); + err = -EIO; + goto fail_ioremap; + } + + *pci_bridge = pci_dev; + *pci_bridge_addr = pci_mem_addr; + + return 0; + +fail_ioremap: +fail_pci_set_dma_mask: + pci_release_regions(pci_dev); +fail_pci_request_regions: + pci_disable_device(pci_dev); +fail_pci_enable_device: + return err; +} + +static void +mlxplat_pci_fpga_device_exit(struct pci_dev *pci_bridge, + void __iomem *pci_bridge_addr) +{ + iounmap(pci_bridge_addr); + pci_release_regions(pci_bridge); + pci_disable_device(pci_bridge); +} + +static int +mlxplat_pci_fpga_devices_init(struct resource **hotplug_resources, + unsigned int *hotplug_resources_size) +{ + int err; + + err = mlxplat_pci_fpga_device_init(PCI_DEVICE_ID_LATTICE_LPC_BRIDGE, + "mlxplat_lpc_bridge", &lpc_bridge, + &mlxplat_mlxcpld_regmap_ctx.base); + if (err) + goto mlxplat_pci_fpga_device_init_lpc_fail; + + err = mlxplat_pci_fpga_device_init(PCI_DEVICE_ID_LATTICE_I2C_BRIDGE, + "mlxplat_i2c_bridge", &i2c_bridge, + &i2c_bridge_addr); + if (err) + goto mlxplat_pci_fpga_device_init_i2c_fail; + + err = mlxplat_pci_fpga_device_init(PCI_DEVICE_ID_LATTICE_JTAG_BRIDGE, + "mlxplat_jtag_bridge", &jtag_bridge, + &jtag_bridge_addr); + if (err) + goto mlxplat_pci_fpga_device_init_jtag_fail; + + return 0; + +mlxplat_pci_fpga_device_init_jtag_fail: + mlxplat_pci_fpga_device_exit(i2c_bridge, i2c_bridge_addr); +mlxplat_pci_fpga_device_init_i2c_fail: + mlxplat_pci_fpga_device_exit(lpc_bridge, mlxplat_mlxcpld_regmap_ctx.base); +mlxplat_pci_fpga_device_init_lpc_fail: + return err; +} + +static void mlxplat_pci_fpga_devices_exit(void) +{ + mlxplat_pci_fpga_device_exit(jtag_bridge, jtag_bridge_addr); + mlxplat_pci_fpga_device_exit(i2c_bridge, i2c_bridge_addr); + mlxplat_pci_fpga_device_exit(lpc_bridge, mlxplat_mlxcpld_regmap_ctx.base); +} + static int mlxplat_pre_init(struct resource **hotplug_resources, unsigned int *hotplug_resources_size) { - return mlxplat_lpc_cpld_device_init(hotplug_resources, hotplug_resources_size); + int err; + + err = mlxplat_pci_fpga_devices_init(hotplug_resources, hotplug_resources_size); + if (err == -ENODEV) + return mlxplat_lpc_cpld_device_init(hotplug_resources, hotplug_resources_size); + + return err; } static void mlxplat_post_exit(void) { - mlxplat_lpc_cpld_device_exit(); + if (lpc_bridge) + mlxplat_pci_fpga_devices_exit(); + else + mlxplat_lpc_cpld_device_exit(); } static int mlxplat_post_init(struct mlxplat_priv *priv) @@ -6366,6 +6493,9 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) mlxplat_i2c->regmap = priv->regmap; mlxplat_i2c->handle = priv; + /* Set mapped base address of I2C-LPC bridge over PCIe */ + if (lpc_bridge) + mlxplat_i2c->addr = i2c_bridge_addr; priv->pdev_i2c = platform_device_register_resndata(&mlxplat_dev->dev, "i2c_mlxcpld", nr, priv->hotplug_resources, priv->hotplug_resources_size, From patchwork Tue Aug 22 11:34:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360520 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 A22FDEE49A3 for ; Tue, 22 Aug 2023 11:41:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233476AbjHVLll (ORCPT ); Tue, 22 Aug 2023 07:41:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231960AbjHVLlk (ORCPT ); Tue, 22 Aug 2023 07:41:40 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::601]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A546AE77 for ; Tue, 22 Aug 2023 04:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QkStmN9bzN/eG/OYo90Aekbnv9f3Cco+nYti6OM3d+r17/pL1qihnP744avyaef52fVu2YNKIzZF0BDnroOKRVR0r9qjQvh0CDhM78x8npPgAnH9zPO7H76ZnUrxcNH8pdCO+/bCb3WrplTeT8KNH3AOLJaj1Iqa75OicbTtwMrM1j7SKxFA3Z2RTS+leXCcKgwjpoz6GPM4oPLLdCywskxX+mkL7v3iyTwq8ANCzDhVZLJRCPJmRvE5gdz/b2ZulxPr+n0MpqU2MleWORmiYG0mXYiOossK4IBK4AWZ+QlZY5TLLUuXIjkKgvYu8w+/FYBsqGc3gQiqZX2KUB6upA== 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=lYrzRi3JI4+NSNzYyD/O4BkzfSEbUSdmQXzBr2SXIy0=; b=AFVLxk2u1jStXK1qdgKnn9UAclRZzUc7FDYiQAPDCURU1VogxST4ACpJeKybGOGniiSKGYJk6bzcS55NHHraPOpUM7JC1RcgOxUXVqkA57/P7AYmPmL7afAqv5R1CYQQbuljVgqJuLExDCy/RRpLIiqp8bDf48vDmXJZQm+Cj/YxJ0BWrK3IC+foUg3pQmwXd5/KuU7kSQk6Jqf7HLF69RbGFWvQIu3GT6j1yy9qEajFx8XUIxJceEKChB2gtS4SdSyLq7s3RPqF2DR9sOAHSV/5HRIz1WFFi31mM3dRsQUUPWS1DMIB2/oAVw5LVT7hKpii2DkCT2I6y0Aq7mY9/g== 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=lYrzRi3JI4+NSNzYyD/O4BkzfSEbUSdmQXzBr2SXIy0=; b=WXJ/UZdvytRK/xv0fqzTGdJpV7K2MQQSN31ZHTtUhzhIydJQHKnxpdHkIgjY8JjCDB9A9HLkxSDMQgiI9ZsI1Hzae8vzfyTWM6KWg+WaUCAT19bcfL7k5ff41Ork0X4I0jGRx57DnIZxrM5beMUFUt2f6wCdAMINsBKvVnJu6DHbr6BnbqJLdIzPtqh+ZcgOgI5PQlmWfXny14I0M515AoscSTb6qUWtFFJjuNYFY1Y6LLA0kI2epRkm+TEWTKMGZOdQIP75YFHVm7IFLfWsDIHLw7u8MrlTv/6BxLIs3SEfRsnzA0y5E8bZMMJRG6atXNfLtfz+IKBJMZril+EF1w== Received: from DS7PR05CA0079.namprd05.prod.outlook.com (2603:10b6:8:57::9) by DM6PR12MB4864.namprd12.prod.outlook.com (2603:10b6:5:209::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 11:38:44 +0000 Received: from CY4PEPF0000EE33.namprd05.prod.outlook.com (2603:10b6:8:57:cafe::19) by DS7PR05CA0079.outlook.office365.com (2603:10b6:8:57::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6723.15 via Frontend Transport; Tue, 22 Aug 2023 11:38:44 +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 CY4PEPF0000EE33.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:38:44 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:38:31 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:38:29 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 14/16] platform/mellanox: mlxreg-hotplug: Extend condition for notification callback processing Date: Tue, 22 Aug 2023 11:34:49 +0000 Message-ID: <20230822113451.13785-15-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CY4PEPF0000EE33:EE_|DM6PR12MB4864:EE_ X-MS-Office365-Filtering-Correlation-Id: f65b4bd5-cfc9-44a1-6bda-08dba3045797 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D2Xr1wnaOckC4GqaxkA4YtdCuKjqW1js/0267b+RL5JDCK8j1mqvWe1fF5BuMhWgWTp43ut55cR192rxvxUxCdAQXnXf4xsRy7IT4kyHOzcHY6e+3C5WKjQ2LG1K1tKc4S51iwGTqSHESLj5PZ3lnvY0iOfyXb3efCyKNyHdzGHtwURP9OQLtwsGOzsdSRHZW8iLdXIHdml7QLmyXSODv/GYtTfiGp4jkmj8mTTlPF2uqcEMfw5HrVldA+8vmUYVkQ9GmhhjBLKMTJSiajkUkgK6CYmQu/dwieuHhzx/Kg6hLCmBhG1y5XKp7ySDFO8mluQD9jFtp9kTSXPWHqBgc3ICt4XE7xkUxhGqyw3+1HOFppGfyvkqYlZRMPXnf0UxYV1468ixYjShNbgNZO/pEQpBszKWu41yp1fA84NWdy7Pm79ARFc7nzkbtbKSsj+JNPHPzyGazLoWSoK41z3MF/7xofin8RTc/M1AJXfpc3B9e2Ad5yprCh5WLOt+UgE6L/6bZ4WmkErOdtfLbs1Hf0XsrSah2cNTpN74KuIfwD7dmC8kJy2Mea+87sCMn/1RvVCbtmqWCxQy2RQ0ohB2l/tbzg7hiAh+gbgNuJDgYkrbn+1DQAX1NZkpXsy4kHx1NnAcqsCFTKvSVpQHJpjvdG9qnn3HVoVv/Fhtli+1nMNfThMfjJXoEZrkhkHYWQC9Ug4dzCdLml0WM5IWNT9jZcfR3Ub5DY9yIPU6sGz5wxly1LxYJ70tjZVr0TZqq5cr X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(396003)(39860400002)(136003)(82310400011)(451199024)(1800799009)(186009)(40470700004)(46966006)(36840700001)(2906002)(66574015)(83380400001)(40480700001)(15650500001)(5660300002)(336012)(426003)(26005)(16526019)(47076005)(86362001)(36860700001)(8676002)(8936002)(2616005)(107886003)(4326008)(70206006)(316002)(70586007)(54906003)(6916009)(478600001)(82740400003)(356005)(6666004)(36756003)(41300700001)(40460700003)(1076003)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:38:44.6701 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f65b4bd5-cfc9-44a1-6bda-08dba3045797 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: CY4PEPF0000EE33.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4864 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Allow processing of notification callback in routine mlxreg_hotplug_device_create() in case hotplug object is configured with action "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in case no I2C parent bus is specified. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- drivers/platform/mellanox/mlxreg-hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c index 6ddfea0d4c5b..eb5ad35274dd 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -112,7 +112,7 @@ static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv, * Return if adapter number is negative. It could be in case hotplug * event is not associated with hotplug device. */ - if (data->hpdev.nr < 0) + if (data->hpdev.nr < 0 && data->hpdev.action != MLXREG_HOTPLUG_DEVICE_NO_ACTION) return 0; pdata = dev_get_platdata(&priv->pdev->dev); From patchwork Tue Aug 22 11:34:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13360525 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 324E1EE49A3 for ; Tue, 22 Aug 2023 11:43:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235095AbjHVLnd (ORCPT ); Tue, 22 Aug 2023 07:43:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235102AbjHVLnc (ORCPT ); Tue, 22 Aug 2023 07:43:32 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20619.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::619]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3A73CD4 for ; Tue, 22 Aug 2023 04:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lorET7YQWkxgbJSc6c8AXbTkGVXpurT4HdKKuDMmIMZLlgSUEOB/AkjwlTgxHUJPeTOcnDcm4YLsogA9L0A7AfRYz30WrP9Jp96yUZoIe29KJkl8BOpHEU1FK9xZBTWoOf/gOSk2kTLaT+n3XqUFqjT882pxuuQ7bc7vdYpJ5345QWXcWLR3I7d0tFGYUzN2YjKXOrBgDfJAZju6lRgTzdHmdJN7ilauIC8xSPs9LDEHgTUi6z3sPTWyh9uV5lVs2dHeiaJ9Rl8hSURbzk/ONwtsFQxygiHlsx+l9piE1dleH/ZHxboXTbcYDHb4xKIG80ceKIGF9Q2yQqLO5n1csQ== 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=AIyWXVrZdaVC7ufs1PIBd+WymvgdYPwkbJE3NTr/u70=; b=oYFUQ1O+D/F1sfEvdfUSqCn5NxUfVidQtuA8a+KBGAog09Ps5c7w30/WUuDnC21AqdCNW8E0BZgTL0QfZzbS19EU1Uwh6VuzJZVtYL0Ruf/zPJFAGNXxLb/uW21mSwUv3Cn5ti+yyFww9XX2+BU+uzsb1A2ZDbEJYODa0IZBbB01eFA5pMkWYjp1ik1Ot4rzWkmGJloZIEdQ/DIv/8ZOQ9gLsh6b8C52xCNrWyxz4GDMLxjgXqyEvceZ6cZ+BwscFZtMuRgyhfHm12t2aC1/OX0uDMii4KjZeHI8n6y0gzP9ghcTXt80eqmtldJ8JgZG+eez0/36JUNE5W1Cx50Frg== 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=AIyWXVrZdaVC7ufs1PIBd+WymvgdYPwkbJE3NTr/u70=; b=AZvBmFo05bvInX7r3izBUFGtT2qZ4PKH6nDzHJ0s9nJrsZZNYVKb1Lq4LupVUygA/IMwUJ9Ed0lmioLneH8qzihvSMFiDFgkyw2p27WMgjFTQiF+AERGHGnBII9jP+zvkaZboZc23uzJtY04c3arYrta8pz5FpC21mc8/hA5I+1niJLhZkeW3AoRQjAv4Ahv2tDhM2e0IJ3ryjoKEmC3LCQ+mirbhP5Rpvlru+6tCTfbwqrCASPD0Kf0b213Cii4cXYpH4eW+ehif/XkFgzohwB0RCR568pvtbKFTILA/T+ep6snjfbxANsCmgJJKjumJhyqtC9qni0+n1DzHHgMSg== Received: from CY5P221CA0054.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:4::25) by SJ2PR12MB8692.namprd12.prod.outlook.com (2603:10b6:a03:543::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Tue, 22 Aug 2023 11:40:06 +0000 Received: from CY4PEPF0000E9CE.namprd03.prod.outlook.com (2603:10b6:930:4:cafe::48) by CY5P221CA0054.outlook.office365.com (2603:10b6:930:4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:40:06 +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 CY4PEPF0000E9CE.mail.protection.outlook.com (10.167.241.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 11:40:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:39:52 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:39:50 -0700 From: Vadim Pasternak To: CC: , , Michael Shych , Vadim Pasternak Subject: [PATCH platform-next v4 15/16] platform: mellanox: nvsw-sn2201: change fans i2c busses. Date: Tue, 22 Aug 2023 11:34:50 +0000 Message-ID: <20230822113451.13785-16-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CY4PEPF0000E9CE:EE_|SJ2PR12MB8692:EE_ X-MS-Office365-Filtering-Correlation-Id: a4802391-0e41-43b2-ca5c-08dba304882c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i4fLhfFlZMBYrCbQKNeTqIxpcTr1o7fWdVjemg7UDa57/Iig9gXD4LRdWQN4y9R5jJIxKMj8txLc5+kKlguYnK5Okm/mwweWOWS25lxDTwobEUgE2ZjLXjeppPW3kq7vxNrT7r4GKsAkNL5AUMr9fkAn08LHUAfyYjewiP81vsnFRIcLAii5Nr/Mb2WIVpJW9G2DDBLVBmfhh3QGuPpj++Wguj0fPxC4SlvZMeAbvg0Z6C78FkRgLaQms1eSHXqtZpHPt2FHNqjKfWlLp6fTnHjgRw+xkyHH5LWv4vZu6FFxNjcnCRM8iTZt86qee8znLE1FD0xCc4yAluP6AtM3zwq+JAV1i4kx+miJmIJzWXcKE/rzz3byuvK3gVspltv1BL1vzBHEoU2RdebRnE+hJCf2iO3gBawpelvf7ixF/xEDEdLR2fq2ca4xH3Kho4bBrkfzE8ZU/W4keO+ueV5OXlAIoE3ajv8oGOlXBzLeYjh2m1BctVDd3nxykGzzbuRFAw869XmXlRBjaOfUaZHw753ssznqu2XnOwlTj7Jf+s5ODnNU53epCMpFNl+rA0Ba+IJ9/GvdNMUEuUNNL+7CenOC3HVfyi79FRxxsTgsHSCsrv6YwKmKpt0WwMuPC9tKI9fcX+jwq7ImyI05xjwHHLt1LyXzZ3DFnyAyL9RNtasErCmmNN7FBQtwiHNtVXZb2fpp3DTdDSxm1im7eGQywCi9GMeHrNgFTD1qCvsiLg+QABZA8hg96T6+dB+6WkGp X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(346002)(136003)(396003)(376002)(82310400011)(451199024)(1800799009)(186009)(46966006)(40470700004)(36840700001)(356005)(40460700003)(2616005)(8676002)(336012)(426003)(107886003)(26005)(16526019)(36860700001)(47076005)(83380400001)(4326008)(8936002)(2906002)(5660300002)(1076003)(41300700001)(70586007)(478600001)(316002)(54906003)(6916009)(70206006)(82740400003)(40480700001)(86362001)(36756003)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:40:06.1796 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4802391-0e41-43b2-ca5c-08dba304882c 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: CY4PEPF0000E9CE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8692 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org From: Michael Shych Define the exact i2c bus (adapter number) of fans on the SN2201 system. This will cause fan's EEPROMs be connected already from nvsw-sn2201 platform driver and not from user space after receiving udev events. Signed-off-by: Michael Shych Reviewed-by: Vadim Pasternak Signed-off-by: Vadim Pasternak Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen --- drivers/platform/mellanox/nvsw-sn2201.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c index 7b9c107c17ce..75b699676ca6 100644 --- a/drivers/platform/mellanox/nvsw-sn2201.c +++ b/drivers/platform/mellanox/nvsw-sn2201.c @@ -84,6 +84,10 @@ #define NVSW_SN2201_MAIN_MUX_CH5_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 5) #define NVSW_SN2201_MAIN_MUX_CH6_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 6) #define NVSW_SN2201_MAIN_MUX_CH7_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 7) +#define NVSW_SN2201_2ND_MUX_CH0_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 1) +#define NVSW_SN2201_2ND_MUX_CH1_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 2) +#define NVSW_SN2201_2ND_MUX_CH2_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 3) +#define NVSW_SN2201_2ND_MUX_CH3_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 4) #define NVSW_SN2201_CPLD_NR NVSW_SN2201_MAIN_MUX_CH0_NR #define NVSW_SN2201_NR_NONE -1 @@ -425,28 +429,28 @@ static struct mlxreg_core_data nvsw_sn2201_fan_items_data[] = { .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(0), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[0], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH0_NR, }, { .label = "fan2", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(1), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[1], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH1_NR, }, { .label = "fan3", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(2), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[2], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH2_NR, }, { .label = "fan4", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(3), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[3], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH3_NR, }, }; From patchwork Tue Aug 22 11:34: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: 13360527 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 3BE76EE4996 for ; Tue, 22 Aug 2023 11:46:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234461AbjHVLqh (ORCPT ); Tue, 22 Aug 2023 07:46:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235202AbjHVLqh (ORCPT ); Tue, 22 Aug 2023 07:46:37 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20612.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::612]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D1E1E5F for ; Tue, 22 Aug 2023 04:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oDA+ErQMINanb81+Bmzf0zoBbqiJgwllpYbrAxzFNcpjucQMdI52DsLkePVJj6zeprqFmrm7n06Pbvx3f01E6bdaBoMWZsty25RLZgxxYSzD5cas35OSlb08oTAhAWmJTGrRvWq8HgQBYlJIyLfjyY7dwm5k7uJTtQvsIB+9H52FMxvpNjGJBnnqDo+2Uy9n74nj1rEjAIrddRQEXZhwsEGOPW+NNUiA2YTvkH+8CoFn7DKGuXPxAHzw3dbTS7moMVa5f7WcCNBGbWcah2CxW2ng1GRQTD+4X9K5F4PDjGLh6708FJt/uD8GYwQGt8m3H8fANjfN2teKko45RvolzA== 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=Rj6wdWcBaPAbNRILTYFgyCBmiR1O9FEQUZrUfEZa6AI=; b=JeWJ1/5BY5iZ2wVWwjVLt2BqdGeg9x5i41MCJ4RtVUBdpfPbo0lAHPfM22FqTul2QOegUPnxC20TOQCkoqy/HO7hwzsf1/zGp5HQyE0e8d1kYth2rw8ieK2zu/fZNaHNg3L1KFR7tyqLELRhwtOlD4VlRLWY+C3kd64MLo9WEXxzbjai64jHJ8VPNZnGYNb0ArgxzFw5JdNh6iarNg3nQX7mJL7DJ781FGjxExdCom2AebWcM2BzYBWe9JeCtEHqkQLHpf8NZwn8Dq+9i9rewID1cjC8yySABfk0A4LdMxCD2ZNRsTHtl83CoyY6+SVIBBUqB5wWvnn8fvH5fT9g2A== 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=Rj6wdWcBaPAbNRILTYFgyCBmiR1O9FEQUZrUfEZa6AI=; b=dPvwcoeR+UcVUOcVmQkWCfDI/u56hPgaoMpZ2K+F/c+rsG/avkFtplKqS+/7cwNX41Gkz2g3B+LH3Sx2uLW6XnmQlgr5tR+d2fVLdVqGyuSSUVtxunl9HMYJUqx4BojPHEhcsvqKkOZfGpYgKc8WKIny3WtJTF1TvWkVhr9o+aNxVX/RDD2gJ4E1RVVrlLDRkB80TrGkxiycWLOVUamOy3fk6jqykhjlCIYVrHsT1K+H278BRgrxjba9mW/43gD9yUXx6LFtJyfQeuCqOkp6LPSpOxakrNcAnxDG7xHvoBsUz8d+X6romACZ2ecac+vq2cTWVGygLTDHD//hpaYL3A== Received: from CYZPR14CA0018.namprd14.prod.outlook.com (2603:10b6:930:8f::28) by CY8PR12MB8411.namprd12.prod.outlook.com (2603:10b6:930:6e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 11:40:12 +0000 Received: from CY4PEPF0000E9CD.namprd03.prod.outlook.com (2603:10b6:930:8f:cafe::16) by CYZPR14CA0018.outlook.office365.com (2603:10b6:930:8f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 11:40:12 +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 CY4PEPF0000E9CD.mail.protection.outlook.com (10.167.241.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 11:40:12 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 22 Aug 2023 04:39:57 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 04:39:55 -0700 From: Vadim Pasternak To: CC: , , Vadim Pasternak Subject: [PATCH platform-next v4 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces Date: Tue, 22 Aug 2023 11:34:51 +0000 Message-ID: <20230822113451.13785-17-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230822113451.13785-1-vadimp@nvidia.com> References: <20230822113451.13785-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CY4PEPF0000E9CD:EE_|CY8PR12MB8411:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c0d3920-29d4-4abf-37e5-08dba3048bd3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: juWjiCCuG6+J6fRXHYTU4yhWH68RzOuuHr0PvRQjgmuueWCaShbBWEk8XigWFuTp30mK29Eb6YNC2kQoLNGTMMC7Z4aMtYhSkQaD1E1mR1KPtX3ZzmOY4bj1Wwha9VieDFZneAjIxVapWr887GN1QV8rST5TMHTcVv2lQsLtkYVu44HO6g5kYImTicVi67p8hukcw2c43STALcxVNNZLMEIk60b7NF+R823uhorvqJeYIBn1ijjNkuE+CVRf70kjbLzgno2KcE67m0AMt/GqVFguQUEk7Qa1zuiETlG0v3ZVD/gHkyEioxypsgw+mWoi/ssycB+se4mL/EIrqglw+PHzx1OFIoSSKJfqC8+xf5maQLQ4S9NLHQkxLY3s4yR/bLurR7ghq4xlntqDBd88FYF6xolht1o/JrSh+kI4YG5BZvxKlg5tN3z5THBDhpIGF9zHT1E3BV0bsSvMjbA7bnJlWoda8OH+nm5guND2stn6expWb4toaaC/pBdBR1CGsb/4D4CQVDT6igFZ/CUY5hkubgOCmO01csWDE+UCI5JEn88BcLZ7cF5X+XMidh8kGBXyk1RCHmEw5Hs8+kWwTnzuLvqxs+wxg/F5kOmfQVKPLcqnGn2+5/WU3k21lGFa2pbzQNluqcKwjwzCv5QX66SZlzKWCY5N1lNqzZeWcK7tqamkQI7CAEv732nYHst38xPhWO+AMREJz6fRFkvaNMD6RYfPNnLsKsm67YQcsx5cGWoRWXW/NFauAuuBs432 X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(316002)(70586007)(70206006)(8676002)(8936002)(2616005)(107886003)(4326008)(7636003)(36756003)(40460700003)(41300700001)(1076003)(82740400003)(356005)(478600001)(6666004)(40480700001)(83380400001)(2906002)(86362001)(47076005)(36860700001)(336012)(426003)(5660300002)(26005)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 11:40:12.3035 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c0d3920-29d4-4abf-37e5-08dba3048bd3 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: CY4PEPF0000E9CD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8411 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add documentation for the new attributes: - CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min". - JTAG capability: "jtag_cap", indicating the available method of CPLD/FPGA devices field update. - System lid status: "lid_open". - Reset caused by long press of power button: "reset_long_pwr_pb". - Reset caused by switch board DC-DC converter device failure: "reset_swb_dc_dc_pwr_fail". Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych Reviewed-by: Hans de Goede --- v3->v4: Comments provided by Ilpo: - Modify desription for "reset_swb_dc_dc_pwr_fail". v2->v3: Comments provided by Hans: - Document new attribute "reset_swb_dc_dc_pwr_fail". --- .../ABI/stable/sysfs-driver-mlxreg-io | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io index 60953903d007..115302236627 100644 --- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io +++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io @@ -662,3 +662,55 @@ Description: This file shows the system reset cause due to AC power failure. Value 1 in file means this is reset cause, 0 - otherwise. The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: These files show with which CPLD part numbers, version and minor + versions have been burned the 5-th CPLD device equipped on a + system. + + The files are read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: This file indicates the available method of CPLD/FPGA devices + field update through the JTAG chain: + b00 - field update through LPC bus register memory space. + b01 - Reserved. + b10 - Reserved. + b11 - field update through CPU GPIOs bit-banging. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: 1 - indicates that system lid is opened, otherwise 0. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: This file if set 1 indicates that system has been reset by + long press of power button. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: This file shows 1 in case the system reset happened due to the + failure of any DC-DC power converter devices equipped on the + switch board. + + The file is read only.