From patchwork Wed Sep 8 12:29:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Jakhade X-Patchwork-Id: 508041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 352D8C433F5 for ; Wed, 8 Sep 2021 12:29:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BD956113D for ; Wed, 8 Sep 2021 12:29:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349297AbhIHMbF (ORCPT ); Wed, 8 Sep 2021 08:31:05 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:39462 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1349005AbhIHMbC (ORCPT ); Wed, 8 Sep 2021 08:31:02 -0400 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 1886da2B016872; Wed, 8 Sep 2021 05:29:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=uqIgky/rbQuIkkOs6iK63hUpt+kph4GnPEZB8fzM014=; b=mX4o1/qVJeubaxqU6d4yJivpvzMCqNiS2n9Ex/A9O1OSDIDXeCJRc6Hh8oCcZSwxNkON z6AVmU0gn2X/R6t8bqt5nW1SCbd6l72xvL06ckYcwE9A6/3pEscKptXdy+Jj067lWlbb moyakHXvj48t7/kGUAboHTSs2+Wm/t8b65jty+CPGhoLVBRAxlv4YEUG7fAi6W8D50DB rXxFphNytfucUkcREqQFE4GrI/NasSuI+Q1AvUDWpOqGcv296zEjcx0imfXIwlBODLGO CAsmWDXplGbx6mkM4/yRT2RSdqEbFTtGFtyqfDQ7oHNq05odEiSyx9/0aNM1W8urMEuF Uw== Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam08lp2047.outbound.protection.outlook.com [104.47.73.47]) by mx0b-0014ca01.pphosted.com with ESMTP id 3axcp9k480-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 05:29:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Njl3DuQ1D+unOnnGevtM19MwaycIKGqeU1UdyZWfiLEP90/96LlzE1XU99RXATiVQ1hQNPd5E2PNcz9jShNMbeGCz6glEfMVYYMZU791Kos/7LMTlZ2w94f4TRsTMAxVoWIaxz4bvbbL2p5mKE3zDhrRaWcdWw3TFCrjuHf+tXmzPnOSRHnEvD9oRYolwFwILVoUWJkhPHk9iARKW0iTx4m2/LM83gF53tW6lJQ9ppCSndz8DIezmAU+pWBW93ty9WkT8jADt8x3lVQan3vZPegXzpY9/j63ay7xBodWlWBBcJBr0aEzlCmUz8kpfIpCq5GeYqnWFC1PrioIW6WAoA== 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; bh=uqIgky/rbQuIkkOs6iK63hUpt+kph4GnPEZB8fzM014=; b=GCMuKXm73Eqv5V+r3NS9V0bQnP+onijwUlnFyI4GsvxFG5VBNO498jCchyHufV8ZAFnvGZNxb/02fpjs4mqRWzaZMtnsnzfqYUYTeL8Jlx/WDmEvP9JxROvGWjcbm1+KeBK7tYiykVMxVG4Elwl5F6rXGSS6S00FQSPHom9Y5gMFPMAaqkSoG8W2dT2OGPWsm/kcZWpBmGxy6+EHOrR+McrTkaYu+QJXG6TCTaYTvOvNZrdQXROoUgVxG1O1QNUrGHh2SuRKUGjjsWe8gWip0+4UqHb1GnQiDEOqU2LUj6QM6cqvpGq+vhnKXWTwAYlf3fhiNTM9G09i+h6MT2qnXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.148) smtp.rcpttodomain=kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uqIgky/rbQuIkkOs6iK63hUpt+kph4GnPEZB8fzM014=; b=KdbNe4NGkqttkFP4afXNyhENcg0NDLAsI5vgE//ZNGqyW2aGSf7mWdiyvPD/FTf9VHiY6hCR9tUlfjYGdZTNZ4ov3qJ08+QWtTkMJM+xutQUekRLeXDT34LbpWsWZT9cAa0fHzc3whEw/9LvI9g9DOOQpyrhqwqQfSk706Imgjs= Received: from DM6PR06CA0071.namprd06.prod.outlook.com (2603:10b6:5:54::48) by BL3PR07MB8955.namprd07.prod.outlook.com (2603:10b6:208:33a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.25; Wed, 8 Sep 2021 12:29:40 +0000 Received: from DM6NAM12FT033.eop-nam12.prod.protection.outlook.com (2603:10b6:5:54:cafe::64) by DM6PR06CA0071.outlook.office365.com (2603:10b6:5:54::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 12:29:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.148 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.148; helo=sjmaillnx2.cadence.com; Received: from sjmaillnx2.cadence.com (158.140.1.148) by DM6NAM12FT033.mail.protection.outlook.com (10.13.179.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.6 via Frontend Transport; Wed, 8 Sep 2021 12:29:36 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTX9L026939 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 05:29:35 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Sep 2021 14:29:32 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 8 Sep 2021 14:29:32 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTWl6010280; Wed, 8 Sep 2021 14:29:32 +0200 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 188CTW9L010279; Wed, 8 Sep 2021 14:29:32 +0200 From: Swapnil Jakhade To: , , , , , , CC: , , , Subject: [PATCH v2 03/15] dt-bindings: phy: cadence-torrent: Rename SSC macros to use generic names Date: Wed, 8 Sep 2021 14:29:18 +0200 Message-ID: <20210908122930.10224-4-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20210908122930.10224-1-sjakhade@cadence.com> References: <20210908122930.10224-1-sjakhade@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b143d85a-9a78-4ecb-b86c-08d972c45245 X-MS-TrafficTypeDiagnostic: BL3PR07MB8955: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8yCzMdebdjPlvtx5QyS+bDAY1WUWB7SdyW6/ifa/cb4z/Z0Rab0IAQ19IZFRg033S44/drAN7Om6i5S/AzSZN7jiGfzYaHH5w5cm5sCtRW4GIcYaUaGXkOOf3QZ3CqVAMlvpkAvDkEcniAYUG37HJJzNTefprp/E2QZpkFOD0vqD9/MuLroBLn01EMuCdMBkMz7S7Kczv3pGs8Xy7TznvWLfUju6byIg5sChGjJGFt5sem3gQFJcxeKxIqFU1WpBod9FZFaIJl4WuyKZ5C9WB2jY7+5wG3qvYHvmLdSFB+TBVwVtbxe3vAOgnZP8pdP9HmnOTZaC1Ahfym+Qbu8b9KF5lTH8zyxwf5EgJn2oDyK3j43muUXG+CnMB8TXxu3NNaGvyz6zt5KgopuUDFdeD2EjeFoLFvehU+tE97x62X0x+wJgMQ7C9WEP4A64ZHiTxoc/83GN+wI6XN6xl2pVVx4JaVeV+EJnEB5WBzdh93O1ztf85nG36vhd+icBLxg7o/a4STwm9TsopyaLezCwx4qJJWM49IiK95ToyT53lTmVao8QJlxK9F7gG/SDiPnyybX9UQdmXoTXGpv9wMbSsZKW5FY1g78pwrtlfMVG1TIUiT/d+3U6GT34VzLUzyd0NGUBt3gNbMU0yhsXycR3AD7lVSOdGkqYVBmBTrAq5MarPG2VuOoSrHBIqBfw98NoGboEmlbEWU20B0UATHNrYMOt3FHhuOt+yN4SVd3jW4ktEluKGnPLn15Y2JjhGxkt X-Forefront-Antispam-Report: CIP:158.140.1.148; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx2.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(346002)(396003)(136003)(376002)(39860400002)(36092001)(36840700001)(46966006)(2616005)(82740400003)(316002)(83380400001)(86362001)(186003)(70206006)(26005)(356005)(8676002)(36860700001)(42186006)(8936002)(336012)(54906003)(110136005)(7636003)(47076005)(1076003)(2906002)(5660300002)(70586007)(6666004)(478600001)(82310400003)(4326008)(36756003)(426003)(41533002); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 12:29:36.8223 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b143d85a-9a78-4ecb-b86c-08d972c45245 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[158.140.1.148]; Helo=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT033.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR07MB8955 X-Proofpoint-GUID: tov-EPriBHnISyWTZcCqC0viPKFwE4ef X-Proofpoint-ORIG-GUID: tov-EPriBHnISyWTZcCqC0viPKFwE4ef X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1, Aquarius:18.0.790, Hydra:6.0.391, FMLib:17.0.607.475 definitions=2021-09-08_06,2021-09-07_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=0 mlxlogscore=833 spamscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080080 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Rename SSC macros to use generic names instead of PHY specific names, so that they can be used to specify SSC modes for both Torrent and Sierra. Renaming the macros should not affect the things as these are not being used in any DTS file yet. Signed-off-by: Swapnil Jakhade Acked-by: Rob Herring --- .../devicetree/bindings/phy/phy-cadence-torrent.yaml | 4 ++-- include/dt-bindings/phy/phy-cadence.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml index bd9ae11c9994..2fec9e54ad0e 100644 --- a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml +++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml @@ -202,7 +202,7 @@ examples: #phy-cells = <0>; cdns,phy-type = ; cdns,num-lanes = <2>; - cdns,ssc-mode = ; + cdns,ssc-mode = ; }; phy@2 { @@ -211,7 +211,7 @@ examples: #phy-cells = <0>; cdns,phy-type = ; cdns,num-lanes = <1>; - cdns,ssc-mode = ; + cdns,ssc-mode = ; }; }; }; diff --git a/include/dt-bindings/phy/phy-cadence.h b/include/dt-bindings/phy/phy-cadence.h index 4652bcb86265..abc4ff81aa7b 100644 --- a/include/dt-bindings/phy/phy-cadence.h +++ b/include/dt-bindings/phy/phy-cadence.h @@ -6,11 +6,11 @@ #ifndef _DT_BINDINGS_CADENCE_SERDES_H #define _DT_BINDINGS_CADENCE_SERDES_H -/* Torrent */ -#define TORRENT_SERDES_NO_SSC 0 -#define TORRENT_SERDES_EXTERNAL_SSC 1 -#define TORRENT_SERDES_INTERNAL_SSC 2 +#define CDNS_SERDES_NO_SSC 0 +#define CDNS_SERDES_EXTERNAL_SSC 1 +#define CDNS_SERDES_INTERNAL_SSC 2 +/* Torrent */ #define CDNS_TORRENT_REFCLK_DRIVER 0 /* Sierra */ From patchwork Wed Sep 8 12:29:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Jakhade X-Patchwork-Id: 508042 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C283CC4167E for ; Wed, 8 Sep 2021 12:29:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA5D261153 for ; Wed, 8 Sep 2021 12:29:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349270AbhIHMbE (ORCPT ); Wed, 8 Sep 2021 08:31:04 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:8530 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1348910AbhIHMbB (ORCPT ); Wed, 8 Sep 2021 08:31:01 -0400 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 1886da7t016869; Wed, 8 Sep 2021 05:29:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=a6i4dMHOxB4UyRk0dA5AgBiPjjno9r9bCtqGLqula6M=; b=kLWEMXtn+vHnEC6lKntYpy1qB40Un5zCqeGMzp92WtgZo0sT4imUdmFUO9lDeRzw2nog EWo92tA490BzSmVkSP5ndQUIZuYts7p4f3alOfZcfypM89X5O53FUkJUZgZ1u6vj4j8j FFHQQUmqb23dW1JDF1BaevhHlobrQqP3oGUMfserU+szdzvhY3SqYB5Lgq5YT72SalCM P+a8pRwHQybNtLI620/LuNoXI8pnmGLlRx4Qny6WaHyv8n7QsQDb+jebE6FATxZQJ1OY wvByf/uYwPu2pUpReqIlkRfregQaPn6g6sMacxAUmQyLZlTAMaM74GM9fV71T/0H+CbE Qw== Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2175.outbound.protection.outlook.com [104.47.55.175]) by mx0b-0014ca01.pphosted.com with ESMTP id 3axcp9k47t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 05:29:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OjCOb69/k8zvYS+1T4ssPQZ1y4QpYz8BLCFSR0U5UBORs9pAXGVYNk7lEgkiwJAjSR7/eoHq6eEBk9o5GG7Ky2JIJBqkBentPYoVhCCjLJ2jIER5B6A/2mLxEytBx1pQ7QQexXCbzwaF8d9H7u5L9Pm0IVwuUlklOI6IM+QgvRZ0pp8GImmLoNVsXO9NeLerShGksLK2sirsPqlTRReAwmEVzi0vf9w8vsdStd+KgqiCQqfrT7+Z1Cr78hUyDE/7yC4plsXyMYZ8oUd/YAk2ToKD0RUli6V2spnuYCNCEVvkh9dZ86kDGP+uPQpkaWyukzgLeURGeg668M2wZYZHYQ== 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; bh=a6i4dMHOxB4UyRk0dA5AgBiPjjno9r9bCtqGLqula6M=; b=bfEquEZK+/ub5qZmAN0IZ+Qgh4C+nFM+1LUziMojzMSFjUqrrqhqht/pmePzU+gdR4POXFzOw687n8RQ+8qDQvpF7MSpoE+3fppY+jn9J1JSXmjEKg4QA7aoAybXO5Kkz/Zswl5V5KIROC8rmbMl7C3lEgOWmZJgHv95Q7voj6RnQbjBfxjdtnKbI1vXVfTkSLVm2YOioxVinpnMQ/URWZCEKlHkc7X8M1iFc8Td4uA1GYJkPrmqLX9XLnlQGLpdV1hPjvtMSn4ov5vr5tAliw057DvSoFx4+5wzn5Cgple69YelC6B7S8Zqtkt4IzYYizYz8rmMIytjeX27rt3Sjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.148) smtp.rcpttodomain=kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a6i4dMHOxB4UyRk0dA5AgBiPjjno9r9bCtqGLqula6M=; b=R5/2znWWDrlxpssUKzoo1J/foESnrtOtr4kAK5jaQnAD2m9TjOEvkzPLzjb9nOsFYL+qO3oyzADziDd4e05HkinCLqH+KvyvwDPWmFu8figq0Rf5lf6Sx9a3uDz6W/UrelUGw04D9QTkyQgCFozhf4DnFIPEa+F8FzVIAkSk1P4= Received: from MWHPR21CA0025.namprd21.prod.outlook.com (2603:10b6:300:129::11) by MN2PR07MB5920.namprd07.prod.outlook.com (2603:10b6:208:aa::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 8 Sep 2021 12:29:38 +0000 Received: from MW2NAM12FT021.eop-nam12.prod.protection.outlook.com (2603:10b6:300:129:cafe::15) by MWHPR21CA0025.outlook.office365.com (2603:10b6:300:129::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.3 via Frontend Transport; Wed, 8 Sep 2021 12:29:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.148 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.148; helo=sjmaillnx2.cadence.com; Received: from sjmaillnx2.cadence.com (158.140.1.148) by MW2NAM12FT021.mail.protection.outlook.com (10.13.180.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.6 via Frontend Transport; Wed, 8 Sep 2021 12:29:37 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTX9M026939 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 05:29:36 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Sep 2021 14:29:32 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 8 Sep 2021 14:29:32 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTWxA010288; Wed, 8 Sep 2021 14:29:32 +0200 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 188CTWxx010287; Wed, 8 Sep 2021 14:29:32 +0200 From: Swapnil Jakhade To: , , , , , , CC: , , , Subject: [PATCH v2 05/15] phy: cadence: Sierra: Add support to get SSC type from device tree Date: Wed, 8 Sep 2021 14:29:20 +0200 Message-ID: <20210908122930.10224-6-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20210908122930.10224-1-sjakhade@cadence.com> References: <20210908122930.10224-1-sjakhade@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0bd53d6e-154f-48c2-decb-08d972c45275 X-MS-TrafficTypeDiagnostic: MN2PR07MB5920: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:206; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rlNCsWRv9yGM9FCprkHGyNKxc1ObVUYEDxUxgT7eiPBhiUAz0N3qhCjaWib13oFQOyRLkrePl4Vi0tywxYqbMcl7XHlCSDk9CQN9bvqSTgvWlxODcjY9yg2Y2kCObXNWIMnfL8LaCz/jyCb63gyC64O+WlhqIlvevToIBL0mnTOHbzP0iW10p/T87pCdBm4p8iaGnRYjy9DiI1kaXa3VQijmlSJO81+ZCJvtKxNK37t58XwX0O9DGOeQ/dX/XtlLHKKtP09CLRUPLvlP1pauwkoIAgyV1JEIpgezLLaMPKx3yt10jVhADba7MHnoBVR8wnXNGK0LssGrt8sNksDfDz5bBGx07baCz9kkgp0cOdjS69q3f2fnUIYXFA4U1KG3dZF5ZW6MrLqLf/KVAoPgjzj2OLSKm91/3OLtLQwu6EuIJxwrslxroUj5CjRxHj6DLqHNUJMLQzXaPEwf97lNbIVtAhn3lWX4ba/EtmojcJEEwJaVzAQFnyGuXw5uvvu8i6Rq3LesMVr33Rq+KwLJuthw8kXX+20QM2C/y+twlxDD1OZqtVHmr+k/7XxYiDVvHg0ngqJLLrKX4rxvrnV0NFF7t8oN40Z0MDoSctPxLN2GiLJDnhe+Lt0H4gqL9wy542yFQT+lR+FIwlB4mcnS9Fd2fS5tAeVFRwtOOMUipwgfLF1jjEURoVIyikIuu3anXFrvwQigBMMgLav31R9R82W2Lr1i9xQcM1d6/hXJipk= X-Forefront-Antispam-Report: CIP:158.140.1.148; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx2.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(346002)(136003)(39860400002)(376002)(396003)(36092001)(36840700001)(46966006)(426003)(2906002)(2616005)(47076005)(36860700001)(8676002)(86362001)(82310400003)(83380400001)(478600001)(336012)(316002)(42186006)(110136005)(4326008)(82740400003)(7636003)(54906003)(186003)(36756003)(26005)(356005)(70586007)(70206006)(8936002)(6666004)(5660300002)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 12:29:37.1699 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0bd53d6e-154f-48c2-decb-08d972c45275 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[158.140.1.148]; Helo=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: MW2NAM12FT021.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR07MB5920 X-Proofpoint-GUID: 6kQnyNtqOG5czOKbJZDw8IadQKcRgAdl X-Proofpoint-ORIG-GUID: 6kQnyNtqOG5czOKbJZDw8IadQKcRgAdl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1, Aquarius:18.0.790, Hydra:6.0.391, FMLib:17.0.607.475 definitions=2021-09-08_06,2021-09-07_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080080 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add support to get SSC type from DT. Signed-off-by: Swapnil Jakhade --- drivers/phy/cadence/phy-cadence-sierra.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 7e0f36dabc95..31e5d428dc03 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -238,6 +238,7 @@ struct cdns_sierra_inst { u32 num_lanes; u32 mlane; struct reset_control *lnk_rst; + enum cdns_sierra_ssc_mode ssc_mode; }; struct cdns_reg_pairs { @@ -360,7 +361,7 @@ static int cdns_sierra_phy_init(struct phy *gphy) const struct cdns_sierra_data *init_data = phy->init_data; struct cdns_sierra_vals *pma_cmn_vals, *pma_ln_vals; enum cdns_sierra_phy_type phy_type = ins->phy_type; - enum cdns_sierra_ssc_mode ssc = EXTERNAL_SSC; + enum cdns_sierra_ssc_mode ssc = ins->ssc_mode; const struct cdns_reg_pairs *reg_pairs; struct regmap *regmap; u32 num_regs; @@ -623,6 +624,9 @@ static int cdns_sierra_get_optional(struct cdns_sierra_inst *inst, return -EINVAL; } + inst->ssc_mode = EXTERNAL_SSC; + of_property_read_u32(child, "cdns,ssc-mode", &inst->ssc_mode); + return 0; } From patchwork Wed Sep 8 12:29:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Jakhade X-Patchwork-Id: 508044 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 190DBC433EF for ; Wed, 8 Sep 2021 12:29:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F418861153 for ; Wed, 8 Sep 2021 12:29:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348945AbhIHMbB (ORCPT ); Wed, 8 Sep 2021 08:31:01 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:17372 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348860AbhIHMbB (ORCPT ); Wed, 8 Sep 2021 08:31:01 -0400 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 1886dluE030522; Wed, 8 Sep 2021 05:29:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=QVW5zowOOqNka9NgAk8b1lOpt/DRuhTeb2B8vX5LFxU=; b=bDWWvwBzhGuEwA/SfcmwdFQGDwn3HjKV/MeVQOFIA/ZFDXFpa0MwshhY2BWT79gLkG3Y 4Y0lpua/hI5VLTUHZd9KdEVuGj8UZRPL2UKeK1mnQHR3M+xsjL9+lqnWkwvBLSOO68Lr w104rW1w6uKNXK7+Abyu79ncoq6yjxid/x4oR0zoOIeGceQCSppXr8ysSNDIlVkeMAqJ 0Ewi3M2m6cHnZjYhPcVznBf+qEvuBM3mwG98lD5IsdZzVrg1mwsURJQIGgLmzVnqGQXz 9S0pGrWfQAW9ZFs1x4ND4gRumX1mR1cnNdRE9ynvBx2qANSLTXXq1kyNaevegNmhYhdr kw== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by mx0a-0014ca01.pphosted.com with ESMTP id 3axcn5b0xc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 05:29:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dFjODxd6xoIVM1Mm55nQj325Vai5bm3RTD8fnx4UC0HbRnK0ejPrmVJNeqexRCLTEydKTmbYylVqvsCQuwRi/wHrzgJskdmToN6OB+OBmgaWUZ2nzupkBXwySbkazli3Dot+gpnIahqzL+KeIP76yJQ9ZllaFE8tY5YBnaDvHqpONBnHTg2wDBz+kpCs21kRGz5kuX+1kb2n5MJMKMo6qTIFQ+uqyqR6vX60EQodDKsPr8vXvgeMbFrd3YDdqmQJE9rXXbXTnZqCmDhX4PBnziFjKy8dg/ruQZ3UzuXOcv2YUT1EvFe8h9NzivuxDo3K9rXiag4iqkz6yB3ZHF6/XQ== 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; bh=QVW5zowOOqNka9NgAk8b1lOpt/DRuhTeb2B8vX5LFxU=; b=ftFZfgKYbi60BCNoU+o2l9UPNSJt0NdUtQIh6xCs/OOFWDLvibYlnV8zBYpga2JFrL3mxz3UwE/r5Bx3QLH2OliQ+7w7Gf3gmLsEUyRm3e+BLXJRNGO6ra3jl66IM9VSRePK2q7qT3K8bIpFbXxlignXz6Xa4To2My1nUSmsJcxK5Oul/8Gc4aTade+Mo5M+0VtXKmfuUsspho9Go14BT+jTlZ7tU6e3LpHDmGHFcQgc5Xg3YDHbCk4OuwPUQ5eU4hVgzvPehCSi6LyHVtl7IWqB4k7xzay9NVY07XSP8WlQ3ejFR3fs+icTcY5bTJVu2ZYhOPScPCeeB3L2/BNSsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.148) smtp.rcpttodomain=kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QVW5zowOOqNka9NgAk8b1lOpt/DRuhTeb2B8vX5LFxU=; b=zt/yNTmqlpwAmHJzwv+zDOoF7pcuLeU7KDvWZSTB1IOM84kQnPAKWQO8e3SSFuHbE/neQC+DAOi+vR9tqAJF+sA18zt6QfUOBhuv7SMkWSEaaLInoVBgEe/kGVlUGP2Nijw9E1lo07dJg/Xp3XrEyw+7XtH0hNiLs7co1oDHC0c= Received: from BN9PR03CA0860.namprd03.prod.outlook.com (2603:10b6:408:13d::25) by BN8PR07MB6194.namprd07.prod.outlook.com (2603:10b6:408:ba::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 8 Sep 2021 12:29:39 +0000 Received: from BN8NAM12FT014.eop-nam12.prod.protection.outlook.com (2603:10b6:408:13d:cafe::9d) by BN9PR03CA0860.outlook.office365.com (2603:10b6:408:13d::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 12:29:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.148 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.148; helo=sjmaillnx2.cadence.com; Received: from sjmaillnx2.cadence.com (158.140.1.148) by BN8NAM12FT014.mail.protection.outlook.com (10.13.183.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.6 via Frontend Transport; Wed, 8 Sep 2021 12:29:39 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTX9P026939 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 05:29:37 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu5.global.cadence.com (10.160.110.202) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Sep 2021 14:29:32 +0200 Received: from maileu3.global.cadence.com (10.160.88.99) by maileu5.global.cadence.com (10.160.110.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Wed, 8 Sep 2021 14:29:32 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 8 Sep 2021 14:29:32 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTWxI010292; Wed, 8 Sep 2021 14:29:32 +0200 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 188CTWN6010291; Wed, 8 Sep 2021 14:29:32 +0200 From: Swapnil Jakhade To: , , , , , , CC: , , , Subject: [PATCH v2 06/15] phy: cadence: Sierra: Rename some regmap variables to be in sync with Sierra documentation Date: Wed, 8 Sep 2021 14:29:21 +0200 Message-ID: <20210908122930.10224-7-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20210908122930.10224-1-sjakhade@cadence.com> References: <20210908122930.10224-1-sjakhade@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09992880-a930-4495-7ab9-08d972c453a0 X-MS-TrafficTypeDiagnostic: BN8PR07MB6194: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:534; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a4RjDDDMW9++mpgajIdiPKZVgE3wsAZBuA0woxPp1a+mqPpBFi+Vz+1pRkdBVUde0BF0qYAbnEIHaUFMdIlYyxK8Y2ZpUI2hFlfnrXWskx5b/BuB5akoxFMcy+Wu1VDx9i5cabMD6/jvpZOLeN1CYwzYJTCOShzxbB/xHAfF93p9PAjJq/lggVuSKkuOcrk1gQtKWoCCv3d81VXa6dIMFYPHUIp4xoanxxcUhDTQ5FZsUWEnFB7/bOvxrmzi7HVLlsKf08DFJ7CT1QiVwlNygrZ80JfGDM3Yn6kOryfOtdJjfAFpiwLNhJveHvgsMHNFi41tZl6Q5fKnO8ri6WhcteToGy4qpGkTSTdXkJKsxHQ4+aNpueIblUICUB+8mjg5opieti1kqK9nSIBP34FHXMN23pl8zAR4dEneXhcdCtLb4Lh4cZR2YAslpjLsvRJgrFcYbhK5rNSgOVG8xiAHARK2KbRlVMNaIXbl3rsZlNsyhSR/VO9y1vFHlakbZ03uCl1Y74lLxziioeGA71JR0ohWeeOKtE5onp9LWqlAhaJ/WBkwtKbnI9NF/QsRROlweSJkh64O/mbUVS1JdSTLSTrh4E7jJLH8XZVmhYsu81OwI7POAWkSF21YeUHQiV9+kAkl45L0WSrQ4eJAzZfbZ/aKsUC0HfZEgGfm7vsL9+F1YjFIjG2B8wpISoeuY7SUJgNVvW2cdIn3QoudKY2RR5JplF3du91fzbcc58pwsuE= X-Forefront-Antispam-Report: CIP:158.140.1.148; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx2.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(376002)(136003)(396003)(39860400002)(346002)(36092001)(46966006)(36840700001)(36860700001)(82310400003)(26005)(5660300002)(8936002)(186003)(478600001)(8676002)(336012)(426003)(2616005)(1076003)(86362001)(83380400001)(47076005)(36756003)(110136005)(4326008)(42186006)(70206006)(316002)(2906002)(54906003)(6666004)(70586007)(356005)(7636003)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 12:29:39.0419 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09992880-a930-4495-7ab9-08d972c453a0 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[158.140.1.148]; Helo=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT014.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR07MB6194 X-Proofpoint-ORIG-GUID: ka15s2M_ZxFWP4XzCMdyVrA-Gr77Q3bU X-Proofpoint-GUID: ka15s2M_ZxFWP4XzCMdyVrA-Gr77Q3bU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1, Aquarius:18.0.790, Hydra:6.0.391, FMLib:17.0.607.475 definitions=2021-09-08_06,2021-09-07_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 mlxscore=0 clxscore=1015 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080079 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org No functional change. Rename some regmap variables as mentioned in Sierra register description documentation. Signed-off-by: Swapnil Jakhade --- drivers/phy/cadence/phy-cadence-sierra.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 31e5d428dc03..a426b12447a7 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -145,8 +145,9 @@ #define SIERRA_DEQ_TAU_CTRL1_FAST_MAINT_PREG 0x14F #define SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG 0x150 -#define SIERRA_PHY_CONFIG_CTRL_OFFSET(block_offset) \ - (0xc000 << (block_offset)) +/* PHY PCS common registers */ +#define SIERRA_PHY_PCS_COMMON_OFFSET(block_offset) \ + (0xc000 << (block_offset)) #define SIERRA_PHY_PLL_CFG 0xe #define SIERRA_MACRO_ID 0x00007364 @@ -275,7 +276,7 @@ struct cdns_sierra_phy { struct reset_control *phy_rst; struct reset_control *apb_rst; struct regmap *regmap_lane_cdb[SIERRA_MAX_LANES]; - struct regmap *regmap_phy_config_ctrl; + struct regmap *regmap_phy_pcs_common_cdb; struct regmap *regmap_common_cdb; struct regmap_field *macro_id_type; struct regmap_field *phy_pll_cfg_1; @@ -346,8 +347,8 @@ static const struct regmap_config cdns_sierra_common_cdb_config = { .reg_read = cdns_regmap_read, }; -static const struct regmap_config cdns_sierra_phy_config_ctrl_config = { - .name = "sierra_phy_config_ctrl", +static const struct regmap_config cdns_sierra_phy_pcs_cmn_cdb_config = { + .name = "sierra_phy_pcs_cmn_cdb", .reg_stride = 1, .fast_io = true, .reg_write = cdns_regmap_write, @@ -689,7 +690,7 @@ static int cdns_regfield_init(struct cdns_sierra_phy *sp) sp->cmn_refrcv_refclk_termen_preg[i] = field; } - regmap = sp->regmap_phy_config_ctrl; + regmap = sp->regmap_phy_pcs_common_cdb; field = devm_regmap_field_alloc(dev, regmap, phy_pll_cfg_1); if (IS_ERR(field)) { dev_err(dev, "PHY_PLL_CFG_1 reg field init failed\n"); @@ -741,14 +742,14 @@ static int cdns_regmap_init_blocks(struct cdns_sierra_phy *sp, } sp->regmap_common_cdb = regmap; - block_offset = SIERRA_PHY_CONFIG_CTRL_OFFSET(block_offset_shift); + block_offset = SIERRA_PHY_PCS_COMMON_OFFSET(block_offset_shift); regmap = cdns_regmap_init(dev, base, block_offset, reg_offset_shift, - &cdns_sierra_phy_config_ctrl_config); + &cdns_sierra_phy_pcs_cmn_cdb_config); if (IS_ERR(regmap)) { - dev_err(dev, "Failed to init PHY config and control regmap\n"); + dev_err(dev, "Failed to init PHY PCS common CDB regmap\n"); return PTR_ERR(regmap); } - sp->regmap_phy_config_ctrl = regmap; + sp->regmap_phy_pcs_common_cdb = regmap; return 0; } From patchwork Wed Sep 8 12:29:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Jakhade X-Patchwork-Id: 508043 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ACD6C433F5 for ; Wed, 8 Sep 2021 12:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65DFB61168 for ; Wed, 8 Sep 2021 12:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348860AbhIHMbD (ORCPT ); Wed, 8 Sep 2021 08:31:03 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:32206 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1348841AbhIHMbB (ORCPT ); Wed, 8 Sep 2021 08:31:01 -0400 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 1886deXQ016935; Wed, 8 Sep 2021 05:29:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=+ahc9zEkbRWKLcg4An6kKo6Zb5TU8icRxkcvsrkVw3s=; b=sA7TYjATbCWb6q51WKvQWelLG6vOOoRo2V6Lipa+THMVFQ6FAjPEiJprPLNoMJNdmhM+ tRbLiqVxVkravgZ+zl1h/bCHHrL3xM2PjD8oIQ6Ma0XLg6Ktzekz5T/oKey3FCxtLzDy PgggJW+L3zHNxc6dkAPnFVgisAmkoCTTrJBIHEjZRoZRNEhNr4hoQxm7uys3QzLUayuf WxT9x9FLOYYFKuRlSVmKAlQtPzBD9VfSeWJF10Ah148YykbWNxopufxbj6al8xQUUpNc N10hZsr6qZtymQErtqjjK4FYK2h2xP6WwMjtA8rSGwBXh7Rlw+teFO2pOxxCwIxWOkch oQ== Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2171.outbound.protection.outlook.com [104.47.56.171]) by mx0b-0014ca01.pphosted.com with ESMTP id 3axcp9k47x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 05:29:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TW5yvab5UUB0ClxJu/odxr3NSdmKg43qo7SiJkaWx3mVoUv5THPwudasY26Xe8Fqt8vf2Ltp7IFaXmK3ZZBqMKF/3OqnKZ4U/HTS2FB3Bq1/ZDAgi/eieekyYZQtfbMFLPMYe41N6lTu1qN1c0FqvzAZv51/XYL/e1CB9svCIGrLpc/3hTZrvKOv5bDqg40B4+iTyprnwgZTCT9BgMRJcF5V0/xf41DRzRk9CEM35jyZwNX3uC0ZG9tLCymeg14q5cG21qeR8h3PGaPX99Xu8/gMo+Tmx9dg5Whs7ECK4AN+f8wufGPKcpLWWrqnRjoKB2rzz7tjGB718UBf0KtT0Q== 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; bh=+ahc9zEkbRWKLcg4An6kKo6Zb5TU8icRxkcvsrkVw3s=; b=WYwAjFyvYLDK3J6CqF9SU4Lwsiy/zGdtehxmV/ZLxVHh+Xl4DUYFlpVzBP84EfvnFRbvfQhlCMwrrRdH5L6DpbZOhDbBnTKgoQPgs0V1HA1YvcT3z3eOCpfh2IY9OPXCtvElkfyrcNhQ1j1HKxu8izdtNGBnP+I1sKyS6V0mnRxbNvTgP+Of664z116epkgY9bfnKqnZCoKu3AnDH1euRafAei7Ic1Zjr2vF97clHJ0e9YdPL1CHELrzDbTK7C0T3kYeGMiZsRWy5LKos+AFtKNMuE7hG6Cg8JjN+on0pWoaTOjbt/KPaTDo7aHfGwGjm6UhiNt64Ggtq3CBHWbS6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.148) smtp.rcpttodomain=kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+ahc9zEkbRWKLcg4An6kKo6Zb5TU8icRxkcvsrkVw3s=; b=aWP1qalnwGcDzOlOrKLhAUF5ze3aG7dO3SlMerjoTr1GHNG9x2I+UImiltEJyDwPAYOYgFJuVHwyhTIOpTSa2o2KwPdsiRgUewlUuRrJf5rozUSMr59XXbzkAUyroEUYb5mGYi2ri7TQBI3PGeDoD7bdLQYnj1sIzGp0dPlionk= Received: from MW4PR03CA0340.namprd03.prod.outlook.com (2603:10b6:303:dc::15) by BYAPR07MB6104.namprd07.prod.outlook.com (2603:10b6:a03:13a::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 12:29:40 +0000 Received: from MW2NAM12FT046.eop-nam12.prod.protection.outlook.com (2603:10b6:303:dc:cafe::81) by MW4PR03CA0340.outlook.office365.com (2603:10b6:303:dc::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.15 via Frontend Transport; Wed, 8 Sep 2021 12:29:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.148 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.148; helo=sjmaillnx2.cadence.com; Received: from sjmaillnx2.cadence.com (158.140.1.148) by MW2NAM12FT046.mail.protection.outlook.com (10.13.181.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.6 via Frontend Transport; Wed, 8 Sep 2021 12:29:39 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTX9Q026939 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 05:29:38 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Sep 2021 14:29:32 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 8 Sep 2021 14:29:32 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTWTu010296; Wed, 8 Sep 2021 14:29:32 +0200 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 188CTW4H010295; Wed, 8 Sep 2021 14:29:32 +0200 From: Swapnil Jakhade To: , , , , , , CC: , , , Subject: [PATCH v2 07/15] phy: cadence: Sierra: Add PHY PCS common register configurations Date: Wed, 8 Sep 2021 14:29:22 +0200 Message-ID: <20210908122930.10224-8-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20210908122930.10224-1-sjakhade@cadence.com> References: <20210908122930.10224-1-sjakhade@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 63d3e642-8d6e-4637-973b-08d972c453cf X-MS-TrafficTypeDiagnostic: BYAPR07MB6104: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:741; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OMmNjoLfru1lS4YderEWeVAPrZ0x+pa75v40DgHW6B751QdyaacLFVDg4gDNF7rgiC2vCc6cwhAOIkucecUaJE9xqvielmkrawlNR5+Ign9OX7KxPybGtsJ7AcV84syUI21UiEpZEr2aNJ46mKTFB/r1KELm/wwctbQbHIbPiFweKipSHOTcibP/mB7fCLEjLjc4uPfO0Dauguo93ZXW+gjd6gB0T5Bb+gBMjZj+rxCyTIZXwePX1yTzjzSm7ygVwMReopFTgupPZKVAlJbCYuHKNPe2rmy9tUTABP+7AyXrTiHTQjyHMn4pa0so+9eRzjNpHB6JUM/bNrLMDR7pAeKqB+k/ZuXivbkeC5ugzCWkDSQHaiBVzgenMxcUlCeM/VqN3WRtEMTUDBvp1IEbXfofqzOIuXeQ6G76BQkQw5qwmnJWq9eLc933OwZQOm0lPe9zUPlf7tP3+zEXJUh7GI9RmoOctu87GGl2zG+Lxgb7Il6EDkF+GVnuwU1Lcpp0gkGzO7U8EqF08GHokGBGLvGJfH1KFgiPcmOOXyo5Jz0JyPYu2GSdblO0Eb9NR+/FRllDNjNvoxuo2nOrvU3ZvsbjzGbaajugRoE2e1pmPUN59YwtbKU7K1zDUIMjggWSDpOHC/+WlBW9WPFC0ht0JYLAq5JIWh7YWsvQNh7q0Z0qcQin54mb4825eDzKwt2NCxS+l56YxVUKLgNMeZqcn2YduekL0++eWX2kDV4Vd10= X-Forefront-Antispam-Report: CIP:158.140.1.148; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx2.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(36092001)(36840700001)(46966006)(42186006)(186003)(110136005)(2616005)(54906003)(508600001)(8936002)(426003)(356005)(83380400001)(316002)(86362001)(19627235002)(26005)(82310400003)(336012)(1076003)(70586007)(4326008)(7636003)(70206006)(36860700001)(8676002)(36756003)(2906002)(6666004)(47076005)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 12:29:39.4286 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63d3e642-8d6e-4637-973b-08d972c453cf X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[158.140.1.148]; Helo=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: MW2NAM12FT046.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB6104 X-Proofpoint-GUID: 7-X-UwJJGuRNvcO6p2MobayyS1io98Ac X-Proofpoint-ORIG-GUID: 7-X-UwJJGuRNvcO6p2MobayyS1io98Ac X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1, Aquarius:18.0.790, Hydra:6.0.391, FMLib:17.0.607.475 definitions=2021-09-08_06,2021-09-07_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080080 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add PHY PCS common register configuration sequences for single link. Update single link PCIe register sequence accordingly. Signed-off-by: Swapnil Jakhade --- drivers/phy/cadence/phy-cadence-sierra.c | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index a426b12447a7..4e27886e4b7f 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -148,6 +148,7 @@ /* PHY PCS common registers */ #define SIERRA_PHY_PCS_COMMON_OFFSET(block_offset) \ (0xc000 << (block_offset)) +#define SIERRA_PHY_PIPE_CMN_CTRL1 0x0 #define SIERRA_PHY_PLL_CFG 0xe #define SIERRA_MACRO_ID 0x00007364 @@ -256,6 +257,8 @@ struct cdns_sierra_data { u32 id_value; u8 block_offset_shift; u8 reg_offset_shift; + struct cdns_sierra_vals *pcs_cmn_vals[NUM_PHY_TYPE][NUM_PHY_TYPE] + [NUM_SSC_MODE]; struct cdns_sierra_vals *pma_cmn_vals[NUM_PHY_TYPE][NUM_PHY_TYPE] [NUM_SSC_MODE]; struct cdns_sierra_vals *pma_ln_vals[NUM_PHY_TYPE][NUM_PHY_TYPE] @@ -364,6 +367,7 @@ static int cdns_sierra_phy_init(struct phy *gphy) enum cdns_sierra_phy_type phy_type = ins->phy_type; enum cdns_sierra_ssc_mode ssc = ins->ssc_mode; const struct cdns_reg_pairs *reg_pairs; + struct cdns_sierra_vals *pcs_cmn_vals; struct regmap *regmap; u32 num_regs; int i, j; @@ -375,6 +379,16 @@ static int cdns_sierra_phy_init(struct phy *gphy) clk_set_rate(phy->input_clks[CMN_REFCLK_DIG_DIV], 25000000); clk_set_rate(phy->input_clks[CMN_REFCLK1_DIG_DIV], 25000000); + /* PHY PCS common registers configurations */ + pcs_cmn_vals = init_data->pcs_cmn_vals[phy_type][TYPE_NONE][ssc]; + if (pcs_cmn_vals) { + reg_pairs = pcs_cmn_vals->reg_pairs; + num_regs = pcs_cmn_vals->num_regs; + regmap = phy->regmap_phy_pcs_common_cdb; + for (i = 0; i < num_regs; i++) + regmap_write(regmap, reg_pairs[i].off, reg_pairs[i].val); + } + /* PMA common registers configurations */ pma_cmn_vals = init_data->pma_cmn_vals[phy_type][TYPE_NONE][ssc]; if (pma_cmn_vals) { @@ -1022,6 +1036,16 @@ static int cdns_sierra_phy_remove(struct platform_device *pdev) return 0; } +/* PCIE PHY PCS common configuration */ +static struct cdns_reg_pairs pcie_phy_pcs_cmn_regs[] = { + {0x0430, SIERRA_PHY_PIPE_CMN_CTRL1} +}; + +static struct cdns_sierra_vals pcie_phy_pcs_cmn_vals = { + .reg_pairs = pcie_phy_pcs_cmn_regs, + .num_regs = ARRAY_SIZE(pcie_phy_pcs_cmn_regs), +}; + /* refclk100MHz_32b_PCIe_cmn_pll_ext_ssc */ static const struct cdns_reg_pairs cdns_pcie_cmn_regs_ext_ssc[] = { {0x2106, SIERRA_CMN_PLLLC_LF_COEFF_MODE1_PREG}, @@ -1173,6 +1197,13 @@ static const struct cdns_sierra_data cdns_map_sierra = { .id_value = SIERRA_MACRO_ID, .block_offset_shift = 0x2, .reg_offset_shift = 0x2, + .pcs_cmn_vals = { + [TYPE_PCIE] = { + [TYPE_NONE] = { + [EXTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, + }, + }, + }, .pma_cmn_vals = { [TYPE_PCIE] = { [TYPE_NONE] = { @@ -1203,6 +1234,13 @@ static const struct cdns_sierra_data cdns_ti_map_sierra = { .id_value = SIERRA_MACRO_ID, .block_offset_shift = 0x0, .reg_offset_shift = 0x1, + .pcs_cmn_vals = { + [TYPE_PCIE] = { + [TYPE_NONE] = { + [EXTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, + }, + }, + }, .pma_cmn_vals = { [TYPE_PCIE] = { [TYPE_NONE] = { From patchwork Wed Sep 8 12:29:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Jakhade X-Patchwork-Id: 508040 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECB8CC4321E for ; Wed, 8 Sep 2021 12:30:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D858161153 for ; Wed, 8 Sep 2021 12:30:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348841AbhIHMbH (ORCPT ); Wed, 8 Sep 2021 08:31:07 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:49924 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1349059AbhIHMbC (ORCPT ); Wed, 8 Sep 2021 08:31:02 -0400 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 1886da2C016872; Wed, 8 Sep 2021 05:29:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=EpE8rmgL0/KhksOTSnJ75V9qFI3tHWTLqw0t9sfXGuY=; b=DWdhNWe+ESYhczkfU0A7V6Hkl2XMYUV5dDfyYcyXes7jEzQ239dP+X9N+ChOXn3+Fa9t dmzKbqcF4iBIFLUA9Z0FNHtdAarktt9NESSWJKCxacmc1Mv8Ml99wVssWX71+f62+V5i ZPJ035jaApA/7bSzepQAcfwNs3y00iEsT0pFqm7M7Icl9ry6WpbH1Y5uWiG3OMn8LCPj 6nBj97u8dBrIJBMFIaHeFbNI3z/rrOZtSXwAb5iEX/GtB0u0H0LJgiGWN8LwPF+O/Vji SdswJ94CO9NmhLtfJ74hbNE95UexQEbXpKe1ldXYjUxS930wt7rHuhsFltSUXSwmVNdZ HA== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by mx0b-0014ca01.pphosted.com with ESMTP id 3axcp9k481-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 05:29:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aTyjVIsIh57ftmTV5MQ1q06VeyFGDb8U5tf+vKO860b1tUppYorv07TBucfhCf9hIgUzgoxwtkDfwwFt99PO9XjKOvUL9d/bci0Mf0tcn/v8YyZhZNsm8RDJs25Kl7xP/W2fr8XEIEzsqjxXYOSR/Eug9z/23SF4TA0EX6X+gAhjzfAWr4rurmgvCDhNreiG35PhjxURdstPb3zz0VbAlUnR/XAN//gRIVoiRD/ioWfgcNG1aNgo4GTKQZZsJDxkyjxrawnb/nW8zYIBGiKEGaRjuXaOczoWHC7Zl+Jp6yickqolGmct98XvfwX04neTPXf5XTEDujDsEc1N4yaTug== 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; bh=EpE8rmgL0/KhksOTSnJ75V9qFI3tHWTLqw0t9sfXGuY=; b=BOXVrN2HtfmVk/xpSfljHTUkR9c3JsL9wD9Ud+QTRrq1N68UGH6zJy2/7JAvRdTJm/zeI5SBdEYAKt++KSKxe7IfF9eZ5bOHhosTdrH1+CjF8ZgBuCwX9yY4Xqa6UkX2p279weYvg4DJnzMdIPSLE0IC2xYgOwFHBKHPC0/zzj90ujvtC2JMWJt3xawqLLDocP33swGrgdX23j5pjpZKbxi18pzN2nFsVBldy4PhFFkqS5xnNWBdN/kb7U1cxbIyAnlDCkz0N2qkuYw4yNc0egs/HsRjA2jJNVCd3qRE8D4aptp41FpQpvC9EvOVG9xYf+BlhRbf4/hI/emsSfPRIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.148) smtp.rcpttodomain=kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EpE8rmgL0/KhksOTSnJ75V9qFI3tHWTLqw0t9sfXGuY=; b=TajNfYsSlg6tPzfUn0KVLrOJnBbzzKadyR/UKuQwfizCZripfPTEQla4gTJVsll0eBbi7dbYAfEWvXn5kUW+580pPRNmOiRej4nlI8htm5/c4vTpyHGXORGjBvjpV0U61IA96/qOt8EHJhi4KLAZNjJMH1VaVBwZsYBS3KYmFKs= Received: from MW4PR03CA0357.namprd03.prod.outlook.com (2603:10b6:303:dc::32) by BY5PR07MB7016.namprd07.prod.outlook.com (2603:10b6:a03:1ef::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 12:29:41 +0000 Received: from MW2NAM12FT067.eop-nam12.prod.protection.outlook.com (2603:10b6:303:dc:cafe::2e) by MW4PR03CA0357.outlook.office365.com (2603:10b6:303:dc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16 via Frontend Transport; Wed, 8 Sep 2021 12:29:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.148 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.148; helo=sjmaillnx2.cadence.com; Received: from sjmaillnx2.cadence.com (158.140.1.148) by MW2NAM12FT067.mail.protection.outlook.com (10.13.181.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.6 via Frontend Transport; Wed, 8 Sep 2021 12:29:40 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTX9T026939 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 05:29:40 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu4.global.cadence.com (10.160.110.201) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Sep 2021 14:29:33 +0200 Received: from maileu3.global.cadence.com (10.160.88.99) by maileu4.global.cadence.com (10.160.110.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Wed, 8 Sep 2021 14:29:33 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 8 Sep 2021 14:29:33 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTXqq010313; Wed, 8 Sep 2021 14:29:33 +0200 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 188CTXtA010312; Wed, 8 Sep 2021 14:29:33 +0200 From: Swapnil Jakhade To: , , , , , , CC: , , , Subject: [PATCH v2 11/15] phy: cadence: Sierra: Fix to get correct parent for mux clocks Date: Wed, 8 Sep 2021 14:29:26 +0200 Message-ID: <20210908122930.10224-12-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20210908122930.10224-1-sjakhade@cadence.com> References: <20210908122930.10224-1-sjakhade@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8c612275-ec1e-4e1c-8d71-08d972c454a1 X-MS-TrafficTypeDiagnostic: BY5PR07MB7016: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VdBBhm5RkAraUjgAWHeEpvLIurhDPcHBQuggQ+LXyFmapT3j2b3IZ2SiAOibreDO4xftQJmFrb+X2Vf4fiuTMjYKcjRc21E+pPbR0vebq6Ko7iw457VolDHlueb0PB+GTXGntCRtrZIS2oxY/mypMx5XKooVV4CuENdH+nHnTJuuMZ5VPkRRUa35zf/apel0klYOWvTReVTLyZaKxEe2UFMOApsnMEaMg6PE3uUOfxsbOx+kygCon1DLg2Im1TbB9wY2Frt/5czE31+mHWFc46XsSZiBTQTNi8V064yrXhZkmq/7IfA4kvfz5I8Y/baxy9LKb66JxS5ywWCbiE2fqdEbvzAVBuynjcepK37k8ziOLZg+gBoIDAOvqZ0ZaZY8K2O2q45lFPIaG97UJj2rIpJPT9UdF5kxbjmN2orqmGK9NI3xgloXQN1175rDlh+OMAr6xfRojCDTp1iNbsfsediVIZlpw8m0pv0Yg4CBKUU8n6Y3zFwQ2z4ugK73WGstPDj32iZp7hrTO+GNTEueBjGCqEf3hLFYDxodQFugJMSNM29uTJFZ3lvD5myCKdqFnjmcD7rZKDz+rTNv9cHlYTimbFfkyb1jf+qTeKN2BPMpaxhPzdU0XtTnPVjg4nIYHifjwg7EOJDpH1wg1zojDGaw372n35/e1hUKY99fXy1q+NXXJYQ450OhJIBn5CzXfwr801aH5e+sOQMcAj3X126Sqf5PBBZ7abptDhsF3yk= X-Forefront-Antispam-Report: CIP:158.140.1.148; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx2.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(39860400002)(136003)(396003)(376002)(346002)(36092001)(46966006)(36840700001)(42186006)(82740400003)(4326008)(186003)(26005)(82310400003)(6666004)(70586007)(36860700001)(5660300002)(2616005)(70206006)(8936002)(36756003)(110136005)(86362001)(54906003)(8676002)(316002)(36906005)(356005)(426003)(478600001)(336012)(1076003)(2906002)(83380400001)(7636003)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 12:29:40.8106 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c612275-ec1e-4e1c-8d71-08d972c454a1 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[158.140.1.148]; Helo=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: MW2NAM12FT067.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR07MB7016 X-Proofpoint-GUID: i1Z3QJ-mVhKQ8MzM9tMWSaJpDF6tP02G X-Proofpoint-ORIG-GUID: i1Z3QJ-mVhKQ8MzM9tMWSaJpDF6tP02G X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1, Aquarius:18.0.790, Hydra:6.0.391, FMLib:17.0.607.475 definitions=2021-09-08_06,2021-09-07_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080080 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Fix get_parent() callback to return the correct index of the parent for PLL_CMNLC1 clock. Add a separate table of register values corresponding to the parent index for PLL_CMNLC1. Update set_parent() callback accordingly. Fixes: 28081b72859f ("phy: cadence: Sierra: Model PLL_CMNLC and PLL_CMNLC1 as clocks (mux clocks)") Signed-off-by: Swapnil Jakhade --- drivers/phy/cadence/phy-cadence-sierra.c | 31 ++++++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 83dc025d77a8..bab78322078e 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -257,7 +257,10 @@ static const int pll_mux_parent_index[][SIERRA_NUM_CMN_PLLC_PARENTS] = { [CMN_PLLLC1] = { PLL1_REFCLK, PLL0_REFCLK }, }; -static u32 cdns_sierra_pll_mux_table[] = { 0, 1 }; +static u32 cdns_sierra_pll_mux_table[][SIERRA_NUM_CMN_PLLC_PARENTS] = { + [CMN_PLLLC] = { 0, 1 }, + [CMN_PLLLC1] = { 1, 0 }, +}; enum cdns_sierra_phy_type { TYPE_NONE, @@ -567,11 +570,25 @@ static const struct phy_ops ops = { static u8 cdns_sierra_pll_mux_get_parent(struct clk_hw *hw) { struct cdns_sierra_pll_mux *mux = to_cdns_sierra_pll_mux(hw); + struct regmap_field *plllc1en_field = mux->plllc1en_field; + struct regmap_field *termen_field = mux->termen_field; struct regmap_field *field = mux->pfdclk_sel_preg; unsigned int val; + int index; regmap_field_read(field, &val); - return clk_mux_val_to_index(hw, cdns_sierra_pll_mux_table, 0, val); + + if (strstr(clk_hw_get_name(hw), clk_names[CDNS_SIERRA_PLL_CMNLC1])) { + index = clk_mux_val_to_index(hw, cdns_sierra_pll_mux_table[CMN_PLLLC1], 0, val); + if (index == 1) { + regmap_field_write(plllc1en_field, 1); + regmap_field_write(termen_field, 1); + } + } else { + index = clk_mux_val_to_index(hw, cdns_sierra_pll_mux_table[CMN_PLLLC], 0, val); + } + + return index; } static int cdns_sierra_pll_mux_set_parent(struct clk_hw *hw, u8 index) @@ -589,7 +606,11 @@ static int cdns_sierra_pll_mux_set_parent(struct clk_hw *hw, u8 index) ret |= regmap_field_write(termen_field, 1); } - val = cdns_sierra_pll_mux_table[index]; + if (strstr(clk_hw_get_name(hw), clk_names[CDNS_SIERRA_PLL_CMNLC1])) + val = cdns_sierra_pll_mux_table[CMN_PLLLC1][index]; + else + val = cdns_sierra_pll_mux_table[CMN_PLLLC][index]; + ret |= regmap_field_write(field, val); return ret; @@ -627,8 +648,8 @@ static int cdns_sierra_pll_mux_register(struct cdns_sierra_phy *sp, for (i = 0; i < num_parents; i++) { clk = sp->input_clks[pll_mux_parent_index[clk_index][i]]; if (IS_ERR_OR_NULL(clk)) { - dev_err(dev, "No parent clock for derived_refclk\n"); - return PTR_ERR(clk); + dev_err(dev, "No parent clock for PLL mux clocks\n"); + return IS_ERR(clk) ? PTR_ERR(clk) : -ENOENT; } parent_names[i] = __clk_get_name(clk); } From patchwork Wed Sep 8 12:29:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Jakhade X-Patchwork-Id: 508039 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E798C433EF for ; Wed, 8 Sep 2021 12:30:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 032396113D for ; Wed, 8 Sep 2021 12:30:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351454AbhIHMbI (ORCPT ); Wed, 8 Sep 2021 08:31:08 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:20912 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1349177AbhIHMbE (ORCPT ); Wed, 8 Sep 2021 08:31:04 -0400 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 1886da7v016869; Wed, 8 Sep 2021 05:29:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=Nj8OXT04WwWhy8TcgMCwtkLbeGj5HrzoEApIZ+Ke8CY=; b=B+LAeO8NWWQErgS4SZz0gGRetUTGvcT7oUFCE3xC8rDk4Z1PsjCeLNDLZ5+bFzMUdI8A yHxlTNR6w/RymMtXmZ5i5BD06vc9xth9NIrhH4LtWD4tEKMjPV0a7sW98jH4TnGl+Fga 5gAD41NSKchuRp8i8gNysPCytwyMcejLzHx0IUDmpngB/UU30GfZk8bQGSPmDTxK/jIy JUggdiCeC7IuIV9ABTIjl73yq2jcQmYGEtaAIQZStQ5dqHNEESAL86QKqzvVrx7Bznn3 f7DHaQmnMV60Cg+1IYx84UZTf+BZ29RQPnoPUFy765fiJqbBd7ftoQI2Bc2FK2c48VEt Aw== Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) by mx0b-0014ca01.pphosted.com with ESMTP id 3axcp9k487-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 05:29:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MDYxJpT8vmbVF2k/1ufX7BKuDdTZ/OfYEZrEM7tYTeSKY5iW2H/VLtXDKPy5CFH5osnWFMXMoY3sWDRLAd+JAYq2kq0O92AkWxPj6dJ3niqMwBn89bKe2qZkOoDDLZyb0+J9LWP6BMdOgtD3FlpsuOR5EuvIVzHr0A+uyYP99FIi4rtk+w1h+VtBf73Zchjk/EumcdgdAPkdILne6WhjJmr109devFnQZ150shrRVPWNNFb9vwQYJ3bZd7RT+tJCWYOr3omK8WfFtIX95oZ1y+CRpoeSHB27+rXfodhLhFjYTl95SDPgK/r56vk9VYhFQp0d/T/3LQ1DMsIi226x2A== 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; bh=Nj8OXT04WwWhy8TcgMCwtkLbeGj5HrzoEApIZ+Ke8CY=; b=b+yGXaYZCoCx4VbOzxUT2LR777HOZp0yLfyK3a5rjAGJZ4l10Kmst9h2Gkc16wcdz3GsSz8HOndAzKEBP/seH+r1WhrBkv/ieXhla+lt+kPDPt1C3LQkYp4KE3anWh0vcmSkM7ZYnLR0tPit1yEX1q7qqRHiAIU5eUhUkZ8q+WU2nOS8Av/ekpShi6t0yy8eFz/3Scyg2TqRG8rtiCAHAacZrtbCpB/+gESYlxVAvViFBP6FWg8Csy9Qkxlr853WEZdyPpHsYBzz0+aKtsQZMB58moKrAn35CL1XO0ALKYUoIPnBbjaZtkiBG1irbQN0gz4ingbHht/h/W2ql3MwdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.148) smtp.rcpttodomain=kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Nj8OXT04WwWhy8TcgMCwtkLbeGj5HrzoEApIZ+Ke8CY=; b=VOiIESUP4BfkowuqsY9KPjkmw/F4TOfprBypESSOsla5SsRFtNuqx7wZzVAf7KLAgNqXhICYnV4O2IZpmFPWvvIAExdZjj4gh44r766JTAe1hpS+UIwAFfvV9STLYpf0XVuWhZPUQiVKU2/GsCSs24erRjD166sfpCTNdWoZaBc= Received: from BN9PR03CA0613.namprd03.prod.outlook.com (2603:10b6:408:106::18) by MWHPR07MB2767.namprd07.prod.outlook.com (2603:10b6:300:2a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.15; Wed, 8 Sep 2021 12:29:43 +0000 Received: from BN8NAM12FT047.eop-nam12.prod.protection.outlook.com (2603:10b6:408:106:cafe::d1) by BN9PR03CA0613.outlook.office365.com (2603:10b6:408:106::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Wed, 8 Sep 2021 12:29:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.148 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.148; helo=sjmaillnx2.cadence.com; Received: from sjmaillnx2.cadence.com (158.140.1.148) by BN8NAM12FT047.mail.protection.outlook.com (10.13.183.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.6 via Frontend Transport; Wed, 8 Sep 2021 12:29:42 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTX9V026939 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 05:29:41 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu5.global.cadence.com (10.160.110.202) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Sep 2021 14:29:33 +0200 Received: from maileu3.global.cadence.com (10.160.88.99) by maileu5.global.cadence.com (10.160.110.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Wed, 8 Sep 2021 14:29:33 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 8 Sep 2021 14:29:33 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTXvP010317; Wed, 8 Sep 2021 14:29:33 +0200 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 188CTXeY010316; Wed, 8 Sep 2021 14:29:33 +0200 From: Swapnil Jakhade To: , , , , , , CC: , , , Subject: [PATCH v2 12/15] phy: cadence: Sierra: Add support for PHY multilink configurations Date: Wed, 8 Sep 2021 14:29:27 +0200 Message-ID: <20210908122930.10224-13-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20210908122930.10224-1-sjakhade@cadence.com> References: <20210908122930.10224-1-sjakhade@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d718e99b-3979-48b3-8680-08d972c455b6 X-MS-TrafficTypeDiagnostic: MWHPR07MB2767: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:576; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QmezkuiDYV8XiRJNvivBhZI9RiOjDUxEfYpdzuJotLRUOEHcD/5I9Mb+UFOBP9y8OD6i2fLwZQ5LCeDhQKL9KjHR8oK5nGqyFkYy6fEuyuZwiwJUda5p2GYDWDBXY/liecD+3R1acE8Ty3ywX2Pv5J4GX2igOL3gyGCoLtBq9soBWReoND8Hg1VYJfGCFsTG9U5tGvPEXgTDGxJxZA7Q/LTbg2YqywPLt2VP7kLFjTvZe7q96PI3G/r8z1NINDkUZPowwyOGm9GWv7FD6JK3wG1xtwxublsjVd/f9t5dntCQh0VAckYmCdcjaFIOJ3SBfOt2M4NIM/1O7IC7KMeXDcVWV1xGiUbJ6LIihIew29udnGezB4x9yTlC09Qa+6/hwH0x2Ifyx7dHhNHS+L1qfLHuaskIJ8WAft1WC5LPMYkc4+mz+FJTbuwg1jN+pfbFAe51kX1Rd0DqpKJQucUjNs3KFDiknlBK3z30yRR6OflvbsebtZz5Zq8IkkccsmpNSufTd+8gw61hcGh2E9wxO+LPBk266gx4w4x14nANuvhs/YVRPy0MXFKvn+SeiAfhESiBatKKTxwqyKbJmG0evaPGn0w5NyRRSrViqL/8ckR/2vz4NnANAcMvlf2ERw/gsmzFWa7Z2upp1St28QFpVfM1lC1qpehNFf3moMXbi5QJBZBWRva1bxPjyNnjs469J0cieljV+97tNCI//EFZF7vc+rC3TU/zwAQhjZ8r01I= X-Forefront-Antispam-Report: CIP:158.140.1.148; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx2.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(346002)(136003)(39860400002)(396003)(376002)(36092001)(36840700001)(46966006)(186003)(42186006)(478600001)(5660300002)(8676002)(110136005)(54906003)(82740400003)(82310400003)(356005)(26005)(316002)(2906002)(7636003)(6666004)(36860700001)(8936002)(70206006)(2616005)(426003)(47076005)(70586007)(1076003)(83380400001)(86362001)(36756003)(336012)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 12:29:42.5448 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d718e99b-3979-48b3-8680-08d972c455b6 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[158.140.1.148]; Helo=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT047.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB2767 X-Proofpoint-GUID: o8joZt6hM7GMYTBMCzoxpqL7nw5KLyTh X-Proofpoint-ORIG-GUID: o8joZt6hM7GMYTBMCzoxpqL7nw5KLyTh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1, Aquarius:18.0.790, Hydra:6.0.391, FMLib:17.0.607.475 definitions=2021-09-08_06,2021-09-07_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080080 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add support for multilink configuration of Sierra PHY. Currently, maximum two links are supported. Signed-off-by: Swapnil Jakhade --- drivers/phy/cadence/phy-cadence-sierra.c | 185 ++++++++++++++++++++++- 1 file changed, 177 insertions(+), 8 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index bab78322078e..fe5b9a2e58df 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -24,7 +24,7 @@ #include #define NUM_SSC_MODE 3 -#define NUM_PHY_TYPE 3 +#define NUM_PHY_TYPE 4 /* PHY register offsets */ #define SIERRA_COMMON_CDB_OFFSET 0x0 @@ -184,6 +184,13 @@ (0xE000 << (block_offset)) #define SIERRA_PHY_PMA_CMN_CTRL 0x000 +/* PHY PMA lane registers */ +#define SIERRA_PHY_PMA_LANE_CDB_OFFSET(ln, block_offset, reg_offset) \ + ((0xF000 << (block_offset)) + \ + (((ln) << 8) << (reg_offset))) + +#define SIERRA_PHY_PMA_XCVR_CTRL 0x000 + #define SIERRA_MACRO_ID 0x00007364 #define SIERRA_MAX_LANES 16 #define PLL_LOCK_TIME 100000 @@ -299,6 +306,8 @@ struct cdns_sierra_data { u8 reg_offset_shift; struct cdns_sierra_vals *pcs_cmn_vals[NUM_PHY_TYPE][NUM_PHY_TYPE] [NUM_SSC_MODE]; + struct cdns_sierra_vals *phy_pma_ln_vals[NUM_PHY_TYPE][NUM_PHY_TYPE] + [NUM_SSC_MODE]; struct cdns_sierra_vals *pma_cmn_vals[NUM_PHY_TYPE][NUM_PHY_TYPE] [NUM_SSC_MODE]; struct cdns_sierra_vals *pma_ln_vals[NUM_PHY_TYPE][NUM_PHY_TYPE] @@ -322,6 +331,7 @@ struct cdns_sierra_phy { struct regmap *regmap_phy_pcs_common_cdb; struct regmap *regmap_phy_pcs_lane_cdb[SIERRA_MAX_LANES]; struct regmap *regmap_phy_pma_common_cdb; + struct regmap *regmap_phy_pma_lane_cdb[SIERRA_MAX_LANES]; struct regmap *regmap_common_cdb; struct regmap_field *macro_id_type; struct regmap_field *phy_pll_cfg_1; @@ -438,6 +448,34 @@ static const struct regmap_config cdns_sierra_phy_pma_cmn_cdb_config = { .reg_read = cdns_regmap_read, }; +#define SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF(n) \ +{ \ + .name = "sierra_phy_pma_lane" n "_cdb", \ + .reg_stride = 1, \ + .fast_io = true, \ + .reg_write = cdns_regmap_write, \ + .reg_read = cdns_regmap_read, \ +} + +static const struct regmap_config cdns_sierra_phy_pma_lane_cdb_config[] = { + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("0"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("1"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("2"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("3"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("4"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("5"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("6"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("7"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("8"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("9"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("10"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("11"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("12"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("13"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("14"), + SIERRA_PHY_PMA_LANE_CDB_REGMAP_CONF("15"), +}; + static int cdns_sierra_phy_init(struct phy *gphy) { struct cdns_sierra_inst *ins = phy_get_drvdata(gphy); @@ -446,6 +484,7 @@ static int cdns_sierra_phy_init(struct phy *gphy) struct cdns_sierra_vals *pma_cmn_vals, *pma_ln_vals; enum cdns_sierra_phy_type phy_type = ins->phy_type; enum cdns_sierra_ssc_mode ssc = ins->ssc_mode; + struct cdns_sierra_vals *phy_pma_ln_vals; const struct cdns_reg_pairs *reg_pairs; struct cdns_sierra_vals *pcs_cmn_vals; struct regmap *regmap; @@ -453,7 +492,7 @@ static int cdns_sierra_phy_init(struct phy *gphy) int i, j; /* Initialise the PHY registers, unless auto configured */ - if (phy->autoconf) + if (phy->autoconf || phy->nsubnodes > 1) return 0; clk_set_rate(phy->input_clks[CMN_REFCLK_DIG_DIV], 25000000); @@ -469,6 +508,18 @@ static int cdns_sierra_phy_init(struct phy *gphy) regmap_write(regmap, reg_pairs[i].off, reg_pairs[i].val); } + /* PHY PMA lane registers configurations */ + phy_pma_ln_vals = init_data->phy_pma_ln_vals[phy_type][TYPE_NONE][ssc]; + if (phy_pma_ln_vals) { + reg_pairs = phy_pma_ln_vals->reg_pairs; + num_regs = phy_pma_ln_vals->num_regs; + for (i = 0; i < ins->num_lanes; i++) { + regmap = phy->regmap_phy_pma_lane_cdb[i + ins->mlane]; + for (j = 0; j < num_regs; j++) + regmap_write(regmap, reg_pairs[j].off, reg_pairs[j].val); + } + } + /* PMA common registers configurations */ pma_cmn_vals = init_data->pma_cmn_vals[phy_type][TYPE_NONE][ssc]; if (pma_cmn_vals) { @@ -502,10 +553,13 @@ static int cdns_sierra_phy_on(struct phy *gphy) u32 val; int ret; - ret = reset_control_deassert(sp->phy_rst); - if (ret) { - dev_err(dev, "Failed to take the PHY out of reset\n"); - return ret; + if (sp->nsubnodes == 1) { + /* Take the PHY out of reset */ + ret = reset_control_deassert(sp->phy_rst); + if (ret) { + dev_err(dev, "Failed to take the PHY out of reset\n"); + return ret; + } } /* Take the PHY lane group out of reset */ @@ -923,6 +977,19 @@ static int cdns_regmap_init_blocks(struct cdns_sierra_phy *sp, } sp->regmap_phy_pma_common_cdb = regmap; + for (i = 0; i < SIERRA_MAX_LANES; i++) { + block_offset = SIERRA_PHY_PMA_LANE_CDB_OFFSET(i, block_offset_shift, + reg_offset_shift); + regmap = cdns_regmap_init(dev, base, block_offset, + reg_offset_shift, + &cdns_sierra_phy_pma_lane_cdb_config[i]); + if (IS_ERR(regmap)) { + dev_err(dev, "Failed to init PHY PMA lane CDB regmap\n"); + return PTR_ERR(regmap); + } + sp->regmap_phy_pma_lane_cdb[i] = regmap; + } + return 0; } @@ -1030,6 +1097,105 @@ static int cdns_sierra_phy_get_resets(struct cdns_sierra_phy *sp, return 0; } +static int cdns_sierra_phy_configure_multilink(struct cdns_sierra_phy *sp) +{ + const struct cdns_sierra_data *init_data = sp->init_data; + enum cdns_sierra_phy_type phy_t1, phy_t2, tmp_phy_type; + struct cdns_sierra_vals *pma_cmn_vals, *pma_ln_vals; + struct cdns_sierra_vals *phy_pma_ln_vals; + const struct cdns_reg_pairs *reg_pairs; + struct cdns_sierra_vals *pcs_cmn_vals; + int i, j, node, mlane, num_lanes, ret; + enum cdns_sierra_ssc_mode ssc; + struct regmap *regmap; + u32 num_regs; + + /* Maximum 2 links (subnodes) are supported */ + if (sp->nsubnodes != 2) + return -EINVAL; + + clk_set_rate(sp->input_clks[CMN_REFCLK_DIG_DIV], 25000000); + clk_set_rate(sp->input_clks[CMN_REFCLK1_DIG_DIV], 25000000); + + /* PHY configured to use both PLL LC and LC1 */ + regmap_field_write(sp->phy_pll_cfg_1, 0x1); + + phy_t1 = sp->phys[0].phy_type; + phy_t2 = sp->phys[1].phy_type; + + /* + * First configure the PHY for first link with phy_t1. Get the array + * values as [phy_t1][phy_t2][ssc]. + */ + for (node = 0; node < sp->nsubnodes; node++) { + if (node == 1) { + /* + * If first link with phy_t1 is configured, then + * configure the PHY for second link with phy_t2. + * Get the array values as [phy_t2][phy_t1][ssc]. + */ + tmp_phy_type = phy_t1; + phy_t1 = phy_t2; + phy_t2 = tmp_phy_type; + } + + mlane = sp->phys[node].mlane; + ssc = sp->phys[node].ssc_mode; + num_lanes = sp->phys[node].num_lanes; + + /* PHY PCS common registers configurations */ + pcs_cmn_vals = init_data->pcs_cmn_vals[phy_t1][phy_t2][ssc]; + if (pcs_cmn_vals) { + reg_pairs = pcs_cmn_vals->reg_pairs; + num_regs = pcs_cmn_vals->num_regs; + regmap = sp->regmap_phy_pcs_common_cdb; + for (i = 0; i < num_regs; i++) + regmap_write(regmap, reg_pairs[i].off, reg_pairs[i].val); + } + + /* PHY PMA lane registers configurations */ + phy_pma_ln_vals = init_data->phy_pma_ln_vals[phy_t1][phy_t2][ssc]; + if (phy_pma_ln_vals) { + reg_pairs = phy_pma_ln_vals->reg_pairs; + num_regs = phy_pma_ln_vals->num_regs; + for (i = 0; i < num_lanes; i++) { + regmap = sp->regmap_phy_pma_lane_cdb[i + mlane]; + for (j = 0; j < num_regs; j++) + regmap_write(regmap, reg_pairs[j].off, reg_pairs[j].val); + } + } + + /* PMA common registers configurations */ + pma_cmn_vals = init_data->pma_cmn_vals[phy_t1][phy_t2][ssc]; + if (pma_cmn_vals) { + reg_pairs = pma_cmn_vals->reg_pairs; + num_regs = pma_cmn_vals->num_regs; + regmap = sp->regmap_common_cdb; + for (i = 0; i < num_regs; i++) + regmap_write(regmap, reg_pairs[i].off, reg_pairs[i].val); + } + + /* PMA TX lane registers configurations */ + pma_ln_vals = init_data->pma_ln_vals[phy_t1][phy_t2][ssc]; + if (pma_ln_vals) { + reg_pairs = pma_ln_vals->reg_pairs; + num_regs = pma_ln_vals->num_regs; + for (i = 0; i < num_lanes; i++) { + regmap = sp->regmap_lane_cdb[i + mlane]; + for (j = 0; j < num_regs; j++) + regmap_write(regmap, reg_pairs[j].off, reg_pairs[j].val); + } + } + } + + /* Take the PHY out of reset */ + ret = reset_control_deassert(sp->phy_rst); + if (ret) + return ret; + + return 0; +} + static int cdns_sierra_phy_probe(struct platform_device *pdev) { struct cdns_sierra_phy *sp; @@ -1149,8 +1315,11 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) } /* If more than one subnode, configure the PHY as multilink */ - if (!sp->autoconf && sp->nsubnodes > 1) - regmap_field_write(sp->phy_pll_cfg_1, 0x1); + if (!sp->autoconf && sp->nsubnodes > 1) { + ret = cdns_sierra_phy_configure_multilink(sp); + if (ret) + goto put_child2; + } pm_runtime_enable(dev); phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); From patchwork Wed Sep 8 12:29:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Jakhade X-Patchwork-Id: 508037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, UPPERCASE_50_75, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 665ECC433FE for ; Wed, 8 Sep 2021 12:30:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5030A60E77 for ; Wed, 8 Sep 2021 12:30:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351453AbhIHMbO (ORCPT ); Wed, 8 Sep 2021 08:31:14 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:35280 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1349274AbhIHMbG (ORCPT ); Wed, 8 Sep 2021 08:31:06 -0400 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 1886de6Z016948; Wed, 8 Sep 2021 05:29:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=0Kr5e0fTDOUkLGW5uyGtdM2SN1Iq4/EJcuPrvlBreAY=; b=Pa7Tm4pHZm+/NVEvteSwBNxvepGJwE472iLiBrvJey4Fg7lGryWiVWDTZbcx/3fyAaQg xPmVInYJ9dl+v7n7q94BudlfuN6h7sERnG3EJ4YufEM+pg7WG8tDo5eezOT9DISej0RK VwQ+/FNmo6qkStQnWb7la0TeHe3OHt/zavumfE8RHrW5UsPbXNBsvwlSXotcROVjEUhN 47pUktTlN1Wq2nIOf4PGcFKVIU+nhQBpvJ/bQpzOHkH2UI/jvO0tyRH+lMc3/NMLaixM DFKxXY8B2ImUwgxwYagz+i1/o17huVYYO7txKe3fvB7mtDJApRixVSGPpRrh4ZZ9UIfV 3A== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by mx0b-0014ca01.pphosted.com with ESMTP id 3axcp9k486-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 05:29:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jrUg/zcajv3kloFJREXfglseAjudlQEsZ8NuqITXwRFfpCyc2/S/A2z+jXV+bJTXxRwfDObKz4y9oWIFaR3s9+kW4BgUvyW+QEWPc1JMpRZA+j876iUIb+zpDHTlT6aUYkA4f/KjHjEihFuWOKPEAbdYN/mUDPWxXNSAz9WnAWAX1tbI4kWe7Jcb09EULfNLSA8tir+9dPRhy3KXINnCBAJhGbqiTKR7Bl7L1hxCxLev2ZbEYYzaB4BrwgtmNN8rGQw7aSoQgIm5TTFuL1AMmJChInBTDR/G64RZcTI7BvfNCfptwSI0S1BJS/ZOnc2s2wxPj3jC+T7EKbXmvH6gMg== 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; bh=0Kr5e0fTDOUkLGW5uyGtdM2SN1Iq4/EJcuPrvlBreAY=; b=JwBeFzJz6RAXjMMCdIhO2yVdiHlREZohCE+AXAK74Na0godSetwEnQ5LNaU/XEkp/MQvqLmG7MM5BEib9ZPHLrpilap0AMREBFcqvlsnw7XBi1MR1NgMn1L6G7U+My608kDW38rpeOnlv7gfZglqBTQJ/fuR4kE0D4qfruRDP6SShZXcunVES4//nHDy1AD1nHiWtG+9ArIc4x5R2fVTkqSU66uhtIavIr3dGIdtSLsaIhcpbPkvmEcPDf7DOIUhbVbBtnbZzMM+rUUWdslo0BMBogujd9DZg4zzBVrJV5mfgiYz9TnvIsGIP0mZdaUmk2IGg3aeQEZSh1lRpe91XQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.148) smtp.rcpttodomain=kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0Kr5e0fTDOUkLGW5uyGtdM2SN1Iq4/EJcuPrvlBreAY=; b=vlxziPs5RC1zzr31RGCgz9YZJ9wb2jFNbOURMY+xSvJ4zx8vOgDq2VKzVwL63RQ5xVV12SS+y7giOuC5J9vFMC8vsGiMgoO0daR1sWbbYg7wyBj9bCNVBAxHaFg1Y8qck5n8V+WrzruIMPCUOQozOMgysAvfLcHIQ5glwQvVmWQ= Received: from MWHPR11CA0006.namprd11.prod.outlook.com (2603:10b6:301:1::16) by BL0PR07MB5041.namprd07.prod.outlook.com (2603:10b6:208:47::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 12:29:43 +0000 Received: from MW2NAM12FT050.eop-nam12.prod.protection.outlook.com (2603:10b6:301:1:cafe::64) by MWHPR11CA0006.outlook.office365.com (2603:10b6:301:1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.15 via Frontend Transport; Wed, 8 Sep 2021 12:29:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.148 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.148; helo=sjmaillnx2.cadence.com; Received: from sjmaillnx2.cadence.com (158.140.1.148) by MW2NAM12FT050.mail.protection.outlook.com (10.13.180.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.6 via Frontend Transport; Wed, 8 Sep 2021 12:29:42 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTX9W026939 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 05:29:41 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Sep 2021 14:29:33 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 8 Sep 2021 14:29:33 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTXju010321; Wed, 8 Sep 2021 14:29:33 +0200 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 188CTXNf010320; Wed, 8 Sep 2021 14:29:33 +0200 From: Swapnil Jakhade To: , , , , , , CC: , , , Subject: [PATCH v2 13/15] phy: cadence: Sierra: Add PCIe + QSGMII PHY multilink configuration Date: Wed, 8 Sep 2021 14:29:28 +0200 Message-ID: <20210908122930.10224-14-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20210908122930.10224-1-sjakhade@cadence.com> References: <20210908122930.10224-1-sjakhade@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19b53ec2-d35f-4a56-eabe-08d972c455a5 X-MS-TrafficTypeDiagnostic: BL0PR07MB5041: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Mop9mYUv9ZE46V8p9M4J/SvP6QzuBlcXOaXdIzN7e5jHmj8Jl7AVs6B2UpIYOOx/ZL+gXrh4FaB4LPZ5yPk9wmWH3TJEKboHAq7YsiwSbXUFx4YJBUbZlBfVqUrvqcmiVNreo903mzqX9sC81W6+IryXdJyP921dIaND0hVAcSNMiKbLdOQp72XKyTkDBVaHrxydu+kVjS4DEbCX3xztdnMBwCJW33xR5hv/O6VME6yqhOdfV5wFZcwuGB2RsYTjozuMoIocE7tP2lUjmAixgC+uGT/p00YN/yBU+EPDr/NDZDko1mgSgydhbJl682LkCM3rt5mA/3fmkez0vkMwSkEb/q5g10f3T7bg9TLDhMRbWCTMMpSB9CJXXrNYF7+RJMGueZXFoRxDp5i+l9yELHDEWD2vSTasWBFeeGEVFtGk+uP8BBpdAT30VpICbBoyqZMfrYOvsY6EjBVg3djEtShDiY/Aya5/eVNIMRSx+ZkrLli5Q2XbxAbeZ4IRjrrPToLcehnGj2dPBb3VnEP3INecWDyWcm4vFL+NI2zRhrAY5CMAijp9Ykd15KA9aFLzVDFOgHo8Mq77AXgpM8sTRdfnl+zKO3gMOOgu2YHv6nvC2S79HOTsKrzL7rGU14CBqnVMw6Wb04D1T0xzYd9wQ1xXpg6BwcZ6hhaYenWUdXvKv5xCh+q1v6SIwC7WYsvlujxAVg+JdOvigeDMQQyhQ+B6xCGVKXijR2giTNS4xEk= X-Forefront-Antispam-Report: CIP:158.140.1.148; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx2.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(39860400002)(376002)(346002)(396003)(136003)(36092001)(36840700001)(46966006)(82310400003)(42186006)(316002)(4326008)(47076005)(1076003)(36860700001)(478600001)(36906005)(70586007)(86362001)(70206006)(5660300002)(6666004)(8936002)(8676002)(26005)(186003)(82740400003)(30864003)(83380400001)(2906002)(426003)(2616005)(336012)(356005)(54906003)(110136005)(7636003)(36756003)(19627235002); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 12:29:42.5179 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19b53ec2-d35f-4a56-eabe-08d972c455a5 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[158.140.1.148]; Helo=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: MW2NAM12FT050.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR07MB5041 X-Proofpoint-GUID: OuQFoLvgOdIhvb78e-J_O5YpYqwh0YOY X-Proofpoint-ORIG-GUID: OuQFoLvgOdIhvb78e-J_O5YpYqwh0YOY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1, Aquarius:18.0.790, Hydra:6.0.391, FMLib:17.0.607.475 definitions=2021-09-08_06,2021-09-07_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080080 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add register sequences for PCIe + QSGMII PHY multilink configuration. Signed-off-by: Swapnil Jakhade --- drivers/phy/cadence/phy-cadence-sierra.c | 377 ++++++++++++++++++++++- 1 file changed, 376 insertions(+), 1 deletion(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index fe5b9a2e58df..9e9d26a9259d 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -45,6 +45,9 @@ #define SIERRA_CMN_REFRCV_PREG 0x98 #define SIERRA_CMN_REFRCV1_PREG 0xB8 #define SIERRA_CMN_PLLLC1_GEN_PREG 0xC2 +#define SIERRA_CMN_PLLLC1_LF_COEFF_MODE0_PREG 0xCA +#define SIERRA_CMN_PLLLC1_BWCAL_MODE0_PREG 0xD0 +#define SIERRA_CMN_PLLLC1_SS_TIME_STEPSIZE_MODE_PREG 0xE2 #define SIERRA_LANE_CDB_OFFSET(ln, block_offset, reg_offset) \ ((0x4000 << (block_offset)) + \ @@ -59,6 +62,9 @@ #define SIERRA_PSM_A0IN_TMR_PREG 0x009 #define SIERRA_PSM_A3IN_TMR_PREG 0x00C #define SIERRA_PSM_DIAG_PREG 0x015 +#define SIERRA_PSC_LN_A3_PREG 0x023 +#define SIERRA_PSC_LN_A4_PREG 0x024 +#define SIERRA_PSC_LN_IDLE_PREG 0x026 #define SIERRA_PSC_TX_A0_PREG 0x028 #define SIERRA_PSC_TX_A1_PREG 0x029 #define SIERRA_PSC_TX_A2_PREG 0x02A @@ -68,6 +74,7 @@ #define SIERRA_PSC_RX_A2_PREG 0x032 #define SIERRA_PSC_RX_A3_PREG 0x033 #define SIERRA_PLLCTRL_SUBRATE_PREG 0x03A +#define SIERRA_PLLCTRL_GEN_A_PREG 0x03B #define SIERRA_PLLCTRL_GEN_D_PREG 0x03E #define SIERRA_PLLCTRL_CPGAIN_MODE_PREG 0x03F #define SIERRA_PLLCTRL_STATUS_PREG 0x044 @@ -150,6 +157,7 @@ #define SIERRA_CPICAL_TMRVAL_MODE0_PREG 0x171 #define SIERRA_CPICAL_PICNT_MODE1_PREG 0x174 #define SIERRA_CPI_OUTBUF_RATESEL_PREG 0x17C +#define SIERRA_CPI_RESBIAS_BIN_PREG 0x17E #define SIERRA_CPI_TRIM_PREG 0x17F #define SIERRA_CPICAL_RES_STARTCODE_MODE23_PREG 0x183 #define SIERRA_EPI_CTRL_PREG 0x187 @@ -272,7 +280,8 @@ static u32 cdns_sierra_pll_mux_table[][SIERRA_NUM_CMN_PLLC_PARENTS] = { enum cdns_sierra_phy_type { TYPE_NONE, TYPE_PCIE, - TYPE_USB + TYPE_USB, + TYPE_QSGMII }; enum cdns_sierra_ssc_mode { @@ -807,6 +816,9 @@ static int cdns_sierra_get_optional(struct cdns_sierra_inst *inst, case PHY_TYPE_USB3: inst->phy_type = TYPE_USB; break; + case PHY_TYPE_QSGMII: + inst->phy_type = TYPE_QSGMII; + break; default: return -EINVAL; } @@ -1186,6 +1198,9 @@ static int cdns_sierra_phy_configure_multilink(struct cdns_sierra_phy *sp) regmap_write(regmap, reg_pairs[j].off, reg_pairs[j].val); } } + + if (phy_t1 == TYPE_QSGMII) + reset_control_deassert(sp->phys[node].lnk_rst); } /* Take the PHY out of reset */ @@ -1363,6 +1378,72 @@ static int cdns_sierra_phy_remove(struct platform_device *pdev) return 0; } +/* QSGMII PHY PMA lane configuration */ +static struct cdns_reg_pairs qsgmii_phy_pma_ln_regs[] = { + {0x9010, SIERRA_PHY_PMA_XCVR_CTRL} +}; + +static struct cdns_sierra_vals qsgmii_phy_pma_ln_vals = { + .reg_pairs = qsgmii_phy_pma_ln_regs, + .num_regs = ARRAY_SIZE(qsgmii_phy_pma_ln_regs), +}; + +/* QSGMII refclk 100MHz, 20b, opt1, No BW cal, no ssc, PLL LC1 */ +static const struct cdns_reg_pairs qsgmii_100_no_ssc_plllc1_cmn_regs[] = { + {0x2085, SIERRA_CMN_PLLLC1_LF_COEFF_MODE0_PREG}, + {0x0000, SIERRA_CMN_PLLLC1_BWCAL_MODE0_PREG}, + {0x0000, SIERRA_CMN_PLLLC1_SS_TIME_STEPSIZE_MODE_PREG} +}; + +static const struct cdns_reg_pairs qsgmii_100_no_ssc_plllc1_ln_regs[] = { + {0xFC08, SIERRA_DET_STANDEC_A_PREG}, + {0x0252, SIERRA_DET_STANDEC_E_PREG}, + {0x0004, SIERRA_PSC_LN_IDLE_PREG}, + {0x0FFE, SIERRA_PSC_RX_A0_PREG}, + {0x0011, SIERRA_PLLCTRL_SUBRATE_PREG}, + {0x0001, SIERRA_PLLCTRL_GEN_A_PREG}, + {0x5233, SIERRA_PLLCTRL_CPGAIN_MODE_PREG}, + {0x0000, SIERRA_DRVCTRL_ATTEN_PREG}, + {0x0089, SIERRA_RX_CREQ_FLTR_A_MODE0_PREG}, + {0x3C3C, SIERRA_CREQ_CCLKDET_MODE01_PREG}, + {0x3222, SIERRA_CREQ_FSMCLK_SEL_PREG}, + {0x0000, SIERRA_CREQ_EQ_CTRL_PREG}, + {0x8422, SIERRA_CTLELUT_CTRL_PREG}, + {0x4111, SIERRA_DFE_ECMP_RATESEL_PREG}, + {0x4111, SIERRA_DFE_SMP_RATESEL_PREG}, + {0x0002, SIERRA_DEQ_PHALIGN_CTRL}, + {0x9595, SIERRA_DEQ_VGATUNE_CTRL_PREG}, + {0x0186, SIERRA_DEQ_GLUT0}, + {0x0186, SIERRA_DEQ_GLUT1}, + {0x0186, SIERRA_DEQ_GLUT2}, + {0x0186, SIERRA_DEQ_GLUT3}, + {0x0186, SIERRA_DEQ_GLUT4}, + {0x0861, SIERRA_DEQ_ALUT0}, + {0x07E0, SIERRA_DEQ_ALUT1}, + {0x079E, SIERRA_DEQ_ALUT2}, + {0x071D, SIERRA_DEQ_ALUT3}, + {0x03F5, SIERRA_DEQ_DFETAP_CTRL_PREG}, + {0x0C01, SIERRA_DEQ_TAU_CTRL1_FAST_MAINT_PREG}, + {0x3C40, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, + {0x1C04, SIERRA_DEQ_TAU_CTRL2_PREG}, + {0x0033, SIERRA_DEQ_PICTRL_PREG}, + {0x0660, SIERRA_CPICAL_TMRVAL_MODE0_PREG}, + {0x00D5, SIERRA_CPI_OUTBUF_RATESEL_PREG}, + {0x0B6D, SIERRA_CPI_RESBIAS_BIN_PREG}, + {0x0102, SIERRA_RXBUFFER_CTLECTRL_PREG}, + {0x0002, SIERRA_RXBUFFER_RCDFECTRL_PREG} +}; + +static struct cdns_sierra_vals qsgmii_100_no_ssc_plllc1_cmn_vals = { + .reg_pairs = qsgmii_100_no_ssc_plllc1_cmn_regs, + .num_regs = ARRAY_SIZE(qsgmii_100_no_ssc_plllc1_cmn_regs), +}; + +static struct cdns_sierra_vals qsgmii_100_no_ssc_plllc1_ln_vals = { + .reg_pairs = qsgmii_100_no_ssc_plllc1_ln_regs, + .num_regs = ARRAY_SIZE(qsgmii_100_no_ssc_plllc1_ln_regs), +}; + /* PCIE PHY PCS common configuration */ static struct cdns_reg_pairs pcie_phy_pcs_cmn_regs[] = { {0x0430, SIERRA_PHY_PIPE_CMN_CTRL1} @@ -1373,6 +1454,233 @@ static struct cdns_sierra_vals pcie_phy_pcs_cmn_vals = { .num_regs = ARRAY_SIZE(pcie_phy_pcs_cmn_regs), }; +/* refclk100MHz_32b_PCIe_cmn_pll_no_ssc, pcie_links_using_plllc, pipe_bw_3 */ +static const struct cdns_reg_pairs pcie_100_no_ssc_plllc_cmn_regs[] = { + {0x2105, SIERRA_CMN_PLLLC_LF_COEFF_MODE1_PREG}, + {0x2105, SIERRA_CMN_PLLLC_LF_COEFF_MODE0_PREG}, + {0x8A06, SIERRA_CMN_PLLLC_BWCAL_MODE1_PREG}, + {0x8A06, SIERRA_CMN_PLLLC_BWCAL_MODE0_PREG} +}; + +/* + * refclk100MHz_32b_PCIe_ln_no_ssc, multilink, using_plllc, + * cmn_pllcy_anaclk0_1Ghz, xcvr_pllclk_fullrt_500mhz + */ +static const struct cdns_reg_pairs ml_pcie_100_no_ssc_ln_regs[] = { + {0xFC08, SIERRA_DET_STANDEC_A_PREG}, + {0x001D, SIERRA_PSM_A3IN_TMR_PREG}, + {0x0004, SIERRA_PSC_LN_A3_PREG}, + {0x0004, SIERRA_PSC_LN_A4_PREG}, + {0x0004, SIERRA_PSC_LN_IDLE_PREG}, + {0x1555, SIERRA_DFE_BIASTRIM_PREG}, + {0x9703, SIERRA_DRVCTRL_BOOST_PREG}, + {0x8055, SIERRA_RX_CREQ_FLTR_A_MODE3_PREG}, + {0x80BB, SIERRA_RX_CREQ_FLTR_A_MODE2_PREG}, + {0x8351, SIERRA_RX_CREQ_FLTR_A_MODE1_PREG}, + {0x8349, SIERRA_RX_CREQ_FLTR_A_MODE0_PREG}, + {0x0002, SIERRA_CREQ_DCBIASATTEN_OVR_PREG}, + {0x9800, SIERRA_RX_CTLE_CAL_PREG}, + {0x5624, SIERRA_DEQ_CONCUR_CTRL2_PREG}, + {0x000F, SIERRA_DEQ_EPIPWR_CTRL2_PREG}, + {0x00FF, SIERRA_DEQ_FAST_MAINT_CYCLES_PREG}, + {0x4C4C, SIERRA_DEQ_ERRCMP_CTRL_PREG}, + {0x02FA, SIERRA_DEQ_OFFSET_CTRL_PREG}, + {0x02FA, SIERRA_DEQ_GAIN_CTRL_PREG}, + {0x0041, SIERRA_DEQ_GLUT0}, + {0x0082, SIERRA_DEQ_GLUT1}, + {0x00C3, SIERRA_DEQ_GLUT2}, + {0x0145, SIERRA_DEQ_GLUT3}, + {0x0186, SIERRA_DEQ_GLUT4}, + {0x09E7, SIERRA_DEQ_ALUT0}, + {0x09A6, SIERRA_DEQ_ALUT1}, + {0x0965, SIERRA_DEQ_ALUT2}, + {0x08E3, SIERRA_DEQ_ALUT3}, + {0x00FA, SIERRA_DEQ_DFETAP0}, + {0x00FA, SIERRA_DEQ_DFETAP1}, + {0x00FA, SIERRA_DEQ_DFETAP2}, + {0x00FA, SIERRA_DEQ_DFETAP3}, + {0x00FA, SIERRA_DEQ_DFETAP4}, + {0x000F, SIERRA_DEQ_PRECUR_PREG}, + {0x0280, SIERRA_DEQ_POSTCUR_PREG}, + {0x8F00, SIERRA_DEQ_POSTCUR_DECR_PREG}, + {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, + {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, + {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, + {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, + {0x002B, SIERRA_CPI_TRIM_PREG}, + {0x0003, SIERRA_EPI_CTRL_PREG}, + {0x803F, SIERRA_SDFILT_H2L_A_PREG}, + {0x0004, SIERRA_RXBUFFER_CTLECTRL_PREG}, + {0x2010, SIERRA_RXBUFFER_RCDFECTRL_PREG}, + {0x4432, SIERRA_RXBUFFER_DFECTRL_PREG} +}; + +static struct cdns_sierra_vals pcie_100_no_ssc_plllc_cmn_vals = { + .reg_pairs = pcie_100_no_ssc_plllc_cmn_regs, + .num_regs = ARRAY_SIZE(pcie_100_no_ssc_plllc_cmn_regs), +}; + +static struct cdns_sierra_vals ml_pcie_100_no_ssc_ln_vals = { + .reg_pairs = ml_pcie_100_no_ssc_ln_regs, + .num_regs = ARRAY_SIZE(ml_pcie_100_no_ssc_ln_regs), +}; + +/* refclk100MHz_32b_PCIe_cmn_pll_int_ssc, pcie_links_using_plllc, pipe_bw_3 */ +static const struct cdns_reg_pairs pcie_100_int_ssc_plllc_cmn_regs[] = { + {0x000E, SIERRA_CMN_PLLLC_MODE_PREG}, + {0x4006, SIERRA_CMN_PLLLC_LF_COEFF_MODE1_PREG}, + {0x4006, SIERRA_CMN_PLLLC_LF_COEFF_MODE0_PREG}, + {0x0000, SIERRA_CMN_PLLLC_BWCAL_MODE1_PREG}, + {0x0000, SIERRA_CMN_PLLLC_BWCAL_MODE0_PREG}, + {0x0581, SIERRA_CMN_PLLLC_DSMCORR_PREG}, + {0x7F80, SIERRA_CMN_PLLLC_SS_PREG}, + {0x0041, SIERRA_CMN_PLLLC_SS_AMP_STEP_SIZE_PREG}, + {0x0464, SIERRA_CMN_PLLLC_SSTWOPT_PREG}, + {0x0D0D, SIERRA_CMN_PLLLC_SS_TIME_STEPSIZE_MODE_PREG}, + {0x0060, SIERRA_CMN_PLLLC_LOCK_DELAY_CTRL_PREG} +}; + +/* + * refclk100MHz_32b_PCIe_ln_int_ssc, multilink, using_plllc, + * cmn_pllcy_anaclk0_1Ghz, xcvr_pllclk_fullrt_500mhz + */ +static const struct cdns_reg_pairs ml_pcie_100_int_ssc_ln_regs[] = { + {0xFC08, SIERRA_DET_STANDEC_A_PREG}, + {0x001D, SIERRA_PSM_A3IN_TMR_PREG}, + {0x0004, SIERRA_PSC_LN_A3_PREG}, + {0x0004, SIERRA_PSC_LN_A4_PREG}, + {0x0004, SIERRA_PSC_LN_IDLE_PREG}, + {0x1555, SIERRA_DFE_BIASTRIM_PREG}, + {0x9703, SIERRA_DRVCTRL_BOOST_PREG}, + {0x813E, SIERRA_CLKPATHCTRL_TMR_PREG}, + {0x8047, SIERRA_RX_CREQ_FLTR_A_MODE3_PREG}, + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE2_PREG}, + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE1_PREG}, + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE0_PREG}, + {0x0002, SIERRA_CREQ_DCBIASATTEN_OVR_PREG}, + {0x9800, SIERRA_RX_CTLE_CAL_PREG}, + {0x033C, SIERRA_RX_CTLE_MAINTENANCE_PREG}, + {0x44CC, SIERRA_CREQ_EQ_OPEN_EYE_THRESH_PREG}, + {0x5624, SIERRA_DEQ_CONCUR_CTRL2_PREG}, + {0x000F, SIERRA_DEQ_EPIPWR_CTRL2_PREG}, + {0x00FF, SIERRA_DEQ_FAST_MAINT_CYCLES_PREG}, + {0x4C4C, SIERRA_DEQ_ERRCMP_CTRL_PREG}, + {0x02FA, SIERRA_DEQ_OFFSET_CTRL_PREG}, + {0x02FA, SIERRA_DEQ_GAIN_CTRL_PREG}, + {0x0041, SIERRA_DEQ_GLUT0}, + {0x0082, SIERRA_DEQ_GLUT1}, + {0x00C3, SIERRA_DEQ_GLUT2}, + {0x0145, SIERRA_DEQ_GLUT3}, + {0x0186, SIERRA_DEQ_GLUT4}, + {0x09E7, SIERRA_DEQ_ALUT0}, + {0x09A6, SIERRA_DEQ_ALUT1}, + {0x0965, SIERRA_DEQ_ALUT2}, + {0x08E3, SIERRA_DEQ_ALUT3}, + {0x00FA, SIERRA_DEQ_DFETAP0}, + {0x00FA, SIERRA_DEQ_DFETAP1}, + {0x00FA, SIERRA_DEQ_DFETAP2}, + {0x00FA, SIERRA_DEQ_DFETAP3}, + {0x00FA, SIERRA_DEQ_DFETAP4}, + {0x000F, SIERRA_DEQ_PRECUR_PREG}, + {0x0280, SIERRA_DEQ_POSTCUR_PREG}, + {0x8F00, SIERRA_DEQ_POSTCUR_DECR_PREG}, + {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, + {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, + {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, + {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, + {0x002B, SIERRA_CPI_TRIM_PREG}, + {0x0003, SIERRA_EPI_CTRL_PREG}, + {0x803F, SIERRA_SDFILT_H2L_A_PREG}, + {0x0004, SIERRA_RXBUFFER_CTLECTRL_PREG}, + {0x2010, SIERRA_RXBUFFER_RCDFECTRL_PREG}, + {0x4432, SIERRA_RXBUFFER_DFECTRL_PREG} +}; + +static struct cdns_sierra_vals pcie_100_int_ssc_plllc_cmn_vals = { + .reg_pairs = pcie_100_int_ssc_plllc_cmn_regs, + .num_regs = ARRAY_SIZE(pcie_100_int_ssc_plllc_cmn_regs), +}; + +static struct cdns_sierra_vals ml_pcie_100_int_ssc_ln_vals = { + .reg_pairs = ml_pcie_100_int_ssc_ln_regs, + .num_regs = ARRAY_SIZE(ml_pcie_100_int_ssc_ln_regs), +}; + +/* refclk100MHz_32b_PCIe_cmn_pll_ext_ssc, pcie_links_using_plllc, pipe_bw_3 */ +static const struct cdns_reg_pairs pcie_100_ext_ssc_plllc_cmn_regs[] = { + {0x2106, SIERRA_CMN_PLLLC_LF_COEFF_MODE1_PREG}, + {0x2106, SIERRA_CMN_PLLLC_LF_COEFF_MODE0_PREG}, + {0x8A06, SIERRA_CMN_PLLLC_BWCAL_MODE1_PREG}, + {0x8A06, SIERRA_CMN_PLLLC_BWCAL_MODE0_PREG}, + {0x1B1B, SIERRA_CMN_PLLLC_SS_TIME_STEPSIZE_MODE_PREG} +}; + +/* + * refclk100MHz_32b_PCIe_ln_ext_ssc, multilink, using_plllc, + * cmn_pllcy_anaclk0_1Ghz, xcvr_pllclk_fullrt_500mhz + */ +static const struct cdns_reg_pairs ml_pcie_100_ext_ssc_ln_regs[] = { + {0xFC08, SIERRA_DET_STANDEC_A_PREG}, + {0x001D, SIERRA_PSM_A3IN_TMR_PREG}, + {0x0004, SIERRA_PSC_LN_A3_PREG}, + {0x0004, SIERRA_PSC_LN_A4_PREG}, + {0x0004, SIERRA_PSC_LN_IDLE_PREG}, + {0x1555, SIERRA_DFE_BIASTRIM_PREG}, + {0x9703, SIERRA_DRVCTRL_BOOST_PREG}, + {0x813E, SIERRA_CLKPATHCTRL_TMR_PREG}, + {0x8047, SIERRA_RX_CREQ_FLTR_A_MODE3_PREG}, + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE2_PREG}, + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE1_PREG}, + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE0_PREG}, + {0x0002, SIERRA_CREQ_DCBIASATTEN_OVR_PREG}, + {0x9800, SIERRA_RX_CTLE_CAL_PREG}, + {0x033C, SIERRA_RX_CTLE_MAINTENANCE_PREG}, + {0x44CC, SIERRA_CREQ_EQ_OPEN_EYE_THRESH_PREG}, + {0x5624, SIERRA_DEQ_CONCUR_CTRL2_PREG}, + {0x000F, SIERRA_DEQ_EPIPWR_CTRL2_PREG}, + {0x00FF, SIERRA_DEQ_FAST_MAINT_CYCLES_PREG}, + {0x4C4C, SIERRA_DEQ_ERRCMP_CTRL_PREG}, + {0x02FA, SIERRA_DEQ_OFFSET_CTRL_PREG}, + {0x02FA, SIERRA_DEQ_GAIN_CTRL_PREG}, + {0x0041, SIERRA_DEQ_GLUT0}, + {0x0082, SIERRA_DEQ_GLUT1}, + {0x00C3, SIERRA_DEQ_GLUT2}, + {0x0145, SIERRA_DEQ_GLUT3}, + {0x0186, SIERRA_DEQ_GLUT4}, + {0x09E7, SIERRA_DEQ_ALUT0}, + {0x09A6, SIERRA_DEQ_ALUT1}, + {0x0965, SIERRA_DEQ_ALUT2}, + {0x08E3, SIERRA_DEQ_ALUT3}, + {0x00FA, SIERRA_DEQ_DFETAP0}, + {0x00FA, SIERRA_DEQ_DFETAP1}, + {0x00FA, SIERRA_DEQ_DFETAP2}, + {0x00FA, SIERRA_DEQ_DFETAP3}, + {0x00FA, SIERRA_DEQ_DFETAP4}, + {0x000F, SIERRA_DEQ_PRECUR_PREG}, + {0x0280, SIERRA_DEQ_POSTCUR_PREG}, + {0x8F00, SIERRA_DEQ_POSTCUR_DECR_PREG}, + {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, + {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, + {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, + {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, + {0x002B, SIERRA_CPI_TRIM_PREG}, + {0x0003, SIERRA_EPI_CTRL_PREG}, + {0x803F, SIERRA_SDFILT_H2L_A_PREG}, + {0x0004, SIERRA_RXBUFFER_CTLECTRL_PREG}, + {0x2010, SIERRA_RXBUFFER_RCDFECTRL_PREG}, + {0x4432, SIERRA_RXBUFFER_DFECTRL_PREG} +}; + +static struct cdns_sierra_vals pcie_100_ext_ssc_plllc_cmn_vals = { + .reg_pairs = pcie_100_ext_ssc_plllc_cmn_regs, + .num_regs = ARRAY_SIZE(pcie_100_ext_ssc_plllc_cmn_regs), +}; + +static struct cdns_sierra_vals ml_pcie_100_ext_ssc_ln_vals = { + .reg_pairs = ml_pcie_100_ext_ssc_ln_regs, + .num_regs = ARRAY_SIZE(ml_pcie_100_ext_ssc_ln_regs), +}; + /* refclk100MHz_32b_PCIe_cmn_pll_no_ssc */ static const struct cdns_reg_pairs cdns_pcie_cmn_regs_no_ssc[] = { {0x2105, SIERRA_CMN_PLLLC_LF_COEFF_MODE1_PREG}, @@ -1710,6 +2018,11 @@ static const struct cdns_sierra_data cdns_map_sierra = { [EXTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, [INTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, }, + [TYPE_QSGMII] = { + [NO_SSC] = &pcie_phy_pcs_cmn_vals, + [EXTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, + [INTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, + }, }, }, .pma_cmn_vals = { @@ -1719,12 +2032,24 @@ static const struct cdns_sierra_data cdns_map_sierra = { [EXTERNAL_SSC] = &pcie_100_ext_ssc_cmn_vals, [INTERNAL_SSC] = &pcie_100_int_ssc_cmn_vals, }, + [TYPE_QSGMII] = { + [NO_SSC] = &pcie_100_no_ssc_plllc_cmn_vals, + [EXTERNAL_SSC] = &pcie_100_ext_ssc_plllc_cmn_vals, + [INTERNAL_SSC] = &pcie_100_int_ssc_plllc_cmn_vals, + }, }, [TYPE_USB] = { [TYPE_NONE] = { [EXTERNAL_SSC] = &usb_100_ext_ssc_cmn_vals, }, }, + [TYPE_QSGMII] = { + [TYPE_PCIE] = { + [NO_SSC] = &qsgmii_100_no_ssc_plllc1_cmn_vals, + [EXTERNAL_SSC] = &qsgmii_100_no_ssc_plllc1_cmn_vals, + [INTERNAL_SSC] = &qsgmii_100_no_ssc_plllc1_cmn_vals, + }, + }, }, .pma_ln_vals = { [TYPE_PCIE] = { @@ -1733,12 +2058,24 @@ static const struct cdns_sierra_data cdns_map_sierra = { [EXTERNAL_SSC] = &pcie_100_ext_ssc_ln_vals, [INTERNAL_SSC] = &pcie_100_int_ssc_ln_vals, }, + [TYPE_QSGMII] = { + [NO_SSC] = &ml_pcie_100_no_ssc_ln_vals, + [EXTERNAL_SSC] = &ml_pcie_100_ext_ssc_ln_vals, + [INTERNAL_SSC] = &ml_pcie_100_int_ssc_ln_vals, + }, }, [TYPE_USB] = { [TYPE_NONE] = { [EXTERNAL_SSC] = &usb_100_ext_ssc_ln_vals, }, }, + [TYPE_QSGMII] = { + [TYPE_PCIE] = { + [NO_SSC] = &qsgmii_100_no_ssc_plllc1_ln_vals, + [EXTERNAL_SSC] = &qsgmii_100_no_ssc_plllc1_ln_vals, + [INTERNAL_SSC] = &qsgmii_100_no_ssc_plllc1_ln_vals, + }, + }, }, }; @@ -1753,6 +2090,20 @@ static const struct cdns_sierra_data cdns_ti_map_sierra = { [EXTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, [INTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, }, + [TYPE_QSGMII] = { + [NO_SSC] = &pcie_phy_pcs_cmn_vals, + [EXTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, + [INTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, + }, + }, + }, + .phy_pma_ln_vals = { + [TYPE_QSGMII] = { + [TYPE_PCIE] = { + [NO_SSC] = &qsgmii_phy_pma_ln_vals, + [EXTERNAL_SSC] = &qsgmii_phy_pma_ln_vals, + [INTERNAL_SSC] = &qsgmii_phy_pma_ln_vals, + }, }, }, .pma_cmn_vals = { @@ -1762,12 +2113,24 @@ static const struct cdns_sierra_data cdns_ti_map_sierra = { [EXTERNAL_SSC] = &pcie_100_ext_ssc_cmn_vals, [INTERNAL_SSC] = &pcie_100_int_ssc_cmn_vals, }, + [TYPE_QSGMII] = { + [NO_SSC] = &pcie_100_no_ssc_plllc_cmn_vals, + [EXTERNAL_SSC] = &pcie_100_ext_ssc_plllc_cmn_vals, + [INTERNAL_SSC] = &pcie_100_int_ssc_plllc_cmn_vals, + }, }, [TYPE_USB] = { [TYPE_NONE] = { [EXTERNAL_SSC] = &usb_100_ext_ssc_cmn_vals, }, }, + [TYPE_QSGMII] = { + [TYPE_PCIE] = { + [NO_SSC] = &qsgmii_100_no_ssc_plllc1_cmn_vals, + [EXTERNAL_SSC] = &qsgmii_100_no_ssc_plllc1_cmn_vals, + [INTERNAL_SSC] = &qsgmii_100_no_ssc_plllc1_cmn_vals, + }, + }, }, .pma_ln_vals = { [TYPE_PCIE] = { @@ -1776,12 +2139,24 @@ static const struct cdns_sierra_data cdns_ti_map_sierra = { [EXTERNAL_SSC] = &pcie_100_ext_ssc_ln_vals, [INTERNAL_SSC] = &pcie_100_int_ssc_ln_vals, }, + [TYPE_QSGMII] = { + [NO_SSC] = &ml_pcie_100_no_ssc_ln_vals, + [EXTERNAL_SSC] = &ml_pcie_100_ext_ssc_ln_vals, + [INTERNAL_SSC] = &ml_pcie_100_int_ssc_ln_vals, + }, }, [TYPE_USB] = { [TYPE_NONE] = { [EXTERNAL_SSC] = &usb_100_ext_ssc_ln_vals, }, }, + [TYPE_QSGMII] = { + [TYPE_PCIE] = { + [NO_SSC] = &qsgmii_100_no_ssc_plllc1_ln_vals, + [EXTERNAL_SSC] = &qsgmii_100_no_ssc_plllc1_ln_vals, + [INTERNAL_SSC] = &qsgmii_100_no_ssc_plllc1_ln_vals, + }, + }, }, }; From patchwork Wed Sep 8 12:29:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Jakhade X-Patchwork-Id: 508038 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB833C433F5 for ; Wed, 8 Sep 2021 12:30:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9C936113E for ; Wed, 8 Sep 2021 12:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351524AbhIHMbL (ORCPT ); Wed, 8 Sep 2021 08:31:11 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:50796 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348875AbhIHMbF (ORCPT ); Wed, 8 Sep 2021 08:31:05 -0400 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 1886dluF030522; Wed, 8 Sep 2021 05:29:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=aUJXGyM7W4qgOw8NAGDOgXkdyHqgk1WrgB6VtVYSmF8=; b=pdA3wVa3eUEnmo/n9ucfViQ+Pt3H1R0fJ+XQ6rQI+eL+i+CH2HTUzbBOZhlv8gpstLgr 1PUZYxCUEEhg6bGdWoFOEQ5jPMeCq5+8DMAWP/wT+9JrLwol8jqUK+s+aIYd9/N8TcPS RC4UdvyS66U6VxyyXyS4kW/B+Pt5rIsVU/nPU/qHP0WitvzBKnMGcnJ/Z1tKZIFFAuJV MH2oJvH4wwXWCYWB7bUqFpRsV9VYzHTMOlbrRZ02HqABzzEzhFq3fJuwQMc0TClrmfum u5q3jsMlBGslS3Uosz1ETOIQ8El+ZeV8IR3ULuZvPjhpkTlZ6xRTjIdZFOIYxG4CQwOT Nw== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2042.outbound.protection.outlook.com [104.47.66.42]) by mx0a-0014ca01.pphosted.com with ESMTP id 3axcn5b0xq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 05:29:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lPoBUyGS52igc4dJU/aQnm8AfZ7FgaFWYJj3daBiXwU5aERa/+bhQRbOGwEB5RpTE/P2wQhT0gbhaB8Ewkkt1HM6L+u3vTqTKE6QGvuQ2vBffn/L2gEVf5xfAwCoyIGpK8DlNCvA4yIcDbG3rxIpgcZ8GbH+N27ZSQbXY43iYxjpPaJy/uzdaQKjzCdL0MkNHOrswOTGqcYfbfmuyt118K8zF+ipUxSCg3aU23he15fm8rgkgXCw43hLn9E9XTy+m+m5JJjmgh/7zRqtQZooOMtes8rC2Tu2yKHoWDDAgXL2MWEUwqW/6OejajxVreeQSac+d86+oFHs6ChUk/4AaQ== 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; bh=aUJXGyM7W4qgOw8NAGDOgXkdyHqgk1WrgB6VtVYSmF8=; b=iMKEVHmFlxYWP4mWuwD+6V0sC+XZPDM1Y7/Mj2teQQhOtlMworzpVc9XqJ3nr+zaWiUW+omW54I99WeoEDfvVCiB1rZK8iFLVHe8CAbCddsKHuSqOflzzGy7oNJ7sHl3NdcDi9uexkM8RGfx74NkqRykoOYPsfoHXnQ9C0s3JsQYr9e4dzRi0+me8ertWYT8KuTc3vNzAUoUnHWSevUJIGV+3+aaHorS5xDXeHps+5hxLdvItTzx3Flc/hCZLRJzedp9N0/iJF2MGp2Os1lIolfAFr0abNDsbUls1FFLCSKFoQ+ofiJubO1juS5WZMWkSmyKw7fMfmcR4+H0rNeTSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.148) smtp.rcpttodomain=kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aUJXGyM7W4qgOw8NAGDOgXkdyHqgk1WrgB6VtVYSmF8=; b=YFb9U+pAmTV0wUlDgaH5CfT/IQFSARVs6cK5qHuXOyTTsVk4Tip5qrt41UBfZ9+Wm0deLbmRK12oUDwf8CrANSJvp8gzXqWQ4qNVnDUD2p6jWoFtj3mb6gcKuGaM+s0FTJavtCZEb/JQPeidD/Blc+R7mTihUH69efvOPxGgPiY= Received: from DM6PR05CA0051.namprd05.prod.outlook.com (2603:10b6:5:335::20) by BN7PR07MB4738.namprd07.prod.outlook.com (2603:10b6:406:f0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20; Wed, 8 Sep 2021 12:29:44 +0000 Received: from DM6NAM12FT016.eop-nam12.prod.protection.outlook.com (2603:10b6:5:335:cafe::fd) by DM6PR05CA0051.outlook.office365.com (2603:10b6:5:335::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.7 via Frontend Transport; Wed, 8 Sep 2021 12:29:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.148 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.148; helo=sjmaillnx2.cadence.com; Received: from sjmaillnx2.cadence.com (158.140.1.148) by DM6NAM12FT016.mail.protection.outlook.com (10.13.178.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.6 via Frontend Transport; Wed, 8 Sep 2021 12:29:44 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTX9Y026939 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 05:29:42 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu4.global.cadence.com (10.160.110.201) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Sep 2021 14:29:34 +0200 Received: from maileu3.global.cadence.com (10.160.88.99) by maileu4.global.cadence.com (10.160.110.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Wed, 8 Sep 2021 14:29:33 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 8 Sep 2021 14:29:33 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 188CTXTv010329; Wed, 8 Sep 2021 14:29:33 +0200 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 188CTX9Z010328; Wed, 8 Sep 2021 14:29:33 +0200 From: Swapnil Jakhade To: , , , , , , CC: , , , Subject: [PATCH v2 15/15] phy: cadence: Sierra: Add support for derived reference clock output Date: Wed, 8 Sep 2021 14:29:30 +0200 Message-ID: <20210908122930.10224-16-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20210908122930.10224-1-sjakhade@cadence.com> References: <20210908122930.10224-1-sjakhade@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca368b33-7f1b-4346-e570-08d972c4569e X-MS-TrafficTypeDiagnostic: BN7PR07MB4738: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:586; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hGn/tiIRy/Ndayv0bFqEGos77Przz0yofAMBbFzD2XMchHcjOHAmJE1h2/w8qwuPzAWzuDAPF93FUDArdXbSBwNTKvwv2SCkqIel/BC7D8Pvg1ltLLLT0EUvPA7U+SA8BGOWv1bGUsbotwG0PPln7/RlUBBZ7MT15PXYUugYQBfJes55lP1pVeqby4V29AmaLr/+gdSM5gyaCLZa6oxZw1fs+wVC8egkAhKGiLnfxNIGk88eHDjsgsCmg/3Ekas6+HHABIjQBLplvmzTIwFzxBtbnDgDx+LTg71vZPtvFq0FC1tNCWt0RPiqM+bygR3m5eb8F6RgWsoUC84aQRdmsbxX3nQ9VeGN7pDpY31o8mz6jOYcDz+TdWrvwQ9hrqgSG3lrXHwVWFL827MJFu6iql6636DSDm5v6YoM6FL8fAf7BFXnVcRTrXAMJeZp+MSUmxoXvSXYKYUeVw6mDif/D30aUZXLnC8eiZHE+ZiiMFssgoDV+8DvjAoqwgnV7bW1YHcSyvTb761bdJb8z9fkxIH+72MbQy2pPg3X36y1wYgUK9IdFIV4W3im2uhMcWakx435TuOlw96oSyifk9sBnHA6hI8QMjxirRobt+ES1HIqTJK21/VHIqfProOavFuQCYxxAlNleAdE/7KJuGIFufjwY4Wbao/sprKR8ztBAWX8wIs8Y8eE2j4o0OuMj7Azqi81ptlg1CiaOMCEISYX2Og+UI8Uy0f3hIj4A3easzm2gfi3RKVoDk9yoDgWx3zRKz07m+4b0S5Aba9tll8Eig== X-Forefront-Antispam-Report: CIP:158.140.1.148; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx2.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(136003)(39860400002)(346002)(396003)(376002)(36092001)(46966006)(36840700001)(26005)(1076003)(82310400003)(4326008)(336012)(5660300002)(42186006)(83380400001)(86362001)(186003)(8936002)(316002)(2616005)(36756003)(82740400003)(54906003)(478600001)(426003)(110136005)(70586007)(47076005)(7636003)(36860700001)(8676002)(70206006)(356005)(2906002)(309714004); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 12:29:44.1176 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca368b33-7f1b-4346-e570-08d972c4569e X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[158.140.1.148]; Helo=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT016.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4738 X-Proofpoint-ORIG-GUID: RlXCiYDHHeVxpB5tR6dWJzlb0le1Vp5l X-Proofpoint-GUID: RlXCiYDHHeVxpB5tR6dWJzlb0le1Vp5l X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1, Aquarius:18.0.790, Hydra:6.0.391, FMLib:17.0.607.475 definitions=2021-09-08_06,2021-09-07_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 mlxscore=0 clxscore=1015 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080079 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Sierra has derived differential reference clock output which is sourced after the spread spectrum generation has been added. Add support to drive derived reference clock out of serdes. Model this derived clock as a "clock" so that platforms using this can enable it. Sierra Main LC VCO PLL divider 1 clock is programmed to output 100MHz clock output. Signed-off-by: Swapnil Jakhade --- drivers/phy/cadence/phy-cadence-sierra.c | 109 ++++++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 9e9d26a9259d..c03e65926954 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -34,6 +34,7 @@ #define SIERRA_CMN_PLLLC_LF_COEFF_MODE1_PREG 0x49 #define SIERRA_CMN_PLLLC_LF_COEFF_MODE0_PREG 0x4A #define SIERRA_CMN_PLLLC_LOCK_CNTSTART_PREG 0x4B +#define SIERRA_CMN_PLLLC_CLK1_PREG 0x4D #define SIERRA_CMN_PLLLC_BWCAL_MODE1_PREG 0x4F #define SIERRA_CMN_PLLLC_BWCAL_MODE0_PREG 0x50 #define SIERRA_CMN_PLLLC_DSMCORR_PREG 0x51 @@ -203,7 +204,7 @@ #define SIERRA_MAX_LANES 16 #define PLL_LOCK_TIME 100000 -#define CDNS_SIERRA_OUTPUT_CLOCKS 2 +#define CDNS_SIERRA_OUTPUT_CLOCKS 3 #define CDNS_SIERRA_INPUT_CLOCKS 5 enum cdns_sierra_clock_input { PHY_CLK, @@ -226,10 +227,15 @@ static const struct reg_field pllctrl_lock = REG_FIELD(SIERRA_PLLCTRL_STATUS_PREG, 0, 0); static const struct reg_field phy_iso_link_ctrl_1 = REG_FIELD(SIERRA_PHY_ISO_LINK_CTRL, 1, 1); +static const struct reg_field cmn_plllc_clk1outdiv_preg = + REG_FIELD(SIERRA_CMN_PLLLC_CLK1_PREG, 0, 6); +static const struct reg_field cmn_plllc_clk1_en_preg = + REG_FIELD(SIERRA_CMN_PLLLC_CLK1_PREG, 12, 12); static const char * const clk_names[] = { [CDNS_SIERRA_PLL_CMNLC] = "pll_cmnlc", [CDNS_SIERRA_PLL_CMNLC1] = "pll_cmnlc1", + [CDNS_SIERRA_DERIVED_REFCLK] = "refclk_der", }; enum cdns_sierra_cmn_plllc { @@ -277,6 +283,16 @@ static u32 cdns_sierra_pll_mux_table[][SIERRA_NUM_CMN_PLLC_PARENTS] = { [CMN_PLLLC1] = { 1, 0 }, }; +struct cdns_sierra_derived_refclk { + struct clk_hw hw; + struct regmap_field *cmn_plllc_clk1outdiv_preg; + struct regmap_field *cmn_plllc_clk1_en_preg; + struct clk_init_data clk_data; +}; + +#define to_cdns_sierra_derived_refclk(_hw) \ + container_of(_hw, struct cdns_sierra_derived_refclk, hw) + enum cdns_sierra_phy_type { TYPE_NONE, TYPE_PCIE, @@ -766,6 +782,91 @@ static int cdns_sierra_phy_register_pll_mux(struct cdns_sierra_phy *sp) return 0; } +static int cdns_sierra_derived_refclk_enable(struct clk_hw *hw) +{ + struct cdns_sierra_derived_refclk *derived_refclk = to_cdns_sierra_derived_refclk(hw); + + regmap_field_write(derived_refclk->cmn_plllc_clk1_en_preg, 0x1); + + /* Programming to get 100Mhz clock output in ref_der_clk_out 5GHz VCO/50 = 100MHz */ + regmap_field_write(derived_refclk->cmn_plllc_clk1outdiv_preg, 0x2E); + + return 0; +} + +static void cdns_sierra_derived_refclk_disable(struct clk_hw *hw) +{ + struct cdns_sierra_derived_refclk *derived_refclk = to_cdns_sierra_derived_refclk(hw); + + regmap_field_write(derived_refclk->cmn_plllc_clk1_en_preg, 0); +} + +static int cdns_sierra_derived_refclk_is_enabled(struct clk_hw *hw) +{ + struct cdns_sierra_derived_refclk *derived_refclk = to_cdns_sierra_derived_refclk(hw); + int val; + + regmap_field_read(derived_refclk->cmn_plllc_clk1_en_preg, &val); + + return !!val; +} + +static const struct clk_ops cdns_sierra_derived_refclk_ops = { + .enable = cdns_sierra_derived_refclk_enable, + .disable = cdns_sierra_derived_refclk_disable, + .is_enabled = cdns_sierra_derived_refclk_is_enabled, +}; + +static int cdns_sierra_derived_refclk_register(struct cdns_sierra_phy *sp) +{ + struct cdns_sierra_derived_refclk *derived_refclk; + struct device *dev = sp->dev; + struct regmap_field *field; + struct clk_init_data *init; + struct regmap *regmap; + char clk_name[100]; + struct clk *clk; + + derived_refclk = devm_kzalloc(dev, sizeof(*derived_refclk), GFP_KERNEL); + if (!derived_refclk) + return -ENOMEM; + + snprintf(clk_name, sizeof(clk_name), "%s_%s", dev_name(dev), + clk_names[CDNS_SIERRA_DERIVED_REFCLK]); + + init = &derived_refclk->clk_data; + + init->ops = &cdns_sierra_derived_refclk_ops; + init->flags = 0; + init->name = clk_name; + + regmap = sp->regmap_common_cdb; + + field = devm_regmap_field_alloc(dev, regmap, cmn_plllc_clk1outdiv_preg); + if (IS_ERR(field)) { + dev_err(dev, "cmn_plllc_clk1outdiv_preg reg field init failed\n"); + return PTR_ERR(field); + } + derived_refclk->cmn_plllc_clk1outdiv_preg = field; + + field = devm_regmap_field_alloc(dev, regmap, cmn_plllc_clk1_en_preg); + if (IS_ERR(field)) { + dev_err(dev, "cmn_plllc_clk1_en_preg reg field init failed\n"); + return PTR_ERR(field); + } + derived_refclk->cmn_plllc_clk1_en_preg = field; + + derived_refclk->hw.init = init; + + clk = devm_clk_register(dev, &derived_refclk->hw); + if (IS_ERR(clk)) + return PTR_ERR(clk); + + sp->output_clks[CDNS_SIERRA_DERIVED_REFCLK] = clk; + + return 0; +} + static void cdns_sierra_clk_unregister(struct cdns_sierra_phy *sp) { struct device *dev = sp->dev; @@ -786,6 +887,12 @@ static int cdns_sierra_clk_register(struct cdns_sierra_phy *sp) return ret; } + ret = cdns_sierra_derived_refclk_register(sp); + if (ret) { + dev_err(dev, "Failed to register derived refclk\n"); + return ret; + } + sp->clk_data.clks = sp->output_clks; sp->clk_data.clk_num = CDNS_SIERRA_OUTPUT_CLOCKS; ret = of_clk_add_provider(node, of_clk_src_onecell_get, &sp->clk_data);