From patchwork Mon Aug 14 08:58:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352586 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 87917C001DB for ; Mon, 14 Aug 2023 09:01:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235884AbjHNJBD (ORCPT ); Mon, 14 Aug 2023 05:01:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234036AbjHNJAc (ORCPT ); Mon, 14 Aug 2023 05:00:32 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2085.outbound.protection.outlook.com [40.107.95.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBCAE3594 for ; Mon, 14 Aug 2023 02:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SummNpMvJ+ppsuxafJSjHGjv9pRXfyT0acS2XpD6qm3Jh/pWhaeMWfhhzRUxpsSheH1/M6GVxLSNop2Gs8ZaP2zfMCUs/oG9fNeoU8fWmVMvHs/+9cPi5oONOnq89LTWODScARe5hVtHp8eXRt23Ns8K7R4UCMFmTqKzIy3SIM7CXE453lWZXnfbKVRNClHmsMHHdqUFWjrxkRwrrskOoehtY4uYBV6Wnvp/HDZ0ppm2uc6wbatfFsO5lWHUk3P4Y0ho425e57GsHmXJvLsAx0IRvvVM3UNiAks3ZUxGuMQtSEYyKwliC8bjJ+kvgbDE+dUrOqf5doHHo7VCIVAHsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wIfvYpg0TpGqP3q8ijl/ltoshmSs0R0qAGqQrwDhAvc=; b=TrlKM5U5aM6e3F9nwHfCRtw3I44SDVTZUS2PRicOlW34UTYDgzryAKwcyhoR+/WotcXWU7HH5w76VN4PrVaKbKIqREm+K/BzJ9syekdV/EAP0rZBtkDIKLE6dP2CCYuazQEoYn/Q+wcdpocN6TGg6Gj6hzVJP8DOEBgnVso5G+FmippfmxKAmZlJ2sd4HETZsJqluz4VYjCjeyHl7TnZcJL8wgEEBkCKjCFXigzY6ydclfrsjSBoKltCws1Y3W2SyyggEVunsUNVn49AI5vwOmvUr+J4cdYm5ws+xD75AzImiS6jwU4yaoOS8orkCP1PeT04Y5w80IMVQw+ovTIE6g== 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=wIfvYpg0TpGqP3q8ijl/ltoshmSs0R0qAGqQrwDhAvc=; b=Bd10ckSVSNaJWylaPlbNmvy+7QwJ4a0fv67H2gVRAw6MZ7KszUNJYvGdNqlRAiDdomiaoC7ru/ja+pDuuyNko2Q01gBN7UcnoNHXNkL1PSZSr+OFJh8zd1Sqow7TdLcHZLRr1BP2eGk22mck4BNnOn4AcN04xAJkBA3wGwfZoTKkpaMEIYQX2+H85/t5YPRshe8BbLvG3uS+EWjNdgKs2ifmuW6TI+q4RUXheVO4cWaW0XZMSNmxwDWY/FpGmD8gRB19IaEW42yET6uTTTiB45Mn5NC0ETCv6JNUrUX3OTLPBbEfsYnWa5tfBE41E+0QrvlgE3hBDwhnK4x+djobSQ== Received: from CY8PR19CA0015.namprd19.prod.outlook.com (2603:10b6:930:44::25) by MN2PR12MB4552.namprd12.prod.outlook.com (2603:10b6:208:24f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 08:59:47 +0000 Received: from CY4PEPF0000EDD1.namprd03.prod.outlook.com (2603:10b6:930:44:cafe::28) by CY8PR19CA0015.outlook.office365.com (2603:10b6:930:44::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 08:59:47 +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 CY4PEPF0000EDD1.mail.protection.outlook.com (10.167.241.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 08:59:46 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 01:59:33 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 01:59:31 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 01/16] platform: mellanox: Add new attributes Date: Mon, 14 Aug 2023 08:58:55 +0000 Message-ID: <20230814085910.56069-2-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD1:EE_|MN2PR12MB4552:EE_ X-MS-Office365-Filtering-Correlation-Id: 25f89e18-f579-4bf5-db1e-08db9ca4cf5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kcNiMEPyeWFAjKSOfogQje+sw6gdnfrc9vj/KBdzg1WgAnoBvPrewlra9jqYGjvqbQrGECPC0Jghc7BWX1uMB98oKOLDyDomw1A2uIS5TI8Dhb9nOFDwx2/tKGcwbnhxYqH5TrCuuwKAr+qo8EDaNL19RsIfMl5RLRDA9HG0f7K5mUFSMqDISvQ2cZTAgONfLylN5HJTKYJdhj6flF7cZ5ZcYzx/DwuO5Tl0kvDdKt/WVxnkA5ay34ECCqKYYvAPFRCJzLKFxAJE6tAkLtbcsjOzrKpNlsOshNtK8n0HiocFSvLjS/kKxC4E9oX24jDaz9K15ltign0FPsPF+5xRwskb1b3v3tsHLbYouRz6oDEtn0kg+OfOqMJnak6AUsabkTuxiXU/pYfuWBhTnnQxz6nbgdKFwddv33DzoavQW0CtQoZEvKhrOEE0jUM/B7ipQdaexAHARxdhbfXCgNXPf+8+I/6sosmX6z0AiNq1mXBillC/CVuQoRjwEmmD9++NjtHfv5URTTMT+BApadizJYnh4pDGWbFRS4NxfaB1taHS/+CzotZDJNqByr7lJx0+vyXvTikyxe1UVaR8JtjmUIAQk5d2GOIkP1iEYMcuwtilDDbxN94fgBjnsDdopJdtxoIHnwNNj+T2uja/FhqJ++6krVJY6AR5zautEIlV1WWPT1wv/UfjMVYQP9rWzwcKu8dIuYbptw1y/TX4GWqjJMID6mAwMqIHAhnoWiRTKx2Hl/yURhjm3F53XH8ZSIuS X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(136003)(396003)(376002)(1800799006)(186006)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(107886003)(16526019)(26005)(1076003)(41300700001)(336012)(8936002)(70206006)(70586007)(316002)(8676002)(36860700001)(2616005)(47076005)(83380400001)(426003)(6666004)(40460700003)(478600001)(40480700001)(54906003)(36756003)(86362001)(4326008)(6916009)(82740400003)(7636003)(356005)(5660300002)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 08:59:46.9320 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25f89e18-f579-4bf5-db1e-08db9ca4cf5e 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: CY4PEPF0000EDD1.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4552 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add new attribute: "lid_open" - to indicate system intrusion detection. "reset_long_pwr_pb" - to indicate that system has been reset due to long press of power button. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 7d33977d9c60..26748c285ddc 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -3792,6 +3792,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(1), .mode = 0444, }, + { + .label = "lid_open", + .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(2), + .mode = 0444, + }, { .label = "clk_brd1_boot_fail", .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, @@ -4431,6 +4437,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_chassis_blade_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(6), .mode = 0444, }, + { + .label = "reset_long_pwr_pb", + .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(7), + .mode = 0444, + }, { .label = "pwr_cycle", .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, From patchwork Mon Aug 14 08:58:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352603 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 81510C001DB for ; Mon, 14 Aug 2023 09:08:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232967AbjHNJIK (ORCPT ); Mon, 14 Aug 2023 05:08:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236061AbjHNJID (ORCPT ); Mon, 14 Aug 2023 05:08:03 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D1C835A3 for ; Mon, 14 Aug 2023 02:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e70kPMMDAD2DnmXom/i1uTUrIz2bkZl3CcUjuKjN7JFtW2b0f1JoSL+XxAjyKAdxHXTU2nIWzbd5q1gPqwZG8wdyEQmmuhlNFm5mOB/NMNaYKRpAi2ZvGbYUrapy555S9KUhR5w9YlQiYWFxjYAIhIzK8oCSic9weufOUXP3yYZMqc0C7Lo95wbIoNPZIsXFeJBgzvveSxC4iQ5phaTzsJuZdq2xCvulEmMY2/OMTmdx3VHqpdXFVBWg50HUaMPB7WlLIm0fiz+iHaw4n1MgvhCxumK6OTCIcHco4PxWW6Y3aKoQg8CNokjD0oxD57Br7gXjOqpxfCtycJx5Ixjtqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=n3o7zjrxWmcBcgOJbtoazQjgaf0vR/PH1EprPS7AjO0=; b=MwhimDvskEMU6bqhJWqzS4Gv1TWKJhwCrygvzrgGB4g60RSM7crVEynVBrSTtfHMCMW0UNrOL19HEjn2gPR3O/z6oVKMaMMYyJ+JDU297+kSTF39Pf2RrivycP7i4qtiATUCYLNmEgdgK8nuJ9jYLrJP/VwlsC+UpDphRTeC5UyYJ6xPS2kPIEdMXmxtvCkHnEbPUKfJSl4a7OU4LpW3By8thCtmmoEkZAm45zzYTSFv6O5karO9HyBuOSmozlhasR4JiwhlSZeFFifqyioQ9M9kR38eOswys+u1P2LvAEaYpflIUUA6R8KCc3A2zXZw/+H49VjgdOoBpPLXangS5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n3o7zjrxWmcBcgOJbtoazQjgaf0vR/PH1EprPS7AjO0=; b=OcyaPyC3NeygYTUoSw8PfIGe3mgGSwSh3FA/qxg0gt4+xdY6NIaceXvyicwjoPyrotmE1qxXHiyUcg6ToaFFD8fN8lJe9TKsWMhsN28i1+KBzhFyqh6pYDBR3lUl0ibjyW5qTIN89yIaj1CHPZOYbXGe91CODDk7Y6kAxwxgrcrj91veNyVu0iRXwCTRTTkdQA+h2e3ivtsd34NS2qsIxkfruiIlqwyETzeEJGqbtplE5c0sDUzVNUpmbvHiuQLdSb/A3TN7kW9l05D1UA8R+0hn1Tf6PTOX8gwvez+vTRlJXqqm+h9Nmtuwl6VXKKlSPxL3aF/c+xhIOEeCeW0+lw== Received: from CY5PR18CA0014.namprd18.prod.outlook.com (2603:10b6:930:5::13) by DM6PR12MB4973.namprd12.prod.outlook.com (2603:10b6:5:1b7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 08:59:51 +0000 Received: from CY4PEPF0000EDD2.namprd03.prod.outlook.com (2603:10b6:930:5:cafe::55) by CY5PR18CA0014.outlook.office365.com (2603:10b6:930:5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 08:59:50 +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 CY4PEPF0000EDD2.mail.protection.outlook.com (10.167.241.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 08:59:50 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 01:59:36 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 01:59:35 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 02/16] platform: mellanox: Add field upgrade capability register Date: Mon, 14 Aug 2023 08:58:56 +0000 Message-ID: <20230814085910.56069-3-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD2:EE_|DM6PR12MB4973:EE_ X-MS-Office365-Filtering-Correlation-Id: 74bace4c-5c4d-4f47-e68d-08db9ca4d1ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: llB+pZuLYCmJODofcxCzeuZc7dC90e28285z7+g0YMisG6cL0guXz8zCtug3CGShlsyFhhwr3dmft/ciX0AShEtGT72fjP9lB9aMWakMT/EVyUuGMqRdYoSkrnCqtA7317oaeOoIJOajD45cdLChwocPgq8YAXhmvtQQ5Epjz7yFCfL5i2TgBKo20L9swnC0s9keTJDIpVZFbkzmMd3j5Rc/VEGxoAkKZWiq0f6TyDIxjhjd9juyHaH/ck1PH6QJi7rElmvPNRAm4F+rD9dgLol8kNAsvt1cX2FwOqtPt/CJnjwu0UHIMqy0SwZtyfZIXg1RWFsejXL5ytQzqejscINLMltuIIK9spVxdk9ks3c0lPc4bAnN1CcKJY5ftye0yCkjQGYiO9C9K36VT/I/558QPs8P7AmReYoPdZyCLAocjfwAVeUm2zLVtAfYp0uPmQvtsWGDSW9bkMIji+gp7Q1ApgH/OQnDZl3Eq0zjSivQlKj5XdTbTRyv8qFyCDmH+u6bEvLGjk5XcvsDzDmXxh2ifBs0rAQ5lNZa+nkz188J4nxnTJhxW1hC4Rx2vbrPxw6kxt7GUH2uyAXLFjZvGzdjm0ONK0stoR+/rBdU64aFI9HO1Ow5v6nNJ3BUIrOPKn8FJ5owfnMl3HKVKHh0Hrknd7ss5Xi7GrAIgIl+wny+pB980eL8yJJfAd+S/H6D7/rkOiOiLNzE+5zbE+zaP8YmWU67kBrfb6Ol842cjlnycwnubVOMOPrtwM15C36S X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(376002)(39860400002)(396003)(82310400008)(451199021)(186006)(1800799006)(36840700001)(40470700004)(46966006)(36756003)(5660300002)(2906002)(86362001)(40460700003)(40480700001)(83380400001)(36860700001)(6916009)(4326008)(316002)(70586007)(54906003)(70206006)(41300700001)(426003)(16526019)(1076003)(26005)(107886003)(2616005)(336012)(47076005)(8936002)(8676002)(6666004)(356005)(82740400003)(7636003)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 08:59:50.8055 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74bace4c-5c4d-4f47-e68d-08db9ca4d1ad 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: CY4PEPF0000EDD2.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4973 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add new register to indicate the method of FPGA/CPLD field upgrade supported on the specific system. Currently two masks are available: b00 - field upgrade through LPC gateway (new method introduced to accelerate field upgrade process). b11 - field upgrade through CPU GPIO pins (old method). Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 26748c285ddc..647a10252c2f 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -62,6 +62,7 @@ #define MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET 0x37 #define MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET 0x3a #define MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET 0x3b +#define MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET 0x3c #define MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET 0x40 #define MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET 0x41 #define MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET 0x42 @@ -236,6 +237,7 @@ #define MLXPLAT_CPLD_VOLTREG_UPD_MASK GENMASK(5, 4) #define MLXPLAT_CPLD_GWP_MASK GENMASK(0, 0) #define MLXPLAT_CPLD_EROT_MASK GENMASK(1, 0) +#define MLXPLAT_CPLD_FU_CAP_MASK GENMASK(1, 0) #define MLXPLAT_CPLD_PWR_BUTTON_MASK BIT(0) #define MLXPLAT_CPLD_LATCH_RST_MASK BIT(6) #define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3) @@ -3680,6 +3682,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(6), .mode = 0200, }, + { + .label = "jtag_cap", + .reg = MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET, + .mask = MLXPLAT_CPLD_FU_CAP_MASK, + .bit = 1, + .mode = 0444, + }, { .label = "jtag_enable", .reg = MLXPLAT_CPLD_LPC_REG_GP2_OFFSET, @@ -4935,6 +4944,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_SAFE_BIOS_OFFSET: case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: @@ -5046,6 +5056,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: @@ -5203,6 +5214,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET: case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: From patchwork Mon Aug 14 08:58:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352602 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 70AC6EB64DD for ; Mon, 14 Aug 2023 09:08:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234986AbjHNJIL (ORCPT ); Mon, 14 Aug 2023 05:08:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236196AbjHNJIE (ORCPT ); Mon, 14 Aug 2023 05:08:04 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2086.outbound.protection.outlook.com [40.107.92.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3152735B7 for ; Mon, 14 Aug 2023 02:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JQFEmoeX1NwK5GR3ebwqy4xZHzkXuzAQKdSvJ1rQKdHS7gue4/UigYM15TchGg2z4gARsZUKADGvOXU2yPN8f4VPBCZY9FeT0/LeGDJG7XRwIaKAhNfa3GeeqGs4OFSBRd0BQWJf2FzJTO/kPV1NOT8LW/LnQc/M3CS6eM20rYTRf0JY/OQXmLWRDS+SN18TNKSh330BjKp1GsCxfsiuuW3lgkJjDlq939fvpJ3QtuOfmNDTsU63aiXPr/6TEwjN/l1nloOtzhxQLi8O9rHkqk5B0cjSShAijLW47ubTHaZrJwhoTU5Cw2ncq8abT35saehfD4DLxWLeqL0h2hG30g== 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=fO2y5y6YdctAZfUI0UdBNW2eRj9iD1xiqx56WROfAPg=; b=DUj0ARcFTANeUtoMREa4T0HA+/zOZiqK1fQTbWSXj9oVot5hwcu6i260RC6FcYCBHF5QV5WFrhkZbep3fmbG0s9JwpcBkLTOjR1YkvjKCoev3UU7v78ZY48ygUOACfpC2X8iE+E73AllsXJA7mr5b7n97uuZZ00sqDZNc2ENJvajZzVJDuShkriNY671CKOhFFyhA72rtl8aSgOSjKRmYXW688jBaycwNFgk+6CkRKNP5dr/1SRX9T3xiiNZAm3IDpN1P3HD93K2YhhN11K9iuo/rg1cIC7P3+SxRhX6hLc3vYPlpMmY2uWcd3mouiPy1LUD/WifH+R9k6ATBzEQfg== 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=fO2y5y6YdctAZfUI0UdBNW2eRj9iD1xiqx56WROfAPg=; b=V0nPlOSevDSlLMRK6Vfe3LoBRnoeE/JZySz4KVVNzGKAGvJzFiMsafVc2N85il1dcJwB4EgjMvldvXBKhubA+Pfvzlsyujl6vH0s/ihGWlo1BYBEChzof3s2LlozxMqCqtdVPHYoXBt0zS0bRsWSr8IeiQK2QCCI11vh5T7txKYdPkl+xH0YdbX2jVEpT6lSyjZrPaFmoV4FZsjC3CxIwHYJJ7Iaq1T3relurVzLWoXFRnRQNNrtNpU7wMjW6Uk0pWYNJSADFQYv6RRWBTOR3r8ecrSkjqP6DmmsxyebfRk6XwhOhXu1E34uC0WtaYc7yJVMyoAKgI747FWljf7Vtw== Received: from SJ0PR03CA0355.namprd03.prod.outlook.com (2603:10b6:a03:39c::30) by DS0PR12MB8787.namprd12.prod.outlook.com (2603:10b6:8:14e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 08:59:54 +0000 Received: from CO1PEPF000042AB.namprd03.prod.outlook.com (2603:10b6:a03:39c:cafe::f8) by SJ0PR03CA0355.outlook.office365.com (2603:10b6:a03:39c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 08:59:54 +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 CO1PEPF000042AB.mail.protection.outlook.com (10.167.243.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 08:59:53 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 01:59:39 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 01:59:38 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 03/16] platform: mellanox: Modify reset causes description Date: Mon, 14 Aug 2023 08:58:57 +0000 Message-ID: <20230814085910.56069-4-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AB:EE_|DS0PR12MB8787:EE_ X-MS-Office365-Filtering-Correlation-Id: 52c2a364-ff8e-47af-f85e-08db9ca4d38b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jC+OshZGlVLJ5b2b+GX9nmNTxG9lun8QTdIt503RxoHp/u1xCoKNxn5/6HXOkB+HEorCy9t/Zw9iKgZm9weH1KG5BHfl8J5KLbSYVRoi695Z6BlWc4Swb+F6Z6v2H7S6NM9jHHjai7AdKgyew66opYzc7/9AEJcDyeomC+eRZ1leeGF/+f6a9BVd0DKEO6bS263Agt6U7eVMLcxIYjBL5lpx/zoPFie3ZNFwCFlbIa8WMbUKHxTnDXZ10HAgaH8Kj3svN8IgH/BMG+9KWa/vk+jn9zWqSMtBciFrYszGbw/xcOvPxKLNG3lw+XE6vZWwty5vlbELN1zFjeFJTYA7CDEU+jWMhegM1ClyvhAH6Sdrl0F5Pdqe82IpWs8RMHu+PqSA57tnGw4BqjQlXYvxTDHcKEY9QsfOhbC4EapaBPZRrZrIvTGrhykoCEzUaGZgib50/LzG9kiYhtamqefq8uqT+M3+yW+ojf1M7Nzod18q92B4uDd5w8RvJKGvhy23iL28TRrKVGlYwfkD571Bkf9bSx5quyJLbDcn7rie0ps7GhCRHOIvGdK+PXTlBIzv/Uu2kLKsJ6XS3wcoZ5sjMSiED870lHYZB+LtnOg8JBl0R0soeFSu+8vdGHR9el9GDKN7lM5rCDPuzU5oYD7/ldB6A0ChFD8EU14IU8O9GUREpeo9paACwLRislWUcslxwZb7kmRaKeOmYzI+bHYMzcs77KkMIwf8+rE1Ou6kR1BkkmeRrMstbH+JnDNpfqBs X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(346002)(376002)(396003)(1800799006)(82310400008)(186006)(451199021)(46966006)(40470700004)(36840700001)(83380400001)(2906002)(40460700003)(7636003)(426003)(336012)(40480700001)(47076005)(356005)(82740400003)(36860700001)(316002)(6916009)(41300700001)(70586007)(6666004)(70206006)(54906003)(8676002)(8936002)(4326008)(478600001)(86362001)(36756003)(1076003)(107886003)(16526019)(26005)(2616005)(5660300002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 08:59:53.9698 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52c2a364-ff8e-47af-f85e-08db9ca4d38b 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: CO1PEPF000042AB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8787 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 speicific reason "reset_sw_reset", which is set along with removed "reset_from_comex". Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- drivers/platform/x86/mlx-platform.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 647a10252c2f..5b0579752afb 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -3556,12 +3556,6 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(2), .mode = 0444, }, - { - .label = "reset_from_comex", - .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, - .mask = GENMASK(7, 0) & ~BIT(4), - .mode = 0444, - }, { .label = "reset_from_asic", .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, @@ -3580,6 +3574,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(7), .mode = 0444, }, + { + .label = "reset_sw_reset", + .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(0), + .mode = 0444, + }, { .label = "reset_comex_pwr_fail", .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET, From patchwork Mon Aug 14 08:58:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352604 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 6F3A2EB64DD for ; Mon, 14 Aug 2023 09:09:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235737AbjHNJIm (ORCPT ); Mon, 14 Aug 2023 05:08:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236681AbjHNJIJ (ORCPT ); Mon, 14 Aug 2023 05:08:09 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2075.outbound.protection.outlook.com [40.107.244.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B24C335B8 for ; Mon, 14 Aug 2023 02:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LkhFNoTukVz4VicC+FdKKOfFuFcnxTxuJeFj5QaUUknF2F6JMgl/LMKbi6DN80DCBwexZCffjd8oGIN1tF5gaRo5jWIeNyd5ZofMLiu6MNdHX1toKkhh8YOQLcZODqWCR/kiOsiluv15FxBA7B6ke67Qf6PEQf4khgCxciVXxCzmA6qNQMIIKYFlfC3GAzUSPcpD/zBZ1B662SiKRsLRpuS4Fki41V9MovD8HtOXm4FTeAMRguTdEMXMxYIHZExHZv6dgmwiGavJnnMvX7dKHVUUUyV+IWOlCor52Ab1SKloMwhQXr99ZWZaCPIxhzsnmv+phx5IPHm9XI198baZ0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JAi8Kkdm59FIWxf1eKWymBH92rg7i5TDcMGVZaqsMjg=; b=WH+eMHqfai+/j52JyXO5+NXEDriJnarCj3Yx2CQqUvY5jl/aOk21kWySrLrhLHrOcMXGqq82i5JvvSFVesjrk6S7rRZUWrWhF9th5YhyxRNZkLBa78HHvXGOmi1DenkevnAFFMCbIjPhzaHdQAHTHOFsrmNEFup33AxYNB4Mx3wGzY9f1djOtNOrRPbK1CQdGl6QXBZvv0hM0+nWLBBh49ynkPY1MXxFTaBLgvSaCMseKcRni5pTRKKrYyI24Zr/02c7yXR725yXcyBi2tDSYd8UjNs5LydW8edm4lkYIvIgqvrgvy9FTc/1qvfhiXnbU7EELR2BRcx3xx5caf9sUw== 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=JAi8Kkdm59FIWxf1eKWymBH92rg7i5TDcMGVZaqsMjg=; b=AAVDGc+irRlLMEmhkEbFYI5U9hgCedi/6sHlkYan3xGtRNjXpxjSLmjJl9iJb0lUOuBccKDdt1ZY842SmRVSmP1xmyArPtwRe5JACOPzxA0OuZ/ued01kxtTQ20SXm0YV0SZLzyu/hcUXfzbWND0758CudUNJerdYouGjLM9VL2WHd+/0DrUjKKzIDKV0AM2kYszZfB7cgKOnS8HUjeYXdp0BAO0zx3g6llzfgNzxCELGSuCxaup4FB3fhnVByFLowCy9AOvstFJkDCN2NlmLTqbkueIZTxPfP6R0jPkEyN6pzwAPnCz71imrVYhPI/hJxY0kNacAkVLPspdZm5Pvg== Received: from SJ0PR03CA0344.namprd03.prod.outlook.com (2603:10b6:a03:39c::19) by SA1PR12MB8644.namprd12.prod.outlook.com (2603:10b6:806:384::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.20; Mon, 14 Aug 2023 08:59:57 +0000 Received: from CO1PEPF000042AB.namprd03.prod.outlook.com (2603:10b6:a03:39c:cafe::68) by SJ0PR03CA0344.outlook.office365.com (2603:10b6:a03:39c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 08:59:56 +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 CO1PEPF000042AB.mail.protection.outlook.com (10.167.243.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 08:59:56 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 01:59:42 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 01:59:41 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 04/16] platform: mellanox: mlx-platform: Modify health and power hotplug action Date: Mon, 14 Aug 2023 08:58:58 +0000 Message-ID: <20230814085910.56069-5-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AB:EE_|SA1PR12MB8644:EE_ X-MS-Office365-Filtering-Correlation-Id: c54f93bb-4464-4b87-4aa8-08db9ca4d502 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E2VzENhElnFCBE/orYXtUbsSKDDxXh6X7esdqC+WTVswF/+tU321ES5CpdhOzrhRaKyYGbZuVHo+QfKc8Z4IAZSzYU/rIcIJ6khzvPzxa9SptjBEiNldD+4692QZHadZmUNBsG4TG/rtWd5pZFO6jlE5nAZ4Ow6chevH+juTuR6gymAJ6iyBxPC7X6QTaAIEWWmbKEifG6HNOaIc3SUNXVk7T4MOIwuLYfK1xK1D1DYxquzl/vHO3aKNYMJVzmPZgbV8/sEhO/Usc6wloSO0A7OaNpSxK0jHArVV8z0imqu4nN16wm4mtJDGefPFp5JnFN3O3HVIFZBlSTS1xz/1gwmrK/B5jx84cl4YTmOtl9cF17DCwk1zftMkT0NI09yumdX7X67KM5JRqi7i0xwHb4EzgEb7cFj3H7v2ffWDZhtsoVbEGrG1DcnRIn74cPjU2YLq8HPQFnshuF/iMZuK4QgDuTqqgc/Kyb+jlYkjQNO6Oc+gK58x1Nk6IRmLzUPAO5BdxWBzBltOYk2hBZitCis+Az79cNouw/eFKqA1wW77L3VR2AJoVjOyQEHpEbRuWIvnu0yX6g2ZLeuM8lYyyAswA7JqBzRNZ+TA69+tsqTW242EJUfkISwfimoKLiNMzzbGqlwKkgbfEv/XsRTAUZuRs89AlV5TZB7L8yF2hflZNKY7Of0t2nqdZnqGiy1QXhcFgOdAxaxbXVzvGvZHeKOIgz7DEOuUDxVX6xX8X4JjTBBBdnIOZt3QmqTGzTvgCN6/adLgl25hxqlFBGMHHQ== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(376002)(346002)(136003)(451199021)(1800799006)(186006)(82310400008)(46966006)(40470700004)(36840700001)(36860700001)(36756003)(16526019)(83380400001)(426003)(2616005)(82740400003)(107886003)(1076003)(336012)(26005)(7636003)(356005)(6666004)(478600001)(47076005)(5660300002)(54906003)(41300700001)(70586007)(316002)(6916009)(70206006)(40460700003)(4326008)(8936002)(8676002)(86362001)(40480700001)(2906002)(40073004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 08:59:56.4386 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c54f93bb-4464-4b87-4aa8-08db9ca4d502 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: CO1PEPF000042AB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8644 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Set explicitly hotplug event action for health and power signals for L1 switch as "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in order to allow processing of notification callback even I2C parent bus is not specified. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- drivers/platform/x86/mlx-platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 5b0579752afb..648b27eff0b0 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -2373,6 +2373,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_pwr_events_items_data[] .reg = MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET, .mask = MLXPLAT_CPLD_PWR_BUTTON_MASK, .hpdev.nr = MLXPLAT_CPLD_NR_NONE, + .hpdev.action = MLXREG_HOTPLUG_DEVICE_NO_ACTION, .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_pwr_events_notifier, }, }; @@ -2433,6 +2434,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_health_events_items_dat .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, .mask = MLXPLAT_CPLD_INTRUSION_MASK, .hpdev.nr = MLXPLAT_CPLD_NR_NONE, + .hpdev.action = MLXREG_HOTPLUG_DEVICE_NO_ACTION, .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_intrusion_events_notifier, }, { From patchwork Mon Aug 14 08:58:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352589 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 89A81EB64DD for ; Mon, 14 Aug 2023 09:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229460AbjHNJCG (ORCPT ); Mon, 14 Aug 2023 05:02:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235829AbjHNJBc (ORCPT ); Mon, 14 Aug 2023 05:01:32 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2056.outbound.protection.outlook.com [40.107.220.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBFF2172E for ; Mon, 14 Aug 2023 02:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SU0LV/m7Q9oa1H1pEJPw3IsOuOj7mPrUqmnrsjptdSha3j5t6OQXxKOugeyzoDgqi3tZbLFOt7ZN7+9NY9t25dAIQENAeD92jtg4yNssEsPFMNhlJabKL5J6A+V8ZTw31Epf9kyXRV8cEGciDf5Revg8Bp6M3GJgiA6O1sY3ZF4rTF2GLdyoAuJBAj6VTSx/yV755qUeP8UD7OGHvQAbQdWscmxnZKiF0ExssUEPv7yhUBil7PbsnyITC6laJTx4Yhg1XPub1YGzsDUDjAgwmf+0gKijak79KYvOuruPJpm9tg5Vpw9mTyp8xNzsAAkdR4+uEsF4LZYEmHDnlNSoag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/5lkbwuXaKYhnHRx76HIGr0lMKCPiw3Uu3qMe14L4FQ=; b=ALwGWUBGYxoSXIjKEDMD/OsvyvcB8MFui2vfv4jsyPcDe+o5TAts1GEpU1GuB3GpJ+B6oRgkW10oCtYVqjNU+EuspwNlq6vxqGCyBrz4ZdMSJvRdNBPWOJZ4CSsrjamU16NCNGFUNYLISccMibUSrsMQvKoYccSX4I0IUjkk2mL1wpSYTfCv1iuugw9DIWVo8zs7ByOM7LSpT4YSxglTpPRdyuW6UuA7CDViKo0hHX6Yx1wa2WuRsfK4O4SDjhTMEcE/RBSRhtKlmzrzcnAGs8zntDmIvVl5LXKyKnQKPCPQzqeiWDeHN0Ot3S+YLaFd27Q8k0MOjQFWUh6Pq5U4XQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/5lkbwuXaKYhnHRx76HIGr0lMKCPiw3Uu3qMe14L4FQ=; b=mgPSNpEZoZmYwE5wwvCWXgZ3uvExnjonXwEsFabAbD9KmsPbxxCktqlbycixuC/cGFgBp0A5PVyyJtuHv9hfRTkaOodnSeji+7ZITovNaEZYmTniS25m7pRk7DYHe8Ed75bGd1/MRuV7xgeRdkXZdHMzJf0zev511z55LEO6dtP+mJtliIeq7nVp04CQCUfXz1P2wAPyIRlds6fYLASLypBd8v0j4JXmJuBUONIYqdqpO46v0R2XcxXfowyQMjbXQotY3zXQYzmmrBBSrZzi+3f/J6A+48rXCb44CFEFSZMHFF4u8wqefzdR84/HetBwob5JcWG/ZdsBHBQyBFmbVg== Received: from BYAPR06CA0006.namprd06.prod.outlook.com (2603:10b6:a03:d4::19) by DS0PR12MB8248.namprd12.prod.outlook.com (2603:10b6:8:f3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 09:01:15 +0000 Received: from CO1PEPF000042A8.namprd03.prod.outlook.com (2603:10b6:a03:d4:cafe::92) by BYAPR06CA0006.outlook.office365.com (2603:10b6:a03:d4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:01:14 +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 CO1PEPF000042A8.mail.protection.outlook.com (10.167.243.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:01:14 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:01:04 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:01:03 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 05/16] platform: mellanox: mlx-platform: Add reset cause attribute Date: Mon, 14 Aug 2023 08:58:59 +0000 Message-ID: <20230814085910.56069-6-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042A8:EE_|DS0PR12MB8248:EE_ X-MS-Office365-Filtering-Correlation-Id: 064e304b-c836-4a72-4dd4-08db9ca50382 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nijBI1LBoYAQR6J9lNBh0s3yyTgm5CpvyIvwK6mWe1QSBEtybgp+haW4xAecvRxI0qiATfOaSOwg4nkiQKVYtVb13whI1rp40ZfvPEwRckyQ1O4mLcLv4c7JaYyWZ9MKa1zQWnJHdF/sH06QSoVe+u53r2190F7zjNf1oQ/X/UC20JPMdLnyrDRgtBatgYt3YvDGnxBgZ6rE3TSKeOYrlFlpXLFvtYHz3U79w5uloMbu+WhVAn1GyXLJjcDSsThw5DCYONOjPeNBD2Rft6hta8MFU1y2npqa8MSaGB/WGxUyJBosfQL8VaN5MTRGAYBlq2jFi/9w9ZY+R3MNToPltXGSJsFr2rv5t78lTva0X6WqqUf74jyUK0YszlnlqzrU5inALtgEPw71jQsmuqIzyca+SWYhlhQPgE6DjCpbsMDsoqLxbfBVbz70oZSi5a+E+BC7LMzWIseICX62XefGCF83D7ma8S1iEFB8rZyicEsNv4gn3dld978LDWb0n9viZM9GYqh/2b9y1Re+o1LqI6KXdYdkLIuPDqdiXwdPMhXkMWHo0KaBkybvX5uvTJ9uXEx6bXJV2T3KyVS9evjO6MUqrVTxRZXtGYCcbvRAOVipJvSkPHpFr7s/7iD3d+BXBsFrg22LAh9zYoDaJFMV0x1mXS9b2Any31vluWHfQ4FU/jy/Qh/pI986gigSGiTz1nmegFSSDPT5X+07BB3/KJH80++edLq0f8z0v3qqN13+Y7cqxm06Lzn3Q95mQfHR X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(346002)(396003)(376002)(1800799006)(186006)(82310400008)(451199021)(40470700004)(36840700001)(46966006)(6666004)(36756003)(356005)(7636003)(82740400003)(83380400001)(47076005)(36860700001)(86362001)(26005)(1076003)(107886003)(2906002)(4744005)(54906003)(40480700001)(426003)(2616005)(16526019)(336012)(478600001)(8676002)(41300700001)(8936002)(70206006)(5660300002)(40460700003)(70586007)(6916009)(316002)(4326008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:01:14.4527 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 064e304b-c836-4a72-4dd4-08db9ca50382 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: CO1PEPF000042A8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8248 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Extend IO registers description for some system types with reset cause attribute "reset_swb_dc_dc_pwr_fail" to indicate reset caused by switch board DC-DC power failure. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- drivers/platform/x86/mlx-platform.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 648b27eff0b0..8e07ed3dc552 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -3558,6 +3558,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(2), .mode = 0444, }, + { + .label = "reset_swb_dc_dc_pwr_fail", + .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(3), + .mode = 0444, + }, { .label = "reset_from_asic", .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, From patchwork Mon Aug 14 08:59:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352592 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 BEB82C001B0 for ; Mon, 14 Aug 2023 09:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234036AbjHNJCH (ORCPT ); Mon, 14 Aug 2023 05:02:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235523AbjHNJBs (ORCPT ); Mon, 14 Aug 2023 05:01:48 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8d::601]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB791199D for ; Mon, 14 Aug 2023 02:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V6YybHY9Zh9wSXk9I6KWWB7TjJT7Hjass5uIg1w5QHYO0Ln/JZTdWBRqAf7W+gSmABP5ioPi5jhKHZ/H/Dxq03N8FRi0j+cPd6p3054SCL9/w15rBYBFucVilG+W72OzI25ftvfMMqNMsqYcsOk0B7k9GYL4Jjfk2LzlkMqPiI/xITGfo4z95CQEI/Eo+OiKq8AW/O561hcKeDeuEa3UwFaC0Yon0gd+C4i3oL4dSS14KfzKhDqgnDGh0F9zYAJ10G8JCfgwuO6roHdfPV7AcgsCKCe5fZymMAMfChOhA4CVwsjThOaJMQiTswHPVHLp9NSy0j47N5/Ay7Rol4KQ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sj/48k7xmk1m/uzjsMFaYjUeKRCSxSITBMelJkeNCBg=; b=F1e2vQmXNmgw0MxjgQwviJrVZrsCzg/KvwrQtK85hnI9D6dPNYYHZz94ZVhK17xIeiRtbChwj5L+6qaf65Fkd6iB8FsFLMe6dqZVvBPtnTuhAI4ZyxTSLH+/ju5ZOotMz5+HQy8QbwvsYKwRnP+LC6R2iCmVuMpoRqH/ePUebdubSLj02m54/92fYtM2GeelSt+1kE6+k25NErDnJaWBuvr5JoSWktZbDvOz72VbvuuvFekkP4Z99h3pvI0llBeWkC5owVksKkU7TYQZmHB2fsctEB9NjV48JbGH2OHp4vOAADmsmCkcisifaSwBVQX99aHMcMZR8O3VIoLs8ZISNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sj/48k7xmk1m/uzjsMFaYjUeKRCSxSITBMelJkeNCBg=; b=rFa/mQBjP7BShIyxm2+2o5jhcHTwz4QkZfnXLgn1bJ8LpFEnXnC0SZLtZ6Uo6Mt7qduev1W4jYg0n8S4lR5GxaRf4f3Z42Hd23uryi5RruaWYbZ3UCCvIPPk462S16dgEqaZdT9CjLakxMVQNsoADkdRdOolgC1AjGwGkFkwfjcfY034Fpl1DkUD7igoxoq+VR1EtIp9tI7KJ7MWe0TxZU5V4OcO5roujKVjSjA53XLSJTjcN0k2VQAM6wh0eVJ16i0SAkUiYzB2QDaP6gjKGKlgkLe9W5W7CbmnR0CgTq2KfCFS2hVtP1+yvv723FVb9ruunTlHMsvPvi3y3xMewg== Received: from DM6PR02CA0155.namprd02.prod.outlook.com (2603:10b6:5:332::22) by MW6PR12MB8900.namprd12.prod.outlook.com (2603:10b6:303:244::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 09:01:20 +0000 Received: from CY4PEPF0000EDD0.namprd03.prod.outlook.com (2603:10b6:5:332:cafe::30) by DM6PR02CA0155.outlook.office365.com (2603:10b6:5:332::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:01:20 +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 CY4PEPF0000EDD0.mail.protection.outlook.com (10.167.241.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:01:20 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:01:08 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:01:06 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 06/16] platform: mellanox: mlx-platform: add support for additional CPLD Date: Mon, 14 Aug 2023 08:59:00 +0000 Message-ID: <20230814085910.56069-7-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD0:EE_|MW6PR12MB8900:EE_ X-MS-Office365-Filtering-Correlation-Id: c5e90d4b-3926-48f2-3e27-08db9ca50718 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l4WEMWk62ol5ggJeBHiBtK5Qo79wvajiFYG5kDaqi9pyZnWXI9um1vImNSTm5RB/XAuE2KBOdysQLca4+ZFt68zWs+jASTqiWeKfFGeAjc6LFSLrY3F5N1tsGcDcmNg2bOsbmYB24CdrQDIUhlo9GjmPN3SAzJuTQ1J/XnsUNpRGRsbB3t69VComCP29n4lHUjDm3GpA+BUKBJfOYcg9EbCH+Ht7KH37IlR2yL/y6f4YBqGtXtzrb7vG2zI1HUCmVFRqEbGfwyqj2y0TG8Xf9XBXqex0Uscp44AYTeN6L1/pHhxWgzcNKpJCo8MraFGsO0rtwBuBRKmpcWvkRLXt3m/hYx90lUcNt8MAiUVJ/yta8mWTyh/0QqQu03mcCTYw8ZP9svbzIganyMpM/pltmqNrj4L26PA0iXCT4vW79NJaau1IQcRZV39bFQrdMhUHIZNs7htAfesf1cQ0Y3cdgLmahjaZnZ1zAe5bzYYCY6DqTgDAqfX8OjV6ZVVHk9Etfn6WSbXZ6jDzl1ojLxUmy7tqUYPMH9KQ4OgHTLsaE34jwnYQV/lQ+DOQfoqIML3HqpocXPyLt1M+6LXyKlQ8k9mvi29yXdd7iMiLAT7AL0Ir3w83XE4sl0wKda79459Eh1p9twjC073+3fbtDjICGuORR+xFdLLoqFjEYTfTiBwKY4EMsFha9p4Lv8IR55b56/e361NLlfxG62EE8WziyPcoAiQe7/t82YPcnDTNgYElnTNzhZxGX/NU892QsQEy X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(376002)(396003)(39860400002)(82310400008)(1800799006)(186006)(451199021)(40470700004)(46966006)(36840700001)(16526019)(36860700001)(36756003)(1076003)(107886003)(26005)(336012)(54906003)(478600001)(6666004)(426003)(2616005)(47076005)(82740400003)(356005)(7636003)(86362001)(5660300002)(316002)(6916009)(70586007)(41300700001)(70206006)(4326008)(2906002)(40480700001)(40460700003)(8936002)(8676002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:01:20.4217 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5e90d4b-3926-48f2-3e27-08db9ca50718 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: CY4PEPF0000EDD0.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8900 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Extend to support 5-th CPLD version, PN and minimal version registers. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- drivers/platform/x86/mlx-platform.c | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 8e07ed3dc552..dce35934cc37 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -95,6 +95,9 @@ #define MLXPLAT_CPLD_LPC_REG_FAN_OFFSET 0x88 #define MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET 0x89 #define MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET 0x8a +#define MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET 0x8e +#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET 0x8f +#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET 0x90 #define MLXPLAT_CPLD_LPC_REG_EROT_OFFSET 0x91 #define MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET 0x92 #define MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET 0x93 @@ -129,6 +132,7 @@ #define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0xb9 #define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2 #define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3 +#define MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET 0xc4 #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET 0xc7 #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET 0xc8 #define MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET 0xc9 @@ -3431,6 +3435,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .bit = GENMASK(7, 0), .mode = 0444, }, + { + .label = "cpld5_version", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET, + .bit = GENMASK(7, 0), + .mode = 0444, + }, { .label = "cpld1_pn", .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET, @@ -3459,6 +3469,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mode = 0444, .regnum = 2, }, + { + .label = "cpld5_pn", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET, + .bit = GENMASK(15, 0), + .mode = 0444, + .regnum = 2, + }, { .label = "cpld1_version_min", .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET, @@ -3483,6 +3500,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .bit = GENMASK(7, 0), .mode = 0444, }, + { + .label = "cpld5_version_min", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET, + .bit = GENMASK(7, 0), + .mode = 0444, + }, { .label = "asic_reset", .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, @@ -5031,6 +5054,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: @@ -5039,6 +5063,8 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: @@ -5150,6 +5176,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: @@ -5191,6 +5218,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: @@ -5199,6 +5227,8 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: @@ -5302,6 +5332,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: From patchwork Mon Aug 14 08:59:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352590 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 CD271C04E69 for ; Mon, 14 Aug 2023 09:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235352AbjHNJCK (ORCPT ); Mon, 14 Aug 2023 05:02:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235552AbjHNJBu (ORCPT ); Mon, 14 Aug 2023 05:01:50 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2043.outbound.protection.outlook.com [40.107.102.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C48E010F for ; Mon, 14 Aug 2023 02:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X3FArqBTHEI5gjCOCgUjvAJorthfuETeX0cILuAKwjTjqsMQtM3vqWRXKR2C/LTouL3vhgRE1npzbMTQYbRcDzpZNjVP9Kl+RqjeWThDsqj3TODF0XL8vdftNIkDhKUx4WsaB09n606uomN1l1T4WVbMBnzZqKIRZWVWGliA2SWPeZO2V/YkUjeWUUBWA0qLeGByBwQ4CJKkjo9MAcKUj5i8TAtaCeW5UGa87lCl0qTfwBo/xzMkKhS06L6eH8/53zyhDsh/4m1hfAAmrM1CbRV89fwbmPViueZdNRCoffP9JfFedW2zNyXw1Q49TR3NZAnx2SW2N/8oWeyByANAmg== 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=JRPRuHKy69xKVC3vvzzbQwo2p99wQlVnTiACdBT3+K0=; b=CX6cM3VTMMe5ZnxhFfyeNMDND3bDPP+Y80XHgZKaTwCKKay1iFvRkiDPF+VybC8aDHjG/aJGRIW7O6P4TGUjCpI6LZkKttYmvS+OcNB+E4gJrYRFxWSUoh/9aJiGbqMfEeYVrieAwdEpUZao19ws4WkZ7NygalfEaMwzSjhqz23BNx3whDU2KChgzaC/belF7llVrVvFyklyx/w5wjPCm2DUP3aEbGP67zl7FqNbFgMuN5tzrv4HlqtETHAfTpK6wP46JXp9an1FiarNZU+47XALk1dYJdOBo1SmWw5F62B5OOuSD2QCpYL/E+bmqHGcOmETpk+/hLh52myLx1dvnw== 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=JRPRuHKy69xKVC3vvzzbQwo2p99wQlVnTiACdBT3+K0=; b=q+ytKzpXJhGd6BQJUSyCbBv5S8tPpRonM+L6wNyG6W+PGYYBAkyRnx8rf5tiCPUXUOu88DJtPTQg+SNpLbrvVKTE2fQeKWH2xeqE7Lg7vLRysb3wCLtSGLoin3l9j+VnBCAKvxT0YdEZtCH8RZhd/KNOnTH4oUpdjoWMOyJRaDygaDVnFOdBjd+IlFF5SeRMF39fkutcT9NeZnUFl2MV+Ica5pD1T5+/aN/GfW++BEgjFiKHgKejBr4dSxtUgIGmU9pyp5SawQV/MJGP9LZR5ckepIntWmpjc7xEYeuvJ4pTgTzFCQ/x5vEcsWTSletQiqZ1J8aUssGqf9qaHC0k6A== Received: from SJ0PR03CA0357.namprd03.prod.outlook.com (2603:10b6:a03:39c::32) by DM6PR12MB4482.namprd12.prod.outlook.com (2603:10b6:5:2a8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 09:01:27 +0000 Received: from CO1PEPF000042AB.namprd03.prod.outlook.com (2603:10b6:a03:39c:cafe::15) by SJ0PR03CA0357.outlook.office365.com (2603:10b6:a03:39c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:01:26 +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 CO1PEPF000042AB.mail.protection.outlook.com (10.167.243.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:01:26 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:01:11 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:01:09 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 07/16] platform: mellanox: mlx-platform: Modify power off callback Date: Mon, 14 Aug 2023 08:59:01 +0000 Message-ID: <20230814085910.56069-8-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AB:EE_|DM6PR12MB4482:EE_ X-MS-Office365-Filtering-Correlation-Id: c9faf09c-d3a9-434f-82eb-08db9ca50acd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0ckAx9N7CAbd62y4bnwxBZCC70jCtq+xQuS/yxTSY5xIx1A+zRTFG9XZfNWPXcTUUVbUFJOh7l1OqnCVoIOW9VQSMNm5eJtKXldm++Fg6KW7cS0aflnq0Ev+onfv2kxZR0G+ClyPsCYTZ8sIbB6DE/SYNGckJxwubalMjtSWM+5wTvILzt1pj0YdQGM+ZquUcDW/hJRWM6nGvOHizo+Jz+Iq3TFaryd9g/0sOWUmMRt8XVN5JBpvyUQHRZyiqGLaAPs8+g7B3kQ6Mm2Pbi1utahOakkqHPdScTU85l7njYlDXsQQODFQ0WbkvKRUhD+nTKzcmHnpO74bz8K+dmphOFNDC+ndKWFpU8sOO/qN5yhvynEsaBH7+/VJW0LS7iIobKGQUqGaFLqS/p/zRzkY4Lt5YA6yDrRunjEsUBPk66wHAROVmpHKySy4bUilHrS13jIE734iVvnEjDVP0xZwLqHiqtd++O95hS1HDoZlQJkNoB92lIg9Gs0MluV6y5oB1kO42dhKxdtHybKeTCYdRw0YSvYEplhG4zO/Jzc15YVAQ7LKn8qAPfx3rJOsoXVBfgsCHTvdV8zqkLNNaCLZR85NqMiq2lB3QwIGlUzS3ZjN/bhs1MOB8uyhKT3OFCRChQWaGydNL3O4CCO/oRNYObpBI6EJuYc8GIHizqnx6hEixdsohp1JU8+tzaAMgaWp7tK/SKsm3Syemu8xy6rHL8HCcLBAnFdJdH71HYo6C0KbHh23t0Ybm3P3M8pMAiYF X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(376002)(346002)(39860400002)(82310400008)(451199021)(1800799006)(186006)(46966006)(40470700004)(36840700001)(40480700001)(54906003)(6666004)(40460700003)(478600001)(7636003)(356005)(82740400003)(5660300002)(2906002)(36756003)(4744005)(86362001)(6916009)(4326008)(70586007)(70206006)(41300700001)(8936002)(336012)(8676002)(316002)(16526019)(107886003)(1076003)(26005)(36860700001)(47076005)(2616005)(426003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:01:26.6896 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9faf09c-d3a9-434f-82eb-08db9ca50acd 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: CO1PEPF000042AB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4482 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Extend platform power off callback with kernel_halt() call. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- drivers/platform/x86/mlx-platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index dce35934cc37..a505f619f337 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -5539,6 +5539,7 @@ static void mlxplat_poweroff(void) struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, MLXPLAT_CPLD_HALT_MASK); + kernel_halt(); } static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) From patchwork Mon Aug 14 08:59:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352591 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 AFE99C41513 for ; Mon, 14 Aug 2023 09:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235126AbjHNJCJ (ORCPT ); Mon, 14 Aug 2023 05:02:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235624AbjHNJBv (ORCPT ); Mon, 14 Aug 2023 05:01:51 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2055.outbound.protection.outlook.com [40.107.92.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22D0519AF for ; Mon, 14 Aug 2023 02:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K+X4R1wL1MeU2jn6Z+tdzflXsu1PM7hLZTCH17kNeU3UW41t58+4/vxtOCdt+9or/sRfGskcvgkLwbNLChJzeacCOHHxe6b5ubbGu7t/TTkAXFlgJRRHQUYgoaZ2aDAUT8qmPymr4Uk1afQgLB6t0ydUX79fDw+TRB3xBYHdeRy6vo+lGQ3LJT4yj6jkW2L7My05E2c8Aed0BgW9NxcSoyVops/yEcZ7iPhzs+EXlOzxOw0YJXMr0+ASdSMxKJsaz4k9HYF0cw75VQDQBWg9TfV7QIDctZva2TZet/gcY+LoYcchJwgXUGaesexTDQU91+2xgG59Z7tiLFa7e8GWVg== 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=Q9cZVsqR2P19xhaS7gvIHYkQr5W0sHo1gV444Bhz8hA=; b=Sw6sYtNa6dkrDsfPztZkeukB6izjxIsb4jXWvxAKpWq7qL9f1n89Gr/4i0QugTIHowQ+gZkDXLghv2Z+G42LAZ8GLca1M+pxWGq72dFwHBI/Ja3A5ONmZ0y52m8LbkJdX9ZSfq19ucZdJ3cMVfIGMGigSKOjc0A4bK+z4KnTYVi4J4iaTPoOhDslC7KP0rPTKPKqX2SHXb5sce3+G5kVnfn+svWAHirSO5xKWCqJmp+183N6H9CtRSYL0x1jk1iMbqtPa8SoWWUKiOnffjaZCNS1TTOlsy0eITEFl4MTVqWEsFJw28JjTt7HCn06jdKg7GbAkTRor22V/xfVNffI9A== 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=Q9cZVsqR2P19xhaS7gvIHYkQr5W0sHo1gV444Bhz8hA=; b=rGKjgtKVgaL7KI+0H3tgDw4f48pBtYseOjtvuXnUv3pB76bW9OZm16soJuaUpKw/ZOdYebrj53600lT/tFHZ0ekGEUuTBGqG+bA4gNsOKyUED1QTu0upweyfFoufaEQh87upyM9Ap5+VhJSkN4UY3YCZDb0x3dHptSbWvytCnANorn4d54E8V6qaKyDQ8VrRhRWEOZhv9EcquWX3SvCkiOcGCBwVH0w7hi33ommMdmSjz8LbMuzecwgUHKCQ489/2Al+JAfYvGwYNaKg9teO+JYCYFMmkEeiUZGwBqsnzZTrttSN39zE9SDh/eQP6hEfqgnN7WnqNtZmeIFjI5Dayg== Received: from DM6PR02CA0144.namprd02.prod.outlook.com (2603:10b6:5:332::11) by CH3PR12MB7570.namprd12.prod.outlook.com (2603:10b6:610:149::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 09:01:26 +0000 Received: from CY4PEPF0000EDD0.namprd03.prod.outlook.com (2603:10b6:5:332:cafe::71) by DM6PR02CA0144.outlook.office365.com (2603:10b6:5:332::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:01: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 CY4PEPF0000EDD0.mail.protection.outlook.com (10.167.241.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:01:25 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:01:13 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:01:12 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 08/16] platform: mellanox: Cosmetic changes Date: Mon, 14 Aug 2023 08:59:02 +0000 Message-ID: <20230814085910.56069-9-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD0:EE_|CH3PR12MB7570:EE_ X-MS-Office365-Filtering-Correlation-Id: 65e4dfd5-5805-43e5-b65c-08db9ca50a5a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wwI3irefXUxDgtE0JCtdaKfFHm6GPmIiY5e78uh5eeM4z2ciUaJIvXWF6OAm+xjflWhRm4MkqUSL9DNufy0olejkyABxe8SPJfD9ahLI48tVgfHJK6WwAnIkn8e+68296/Lp78FxfRhkLqng1Pe7tgTJCBhN7AgpYpWxnSLGIVvNFhRRZh9lq0yE2iZM9n8bE2Gqxx6D3BG7yBV3GOx1E7ncOC6zQlD7QrSm2M6xzP7qzJktsXyqc6bu+kZoJP9aNQBRi6dPLLhnI8bEzwIXN721pp5DZ57ceLaDR6NNZIjiCtnbv4Dxllh9XPr4j2W0ZvtoZolXl70W1wDSiczeSUSSwp1bm5I45MmtJ0wevvknbhQRaygyOqPWDyyfcjJ/ZXE5Tx1fqjzTrk6iwyqiyXFu4RkveUChb4CMWOlqpIReoePyn/YKqhvCSzAGj77o+rJ27IroPMyLU6y3+7dbYeO3q1ayufz9uXwXAVZj8EW5wQYKx8DfxOUh/39ojSPxPgMDxww/v59JaQ67VlsZJqqEn5BTHAlQago593xgEOM+CruzmMgfDZYppj+4xfrOzNNHKbj3ZnlJO/FKh+tc37gfGC3R6q++GpOuWArgqa9nz75+5Th6Bp93u7K83+k9Fsq7nmA2n0kQp7vU37TV3cZI8OL7pqJzArkkE3u/3ZJCxXgIWCmlmPUDEsPDtYs0+5fpdvEdzev7V480Ys1vepU9Rw7GxMUIShBOHxfYLVvuv1/k8jKKm3fBVYJ5NDaf X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(82310400008)(451199021)(186006)(1800799006)(40470700004)(36840700001)(46966006)(40480700001)(54906003)(6666004)(478600001)(40460700003)(7636003)(356005)(82740400003)(5660300002)(2906002)(36756003)(86362001)(6916009)(4326008)(70206006)(70586007)(41300700001)(8936002)(8676002)(316002)(47076005)(107886003)(83380400001)(426003)(336012)(16526019)(2616005)(26005)(1076003)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:01:25.8904 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 65e4dfd5-5805-43e5-b65c-08db9ca50a5a 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: CY4PEPF0000EDD0.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7570 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Fix routines and labels names by s/topology/topology. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- drivers/platform/x86/mlx-platform.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index a505f619f337..1010064d54e9 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -6265,7 +6265,7 @@ mlxplat_i2c_mux_complition_notify(void *handle, struct i2c_adapter *parent, return mlxplat_post_init(priv); } -static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) +static int mlxplat_i2c_mux_topology_init(struct mlxplat_priv *priv) { int i, err; @@ -6294,7 +6294,7 @@ static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) return err; } -static void mlxplat_i2c_mux_topolgy_exit(struct mlxplat_priv *priv) +static void mlxplat_i2c_mux_topology_exit(struct mlxplat_priv *priv) { int i; @@ -6308,7 +6308,7 @@ static int mlxplat_i2c_main_complition_notify(void *handle, int id) { struct mlxplat_priv *priv = handle; - return mlxplat_i2c_mux_topolgy_init(priv); + return mlxplat_i2c_mux_topology_init(priv); } static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) @@ -6336,14 +6336,14 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) } if (priv->i2c_main_init_status == MLXPLAT_I2C_MAIN_BUS_NOTIFIED) { - err = mlxplat_i2c_mux_topolgy_init(priv); + err = mlxplat_i2c_mux_topology_init(priv); if (err) - goto fail_mlxplat_i2c_mux_topolgy_init; + goto fail_mlxplat_i2c_mux_topology_init; } return 0; -fail_mlxplat_i2c_mux_topolgy_init: +fail_mlxplat_i2c_mux_topology_init: fail_platform_i2c_register: fail_mlxplat_mlxcpld_verify_bus_topology: return err; @@ -6351,7 +6351,7 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv) { - mlxplat_i2c_mux_topolgy_exit(priv); + mlxplat_i2c_mux_topology_exit(priv); if (priv->pdev_i2c) platform_device_unregister(priv->pdev_i2c); } From patchwork Mon Aug 14 08:59:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352593 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 DBACDC04A94 for ; Mon, 14 Aug 2023 09:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235516AbjHNJCL (ORCPT ); Mon, 14 Aug 2023 05:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235741AbjHNJB6 (ORCPT ); Mon, 14 Aug 2023 05:01:58 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2085.outbound.protection.outlook.com [40.107.92.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7B97171B for ; Mon, 14 Aug 2023 02:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JO8EPSQfLKe0Uq1ZuwWIALmZt7Pig9q5VKnGK1GP79GN256gWbyTr7rrU1l0QY5WRUUEHREd2Dn69PDMTSkKCxNPXwQQgSIQe5FVrvk9LuHp+0EOGLibcT0O6NaGRVPzCxJeOZob90fLgQIV0D+hmsSuLqalMFfZVTFZAzpk/9MxnvKeGt97XlR5b3wrq0uOyTI6BEyi/E926623QRp6WeJl+ZA1GWhoxoVuu5XHbSE3O838I7hV7OkYZm3OcNkuCbI3cVg6Kbu6x0jkJhycMjlzDvWeQ/0tOsOudLHy+E43pE9wbEoyriNyJ7G8kDjYOK+hxIvKbRgSJCE6xgk31g== 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=kGZsqncu6h51vEmJbmlJgNA4y6AnXVWWChYo3Cws2sc=; b=XWbL9di9jPAgQEze4TkXEMT5eOJ32w4ZPb1lxh8F4LrqxLvkEOElIbHl+Dl56kLkpAzb9v1Cg1rqZZ73OwrjmT1advrs9/MQCDCQ5HsvJbmMkPZ88RB7pCqL5h5XviRWDCxlYh1+ISx8OTAmA831TUPr9CExyzc9+NhOixvo31+h6h1Wh5VVc4kr098WNI2RmxzXo0wZzyKe3++MovT5+ddJ+/KjgqY9hYXcIPl7PA2NysTOWlEZ7tfhG7Wy9pWTGsS47hmcBiRtM0I57e5X19whkvoPivxTp/v6+lzP0XDWhb9BPBwlJbLyJ7DkJ/PSv63tppvFIUAtgEe8oqsqQg== 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=kGZsqncu6h51vEmJbmlJgNA4y6AnXVWWChYo3Cws2sc=; b=ofBUBsbCgQ/Z9uxhPSSu4iwu8HsY7UEryrXunB/QgwK7qr+bLQt3krVdhaHAl7qAw20cE+BjKBnwBaX/c5wM7uz05Fd1kGW8h9PF6qFfbW53ag2cgRqz4/PnyJeyO/WSx8+lb53tAco+GhscNFpzHeXE325lDJnu7314kYwPfD8ZL+yYXh1bTQyeN3mxz9MKBwl4z1gG6vm1FeD5hYxpuOv48ScSV1JuQimDD9L5Xu13h8vOBGwICg2hKYtTwQdedzAWewb8eMfvQD/MsgiyHOARoyTPJnyfx/D8B1qdBRVPbPVOC8Nt2HFpONG7N1TAEhtHll8hmRFU9oU7F6exDA== Received: from SJ0PR03CA0357.namprd03.prod.outlook.com (2603:10b6:a03:39c::32) by SA3PR12MB7974.namprd12.prod.outlook.com (2603:10b6:806:307::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 09:01:34 +0000 Received: from CO1PEPF000042AB.namprd03.prod.outlook.com (2603:10b6:a03:39c:cafe::cc) by SJ0PR03CA0357.outlook.office365.com (2603:10b6:a03:39c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:01:33 +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 CO1PEPF000042AB.mail.protection.outlook.com (10.167.243.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:01:33 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:01:16 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:01:15 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 09/16] platform: mellanox: mlx-platform: Add reset callback Date: Mon, 14 Aug 2023 08:59:03 +0000 Message-ID: <20230814085910.56069-10-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AB:EE_|SA3PR12MB7974:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ed2e335-5539-49f3-ed31-08db9ca50f07 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k+4duESRR6WMW8SltV3tlNT4xWucul22tjCJ5wD5ewnS1KyBF5JT6cO3jteLUNy7+7I1eABvwL2uNwDBrS2bcGLS39ABySWeENVI8diq8VE40xLjLrsGAAQEwdAZQWjGHDZHW6TX6gqLs3yM/ufG4h/VCqmNChYhs+8fsOegkZTWQHWE09CGxgUDgJ078lqLrceMikdnR1H78+H4thhLETig/U8DNrm90gBOpH+SMjNB2G9qPyp4iOQTvsSVmYTZXo7rrrVLmDz5zfRiLuURVxViaOouyzZWYHG6+5sm8ZZOzzh7S679V6YPu02tA59ccUuq11hrU+XrtloHdpE05HsXgNX1CKaZCndVHMmaIgXFm3qnOzzhJAhB4s27ORenmrHTG41D0N38Zn7JQT4SmtibTBUAIdJzj5IL3YzU8VjqjVKfhBWHGsw6amuT9Gk+5zPcLNLc6F9kmKp3kHSSSW8OFgLlQTRwWCJNL2luUJaVfprSFVevzfmB0x/p8iBd28dkF5Or6VFHCZ+KLezI4yKVgB3lwhlO9VfgaXweJ+4MreEm4G5yL1fC92Iq2BnrM83/kZDmuXUq3zOlPHURbHKUURfQ+Ss9MteYyg0ok7C6EdWJ4xxh83a45H+PB5o65GLFqmrVIQz90Ex05dQ6gqSeqaazGQTsbXrzWD4p64pZTcqlfFdY4Rm82m3Vd10W4nzz+PuhzFAZ272qBKUqZ29Gf1RMkq2GuwWCLkgx+7LaIocfAwWRZtejDyleWoEm X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(346002)(396003)(136003)(186006)(1800799006)(451199021)(82310400008)(36840700001)(40470700004)(46966006)(40480700001)(40460700003)(478600001)(7636003)(356005)(82740400003)(6666004)(8936002)(8676002)(4326008)(70206006)(54906003)(6916009)(316002)(41300700001)(70586007)(83380400001)(36860700001)(47076005)(336012)(26005)(16526019)(1076003)(107886003)(426003)(2616005)(86362001)(2906002)(5660300002)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:01:33.7677 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ed2e335-5539-49f3-ed31-08db9ca50f07 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: CO1PEPF000042AB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7974 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 --- drivers/platform/x86/mlx-platform.c | 45 +++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 1010064d54e9..b577ce572ab1 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 @@ -265,6 +266,7 @@ #define MLXPLAT_CPLD_LPC_LC_MASK GENMASK(7, 0) #define MLXPLAT_CPLD_HALT_MASK BIT(3) +#define MLXPLAT_CPLD_RESET_MASK 0xfe /* Default I2C parent bus number */ #define MLXPLAT_CPLD_PHYS_ADAPTER_DEF_NR 1 @@ -441,6 +443,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 +2364,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 +4963,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 +5072,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 +5237,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 +5542,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 & BIT(0)) + 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 +5892,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 +6442,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 +6468,8 @@ static void __exit mlxplat_exit(void) if (pm_power_off) pm_power_off = NULL; + if (mlxplat_reboot_nb) + unregister_reboot_notifier(mlxplat_reboot_nb); mlxplat_pre_exit(priv); mlxplat_i2c_main_exit(priv); mlxplat_post_exit(); From patchwork Mon Aug 14 08:59:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352598 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 4E2C7EB64DD for ; Mon, 14 Aug 2023 09:04:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232712AbjHNJEO (ORCPT ); Mon, 14 Aug 2023 05:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235340AbjHNJD6 (ORCPT ); Mon, 14 Aug 2023 05:03:58 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2076.outbound.protection.outlook.com [40.107.220.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EE9F10B for ; Mon, 14 Aug 2023 02:03:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vun2ANOv8zTzjbxWG8yyh+Jgh4YeqK0oP1tji00bEkZqVOZQ0L2Mfs+1oE9PhAcEE9S2r3cove7DND6L9aZGFFdl9Wfy94s6AZg2jGP5wl0tqTTuDuVEFNTLg5CPwW/8KcfklocbZSoHLjzKpjflumqnpH8f/VUBso57MZDG2AaIz5mDyncDR2mLgzfMLuYYAvISZcGiyJT/s/G5mepD9NyCjpOXpGBjfOILAebVjUzXmGA8dIYQx06iM9TpihQ4j/t2LziZfciO8cx4BJDDXQvycon/sFdyOlTcL3+2HCX3nIoohygTYZI6kHLCVqQZWFu5UM1YkyEhuIsdlEk3vw== 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=n/UTiBt53ju3zjGpbgFY7Usyp4hzY8kpdQKfuYK8XGo=; b=V2aWxUEjAzUp5GT/QqqWTigjlI05tp5V/lCCT9r7aYTgQZX+JOPrshG5EqAtphMVG7sbqfs9njgSKDJhmlXD54z/uJ/IvEmafsjH+NqnhaZez/SIUazYEj/K2DiwYU6S8LrAF+GmEcmPPYQ38iaJlDJr5gBWn36uKjmsqmk4uS9am4VhNDcLt4vqNyfaWdmxeCvDvr/jVz4DFhZL9Zxt0z0UOXkl1bLvNbkXyQ5gWjzyIpxaTDlCMP4YJJvyXtHCY1jq7qy2CIrhZS/p+gU+SJAT3h9xgnRa5jGD7y+Op1YF8qg/5Pq2s+hW/Olk/OWmGS97LkQ8BKB2SgtnPChkCA== 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=n/UTiBt53ju3zjGpbgFY7Usyp4hzY8kpdQKfuYK8XGo=; b=m6j0cnDIok6PhqaohHUr4lejrTty4hH7TcBKEDh5re3Q5fWlep2LYgNBCSA08XDk+Am0P1Sd8j4ch1Ae/g6zUmLPRl5gfiaFwWk6t9toUA3kjCc6wY+wd256HfYG+b1GiMBHo9lLKb5Rms6bZDn7deQGkV4pYlvetuPs3YZufoOgLorro3QG9boFa+7ahdp62c27SM8iKfu7a+RfczP0ypC8YfVDEa6YPzOPbVEn1fFAOYbCQLzZAJQ0uNX1RdZ9uNZt/JMXJOAmhAWwXVufww5Ju8+BVa4atWH6RS6DWUNisiergq9vXWzgdQ3QX1G3qzoBqcKPRWPgI/8exyUMyw== Received: from MW4PR03CA0045.namprd03.prod.outlook.com (2603:10b6:303:8e::20) by DS0PR12MB8502.namprd12.prod.outlook.com (2603:10b6:8:15b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 09:02:52 +0000 Received: from MWH0EPF000971E9.namprd02.prod.outlook.com (2603:10b6:303:8e:cafe::25) by MW4PR03CA0045.outlook.office365.com (2603:10b6:303:8e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:02: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 MWH0EPF000971E9.mail.protection.outlook.com (10.167.243.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:02: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; Mon, 14 Aug 2023 02:02:37 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:02:36 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 10/16] platform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infrastructure Date: Mon, 14 Aug 2023 08:59:04 +0000 Message-ID: <20230814085910.56069-11-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E9:EE_|DS0PR12MB8502:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d113db5-36ee-464b-c433-08db9ca53dcb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wDWnYcGLkmBJxaOBztEC/n5TWGhPyEu4WMjym9yMtgaYqWSxtf7EiNaEROfMkY3lfGkP6diiicRJ/Ve1cKCTwwVETzzbFjB1kbUHey+uCBNzfhSGihSyf0e8VCzYO2Gj99INjgpocNUscDXa3M+quDjfJyvrWo3Lor+e3J24rREuJp4UYbk0TiyNbTkm3JdHNLhBtLNjwD8mPF8RlBpDliKYR+VUvMmkQNiMd8RnXtIUk3aSmgG4mkdvkCbEC3N2m/11RY3Iid0UzWIyRMvPmBR833pDdJxwhGWvG81xFwK9PS0IQjIfAXocthkwr4CD6ZqxisjgICMXPxeLZhnnvqW5xPg8Vq1dPOF0jDBi6r9fiMyC/n4e163CTCpJAFC/6LWzFlTSJfMMExr4aOEjMe/NwiTTlZIb58GaBVYZm6ew3Th8s6dBHvK00oMkKjOtdOd5YFqU+9NXRUqSrCDRjaTFKMmRcWw4DZ+sRR/sCXUE7hXnVA8bNB4/tdBEfR4bnN1o0M2T7Nt0EJxhgPacgV8sWhbAMIiMp4DmfKpuvyyh5Ftmsfo9B+8KZGg9HvoB0J4kRjv+kD8DykFJtZ+WWz4kC8lBv1VifIkuIZjCLd7NofCrzYHCj2AB19GtnJOrxW65pARNaa6IDFi9RimRqwpQzTnTADeNY3zllZ9rwE99gNpL+vdzICUjhD+V4UAH2ju6uNB9kQcZXUvMHonWPTduvL3sI76s4V3AL7OsRplw2LbolmsaFnoPrK01eJI5 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199021)(82310400008)(186006)(1800799006)(36840700001)(40470700004)(46966006)(40460700003)(6666004)(478600001)(70206006)(70586007)(47076005)(83380400001)(36860700001)(16526019)(36756003)(86362001)(2906002)(40480700001)(426003)(1076003)(26005)(107886003)(2616005)(336012)(82740400003)(356005)(7636003)(316002)(4326008)(8676002)(6916009)(54906003)(5660300002)(41300700001)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:02:52.2264 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d113db5-36ee-464b-c433-08db9ca53dcb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E9.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8502 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Currently driver is activated through DMI hooks. Prepare driver to allow activation also through ACPI trigger. Modify mlxplat_init()/mlxplat_exit() routines. Add mlxplat_probe()/mlxplat_remove() routines and "mlxplat_driver" structure. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- drivers/platform/x86/mlx-platform.c | 91 +++++++++++++++++++---------- 1 file changed, 61 insertions(+), 30 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index b577ce572ab1..68bfa446738e 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -5573,6 +5573,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; @@ -5593,7 +5604,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) @@ -5616,7 +5627,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) @@ -5641,7 +5652,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) @@ -5664,7 +5675,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) @@ -5687,7 +5698,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) @@ -5710,7 +5721,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) @@ -5736,7 +5747,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) @@ -5761,7 +5772,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) @@ -5787,7 +5798,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) @@ -5807,7 +5818,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) @@ -5829,7 +5840,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) @@ -5850,7 +5861,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) @@ -5871,7 +5882,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) @@ -5894,7 +5905,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 = { @@ -6138,12 +6149,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) { @@ -6157,13 +6162,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 @@ -6388,16 +6391,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; @@ -6460,9 +6460,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); @@ -6473,6 +6472,38 @@ static void __exit mlxplat_exit(void) mlxplat_pre_exit(priv); mlxplat_i2c_main_exit(priv); mlxplat_post_exit(); + return 0; +} + +static struct platform_driver mlxplat_driver = { + .driver = { + .name = "mlxplat", + .probe_type = PROBE_FORCE_SYNCHRONOUS, + }, + .probe = mlxplat_probe, + .remove = mlxplat_remove, +}; + +static int __init mlxplat_init(void) +{ + int err; + + if (!dmi_check_system(mlxplat_dmi_table)) + return -ENODEV; + + err = platform_driver_register(&mlxplat_driver); + if (err) + return err; + return 0; +} +module_init(mlxplat_init); + +static void __exit mlxplat_exit(void) +{ + if (mlxplat_dev) + platform_device_unregister(mlxplat_dev); + + platform_driver_unregister(&mlxplat_driver); } module_exit(mlxplat_exit); From patchwork Mon Aug 14 08:59:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352594 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 59CFDC001DB for ; Mon, 14 Aug 2023 09:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232433AbjHNJDn (ORCPT ); Mon, 14 Aug 2023 05:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236131AbjHNJDJ (ORCPT ); Mon, 14 Aug 2023 05:03:09 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2067.outbound.protection.outlook.com [40.107.237.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FADD198E for ; Mon, 14 Aug 2023 02:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oglqq/7yLOyRpqSgxgPZ/EXMzcqlezH0PRGLHXuBVkcF54oRcOzOjt1IOIgYWewfMU+sEG9bb3KVCJNa/R5otdMX5wAlsBNc7RXuwmX59iA9NiX1bj391C1BwqY9N8y4onM/5yuBuyNBEHNBJRMn8v4Q7YXRR8uTJZ35/sx0f44ccFjan4NT//BLZ3ZPwyI57/TFb45iIjweu28E38vRrHJigqkEdqJsQxr0M+T1HvK90D2qB6oOAip6LfOl/L0VChL2frITJ1FPw53p+Vuk07qGUpVHfSHP1Pu2VzI5mk+/6gguyWGVLcZ1gWzj31LI490jYnGlrDRYNVC6DgtwUA== 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=k1FZlkbuWcrFHpkVk9McmATdEq3ZfcbZX69wNL/IY9o=; b=buRwjy1elJw8lHsxb8nuttt8YrO316d6HrbYdaSrPh9OANnVlz+0WTrF6S+WrTsnP0mCofIKFWmVIZG2ZsqwwFRHaiEcgmCg/opNDAiqD1XV1bhhvty2wdRKxXlKSbHqQTdzntWUoZ/oiDnJgL6Mj/IDPBF3Hb6Fcup+5scLweYrBqVwAbN5DduRePebvM3BPYXlqFEo4T3qt90sibJX0dE/fVHnjAowELpRxsjy97gqjkCv65yDtSSRwGtWW0FJVQvWFY8YW6GDtqWxKtA882onLK+e5ZdoH4ld0CVOfyb8Id5WLrzhLaSgdGd6hr2Nug2ca7T6EtEArlgb6+B3Vw== 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=k1FZlkbuWcrFHpkVk9McmATdEq3ZfcbZX69wNL/IY9o=; b=t/q6G+oDD+DQVXf45olvqHvolntEsZP6H5KAG53cA89bXzn/OYNstivTnG4P8sGEDbZ+nlOkZ2WCymsmluNtnoBE0X15oaKbyfmersi6ye4Z4yO98so377mI/SbBnZLekpYStsimZS/4KUYJ8UtxHF9Em43RiCO2m4U7KjrQPEF+WENmyv6bJjilreC6XRoys+V3ksZtjjRY3Pn8EbPe2iBQiFMFW6uRU+5mwLfcHXz/69LABu5cNGO9sREjonvxkkM3Nl878bKI5mB6YPDlqO5hcG671CuaUNAOmplyE2qP/Y7CS1R3SoLqMA/s07N+SeRzAUwWEtIwh7jIJfhAWw== Received: from MW4PR04CA0364.namprd04.prod.outlook.com (2603:10b6:303:81::9) by DS7PR12MB5766.namprd12.prod.outlook.com (2603:10b6:8:75::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 09:02:55 +0000 Received: from MWH0EPF000971E5.namprd02.prod.outlook.com (2603:10b6:303:81:cafe::65) by MW4PR04CA0364.outlook.office365.com (2603:10b6:303:81::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:02:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000971E5.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:02:55 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:02:40 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:02:39 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 11/16] platform: mellanox: mlx-platform: Introduce ACPI init flow Date: Mon, 14 Aug 2023 08:59:05 +0000 Message-ID: <20230814085910.56069-12-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E5:EE_|DS7PR12MB5766:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e973428-9bec-4b7e-15d0-08db9ca53f72 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3brB7fkRP8BjahPRGO/BBpyOsLfKIrbaF3DtZSMno7tqetthTzsiS14msiNh3CeLjPqVbtSE0wn3ggwXvhWGV7kY1ZAXH+h4g4Cka9zDYeXqhF5s7yiE0SnEOoj/EcoeBTaIwDUngnIJerYhxKZaYf5aY6L1VKS5SQ8ZWKXMSup77B2DgYgHdZu74IsFxFvE+pKgIp2KRfK2HbAjHTgnE11ZIRsEURdhaIZ9YYTgUtXU+HwZAK2oFNWF+HKz2/nCWsH/6niFsio8/fpqNnvEVNDfkFdb/t8cwyt0d8g3gvDlWckChTuR2TJTOXZNqU2IrMuRtQC9Vk2osIlx19nNa5C21b108S008DFkBf4gLM0DvCEY5TTW2GHxZ0ld76W5150Yy7lCviHoUGd/HpSzRqOJX6M7b5/YlwhQ3Ohm8ZKvnsngcGJ8ycQY0u+cFww2VaIMmaoVqp12cp8fh4GxNRQMjVoHIO1LpqGuSQVk79marbszPZMSGLFc1JhjX4FMGnTp7J9bSPu2ll5xtxFVSr93NtKty8NjXhguJDwd9cFf+O+6dXI36hlhGc9VIKA4e7m6gaVtMFvjXz0BYiTR02St3CVeIVtaLa4oHypKI5XxyWc5uKt+fo5A0LQmYqJKcGNRr6hqmanJ+qUDLzK9Y5lefPBldxjMOa2PAUlJA0sdeKhO2rJtpiJUPOr35Jq2Sku2ovvBkso55fcruFba0jFFlGIKV4WFiLXG8x12Whf4zmdLuO382D4XW128HDL7 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(396003)(376002)(136003)(82310400008)(1800799006)(186006)(451199021)(36840700001)(46966006)(40470700004)(26005)(16526019)(336012)(2616005)(2906002)(1076003)(107886003)(426003)(36860700001)(47076005)(70206006)(6916009)(316002)(4326008)(5660300002)(70586007)(8676002)(6666004)(41300700001)(478600001)(8936002)(54906003)(36756003)(40460700003)(40480700001)(86362001)(82740400003)(7636003)(356005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:02:55.0097 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e973428-9bec-4b7e-15d0-08db9ca53f72 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5766 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 --- drivers/platform/x86/mlx-platform.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 68bfa446738e..e2226c218a54 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -6398,6 +6398,9 @@ static int mlxplat_probe(struct platform_device *pdev) struct mlxplat_priv *priv; int i, err; + if (ACPI_COMPANION(&pdev->dev)) + mlxplat_dev = pdev; + err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); if (err) return err; @@ -6475,9 +6478,16 @@ static int mlxplat_remove(struct platform_device *pdev) return 0; } +static const struct acpi_device_id mlxplat_acpi_table[] = { + { "MLNXBF49", 0 }, + {} +}; +MODULE_DEVICE_TABLE(acpi, mlxplat_acpi_table); + static struct platform_driver mlxplat_driver = { .driver = { .name = "mlxplat", + .acpi_match_table = ACPI_PTR(mlxplat_acpi_table), .probe_type = PROBE_FORCE_SYNCHRONOUS, }, .probe = mlxplat_probe, From patchwork Mon Aug 14 08:59:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352597 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 685BCC41513 for ; Mon, 14 Aug 2023 09:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230384AbjHNJDm (ORCPT ); Mon, 14 Aug 2023 05:03:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236147AbjHNJDJ (ORCPT ); Mon, 14 Aug 2023 05:03:09 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20602.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::602]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFD34199E for ; Mon, 14 Aug 2023 02:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UCPjbU/UcaNSzcJIAqmJyTXRZwB6r6+XeVg95Sp17QsYrE5eCuUakTI5x4uRQ0o8NPiWotrdLvbBj7rK79MIPjF8UHVlDauKsUYsgttzTb2r0DluH+0ddR+L5tEbVnYcMoD8pgfihP8PC0LGpew86uzeRALCRA3pKbbGbCP3w/sCNR6vkFj++zO8Rqo1kd8p3dItWw0uXL2sMBvuYaTikxHOigTO1Ew4diM/h32lsTeVl/tjudO6p3ji/qAptFm/7lV7WRTbonj9fHrWz7uDzjfthrbBok/LPXsnG/Y0AGfmyxY1lO2oBH86D7XfIjnZNQnEmZ924+x/ZAuD/ca/BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Hk6OFUz+T9evPk//wvLYS7BbFza/pvWfb39Mi5hAS1k=; b=bjqfRR/OGLPwK9mU3sFdnX86k1pEzq6GayfFht6miwRXWa/smMT2yDW9lXagdLR4N6oOA4dWFR8ZQQE2xfCnOR8ShmoY4X5Md0Yji41EflimghhD5GY1USvtxvNUhdsg8ulLqa4ANV35EtXT2LJZbMOMbncJ1YK2myK9IDkVpDnduTVu+C69A7hTFwihe2Gg1a7pUOrJ3580qYnbdjeRdg4/JLU0vM1M7pNt64r/RUeb8JIOMy0d/0h8Mmisy24MGou62nrED4ZRFmOoahpG0vt7qv527MEr5rfZRiS+gjEMEMXCC3ghy4nZ65gdMMyVBhTf6qirA/oDCYUeX4V7qA== 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=Hk6OFUz+T9evPk//wvLYS7BbFza/pvWfb39Mi5hAS1k=; b=Ph24P7N1gA7M5pYEgEbIYPIIwEFOJsYjNkb8rHYR98Zgq2S4xTD1zsjhBLiTBvvbu/rfm8XvAac3v3KoU7HRnccdVX6ZXdmHWiDG3kOxc6WXkFvNeFxXWr32H3IJHehmQ/1LVWpj72OnyB3Frcy7ePRURYzM9qOXHGkFxiNjaLb70L9aribL3cQE2ZxNnHeGThQjG+LkOsm5y/jkzOVlPUu0WjaV1hOjqTDWEa+Y4x4RJPHnX+cyAhUb1Gi7m9RIre6/S9JjlmiMN2xWdrFhJVOwBD+g97rtfMRqh5PsOsfHtWWh9f+RUhSToA7cTxScCjv5k7eYqM67SxuKMxEZdg== Received: from MW4PR04CA0362.namprd04.prod.outlook.com (2603:10b6:303:81::7) by PH7PR12MB8105.namprd12.prod.outlook.com (2603:10b6:510:2b7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.19; Mon, 14 Aug 2023 09:02:58 +0000 Received: from MWH0EPF000971E5.namprd02.prod.outlook.com (2603:10b6:303:81:cafe::74) by MW4PR04CA0362.outlook.office365.com (2603:10b6:303:81::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:02: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 MWH0EPF000971E5.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:02:57 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:02:43 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:02:42 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 12/16] platform: mellanox: mlx-platform: Get interrupt line through ACPI Date: Mon, 14 Aug 2023 08:59:06 +0000 Message-ID: <20230814085910.56069-13-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E5:EE_|PH7PR12MB8105:EE_ X-MS-Office365-Filtering-Correlation-Id: d9f075ca-4d71-434e-ef23-08db9ca5412f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QXJeZriIqzPwpxaAvgtp9/Icl1UpTtLMRYQKL5l38LeIC/pOCP40haGyki8bFNJGodOYlx7Fi4/6cPnma8v+jVHmRGZ9E3gLKTL7VTaqr8/HHA5mC3/EEbP+b6aeE22cM1RtEBdZc5KWcduNVgGcZjImDNe9MRGPSTOERy/UpWN/ESx8Ab2ibTgHSQMH9XNp0vR5xp2gagD6tX0/Va8umvEb/rLwT7i4r9zHAHpVpPaX0Hd5hvmPJO1R1/KBX+ZC6PchaulLxX6dyUnNd6mJ3cF/wXQjc6wbILjNEQlYfZ63qSE7EZppj5nwK8zpscD+cn82Q75On/w8+r1BWDiqRVHln/TGRlo969IwWJPs41bjkB9digXh7k6MrZFj2BAFjwx/Ka+dZbtTZEPcVnyYi5f/c+E5q/YjDJlbtQx4e0vXL4SGtQSMkR3WM/nAub1dGHZRzirNMzM2W6g7RYf3O9LXsaIMay0NQ35yoASmFzTXGgq10C1YS00RT4iwUQmqNuCahIxe2ahpoK8zx2em1eekeotrnulc1L/ZedQAjn5JNnL+Pe3ARsd+mn910DQZfA6jpn5j+i+GZkVRMhaEReFCSfvL0QPgDYpjVWja/Lb+yFLt9TU4l+qBcqmIApADj7fMaNIUrVM4RXhSZHpp/keOmqnk1Fxi2OgPYR9tv5kCHZjH+VRW2vSbeH4jPYR7l9PRokLZ/OaifHtSwauJm3zAEuks7eJy4aCFHrghSMwTLaneZLs3gYtkynHhnUol X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(396003)(136003)(451199021)(186006)(82310400008)(1800799006)(36840700001)(46966006)(40470700004)(1076003)(2616005)(107886003)(6666004)(36860700001)(36756003)(47076005)(86362001)(40480700001)(356005)(7636003)(82740400003)(16526019)(83380400001)(336012)(26005)(316002)(426003)(40460700003)(54906003)(41300700001)(6916009)(8676002)(4326008)(8936002)(70586007)(70206006)(5660300002)(2906002)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:02:57.9316 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9f075ca-4d71-434e-ef23-08db9ca5412f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8105 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 --- drivers/platform/x86/mlx-platform.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index e2226c218a54..a70b86e60721 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -342,6 +342,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; @@ -355,6 +356,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; @@ -6187,6 +6189,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, @@ -6395,11 +6399,17 @@ 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; + int irq_fpga = 0, i, err; - if (ACPI_COMPANION(&pdev->dev)) + acpi_dev = ACPI_COMPANION(&pdev->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) @@ -6414,6 +6424,7 @@ static int mlxplat_probe(struct platform_device *pdev) platform_set_drvdata(mlxplat_dev, priv); priv->hotplug_resources = hotplug_resources; priv->hotplug_resources_size = hotplug_resources_size; + priv->irq_fpga = irq_fpga; if (!mlxplat_regmap_config) mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config; From patchwork Mon Aug 14 08:59:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352595 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 228F0EB64DD for ; Mon, 14 Aug 2023 09:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232607AbjHNJDo (ORCPT ); Mon, 14 Aug 2023 05:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234881AbjHNJDM (ORCPT ); Mon, 14 Aug 2023 05:03:12 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20631.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7AAD10FE for ; Mon, 14 Aug 2023 02:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RIBL84t4XrrMVnQLlMrvS2KuV1UrECRLXnG9p4x2WCFirUG+k9sfvuH5JCz8U56wamghsxPz4bqimsnd0SpcHCYIKGtk8kOKPdiaAMJwzWZg1JQeqi/6/lcZm3fPfbO/ob6au/pmo7AJKdxAy9+rQl2b8c//T2xyXhJgakhdNC5Ak7Il2gRlm4/GAADdJHVPM+fduvseSlN7AMBuguNpptgmB5l2vAjlIsBwr66g/StAUyb6WSdbsj7yVr3neBDsVHi4lDSjr2zohbuY5JmM2MQ62Kgia3KWGxh4lX6pXzyWsq0qTNn4qnnTk7WWbvnKneauUzSB6VcL3araiwOJTA== 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=feaiOH5/j+dRihcLFMdKP+tDk3dBKrf4I77a80EZdtk=; b=elkCqGsHu9mF1Eq1A6wQNZKRGVVA57oHV5kZLvWFTMzWRUEeMz2d56DfQyf434hwNcoJeapKmppUnJR1Oj5Js2d+l2eu7P850oXLPT0dZubdf5rUg9e93tAe40CHjhI1WqCKAiwpFRO0576C/FDHlpSz7E9gR70eNsJ8bjJ5PPgwj0vMapk6IxysxCyYmfBl7wgfXhjm9fO97YuOiiFBzsHRYnh40eF0SmPp0CF4B8CiN91SgljIINb+yoSwkQhsECcdLkvKJ70wRhGHwzU8sXeh4wVd2kAWLdDFyn+qf1G5uTQTj1OMPJFLnLtIHymGPh1ZE4nqlu8NoGw0VIpvNg== 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=feaiOH5/j+dRihcLFMdKP+tDk3dBKrf4I77a80EZdtk=; b=VkNIjMQJl+f/CFqHmnooYhZG4adbRW5t3nJtE/mmvu4J8SOyktlEaBeIaHPQ4wAV+3TFa1sENkzZk+P1AhJ9/TjUz5RSmWrMJRHpFcDM4y5pHcU816+O5VRbCTZQ1cZn1/tPPCV/EJr4jV+HEqlt6cAlo6Xfk4hl0WFqBlbYTldfLDWUZL0ELaIXqoxxtTqdGHoPWL/w6kAbC/rkTi0OYZs34f406UO3RrEt4Xn9AoCzwHJDsbLneXmGYLoNF+XjSDCu5i/oNFJMeEQeU5SS1cTetOM91imZSfTveRxOinMELjCSTDq2y0XaGe8X2KL7Kp7WIoj8sIRsul3GFv1BqQ== Received: from BYAPR01CA0035.prod.exchangelabs.com (2603:10b6:a02:80::48) by LV3PR12MB9266.namprd12.prod.outlook.com (2603:10b6:408:21b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 09:03:03 +0000 Received: from MWH0EPF000971E4.namprd02.prod.outlook.com (2603:10b6:a02:80:cafe::50) by BYAPR01CA0035.outlook.office365.com (2603:10b6:a02:80::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:03:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000971E4.mail.protection.outlook.com (10.167.243.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:03:02 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:02:46 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:02:45 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 13/16] platform: mellanox: Add initial support for PCIe based programming logic device Date: Mon, 14 Aug 2023 08:59:07 +0000 Message-ID: <20230814085910.56069-14-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E4:EE_|LV3PR12MB9266:EE_ X-MS-Office365-Filtering-Correlation-Id: 2afd42fb-6e87-4202-3672-08db9ca543fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 38imAJzNdG/Q12b3qhikQhm/dMe8Qy9NekLjDRmjISVt4z49UgeWCJa8DZfQwAAZfK0X9L/ydH4jm7L6vbnGyE+3MRdnU2RQKz1wxduVTGyLJhLm1avwoJsJkW0/Cf6BVmHH1Mb8zwIYbKQu8DkvBNRvFTcNNJPBIhvXWTLl6aWZKkSG4fy0WWNyzP5WRgcfzAG8Rs6tcT1fo/pC7xMRkel85kFLly5Rp0jRXmdFbGa9Fzy/7vtLmayE70Y5Og0mkTCvmiJSBmzcIwxxjFwOI0jflZxr198hR+/waD+FYdtViMjy5jlgJZgne2/nJO1neXTasC1SdIHo+NA5Su2E0BP4NppZZpaBTQ9wvWbAOjC7SBBAoDACpSwYCYuEJVZ1chkcDSXEXdp9YVtVHgW9NQno/gbcLUrTIBnYJl7EHmkyiv1wW72JRbgeNxcNtHy/oZxGdPrZZUtqu/nKUJsH3S0pYYC1xqMPGIs1rgWWKNHYyu+1SgogjRtAeIuZG/U/wcH+c6NX2K9gVM8sAJpQ+8kLtFgsMQWLH/J7f/ZkIsst563/Zw9WXNdPJXXqFnrWffg4tCnldNwPXW9sQ0cxyM9j3URTEBb2+oEXVNVpZNDMEhP4ZVdt5+fV9McMGCBbAFBZTWuYPHhrbQuziPgw9K1F4hS3iIKNkOcjWKAJmV4oRDg9xoVhbWwlR0UMrQQqOOmmCJJTshfNl7BPPjQcn34KXjPHbN5XJTCTUvNLKGIUFrj+8BDOF/hUuKC32Iu5 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199021)(82310400008)(186006)(1800799006)(36840700001)(40470700004)(46966006)(40460700003)(6666004)(70206006)(70586007)(478600001)(47076005)(83380400001)(36860700001)(16526019)(36756003)(86362001)(2906002)(40480700001)(426003)(1076003)(26005)(107886003)(336012)(2616005)(82740400003)(356005)(7636003)(316002)(4326008)(8676002)(6916009)(54906003)(5660300002)(41300700001)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:03:02.6127 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2afd42fb-6e87-4202-3672-08db9ca543fa 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: MWH0EPF000971E4.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9266 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 --- 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 a70b86e60721..d60f7470e208 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 @@ -330,6 +331,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 @@ -361,6 +368,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[] = { @@ -5543,6 +5551,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) @@ -6171,15 +6182,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) @@ -6365,6 +6492,9 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) mlxplat_i2c->regmap = priv->regmap; mlxplat_i2c->handle = priv; + /* Set mapped base address of I2C-LPC bridge over PCIe */ + if (lpc_bridge) + mlxplat_i2c->addr = i2c_bridge_addr; priv->pdev_i2c = platform_device_register_resndata(&mlxplat_dev->dev, "i2c_mlxcpld", nr, priv->hotplug_resources, priv->hotplug_resources_size, From patchwork Mon Aug 14 08:59:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352596 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 78161C001B0 for ; Mon, 14 Aug 2023 09:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233300AbjHNJDo (ORCPT ); Mon, 14 Aug 2023 05:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235006AbjHNJDN (ORCPT ); Mon, 14 Aug 2023 05:03:13 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2043.outbound.protection.outlook.com [40.107.94.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CD0D1701 for ; Mon, 14 Aug 2023 02:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fVUTSJB3abF/WF3aHVDVbdN0LKU0xNMHM1y+A+upUBtZd7EX0QuTuKJc2x55y+vV6v0xsDybARTMLKuU9zAaeJQpR9dmRQLg00trgEMxMckRi/v361qTipHPnteMys/brcH4un+vVnJ+NBHA484zEBRZ2DPUmNtNzXelTOHiCqojxcpCZmC3bVlQ6MROHbtQ3GmZkRn0eXNYRHDcM4IGYzbCkNQwpT8uOn75aUSeHBPuKJw7FFdKYTz5SHYi0BF0V1a7lJYwwRQ/ZJ5ANqRwKxyb+o8p1IUxNMrq4AHgXqJmycRpYeX9A07aqdUzvLfz1Z0UtyZSMaTRObCj1o53sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mv0S/XhvKsXZlu9CtjytXYXccCQ/UPrRPjuylW54Dpw=; b=HZwYxqBBWszwp1/HjBXb4u1PkhCGcuhnhTo7J7CHJViTnjppfU8yAP4wfERaUR0Rf1Nso2Jak7K6Q2AewI6xap3TNyKQhpnUC/vR55XKlCq2f3hsKEpTKZ0WoDOZVXji1afG2MLfZnCIpL8xvvXeFAW8bEvV7sciiQg7gbt/nHTRMU2/2NSGcP9FcHE0LnYLpf/gffYSdb6+67bxaIpuDZmkqHzDrPe6Bx7t3xw2qLxlCYE4ERccEVVLQMlqCi9/xgC7bt2Immvg+PJ3uQq0vOjm7dv50jgIbb82r+SJrqehUGJjTIpHgjs5ShfjldwKUfVCWvanPj9RYgd2tAHdOQ== 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=mv0S/XhvKsXZlu9CtjytXYXccCQ/UPrRPjuylW54Dpw=; b=qiiuM2p+ynawThKL3qjRDLwkF/XC9iEVf8fkdOxoFz9CXh0/7gp1UTHJYV9PaHP3p6HfyrIOgXbW7Xdf8UFDJUy8iUwI5u8v1uONRT1h1zOJ4WxbjdZR1OqSpTMoK+mbjYkFAqJx9IZf907z4HFHxG6jG6l/D2+oXGjSXNqh3gnIKi0wjMuYgOqZvc1/rLuQGezvj+3rLuFj7BDISbjDylRJx4OvYhMpCDo9ZVRmtS8Ke6WoH+xy3LAvwqDQ+syaUlySEruFzWFMB46XKGh5d6FZjU5Byogc7CQsZAXcTTw/X/cRj4s1Qf4dm8IS5ahyIvM7P7+Rn6vBUy/aWP782A== Received: from CY5P221CA0065.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:4::35) by BY5PR12MB4227.namprd12.prod.outlook.com (2603:10b6:a03:206::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 09:03:04 +0000 Received: from CY4PEPF0000EDD1.namprd03.prod.outlook.com (2603:10b6:930:4:cafe::72) by CY5P221CA0065.outlook.office365.com (2603:10b6:930:4::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:03:03 +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 CY4PEPF0000EDD1.mail.protection.outlook.com (10.167.241.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:03:03 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:02:50 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:02:48 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 14/16] platform/mellanox: mlxreg-hotplug: Extend condition for notification callback processing Date: Mon, 14 Aug 2023 08:59:08 +0000 Message-ID: <20230814085910.56069-15-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD1:EE_|BY5PR12MB4227:EE_ X-MS-Office365-Filtering-Correlation-Id: 21e93903-d3bb-45b1-8924-08db9ca5449d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f8e49ouUkF5lZYym2tP0VWbhMJNvKAe0tTasSHw6As6CNPOkwJzkH4jQ8nemH/Ah15Adyx2+IS4FeV4SfMQn0hFTjRpFn4IM0M4ICXZsOpzypsWCdDB7n1ciYWxc20dQ3eMr6yY3YMlN8b2GEQowRKP93DbTonM9A13k6NYGiP5ruGZ5Y+6kDXxgcgKwvBwsRLx59CAMsGc4PoqitfWyJXF5MpN+jtk/O5OYDLXLDFWUEp4RYztNqIQVOMRmCMhFhGhuLSuwfoRk2YTxKyOx3eau/lt1JLEzv56XzHD0MCnD+eunoD0lsGlyg72G6/f7mKwGpQiLKi/6NoTJ46qvaxW74f7uC9Wi+vrCa2jC9Hw2aG29vve4CmCNOsetf8j9zw5QHzFpqNMlQADTIsLy7MtpYnKqSNbXDScfkLVQQ4YZyk+P+yxNHsJpIpsHiiCltRN38q5zWcrvRS7h6UfhmNA5VpQtYgaXAUT1ixdo4fnLGKItXPyrdbFVCK6/OneTbDuAWCDOK4+TDDmpcqG3WqwaXCNmiqSGI4Kjy7IFrF1Qljx+1i1OROXwuhJ8cPINHW27FMKbWSjvjBxccZ20tLCRfQCXVlYft16VrvKJyEE8vWwQ4HY/eaUQ9vU04jX8rlVBr9SN6GY3Omu3/Bo7+mftnbmB9queHSBWtiycI4D7oYZUZWhtRW9IEC0LUpbv/3pqUMJB7DJcVU/q2Mb97g== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(39850400004)(396003)(346002)(136003)(186006)(1800799006)(82310400008)(451199021)(46966006)(36840700001)(107886003)(16526019)(26005)(1076003)(41300700001)(336012)(8936002)(70206006)(70586007)(316002)(8676002)(36860700001)(2616005)(47076005)(83380400001)(426003)(6666004)(478600001)(40480700001)(54906003)(15650500001)(36756003)(86362001)(4326008)(6916009)(82740400003)(7636003)(356005)(5660300002)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:03:03.6362 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21e93903-d3bb-45b1-8924-08db9ca5449d 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: CY4PEPF0000EDD1.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4227 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Allow processing of notification callback in routine mlxreg_hotplug_device_create() in case hotplug object is configured with action "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in case no I2C parent bus is specified. Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- drivers/platform/mellanox/mlxreg-hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c index b7dcc64cd238..c5abedd3514d 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -113,7 +113,7 @@ static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv, * Return if adapter number is negative. It could be in case hotplug * event is not associated with hotplug device. */ - if (data->hpdev.nr < 0) + if (data->hpdev.nr < 0 && data->hpdev.action != MLXREG_HOTPLUG_DEVICE_NO_ACTION) return 0; pdata = dev_get_platdata(&priv->pdev->dev); From patchwork Mon Aug 14 08:59:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352600 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 1DC7EC001DB for ; Mon, 14 Aug 2023 09:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233409AbjHNJEq (ORCPT ); Mon, 14 Aug 2023 05:04:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233902AbjHNJE1 (ORCPT ); Mon, 14 Aug 2023 05:04:27 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2066.outbound.protection.outlook.com [40.107.93.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A80A10B for ; Mon, 14 Aug 2023 02:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WocBfEOwhHRzN5DPm2FMVWESRPKjgFvcBn7Uc2oVoaaneoK3QaijqkYdZS/Ql6VGa+WHHmsR20jdmVuPpbUDnET1MoG6aiVqijmMB6O4pR8tXA0l6E6oKENgiuT57FYsdEeH37ireLD4rzkW/63UeqX4/LvaRHyCwHUq/2HaLzcHuCSe/fry4qI4tpf2+bRnWVaqyIF+SU9i3GNq6/YRiUR4pdhjtWuLnfAII4nhaymGbouRCjaq20vGNJFQ0hBuDkKeiDlyo0fze5a0UolaFJHJAob7CzDTeF3uGV7tCZpv/2tVjw8Y0hYwSvQNfQhIzfa4jMYDPMY5qxc426o/rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yiI6U8wQcgnkhQB3bbIxE4I3kErVDwm8RWVfnjHWesw=; b=j1bm5BS9JIQljCsxmHQAZwKQK2QbzxlGSJmh0QQkcPXJeaqaEaUNAvrJogQRdGqvIW2+yg3F2Efqnelv9tBGeS97dlCR9ulLVwpC6tYxaQPQWU3lkJ8yeBWfQM9kGY08I6Fz3oE3dZiO068MYa6bSzPVFup9l29MUe1tIdmNUzTGlITkzhjU7klXhOOWbfFEp3//INjaKQYofIhiQkK73LKh0SlOqz1Imo0+IRbGSSTncm4QjfO5zpeOsQs0FjglT1okf5lFEv8tHk6EClzlMezAq1kTFtYXkW9v7gRbtcm7ffc29cr/P7IoAEuhSk2NOLcLJvGJ3wb5a4XqE62aXQ== 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=yiI6U8wQcgnkhQB3bbIxE4I3kErVDwm8RWVfnjHWesw=; b=QaP3fM3h/XmcuM9ISRNvvpGRIAYpqacs1YgdFbOG59B40G4cfK2xMgrH03rWwVapAvJkRPP/qfXAEG0JJDR7kA02yDlfKuHxws9dpVRJTbnZZsq0ThTVeC+bSkt0+iDyPTwmTocvyAfLnFcRLWB0y7tdh3wklgq6VmaZTc7a/NgiNY0zCQ5FS7ovF5c/h4zgNk194VlzQXqbczoa7kwdrI6z5cZK45dbZIEMhEK3SLDzAOWQY1iAUvaIM5TBJDtumxJLxRzgBfw7Gx8xhGRo3LDNrdAGysAxXA0Q91D2IvjlDp7MvYlLjA/FxeKx+g3MWPUGOJ5KKMEY+1zXM9e+Hg== Received: from MW4PR04CA0382.namprd04.prod.outlook.com (2603:10b6:303:81::27) by SJ1PR12MB6194.namprd12.prod.outlook.com (2603:10b6:a03:458::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.24; Mon, 14 Aug 2023 09:04:24 +0000 Received: from MWH0EPF000971E5.namprd02.prod.outlook.com (2603:10b6:303:81:cafe::cb) by MW4PR04CA0382.outlook.office365.com (2603:10b6:303:81::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Mon, 14 Aug 2023 09:04:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000971E5.mail.protection.outlook.com (10.167.243.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:04:24 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:04:13 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:04:11 -0700 From: Vadim Pasternak To: CC: , Michael Shych , Vadim Pasternak Subject: [PATCH platform-next 15/16] platform: mellanox: nvsw-sn2201: change fans i2c busses. Date: Mon, 14 Aug 2023 08:59:09 +0000 Message-ID: <20230814085910.56069-16-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E5:EE_|SJ1PR12MB6194:EE_ X-MS-Office365-Filtering-Correlation-Id: 46f7b65f-3e73-4629-848d-08db9ca574a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sICrKr8lItetcUMQwDHPYkC+zvfpvlaf2Fe0gLgNlaA72iZj6iYWZOWuLRVyF7Un3Od04XBsOqGjz+oWkLTezrakNIiBggnSyunKfJhoj9NNG8f709+bxm/IruWEdZjP9Ox0U97wJBRnoDOw0ANJLuuYpHoteB+DVBRJAr3VAUcjWM7nFkY0mFn4y3UGuYVyr3lv/ZPuXP+AzQDXR/o4KG3BVtR+MJO1dAtyUGpAdaKUbc+qoiJS7uWb2gF6iJLCvlCXKJSD5XwMiBKWyfYMzRQ0OOlzmScEuZtVJ7+Vtr5hXPaSyMOXmL9Yh2COdbW+4hj0tsk3M9KeA5MFVYHbCynwwWikZAmHA5svcepXCQG/eG6BksXutCIWsYR+dDhzqCkrZoLYSWndNmK7OC8Ie57xETbO+gjScD/iviXtaLmVE0SgCv8FgjLlHsU+ADNlMa8M/JfgQgytPDUh623n0A4YbHdWoWzp3uIN2PwOuwp5dAbSBKvZZBt9cMCBCBZHdxtBuNyMC+wphXU3mHzj+GMmmJ9W/nuqBDFBTwWC10C0BvhjCAfMnZAEOJQpPi5/H7Re+cptMZzNN8iSwd+yJy3rXr3peRaR6hy9xyQ3XMs2NF+ukE/wNN1+zIoxXPiays99u+pLwd1uLV2ptWB9EWRABF1v2Bpk8X7iRwvJmfXqcE0p/d/fHMa+h0iPZtcBm+0iiyQvCvRYSob/f1Svi9LwiWpIEgE4oWVA355QVts/j/reFDg4+oCrzeAw4rFh X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(346002)(136003)(39860400002)(186006)(1800799006)(82310400008)(451199021)(46966006)(40470700004)(36840700001)(83380400001)(336012)(36756003)(426003)(47076005)(36860700001)(86362001)(40480700001)(41300700001)(478600001)(356005)(7636003)(54906003)(70206006)(70586007)(6916009)(316002)(8676002)(5660300002)(4326008)(8936002)(82740400003)(40460700003)(2616005)(16526019)(1076003)(107886003)(26005)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:04:24.2766 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46f7b65f-3e73-4629-848d-08db9ca574a9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6194 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org From: Michael Shych Define the exact i2c bus (adapter number) of fans on the SN2201 system. This will cause fan's EEPROMs be connected already from nvsw-sn2201 platform driver and not from user space after receiving udev events. Signed-off-by: Michael Shych Reviewed-by: Vadim Pasternak Signed-off-by: Vadim Pasternak --- drivers/platform/mellanox/nvsw-sn2201.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c index 7b9c107c17ce..75b699676ca6 100644 --- a/drivers/platform/mellanox/nvsw-sn2201.c +++ b/drivers/platform/mellanox/nvsw-sn2201.c @@ -84,6 +84,10 @@ #define NVSW_SN2201_MAIN_MUX_CH5_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 5) #define NVSW_SN2201_MAIN_MUX_CH6_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 6) #define NVSW_SN2201_MAIN_MUX_CH7_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 7) +#define NVSW_SN2201_2ND_MUX_CH0_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 1) +#define NVSW_SN2201_2ND_MUX_CH1_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 2) +#define NVSW_SN2201_2ND_MUX_CH2_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 3) +#define NVSW_SN2201_2ND_MUX_CH3_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 4) #define NVSW_SN2201_CPLD_NR NVSW_SN2201_MAIN_MUX_CH0_NR #define NVSW_SN2201_NR_NONE -1 @@ -425,28 +429,28 @@ static struct mlxreg_core_data nvsw_sn2201_fan_items_data[] = { .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(0), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[0], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH0_NR, }, { .label = "fan2", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(1), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[1], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH1_NR, }, { .label = "fan3", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(2), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[2], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH2_NR, }, { .label = "fan4", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(3), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[3], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH3_NR, }, }; From patchwork Mon Aug 14 08:59:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13352599 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 BB41CEB64DD for ; Mon, 14 Aug 2023 09:05:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233521AbjHNJEr (ORCPT ); Mon, 14 Aug 2023 05:04:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbjHNJEb (ORCPT ); Mon, 14 Aug 2023 05:04:31 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2063.outbound.protection.outlook.com [40.107.237.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CF3310B for ; Mon, 14 Aug 2023 02:04:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A8ssCEI9K0xdV7CTs/TsjukId//XcYiv3KMZefV+CBgYsYrpkNNwaTT/PITC+ZL3lclQCFuWP7QbivoIlydMBCyoIkd0Znb5dP7566csgStRkWCBW0wR/FkcJRMMsx2bLYWVSTVY7B+X9eHzqexSYZnLmkVKBjpvETUX7RgwTOvxsjzbJuhZJ7y3KM1KWzPFPVgM9yPH6pbsFv+B7VVXjX3v9nqTcMuEbrtlucIlz4goaA+jM5gVfMqMWuxq3qM3ovCsXby3gCn/vPB6D6+SmDjEMHxAWgka272W/USTzdn0Ttl2e263gavM4naKIk6YtAwMOqYveQJm6MWeMd/Ziw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=weOk10MDBUQYhj0gbqxOz2vJzRheG88GF4qAUMkOjcY=; b=LP7k5Nq0qlm0IyAsWXmnAlPvjvhWwIqjW7qo5Pb0vXCDjDwN7JCVJ+GD6vEqFnT8Hi8e9xumoRo6RVlsZSUOAZPoaMZ+PKxIu8wMJ2a5lKBgbPy1mI2JaZRe+DE5XQRePNYq8woxPXBnVpx5J0KxtaaBUia7k3KsKV5SgG9qLiuKsv1nC0AQUNmLGCQpZ5wjgRdDbAxqGoeP6CQaA9XO3k1bKyCL5Ao/8KgLHrEzR/ypnxJEdkonlcjB2lBYIdy0+NUdXf2zTOznvkZ+ZMMo9gdpTgIOgtzwRXpuWLx13YrElvMAAKlUZK4vGGZ08h0IEyoJVxCnhn7L3Az8k/f++A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=weOk10MDBUQYhj0gbqxOz2vJzRheG88GF4qAUMkOjcY=; b=FmAfnRPl3/TlS1ubWxoq+ruc2E6NDcrin63z2KoSSxGnws+3Y0S3aXfVZnNJqOPzr9ps3bi0yX/JzbttNvM9Pw05w9rYTqEBOJBq+4vbucJNTH9Xif6nGHh4i0iKf9lDwpmBOaTsbky6K3BMyNTjkjpKI7hFyMlDgg2ZmK9mJ8nkcFf9cNa4Hm9xM8ZkkI9qKmj3vnpf8Oqi4Utt1IakTui4a0ZWGiLblVNKj+/sOh6EP3IIJmMQlpSKNqRDCr/QtaYRLp42Bqdv+YiHRQEvsbGlCjygdsr06aPglheK1PPYWsaD9s9KE77dnFVok6dV0OgPyf3IB0mjCz5mBv+b2A== Received: from DM6PR13CA0019.namprd13.prod.outlook.com (2603:10b6:5:bc::32) by MN2PR12MB4357.namprd12.prod.outlook.com (2603:10b6:208:262::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Mon, 14 Aug 2023 09:04:28 +0000 Received: from CY4PEPF0000EDD2.namprd03.prod.outlook.com (2603:10b6:5:bc:cafe::3) by DM6PR13CA0019.outlook.office365.com (2603:10b6:5:bc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.13 via Frontend Transport; Mon, 14 Aug 2023 09:04:28 +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 CY4PEPF0000EDD2.mail.protection.outlook.com (10.167.241.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.12 via Frontend Transport; Mon, 14 Aug 2023 09:04:28 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 14 Aug 2023 02:04:16 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 14 Aug 2023 02:04:14 -0700 From: Vadim Pasternak To: CC: , Vadim Pasternak Subject: [PATCH platform-next 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces Date: Mon, 14 Aug 2023 08:59:10 +0000 Message-ID: <20230814085910.56069-17-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230814085910.56069-1-vadimp@nvidia.com> References: <20230814085910.56069-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD2:EE_|MN2PR12MB4357:EE_ X-MS-Office365-Filtering-Correlation-Id: 57550045-f04c-4b07-350f-08db9ca57728 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qnmJ8DNlMsXRMJf9DOI0vvjDI/+Mq/pBfPh6PFAWYIudOPDwQSkXxbtbhpWqTCEAW/jmNyAFkmLROoEjgUmxgNuPt46tzH5tfmCK2J+rpzDJBSA6FLoWNBD8g0Gc2q6L8eYGoNn2TwWw16R9m4B+s0R5Xe0RYDWhKPN2oKUHVSP0RqRj1cTkcDGJFt9vvy0p7eExKHDu0nXv16Oyuvitw2Xb7RR4kD4OSAowXBikOvMfN4EiGNbauEVaedsDJp4nDG6n5XO/55SzMOAGNZrUGvqiKWQfh7sbAT5FDRCWXg05RWrgSkJyn+MExCRQ3Zko1J7n7Uc8gzYp4YH/6BLE94yLfyFaVmT3I0ev6u+zcDYSl/J8LbhkLz4zoKvUBOWaHVWQKWjvfil4oSOiHKKJOJ7Yyf6ioGaN0zDPaZLNALpV/xgpUYW0kFOYq9YY0EDU0qHRy52G2Psh0u4dzo0rbDwD9jcxmgA+jMNOkh3xLR9EJTQ7JXGdf84bD+nY/iKMgXHkirzOJPZsXTK+06DjEfEGbZgZEAs/rtPYLP9Zd0YH/ESP+Xzso8DxUiLaAFygwAa0ui6Y0Udpr5JjyxFd+OjSml4AT/N4MWu6QlBBc+t+WJUmt2cX4j1H2QLOniHFl3GjvlHjsnEsghJ8ASudKtCQKoqNQU/72y73A3d9Vxwl3Q05bjrc53AMiDm/pl0Jkdpcdf19SW10WVFNHc/3hxQ2qBPv4hE+sbW28MCUOg0YzBbn40zz00CN4U/lTuX+ X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(376002)(346002)(39860400002)(82310400008)(451199021)(1800799006)(186006)(46966006)(40470700004)(36840700001)(40480700001)(54906003)(6666004)(40460700003)(478600001)(7636003)(356005)(82740400003)(5660300002)(2906002)(36756003)(86362001)(6916009)(4326008)(70586007)(70206006)(41300700001)(8936002)(336012)(8676002)(316002)(16526019)(107886003)(1076003)(26005)(36860700001)(47076005)(83380400001)(2616005)(426003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2023 09:04:28.4311 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57550045-f04c-4b07-350f-08db9ca57728 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: CY4PEPF0000EDD2.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4357 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add documentation for the new attributes: - CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min". - JTAG capability: "jtag_cap", indicating the available method of CPLD/FPGA devices field update. - System lid status: "lid_open". - Reset caused by long press of power button: "reset_long_pwr_pb". Signed-off-by: Vadim Pasternak Reviewed-by: Michael Shych --- .../ABI/stable/sysfs-driver-mlxreg-io | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io index 60953903d007..633be2bf2cd0 100644 --- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io +++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io @@ -662,3 +662,45 @@ Description: This file shows the system reset cause due to AC power failure. Value 1 in file means this is reset cause, 0 - otherwise. The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: These files show with which CPLD part numbers, version and minor + versions have been burned the 5-th CPLD device equipped on a + system. + + The files are read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: This file indicates the available method of CPLD/FPGA devices + field update through the JTAG chain: + b00 - field update through LPC bus register memory space. + b01 - Reserved. + b10 - Reserved. + b11 - field update through CPU GPIOs bit-banging. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: 1 - indicates that system lid is opened, otherwise 0. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak +Description: This file if set 1 indicates that system has been reset by + long press of power button. + + The file is read only.