From patchwork Thu Dec 23 06:01:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697933 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AE6CEC433EF for ; Thu, 23 Dec 2021 06:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5gEYJlM5OgFPGRneg/hbSsNoPqPzAjxHfLM8qIas9Pk=; b=OvljYAbiUEmu4/ 6f1fTqsd/nW7eBNI8wvxGzjHjEIQJS98JiQaykJK3FCM0ezd7oeRejdxlm1c9e8kCIhQ4QaHJ3a5k gx5A6cI0O9nO2w0BFeVB8amrocOWxi0Ao5W5SNyAtCnt4YKZGbNjq+xAeudI62NjThtS5FGqvI68e /V3v9QZ2J1YU3Hxf/nUXqnJptdXp34bCXYvaxrb8gtKF2Dv+m3JdyBNXgFQUQEMXeYLPf0kBVCQ7d AineP7MapIxiPNCYT7K2+TM8fM9ux4j8ePYX621rTZ8v5kJ5/BmSdAPzhEifG/EgSEm4VwQ+wQOSk Lmeo11ssJ+4rNZHS4a4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HDw-00BuFn-3l; Thu, 23 Dec 2021 06:05:08 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HDs-00BuF8-W7 for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:05:06 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN4Isld005574; Wed, 22 Dec 2021 22:05:03 -0800 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=TPcgxzMf0ZBvtJz/tlHuf2xI84b4LiRt2eVmxt46vOY=; b=nQY6aEZ1h9pI5tbSbTG/7QPg9GmQ3VSK3ar1Cb/qlkPPcrhhM3cZZRHEmjVslDUqcyfH TcKjVmGGFSdH5PDWnN561l4m4GIUouiwDAW33FETyjdRWYZ8Rn3I9zCYBVMaSA9uCIEU 235u9lUY6VT8/+qJJAC+Dnv/Hqj9TBgo1gJcA5kCgBUYCZ85A7wbGDUlYDsDMr3cr7xs wxzjeK6YzktFkXBZHW8ym1Y0nXnmk47SDXmBG8plvRgcNGEoiAAxJxXthn5WulzY1iyZ fVyerRujOLTgPYZ8BM/dHlXl4aAdz8Hlisd6U1NZ68intImrVrFw01eqEkOiHZDxYOzm MQ== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvjqf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:05:02 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oq6g/dKoW33jOTkcY3JN1pTFvr4spde42JffCmgjJdYcWeH/klQ5uw5Y0qwRDopcEcqq5cguyiNXED4pIB1Zeb3rM3yYEn+/OkUynQJZJcwoQQ4p1ylORX5BWnw3A0esy9EuN0APUnp/tXcs+4A0L/Tlmv4GqahSh4SMtv6pAGpYDXsIzcj2XaJqQScp1TON2IAEJTEsNIJgUJa9wbV77lWVmLMw3zGK+yKvsHKq4sJkZ36T1yX1zB7nUQkLwD5W7jnWOois5kcjUlK3LavyKSnEXB5IOQSMrBvLIXuhXf7sKt08bn0tj/PmG3t2rEyvCytJ6Lc62/y8+t1ht+5gbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TPcgxzMf0ZBvtJz/tlHuf2xI84b4LiRt2eVmxt46vOY=; b=OC5Aj5yuAhJXSAk6JhUAuwiKzSDXwMKs/PiVyEKYi1Kfr8Pa6oLxw7vicVWQIcIJaOOFcYsnUgucWAjMzGa8y3VGQsYiOMQinCKaIPLi+uNMIyqV/Z4XZfRIqMGPXekxsQ1V5w8RAe0QcvTd0JUuU0WCVVuo3Nq+8HB0/KCiW13WlY/0fEkoRkX1qI4mb/kw7KLkPJGdf0YKcEfTBQbefpbgAFO/3Netj3HgCuD6AJXAmMuQu+fcIhgjpmBszz+3AtQNGbQVReK4u7AtUpO/vmg8w1AnerP0+59uka5Sp+0XGPg32niwkBE9nsscJ1CpuV2ltfpUGUlwdy1gGBa2IA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) 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=TPcgxzMf0ZBvtJz/tlHuf2xI84b4LiRt2eVmxt46vOY=; b=w8mj2pNTZTQ2y2Xeodly9odAHJCwlvGN+wwbYapHKp2FBCkjDZr0fEeX7p8SpT4fxNup0x47pa2X3qDTQQUxAbpE0G5WedcN/DDNSOy1OWr9WijTHP0wyld/BSbCYVsACzbNjx6rraD/gXqqn4fBWnbt16sNcZnwZuNkhTb8clA= Received: from DM5PR2201CA0010.namprd22.prod.outlook.com (2603:10b6:4:14::20) by DM5PR07MB3451.namprd07.prod.outlook.com (2603:10b6:4:6c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Thu, 23 Dec 2021 06:04:57 +0000 Received: from DM6NAM12FT018.eop-nam12.prod.protection.outlook.com (2603:10b6:4:14:cafe::7d) by DM5PR2201CA0010.outlook.office365.com (2603:10b6:4:14::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19 via Frontend Transport; Thu, 23 Dec 2021 06:04:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by DM6NAM12FT018.mail.protection.outlook.com (10.13.179.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:04:57 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 1BN64uUm024878 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:04:57 -0800 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; Thu, 23 Dec 2021 07:04:56 +0100 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; Thu, 23 Dec 2021 07:04:43 +0100 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; Thu, 23 Dec 2021 07:04:43 +0100 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 1BN637v5009953; Thu, 23 Dec 2021 07:03:39 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN637GX009951; Thu, 23 Dec 2021 07:03:07 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 01/15] phy: cadence: Sierra: Use of_device_get_match_data() to get driver data Date: Thu, 23 Dec 2021 07:01:23 +0100 Message-ID: <20211223060137.9252-2-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: 2d11bd81-dee1-42bd-5325-08d9c5da2587 X-MS-TrafficTypeDiagnostic: DM5PR07MB3451:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:311; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HG4PC8lv1O3HAH0PSZ14q7oU4M3ZsDG1vSdT03xPgHTLHU+d5C4g/v3wy1IrWVrMxi5Rb4ZqM6YaGhKOc6dru5lUXOKIRAaA6bMvn6LPgTaT469DWFDzlCW0f9AroDXcoZXjF/V5q/fCK0t6cyU/ZjiKMm1fabRegcAdGlZo15hUPpHuvbTNDtSztrg02TwefCXkcHyc53Ui7Y9qlr7gaKZ0PNjUDsFpgJMzTnkKmRVIPghvxG2cesP/VS4vpvJWCmIkV0co60X5lYYylEZAXvhx8LU7sE8bLKf8JrgtuJBCqxLo09EecdnEZ8Rmg240bizL0qSrj0sIm4mdwciVr3KaApJP7vjZgup/PcZ1R5xv7kpBI88hVKphQU3XtKUOTD3WzNQnjkgVI6aEvvxDX3lIlwRs5n243fRDAr4WeDU7U4VGKdrxzoqOwlXmeYYZihALiJIn53zSFhe0LrXRb7rRtmIgWFXlTdrw0ITdj0TS887gfeEvnWjisb2q38hdivf3o3f6uG+dQJQ6jhIiivWOYLfPOE+QabKqFnumDz3Z91kDJK+4Z+EKLfItgIui67xKo2HstxUxBKSsv1JH0mYWMeg47zaT2+vn86cQWRB7ruQncd4pd7+aiwmF47lom08woa2FpYM6W8B8UTFfD2yJZWKR/K8HpjW5z8HirqFj6GGmKyNe/2D+ZhesMGt8OmGdUXDKUCccVkER6kZoQSwawMUkWJzTr2gbHtO2n47TB7km5L1TIkN6PgsEF6t09yW1hFxJ1jZwbN1cchLmuAOjJsclv1rt+PpbaCRNpbr+2NDbGfrLMFAJ4ShieolnsXOtXp4qo74BQ1JCOYuuuw== X-Forefront-Antispam-Report: CIP:64.207.220.244; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:wcmailrelayl01.cadence.com; PTR:ErrorRetry; CAT:NONE; SFS:(4636009)(36092001)(46966006)(40470700002)(36840700001)(4326008)(36860700001)(426003)(6666004)(2616005)(336012)(110136005)(1076003)(40460700001)(42186006)(82310400004)(36756003)(26005)(86362001)(54906003)(316002)(186003)(81166007)(356005)(83380400001)(2906002)(508600001)(8676002)(8936002)(5660300002)(70206006)(70586007)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:04:57.1710 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2d11bd81-dee1-42bd-5325-08d9c5da2587 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[64.207.220.244]; Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT018.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3451 X-Proofpoint-ORIG-GUID: 7i2eG9dk7hC7xi40plOCvY69xKOOdvXg X-Proofpoint-GUID: 7i2eG9dk7hC7xi40plOCvY69xKOOdvXg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230034 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_220505_072662_3471E478 X-CRM114-Status: GOOD ( 17.04 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Use of_device_get_match_data() to get driver data instead of boilerplate code. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju --- drivers/phy/cadence/phy-cadence-sierra.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index e93818e3991f..54d1c63932ac 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -253,7 +253,7 @@ struct cdns_regmap_cdb_context { struct cdns_sierra_phy { struct device *dev; struct regmap *regmap; - struct cdns_sierra_data *init_data; + const struct cdns_sierra_data *init_data; struct cdns_sierra_inst phys[SIERRA_MAX_LANES]; struct reset_control *phy_rst; struct reset_control *apb_rst; @@ -595,8 +595,6 @@ static int cdns_sierra_get_optional(struct cdns_sierra_inst *inst, return 0; } -static const struct of_device_id cdns_sierra_id_table[]; - static struct regmap *cdns_regmap_init(struct device *dev, void __iomem *base, u32 block_offset, u8 reg_offset_shift, const struct regmap_config *config) @@ -829,8 +827,7 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) struct cdns_sierra_phy *sp; struct phy_provider *phy_provider; struct device *dev = &pdev->dev; - const struct of_device_id *match; - struct cdns_sierra_data *data; + const struct cdns_sierra_data *data; unsigned int id_value; int i, ret, node = 0; void __iomem *base; @@ -840,12 +837,10 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) return -ENODEV; /* Get init data for this PHY */ - match = of_match_device(cdns_sierra_id_table, dev); - if (!match) + data = of_device_get_match_data(dev); + if (!data) return -EINVAL; - data = (struct cdns_sierra_data *)match->data; - sp = devm_kzalloc(dev, sizeof(*sp), GFP_KERNEL); if (!sp) return -ENOMEM; From patchwork Thu Dec 23 06:01:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697934 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F25F9C433EF for ; Thu, 23 Dec 2021 06:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9rsPJ9FtZoyKyW2g/cTF7xp4rc0VAt5XC8VhfAblNZE=; b=f7aXF2xs39mVX+ llkV1oK77kooOM9o94y3KdyMALOTyO2IRJ0WFXK6jvNsFsNInTuKgnZETbY+rgBpAL8eKxhlzVlK8 /+h+890qL5a7Uvmmw8nrHq+tGU6K9hwfsj8V1yninnvzwmh4AxmFcygduJa2juLezMYpc64Om3CZK smItHFokjvxScgAN3NUNBghP0Ez6pVv1mSL9Kv5Lgcl9rwUuKjMb+bUNfPQx2YVSq54g0Tmm3qgAM snHs9VFI5GGmPiC7ww1wfJMmza6ms0cKg8KKRBXAqsD4bTEx9pBTvmOj+fhu0Ss+fGILF1iEMClnm OoIHQ9OFdqGgTts3Go9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HF8-00BuPo-Dg; Thu, 23 Dec 2021 06:06:22 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HF4-00BuPK-RD for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:06:20 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN4F4RO005438; Wed, 22 Dec 2021 22:06:16 -0800 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=3fNMjXY5Yo3EUBn8euP3yHJDH41JACdnwDYdNTjWkps=; b=sqpNBZlg1aMvC2tBN6ZXOwXx1KIAIrDs7YE/TJM4r8T/25sKUn/Sp++I79g7PLwWhvzA mRP4e2TCnH9ryPvMl74iUfyI41CvAQuJ+w25/sms1Ki3Swfb50Jqkzgrlvhn8EYNfizv MX7gFTYrvuBKdFy0DX8kmIINLrUpcc04C6MfNio8jG/N4wSnQovszH0mqakMw+MRUDw2 cywb5kocYJYS43BzB6YorOE0/nqzHBy1y7Y/CcP+ToCk/tWJl5xZ1K2RH9jmUBS+Fuf+ X+flh45Kxr5mHl5+v6T80BWiGl9cuRc1MxvgpKnxdVIlS+hO4m4yTuX51WZta/4lImkh jw== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvjth-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:06:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=czw+2GhlMc3g/CaCIBBxkP43KcpjgkUrXZJTfLM3yr1AgCaOf/Cg4+luJ8vMEoA1VEFEGMPppmawrfhsfD0lToq2HtWSVt7UaJbHoGqj0EbRActWoGz3lO0eMgdpcsQQKWQBON9xFrldqKkAyllraOzdsH0EkuKE1u+lmOtOB6YMfdJqBmWEt1u0QZI62iht2uhcEcBmmb7bvMVvt21YHYu5qQyRxyoy80zkZe7h6Ck4td6ehHCMk1qPF95I845Hm71JkZf9KFYUhO/qAPRBXcb9+M5Vs1IvkiAcgAASZ90CGUyltj/5tv+C0tYJZALBFGJHkicvQAUeH8GjHAbqzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3fNMjXY5Yo3EUBn8euP3yHJDH41JACdnwDYdNTjWkps=; b=SDfb4iMXi9jM9n0+RKu273AspBhmp4n9QxOGl1i5+xR8XnhCXGtVSgrlq4NBWTO/iv3bAlGTXWQVmkyEkTlgd9KAxVH06yX5o+nJkMcJrVQ77mvDc+Vo13Od4fg1OzsttUK6Qbd3qIXOWZ5Pu1feuSq4Ku0Z8usFiuLQosGcwZMGqb8C6ehIORnc25dBN3vXDKSRrchVGMV6ANED37qJIjudTg2AIl6dt28I4XtF3Cczs2hZrV7svhiFIfDxqK+jiIKPebAvm26xfWe3+DNt/ZYyZQXsEuDNk1PcbqtkIzfpLfQ3xPqgHrkheEuMDcUm61ouL+HSf7xFzxRPIHVG6A== 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=3fNMjXY5Yo3EUBn8euP3yHJDH41JACdnwDYdNTjWkps=; b=ufU4NDpWeSTyw32jvRKAXZzTFt0wRpEW0ITqk50CpF7mm1hYJ7qnWIb/2Vwvo+pc/pC4nrpJMvOjH53FbCdYr4Xll9C9nKMPVnyxRU+ok5UknggX5Q6218RheoHI9QSXzPcJeIZkChPIP5biaIxpnrdPDV5qXO9geFegDrxHVBw= Received: from DM5PR19CA0062.namprd19.prod.outlook.com (2603:10b6:3:116::24) by DM6PR07MB5290.namprd07.prod.outlook.com (2603:10b6:5:4e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 23 Dec 2021 06:06:13 +0000 Received: from DM6NAM12FT050.eop-nam12.prod.protection.outlook.com (2603:10b6:3:116:cafe::be) by DM5PR19CA0062.outlook.office365.com (2603:10b6:3:116::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19 via Frontend Transport; Thu, 23 Dec 2021 06:06:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;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 DM6NAM12FT050.mail.protection.outlook.com (10.13.178.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:06:13 +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 1BN66D5H021540 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:06:14 -0800 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; Thu, 23 Dec 2021 07:06:12 +0100 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; Thu, 23 Dec 2021 07:06:12 +0100 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; Thu, 23 Dec 2021 07:06:12 +0100 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 1BN64aH8010649; Thu, 23 Dec 2021 07:05:08 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN64ZY3010632; Thu, 23 Dec 2021 07:04:35 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 02/15] phy: cadence: Sierra: Prepare driver to add support for multilink configurations Date: Thu, 23 Dec 2021 07:01:24 +0100 Message-ID: <20211223060137.9252-3-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: 8c5e95b3-8d29-4ec1-13bb-08d9c5da52dc X-MS-TrafficTypeDiagnostic: DM6PR07MB5290:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:595; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0EElkO21SLmsfJ6Ze+JU53rB5voABJOmesL0RAn5ozxmmZK2GAErI9LnLMKyRUwbTdZbOSev3iHFdRinh2LM8LPhG/z11hEkEAfAfLAgcpxr9s+aEU7diV18wSc1MqXt++2nDxBEeeisuiX/7XEP6kZpIE+TDr8TEAZ51Gr+qvlc1Wo6qarWEFjmQOTx+gxMMx33sc1jhwHxTzXvnGZneR0jELw8QP0qlney8QFkVjn6SkGjFHL6hwcPV18Qgqhg+maRjoaMagepU8ZgCs2J6u5HOkeZH7A1X9RmHQPqsb48OhFDouzgBy20fvDtHxuilVC4HGR4y1GAz3DlZBYvKwPeqfwfXsnw4tRD9XKYoPlwplM9f0X+RG3ZPwU05sIUmbaNl3kgAVeWcpjDPEmAYGzzW7qPOPpFuDkTgpXfzvlwvCG7/d++fjvsZd8r5M5a55uyvctWoJdWbtdsLtxUpqbfHNgvpEv8JX0Y56kL8CGzY+/MNyyvRGMu2rECBfjwmSGQ2nnWLc9Ro5wgOzfUtH3xrU5pYOtVtLOXAOZ84gIdFpxi1JY4s6HrX2EW57tzy3tc7WKduI361xIZtumKYjiqqjmBz05wQ4TzpGS6bmklJ0c2vzf1/kO2g63JoIxgh5y8Ehos2LiAfdL0I0B8y5AMleO1Ap/jrBXH1mMZeBNwqAlngsjaAEzWVgDSofP5vOOAtr7bTFw9g13SpxgH9Xq7+9XCdWewB4eHJDcpu6dk0iET7BjzfZgjI+dNGhaiPlBOgQcto31yeme/oq4sjIvoaOqBcxcfREcRNSzv97U= 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)(40470700002)(36860700001)(8676002)(42186006)(316002)(508600001)(47076005)(336012)(7636003)(70206006)(70586007)(2906002)(19627235002)(4326008)(86362001)(83380400001)(40460700001)(356005)(110136005)(2616005)(6666004)(54906003)(426003)(36756003)(5660300002)(26005)(8936002)(82310400004)(1076003)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:06:13.2395 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c5e95b3-8d29-4ec1-13bb-08d9c5da52dc 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: DM6NAM12FT050.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB5290 X-Proofpoint-ORIG-GUID: K1yuaH5fVc-8ec8dIH6aWMbLcQqIdt-3 X-Proofpoint-GUID: K1yuaH5fVc-8ec8dIH6aWMbLcQqIdt-3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230034 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_220618_923523_81390310 X-CRM114-Status: GOOD ( 22.16 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Sierra driver currently supports single link configurations only. Prepare driver to support multilink multiprotocol configurations along with different SSC modes. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju --- drivers/phy/cadence/phy-cadence-sierra.c | 195 ++++++++++++++++------- 1 file changed, 139 insertions(+), 56 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 54d1c63932ac..c82ac6716f5e 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -23,6 +23,9 @@ #include #include +#define NUM_SSC_MODE 3 +#define NUM_PHY_TYPE 3 + /* PHY register offsets */ #define SIERRA_COMMON_CDB_OFFSET 0x0 #define SIERRA_MACRO_ID_REG 0x0 @@ -217,9 +220,21 @@ static const int pll_mux_parent_index[][SIERRA_NUM_CMN_PLLC_PARENTS] = { static u32 cdns_sierra_pll_mux_table[] = { 0, 1 }; +enum cdns_sierra_phy_type { + TYPE_NONE, + TYPE_PCIE, + TYPE_USB +}; + +enum cdns_sierra_ssc_mode { + NO_SSC, + EXTERNAL_SSC, + INTERNAL_SSC +}; + struct cdns_sierra_inst { struct phy *phy; - u32 phy_type; + enum cdns_sierra_phy_type phy_type; u32 num_lanes; u32 mlane; struct reset_control *lnk_rst; @@ -230,18 +245,19 @@ struct cdns_reg_pairs { u32 off; }; +struct cdns_sierra_vals { + const struct cdns_reg_pairs *reg_pairs; + u32 num_regs; +}; + struct cdns_sierra_data { - u32 id_value; - u8 block_offset_shift; - u8 reg_offset_shift; - u32 pcie_cmn_regs; - u32 pcie_ln_regs; - u32 usb_cmn_regs; - u32 usb_ln_regs; - const struct cdns_reg_pairs *pcie_cmn_vals; - const struct cdns_reg_pairs *pcie_ln_vals; - const struct cdns_reg_pairs *usb_cmn_vals; - const struct cdns_reg_pairs *usb_ln_vals; + u32 id_value; + u8 block_offset_shift; + u8 reg_offset_shift; + 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] + [NUM_SSC_MODE]; }; struct cdns_regmap_cdb_context { @@ -341,10 +357,14 @@ static int cdns_sierra_phy_init(struct phy *gphy) { struct cdns_sierra_inst *ins = phy_get_drvdata(gphy); struct cdns_sierra_phy *phy = dev_get_drvdata(gphy->dev.parent); + 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; + const struct cdns_reg_pairs *reg_pairs; struct regmap *regmap; + u32 num_regs; int i, j; - const struct cdns_reg_pairs *cmn_vals, *ln_vals; - u32 num_cmn_regs, num_ln_regs; /* Initialise the PHY registers, unless auto configured */ if (phy->autoconf) @@ -352,28 +372,26 @@ 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); - if (ins->phy_type == PHY_TYPE_PCIE) { - num_cmn_regs = phy->init_data->pcie_cmn_regs; - num_ln_regs = phy->init_data->pcie_ln_regs; - cmn_vals = phy->init_data->pcie_cmn_vals; - ln_vals = phy->init_data->pcie_ln_vals; - } else if (ins->phy_type == PHY_TYPE_USB3) { - num_cmn_regs = phy->init_data->usb_cmn_regs; - num_ln_regs = phy->init_data->usb_ln_regs; - cmn_vals = phy->init_data->usb_cmn_vals; - ln_vals = phy->init_data->usb_ln_vals; - } else { - return -EINVAL; - } - regmap = phy->regmap_common_cdb; - for (j = 0; j < num_cmn_regs ; j++) - regmap_write(regmap, cmn_vals[j].off, cmn_vals[j].val); + /* PMA common registers configurations */ + pma_cmn_vals = init_data->pma_cmn_vals[phy_type][TYPE_NONE][ssc]; + if (pma_cmn_vals) { + reg_pairs = pma_cmn_vals->reg_pairs; + num_regs = pma_cmn_vals->num_regs; + regmap = phy->regmap_common_cdb; + for (i = 0; i < num_regs; i++) + regmap_write(regmap, reg_pairs[i].off, reg_pairs[i].val); + } - for (i = 0; i < ins->num_lanes; i++) { - for (j = 0; j < num_ln_regs ; j++) { + /* PMA lane registers configurations */ + pma_ln_vals = init_data->pma_ln_vals[phy_type][TYPE_NONE][ssc]; + if (pma_ln_vals) { + reg_pairs = pma_ln_vals->reg_pairs; + num_regs = pma_ln_vals->num_regs; + for (i = 0; i < ins->num_lanes; i++) { regmap = phy->regmap_lane_cdb[i + ins->mlane]; - regmap_write(regmap, ln_vals[j].off, ln_vals[j].val); + for (j = 0; j < num_regs; j++) + regmap_write(regmap, reg_pairs[j].off, reg_pairs[j].val); } } @@ -583,15 +601,28 @@ static int cdns_sierra_clk_register(struct cdns_sierra_phy *sp) static int cdns_sierra_get_optional(struct cdns_sierra_inst *inst, struct device_node *child) { + u32 phy_type; + if (of_property_read_u32(child, "reg", &inst->mlane)) return -EINVAL; if (of_property_read_u32(child, "cdns,num-lanes", &inst->num_lanes)) return -EINVAL; - if (of_property_read_u32(child, "cdns,phy-type", &inst->phy_type)) + if (of_property_read_u32(child, "cdns,phy-type", &phy_type)) return -EINVAL; + switch (phy_type) { + case PHY_TYPE_PCIE: + inst->phy_type = TYPE_PCIE; + break; + case PHY_TYPE_USB3: + inst->phy_type = TYPE_USB; + break; + default: + return -EINVAL; + } + return 0; } @@ -1006,6 +1037,16 @@ static const struct cdns_reg_pairs cdns_pcie_ln_regs_ext_ssc[] = { {0x44CC, SIERRA_CREQ_EQ_OPEN_EYE_THRESH_PREG} }; +static struct cdns_sierra_vals pcie_100_ext_ssc_cmn_vals = { + .reg_pairs = cdns_pcie_cmn_regs_ext_ssc, + .num_regs = ARRAY_SIZE(cdns_pcie_cmn_regs_ext_ssc), +}; + +static struct cdns_sierra_vals pcie_100_ext_ssc_ln_vals = { + .reg_pairs = cdns_pcie_ln_regs_ext_ssc, + .num_regs = ARRAY_SIZE(cdns_pcie_ln_regs_ext_ssc), +}; + /* refclk100MHz_20b_USB_cmn_pll_ext_ssc */ static const struct cdns_reg_pairs cdns_usb_cmn_regs_ext_ssc[] = { {0x2085, SIERRA_CMN_PLLLC_LF_COEFF_MODE1_PREG}, @@ -1113,32 +1154,74 @@ static const struct cdns_reg_pairs cdns_usb_ln_regs_ext_ssc[] = { {0x4243, SIERRA_RXBUFFER_DFECTRL_PREG} }; +static struct cdns_sierra_vals usb_100_ext_ssc_cmn_vals = { + .reg_pairs = cdns_usb_cmn_regs_ext_ssc, + .num_regs = ARRAY_SIZE(cdns_usb_cmn_regs_ext_ssc), +}; + +static struct cdns_sierra_vals usb_100_ext_ssc_ln_vals = { + .reg_pairs = cdns_usb_ln_regs_ext_ssc, + .num_regs = ARRAY_SIZE(cdns_usb_ln_regs_ext_ssc), +}; + static const struct cdns_sierra_data cdns_map_sierra = { - SIERRA_MACRO_ID, - 0x2, - 0x2, - ARRAY_SIZE(cdns_pcie_cmn_regs_ext_ssc), - ARRAY_SIZE(cdns_pcie_ln_regs_ext_ssc), - ARRAY_SIZE(cdns_usb_cmn_regs_ext_ssc), - ARRAY_SIZE(cdns_usb_ln_regs_ext_ssc), - cdns_pcie_cmn_regs_ext_ssc, - cdns_pcie_ln_regs_ext_ssc, - cdns_usb_cmn_regs_ext_ssc, - cdns_usb_ln_regs_ext_ssc, + .id_value = SIERRA_MACRO_ID, + .block_offset_shift = 0x2, + .reg_offset_shift = 0x2, + .pma_cmn_vals = { + [TYPE_PCIE] = { + [TYPE_NONE] = { + [EXTERNAL_SSC] = &pcie_100_ext_ssc_cmn_vals, + }, + }, + [TYPE_USB] = { + [TYPE_NONE] = { + [EXTERNAL_SSC] = &usb_100_ext_ssc_cmn_vals, + }, + }, + }, + .pma_ln_vals = { + [TYPE_PCIE] = { + [TYPE_NONE] = { + [EXTERNAL_SSC] = &pcie_100_ext_ssc_ln_vals, + }, + }, + [TYPE_USB] = { + [TYPE_NONE] = { + [EXTERNAL_SSC] = &usb_100_ext_ssc_ln_vals, + }, + }, + }, }; static const struct cdns_sierra_data cdns_ti_map_sierra = { - SIERRA_MACRO_ID, - 0x0, - 0x1, - ARRAY_SIZE(cdns_pcie_cmn_regs_ext_ssc), - ARRAY_SIZE(cdns_pcie_ln_regs_ext_ssc), - ARRAY_SIZE(cdns_usb_cmn_regs_ext_ssc), - ARRAY_SIZE(cdns_usb_ln_regs_ext_ssc), - cdns_pcie_cmn_regs_ext_ssc, - cdns_pcie_ln_regs_ext_ssc, - cdns_usb_cmn_regs_ext_ssc, - cdns_usb_ln_regs_ext_ssc, + .id_value = SIERRA_MACRO_ID, + .block_offset_shift = 0x0, + .reg_offset_shift = 0x1, + .pma_cmn_vals = { + [TYPE_PCIE] = { + [TYPE_NONE] = { + [EXTERNAL_SSC] = &pcie_100_ext_ssc_cmn_vals, + }, + }, + [TYPE_USB] = { + [TYPE_NONE] = { + [EXTERNAL_SSC] = &usb_100_ext_ssc_cmn_vals, + }, + }, + }, + .pma_ln_vals = { + [TYPE_PCIE] = { + [TYPE_NONE] = { + [EXTERNAL_SSC] = &pcie_100_ext_ssc_ln_vals, + }, + }, + [TYPE_USB] = { + [TYPE_NONE] = { + [EXTERNAL_SSC] = &usb_100_ext_ssc_ln_vals, + }, + }, + }, }; static const struct of_device_id cdns_sierra_id_table[] = { From patchwork Thu Dec 23 06:01:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B19EC433EF for ; Thu, 23 Dec 2021 06:08:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SUFWBUThkejhlp454/bk+gmMsn/pf+kDiJB26/yF7/Y=; b=TbgP3eaGBNCzb1 oH0NyOc3qq/9PA9GAc+zmxT3JhtfYKKdtUi/gsFaqaKBfUS+wjmeSniEN0r/Z1ZDKolCj9RPB6RAg tCTnN70g9I6G3lMgElaV17qskRKBnr0nI11OJnXrZJfK7BTCS4FPR7XfBBtmp/a+P4jzkAnR7bFpd blYEeTjG52f4fm7GxquQ+B/CWgVeWMjovpQrxmwoOhsH/BBaeO8c7n+NMvMuAA15LQOmdGyMaGGik BQj33U/hI/a2aFT+qZLOp9ESu7JsiQ4SmU4vZHhvelrEnOWBexwuM6zYiG7JVe5d/k92R6QPtxf0y 0PaIXvUmF1+Vv3yKw8rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HH0-00BuZT-RL; Thu, 23 Dec 2021 06:08:18 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HGy-00BuZ4-Q2 for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:08:18 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN3mvTg005509; Wed, 22 Dec 2021 22:08:13 -0800 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=2pfTm9eMx8rDFS/G1HRRvMPJRstkV53qxgoEbhf52u0=; b=WxAwJ85iB/J3TOT+6Md9N40gFZkSdv8seDkYhn5qI0zIArPWrcH/tKeOi2zKQbv0Lnx8 ukcI+eGpJWgr8/X/c6HBbMMgyJndqWnvEWFX1HUKJ1QrvSNN7VZyPSTNYpsSg2BcJea/ L6c8v1ox2FrAAxjeYbuHTqWT5b+C2IWb3436BWV3Dy1j504mLxze93cVFSZhF6bsNgGZ 4iWjPKjS2z8cypEyRMoKi3GTfBaCWukk7BkPuIweQ8qbTKpufR/1KrXqKzw+FMFn8h90 mgbl5UrWeF7EY7QIQd/NRc4wP/ZdQZCCtfuki5LRvTFfa0BJcpYcopuhYEtYZ5x3LvA6 BA== Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvk1b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:08:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GNcNMgxJnvSr6VFj1RMRRe6fgC6Tjpg0JWjpuLn6mLbCkN9C47an5kSefA1Zv4aHuXD1vGfL3nzN5dTDLDnycmNcZAT2DlumboO2x/CRElG6YBNpq6jabE7PuV/nuzhp/bGy0svwSPdky81aDwkPTFmqsNfCdgTM3PYHqaOTGhV+ZfnIJ+rheJM29n/FI3XAlw49+c6y+1UKHYrnI8s06fmA0T4D36Q0o7XufI26BJ+qJmj8R3gL635a0eOorVJCRh9G9jVqDC4lcQeo3seq4JQQ20+uNLZJ+xxVEAaXwPSnX4JaCtJn9VjzAZDnTfoSqyRJB31W0YtU7TsvH0FpDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2pfTm9eMx8rDFS/G1HRRvMPJRstkV53qxgoEbhf52u0=; b=lqIqV7XxCn7IajX6jp3J8+iwjAGDzXMLL6PQ/t/YDMJGZ0yH+LfPEFKdGO0Wynse+8BLIh4MMO/Ir4kxd/5vBdvMed40DgH/twvuoRVdoVXED6FiqyII4OsaJH75LxI1h3sgr70wb1mVOHbtriG0kGvKBBNjH8wPk20BfvIRP1igcazgTEBqRTkNn2w1f0Fg/M3jx7ZUYvw/kKXaKXxwA8ahSlKfhWGTqT7P3oSPllvJHE5ErrTqxCz+nBo3HlMsGTxEfkj1ylHqAZXk2PHTJKOKQ0QRVd2Bad4VdtA0TjXL4LQ0ZsxQJ/H1K34kdN117/dwY/rqfONdXNZiyT3z5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.147) 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=2pfTm9eMx8rDFS/G1HRRvMPJRstkV53qxgoEbhf52u0=; b=2p7tHVFY7X4Vxv23hlWRQM6zaW5kD1mS73Sgjf8GCQ/hz6id/W4tM3eR/Wzos+Q5wyZYf5maovjY4I6nzXiLAOeo7XtT1Kv7EO9y3fdqlhLqpVTHlsfqA+WsP6dcHHzDMi3leGFECZ47Pcms+G8e53fJcAyJlw3WQdywJZnJW7k= Received: from BN8PR12CA0031.namprd12.prod.outlook.com (2603:10b6:408:60::44) by CH2PR07MB6757.namprd07.prod.outlook.com (2603:10b6:610:21::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 23 Dec 2021 06:08:11 +0000 Received: from BN8NAM12FT042.eop-nam12.prod.protection.outlook.com (2603:10b6:408:60:cafe::78) by BN8PR12CA0031.outlook.office365.com (2603:10b6:408:60::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.16 via Frontend Transport; Thu, 23 Dec 2021 06:08:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.147) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.147 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.147; helo=sjmaillnx1.cadence.com; Received: from sjmaillnx1.cadence.com (158.140.1.147) by BN8NAM12FT042.mail.protection.outlook.com (10.13.182.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:08:10 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 1BN68AIN018761 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:08:11 -0800 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; Thu, 23 Dec 2021 07:07:57 +0100 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; Thu, 23 Dec 2021 07:07:57 +0100 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; Thu, 23 Dec 2021 07:07:57 +0100 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 1BN664pb013494; Thu, 23 Dec 2021 07:06:36 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN664vN013450; Thu, 23 Dec 2021 07:06:04 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 03/15] dt-bindings: phy: cadence-torrent: Rename SSC macros to use generic names Date: Thu, 23 Dec 2021 07:01:25 +0100 Message-ID: <20211223060137.9252-4-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: c652750b-2039-4101-8fee-08d9c5da98f5 X-MS-TrafficTypeDiagnostic: CH2PR07MB6757:EE_ 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: 4wRTqfB1vc3vL57ReK3yumavAEviXWtu9+3dLkicwBlqKhxrCe4azMoNj/p0frpFfKQhtkcphAuzILCcGh7QDMOkVslySUXrAvDwqhKbEZSrZE+h4x+++Xl681Ak0imhNyVf4wN84UMhD/j4+otWAsbdz8Oxfr6SrR3iWF6hRlodKp6r8Kj8Xssz+rsB/T2g+oJ22janf0vwh8f0SuL8W0JmM3tEoDNCrN1AiS5QC+7x/RTCJJ7U1A94K6vQ3AvZMnrzBfZfePYfUI2YmWmJFoaWOfKbDh7hBydBP6rlxIUExhX8JHJGdYZuB9wd137XeTEEXIS8nOy3QqtBmZGh1PcrYi5Gtx0u/b21iUxS9Glk5DkAGlLBaOoIVoR/a/O1jg2Gz490Al/bk0OsI+i3AkmguVhaIx4H5BflLokNjrz3Yv+nyF4kA2x7JWza+NpEtzadCVeganiIH43k4mOjq/grHo86hGVoxW8Pt4sO/KygaRR0dlT3JwCbQHdgTW2Vg2TLr3n8JZIYSjJE53KppfphoFIR4Au3JLCsJd7bnZyL3nyvGefOJrCWIN91iHn+OJvHMBfag7u2Q4W8tB1XnU9q1If7YHAs2ktPdWZy4qJXCyXSPk8rIg35uX/Wk+Fqw2zxIuUhe6nOZcYs6QisTz+wu6v0st+GJKGBgfIcAIKkzo2EPS6ONJtiRWU7O6IORUCrk7dVmFX+844HeiHVIa11ZcidfZOFQRev8ZCh2Y3sm4Zbj4rfwNtzw7HHf8gRchb5hYAP06B7sxp0ZcoxvVM8tdZhxA/8/uA6YffIara5l84Vi18uU0gtFgln23TO X-Forefront-Antispam-Report: CIP:158.140.1.147; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx1.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(36092001)(46966006)(40470700002)(36840700001)(1076003)(70586007)(5660300002)(508600001)(70206006)(4326008)(7636003)(2616005)(36756003)(356005)(26005)(6666004)(83380400001)(8676002)(186003)(336012)(426003)(8936002)(42186006)(47076005)(54906003)(316002)(86362001)(36860700001)(110136005)(40460700001)(2906002)(82310400004)(41533002); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:08:10.8002 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c652750b-2039-4101-8fee-08d9c5da98f5 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.147]; Helo=[sjmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT042.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR07MB6757 X-Proofpoint-ORIG-GUID: bkW7P8M4WwMAtzpcruuQK6xWTrsgf3se X-Proofpoint-GUID: bkW7P8M4WwMAtzpcruuQK6xWTrsgf3se X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=778 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230034 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_220816_883159_1EB09067 X-CRM114-Status: GOOD ( 16.12 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.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 24fdc9e11bd6..d55fe6e6b936 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 #define CDNS_TORRENT_DERIVED_REFCLK 1 #define CDNS_TORRENT_RECEIVED_REFCLK 2 From patchwork Thu Dec 23 06:01:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697936 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B24CC433F5 for ; Thu, 23 Dec 2021 06:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ck8flZL1GnaKLEBgkybSWBg/CMEKhELIpD08ex+TcgI=; b=kWwLwoWGryNGzh +z4+opCvFDu0o1WNfHYfSRz1zElBk1KVK+X4xbX//Cx9PPTzVn1gaLVqh9q/gyFhQK7CW8ATxyduf MDq/SzcwQOOwrX9sNMfuqB0wG/HNRhwat9IJfz4V3jR1XyvlKiJcQv21kXFvEfyPZHooZyrUFTXXb 3tlNh15uJpifOv0tBf594YMaQu88z4Y3xO0dmDB3hKnzfWQ5sTciNNP0lpEnmqq2UX4UUYwY8S8yV 0YWX+NEU4uPNqd0g93vL2XbzfLW+r3BMgmXYvZS5NF9s32bQ21go6gb8FVN0yV9t8Gx3pnoxfHKTE I4DjoEJxmPGYSje388fQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HIg-00BufP-27; Thu, 23 Dec 2021 06:10:02 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HId-00Buew-RM for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:10:01 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN3qOP8005437; Wed, 22 Dec 2021 22:09:57 -0800 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=LxhFqcql4Dg9Uel4uwEVR1Th6ctjD9b+FSHFKo8jkCk=; b=VhkE5cBR8g2ewws8KSQMZAG1xkXg+n47TKu8dJ0OD2DUOXy/NIYqZoh7r1jAr0I9cFTo xqKIkwqiG21WaMwWfpI6MsDxAFihz7atDBKnd6mfCTcVujVHIajrMwg5MWiGuGA1g3U7 cQE0+3TT8YLJV5+a8W/ImTUtoeEUhTvk3kjOciOqROvBpKQvLMwjVdLfe5syLmehtIz9 FqA12+kM38FU7/BTK5o8sSfP9dY+qpUuy3t/7OoCDwgYKs0k7RRdXCxj4RuvnhnPx5lv GiUn7EV6AjGILC+4wHqgqdb3lwUx7SPd3MuE32OIfMGCRbjZ6s4LlTdJoTSjwiLQKr+I 7A== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvk7a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:09:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rjxijnf5mR+za2hvL2wI+vG3RqO1BYRBmwTHnd8ijDYEvhheeaiFF0cMaY+Drjwt+bLfrq6l5j0z16RJ8XaWpt66v2aLoqfb77ypnDrIpLWNXD0G9/rwc30ZF4dWzAnjVC33Fxn8LRLrFf7RpsqSvcXyRFfrmjEii5jaw6LztOR+ezc4iTN6LDjMMsvq9nRgBahkyXej73FP3Jes/gpKVwlAdv2PcsiS1yuoOIO4fjG5PzlJpqHIMOJVhBijaNSXnKSZ+fiUNvOukOaZuZRphq7Kab2JT7p/9Kj7gYfzCZgKTxRTBsv2RsHWIbjH1nF4iTjMncZLCU5nmR6+W0+DaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LxhFqcql4Dg9Uel4uwEVR1Th6ctjD9b+FSHFKo8jkCk=; b=lVuvpB0y9RC07ctsxr7dmkXG9Rhi+xzgNlIui1XzkDPAd59UrsI874zeh3HyTNw2lMi0/lgW9ArUGuC/q/GB6kdYKldF+LlaEfsoD9eb/RAmRMVacRqExXH/sd8GddvG5iMawPxvQttVSAtnoVnrXltlrxlRLeUx9reAj/0RHNQxuS/KFhN+uokS3azLDCO52ean4LZSOw+ub9REKCR5JGLfqSK4HnuTORi9irUIongvt74fcHcqEYTaAqjlk6Vyen8ZjoKBdK0sBXcgCL+UZ6kAFdt2/3/1UVeBRW9xw9HWwOIdVYsOkFzIwN+A1wMrFs8cHLmWddAR6rtyP4SirQ== 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=LxhFqcql4Dg9Uel4uwEVR1Th6ctjD9b+FSHFKo8jkCk=; b=dkPLIGcdLh7InZDwVsmQh/J/V62hXod/AoAGQTi0uSQPZxPe4/ycegIrXfnTXN2u/UtWTjRlGJMNixpAySLupoWkwuruXjsquMnzdoscIIeDh+9YygCVJvNhrNSp9+9Tq4h/21POjkp4B9etnzz1hNV8iV3JsE9QzmWj2Kk2YAU= Received: from BN6PR13CA0021.namprd13.prod.outlook.com (2603:10b6:404:10a::31) by CH2PR07MB6597.namprd07.prod.outlook.com (2603:10b6:610:2c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.17; Thu, 23 Dec 2021 06:09:51 +0000 Received: from BN8NAM12FT010.eop-nam12.prod.protection.outlook.com (2603:10b6:404:10a:cafe::c9) by BN6PR13CA0021.outlook.office365.com (2603:10b6:404:10a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.18 via Frontend Transport; Thu, 23 Dec 2021 06:09:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;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 BN8NAM12FT010.mail.protection.outlook.com (10.13.182.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:09:51 +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 1BN69o4j021863 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:09:51 -0800 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; Thu, 23 Dec 2021 07:09:25 +0100 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; Thu, 23 Dec 2021 07:09:25 +0100 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; Thu, 23 Dec 2021 07:09:25 +0100 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 1BN67n1e016075; Thu, 23 Dec 2021 07:08:21 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN67n4S016074; Thu, 23 Dec 2021 07:07:49 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 04/15] dt-bindings: phy: cadence-sierra: Add binding to specify SSC mode Date: Thu, 23 Dec 2021 07:01:26 +0100 Message-ID: <20211223060137.9252-5-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: d0c5753a-ec23-4a30-8de8-08d9c5dad4e9 X-MS-TrafficTypeDiagnostic: CH2PR07MB6597:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1peBVXcCpGI9h3yyKV793qtTAu/B/NHOPfCJcnzn2Ga/6Alj7PKHQEoZ4XLzwOuGKROZriaHf5RD37aVOCtMcTHoCjZPjTo0j3fDegT845zphnYUBePulwu8xwJy+Gek2Itol2WBVngHWM0dh5+PRmzvmgM7IaMlB7wRG6+yyGRPKqteL3aIJLaaGaF3eP99WtXheTRm6BXVh+Zp8/fn3byRsrwfcMOw5qN51S+00n3ytiJM5h6UdGi3OGjI1857RqdLtjnVPbsvDxICK0KOTO/fkqDs5LOwNkCieUgmThf2y36lavDdJUsJyXq3uvGAMUeyIB+UXkNy2YngNLF6cCVABdtcPqqvfbdslIUPM4jBYdRbJkDpTzKDoC5wIC6fq02COG2fzdwj+dqMgftoqqotS8/+KQP9qzSJS6B06w6YXnvirsN+JjSnT/QgJ6eUEvWNlVyXGIBbgiLYq2mZAPsNZOJtIYk7GLqCQE9rUA2D4+uo/MbPmjchITtjWBlzGnpw3FTgCtR0mcJJfPnrKT4Wrm8kBmQsnt8/cFImtcg/9ov+A3sq97iUPVObvxQ5QYudDZ0HvzO3ZpUIkcGjFdXg0OU2Lgjp6CivYUwvcN2+FXxecjMrTJqPwdPJ9a93/B8On1GEQF3bouKo2eXGvBARjnSrw2oaza/sqnrCK92uJQTaFF58AUtfb9K24x9RuSlNvR++ueS6AwtOdwoH5bhpldZvF1DtiC/0aoEhdJZHFuDQqoH82s+F/eZ+q6baJ3a6DUpcErlya3zeLahLMNEyN3auE1r9+fqMGas5k1Y= 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)(40470700002)(36840700001)(46966006)(36860700001)(36756003)(5660300002)(186003)(1076003)(70586007)(4744005)(40460700001)(83380400001)(26005)(7636003)(2906002)(356005)(336012)(86362001)(4326008)(508600001)(6666004)(42186006)(47076005)(8936002)(316002)(426003)(8676002)(70206006)(110136005)(54906003)(82310400004)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:09:51.3848 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0c5753a-ec23-4a30-8de8-08d9c5dad4e9 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: BN8NAM12FT010.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR07MB6597 X-Proofpoint-ORIG-GUID: vzzDXM635vdlbk8IqQtwF_sdB8M44a8f X-Proofpoint-GUID: vzzDXM635vdlbk8IqQtwF_sdB8M44a8f X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230034 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_220959_918941_D0D2203A X-CRM114-Status: GOOD ( 11.16 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add binding to specify Spread Spectrum Clocking mode used. Signed-off-by: Swapnil Jakhade Reviewed-by: Rob Herring --- .../devicetree/bindings/phy/phy-cadence-sierra.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-sierra.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-sierra.yaml index e71b32c9c0d1..a9e227d8b076 100644 --- a/Documentation/devicetree/bindings/phy/phy-cadence-sierra.yaml +++ b/Documentation/devicetree/bindings/phy/phy-cadence-sierra.yaml @@ -113,6 +113,15 @@ patternProperties: minimum: 1 maximum: 16 + cdns,ssc-mode: + description: + Specifies the Spread Spectrum Clocking mode used. It can be NO_SSC, + EXTERNAL_SSC or INTERNAL_SSC. + Refer include/dt-bindings/phy/phy-cadence.h for the constants to be used. + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 2] + default: 1 + required: - reg - resets From patchwork Thu Dec 23 06:01:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697937 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B8CDC433F5 for ; Thu, 23 Dec 2021 06:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Jie25RC5SbWL5e668oPTGzf6AgxRZcgmr3R7BEFkzfI=; b=AenxR1maI5ehFm k4aRA9aaynaVTcbAJg4P3eZVzCV5KSDd8Dkwyv7ihQ0+lY4UZkM5fdVZcHo1X//19fw5uLREeTc2L 2OAVgOU05/q7Oj/YYwpMVG+JxwPXSCkYnqejtkGj7m7ZQZhvRa0qvyizs/CLwwjuRJImgXH3WqwA9 jZTw3Du4Yq4NnRGAgyooFSOgSDEO6gxPJHb1CwX+w9AQEg82iWXPkpwamIxLZXZydA+8R+2o8PkLe 5e97i5+cGHLUkeFwPemn4/K0iJkL7ufdAvCH1Zd3/H68Hm+ZwZR5p0f1z01VN36/JwRDvdc2i4Vwe g1PiAjuJI4C0fJDSDTDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HJw-00Buqr-Ho; Thu, 23 Dec 2021 06:11:20 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HJu-00Buq7-Ch for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:11:19 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN3qOPO005437; Wed, 22 Dec 2021 22:11:16 -0800 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=lJ9APA/34eI5B9CvFGyKfrTut9E+AyzRIvFFkYvjYaI=; b=qQOQYWQkMV2XafP0tanTKtc1IqKlyglJqtdFSD7gE5RBOqi2jo2ydCgXB9GbNZ5t5xVI dAif69UPhJBFjmMST4v2F565DoIOmOg/lU+IXgCCAyQEPojOztYE15354d3XabN2K7dj gJ4ECOc/S9oV7KefbPDjsSDSs15PXN0GPFVj1A4aWwDhiEA+aan1OgdEB2IQrwF5YHN/ S8i4Nl5caXs9DqkLRV7cjQxn3w15ru+G0zCsRAf/XtszYBioqNu+f077F4AxwhBaqjfv AqLtktVmMWR71qVkPFSFc372V2MtlwKuibD0Yd233SKSIcXiIb64otI4iZZ2W1/SZuuZ Wg== Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2172.outbound.protection.outlook.com [104.47.55.172]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvkat-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:11:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e6/C2aIaAAdBXtERqAZ7KqgL6oRcdpAhwM/hDpV8BSokezfETE20OvMMgho7xldex2EGZGV5EwILmpP5TS3vcaCItbu6518WZa/dR9Og7U7ZwjBcoKSXEDWFkIX8J9MPcF/s7ROzcCUpFKG37x7J3C5aldAL2XcTtdcC7n8C0SBeff3/FfYJRv2QkF8sl/V7U/5gF7Ch+mhVdllvX5rTQdNQVSkHd8VETyNKzD5aAadtnmGKietFi/yps9w3RQN2iHRSyFnhDnWQUZ3kuyFI+jxc7NQo7OAj5YPXI7eRst7ga8p7nCPxEdy15Hf/THNf+lQkTS2yzNN4lNrcgoVHKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lJ9APA/34eI5B9CvFGyKfrTut9E+AyzRIvFFkYvjYaI=; b=XL2jvHmzSJwlFxJapSgGIfI2BSLL6+85+EGBvYZKmCrFH6XZ1hsUTH37E2Vse4hJyJFIxJGgBb8+7ymAmqY0MZmNNo4vKf1UcnBoO9cHlDPFOnR17N0onWuQviXnrdp05sWuWefv4+s9/arBThnwDHuyFxzkdH7cwc8kMTVSZPyHfgS+QVNnDxHoUccn0O4O38RxLotWKTWYtVzVcwweUdT6OJR2COtr8Pi3MP1XimlZbE9K7ZFr4eOYRTj9DighCSw2Ckcf9xJipcFQgztHGxy/EGInV09FDDCN7ws3pM2SP39LGR8JkMlCGV173iRyHsITVUgieY3dRGAAxHWamA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.147) 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=lJ9APA/34eI5B9CvFGyKfrTut9E+AyzRIvFFkYvjYaI=; b=OxcdD82uWKsknJh8+dCNzH6c6opj7GCI+vOuFHeVPmeIEYihpnC4lZTrAEKkhQjyRgMfki+mq+6A4mQb4X64jsO0Nn/ypIu8B8PENFvYSWAL1pcVuQ6bcycH+r6BBcG541dmefulfeHi/WAvGopZ3/FwLWXKm8RwAyVbcNDz5tk= Received: from DM6PR02CA0101.namprd02.prod.outlook.com (2603:10b6:5:1f4::42) by CO1PR07MB9066.namprd07.prod.outlook.com (2603:10b6:303:151::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.18; Thu, 23 Dec 2021 06:11:13 +0000 Received: from DM6NAM12FT020.eop-nam12.prod.protection.outlook.com (2603:10b6:5:1f4:cafe::1d) by DM6PR02CA0101.outlook.office365.com (2603:10b6:5:1f4::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.17 via Frontend Transport; Thu, 23 Dec 2021 06:11:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.147) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.147 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.147; helo=sjmaillnx1.cadence.com; Received: from sjmaillnx1.cadence.com (158.140.1.147) by DM6NAM12FT020.mail.protection.outlook.com (10.13.179.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:11:13 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 1BN6BD5N018996 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:11:14 -0800 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; Thu, 23 Dec 2021 07:11:06 +0100 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; Thu, 23 Dec 2021 07:10:53 +0100 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; Thu, 23 Dec 2021 07:10:53 +0100 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 1BN69Hic016570; Thu, 23 Dec 2021 07:09:49 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN69HnR016569; Thu, 23 Dec 2021 07:09:17 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 05/15] phy: cadence: Sierra: Add support to get SSC type from device tree Date: Thu, 23 Dec 2021 07:01:27 +0100 Message-ID: <20211223060137.9252-6-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: d1de8848-7d5b-43e8-6bc3-08d9c5db05bc X-MS-TrafficTypeDiagnostic: CO1PR07MB9066:EE_ 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: H0whvJuu6XwWop27eqcomW4c7YzvqEhq6atc/PBwDFp3mGplRYXX2tLawCJzK6frtw+6ozqTd7D62zRq0vp9yvrpIdjaMlx6biBUjBhzt0AmkLV4Zzr6R9nK2AHJ1Cby/rVhqvdp73LSvrnm5apQmEPWDxwiaYpEwERNUieuevt9wnLoKIv3fQyUZ0CiwwKJFW/D/u/k9Hs+icFdZqFgWUIoMQsis0Jy9tyIEBTGFxg094rkJPeyOCBQrn0PvO5HJh9JUkAQmKvuMRaaf0PhiKN9Z1ZoG++V18nEA6fQntZdRzGPSGWMwER/t/BabVnrNk95+F65ZAAxtavdhbUl4weQdYPpLEn1LZXFyQ9IwzgpAfQJmXlICb4K7mdp5oCQ1iWyUMW/et9ab0AoOC5Pa/IrmztrFtQ+svL7wjeMYHgpBRkliidtp+RqMhCksPOU5gcp5k4rLy+MWAdbVDdi9Qu1p6EfZNYulmWxEi2e1aAosq3HhA9FMGmOEIVkIs2svxh/Nqr6fjgY2xPcVadcxmZB7SDofK7nH1rVVuPgiGbb2UmLlDXT3rxTdBN3eoaBTI27LMmZe/6K/2NFC06CS2woHsKHtMJ8idEGDv5KZWixxHx03zOwvEnwI2VL0BtF995BhUQT+mU1LKXYMdU3Kw41MTubydtKp2R5rqg+rZEyFMWNVXVTpI4Dnq9h1rz5zGtoX3u5VlMBHT/yyt0kgoFXBMVo+Fk9IIeYbd99K2aGcwStXq3vGQ3LMnTmBPSklT7D/HPNjqtI09KnJnf7IoDib1rtFoEECyqSeRPACcE= X-Forefront-Antispam-Report: CIP:158.140.1.147; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx1.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(36092001)(36840700001)(46966006)(40470700002)(186003)(36860700001)(40460700001)(1076003)(6666004)(36756003)(8676002)(47076005)(110136005)(4326008)(82310400004)(5660300002)(336012)(2906002)(26005)(2616005)(426003)(42186006)(86362001)(508600001)(70206006)(70586007)(316002)(7636003)(83380400001)(54906003)(356005)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:11:13.3442 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1de8848-7d5b-43e8-6bc3-08d9c5db05bc 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.147]; Helo=[sjmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT020.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR07MB9066 X-Proofpoint-ORIG-GUID: GzavaDypH6UorfMCMmHL0zKvIh60DDA1 X-Proofpoint-GUID: GzavaDypH6UorfMCMmHL0zKvIh60DDA1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230034 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_221118_465607_D5B7E6AB X-CRM114-Status: GOOD ( 14.57 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add support to get SSC type from DT. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju --- 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 c82ac6716f5e..4674328574f5 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 Thu Dec 23 06:01:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4AAA8C433EF for ; Thu, 23 Dec 2021 06:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Wgr2hn6hQzd/qF3RERATiGRIBWzVu162rh9FJUZm2nk=; b=d4mzGM6iGkijUQ uWNiUKrOR64Sfbs6ZbYR8/Qs85erP+DiKbp1f0LU4Btu8viC41XmE7u1MZI0Xp4sRnTrNzN0z98TM cu+8TKV9698L54DgB36ngYbOnfEDX+MURZnyh4yoaoRX/abwjJLsQE6DJynOV6l5svnL7TP4aE64K OWFRfM1BRd64kC2qF58E3F9jZ7S6pwC+0nar6Ge1NCPWHb8zbxnvgeaL/ST/j8L0a2zNsjafC/yev 5WmDPur8ZgoV9pjzEdT56KrBuYoI/n0iKJJw/Dt5u68yuSK3PtMiz0q8vkfzorc0QtRrg2MKrZy23 +YbFjQF7OhRkYZ/6IOnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HLD-00Bv4D-OM; Thu, 23 Dec 2021 06:12:39 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HLB-00Bv3h-0s for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:12:38 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN3mvUC005509; Wed, 22 Dec 2021 22:12:34 -0800 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=rJ5LvbsV6vF+hIBAZ7qS5ZxOtvz1rhEcV0aiXNdI7sI=; b=Ekrab2UwuaciJf1LZFf6b+CychppYjRgFNJ5+IrH/lgbIBWX13m/XGp5qzouUmyJdH2A 4AjO2aLEtPtfYI7Sz3W+pDoQu9NOg5H8NzpuBiW9KAcMVQNJNdGSQp9OsoOU+N1J0hKM djn8iMvgR8hZGt0gVW38BsMR46i+ZBUbySbqaglQB+HVHxjHFbHXhsvXuNIYCpDPLwQi vu14ZeVKdJV4B+hK6Hr2HOaQUy9XkhANJqxk+9xVYVW5Q1iPmp90UJUqItVYSHeciKjj wqPXmXFktUV1Txtcu7ShHG44zzmpSPdpBvRSgEF0TpGW1SiEeNlNGUkDK0/VidLwB3Qh NQ== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvkdv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:12:34 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=du3zCpAE2qNgLyp2qsERBZ5JbPUVb5fWm92gLGLIOB2uVaRvJcjcyRxHMCpMupnUB80jalMdluHKiC5TyAPFcLovF82bYSJlZfnZOH1cp5v1HYC9HV5msw8pt7kL4jGbt/ycZBoqtnl9g3ruZYN+AxauNUJH0TXFsi7FyP6lC7PIo0mQ0ssAhDplvIknFBAjzT7xJCEUi3rnkPDD3HHAVUyZse26OE7GSjDSwHaejFTJUYbLfSfAIV8ph0IGJA/rZOWbmmOs+eLafQPh3v0BvGh+fXlw7H2j1xfzK/7uTZay2vsqx0Xkl+NY5Tohwu5hFDLCcg6qGtmENwbGQV0NEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rJ5LvbsV6vF+hIBAZ7qS5ZxOtvz1rhEcV0aiXNdI7sI=; b=l49AKE84hXfbkTwKtevwDoRiYRBlTUcHtCZHZKBz5gQQvWmyTx3UAqYRYE4gNHnEtVrlfxtXfgtCffLjjrvWkW5MzSINKfRVIXm1n1Zj49p+r4C0QNLb/VhXZAqqEgJnoh8p/7EFGfiP+EH7f8INA5Xb1TkqB7uSMa7I4sxOOzXyTm2TqlejLTKgih/GPto+xL4h8QFcvQrqnpG4gNeL6vD69tOWQp1LXILImYs47KlzUvz+BTIIKwZhnko/7jLlt/CHSMHdB+K4XNe2POHV01MpQbg2ZaVNZQxC1eEugw/EWcsymu76GsRq07AunHM4bBFelKkICOciMsZBxIM9iQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) 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=rJ5LvbsV6vF+hIBAZ7qS5ZxOtvz1rhEcV0aiXNdI7sI=; b=ZnQE7IT5/FBNwAfb0FEXdujzKIFZ79bvNgZivei2tRFahGohGsFk64KzJ3LvS+R1mIqiKxnzoQvW2zl+9aam6E5tLIFlLfSVA1noPPdb6Wyltb9pE/9VIeJAa6npdAwkY95XkcgQq4+Rkha5lXOjpZVrLC0i7FldAgXsBhz/7wo= Received: from BN0PR04CA0067.namprd04.prod.outlook.com (2603:10b6:408:ea::12) by BL0PR07MB5523.namprd07.prod.outlook.com (2603:10b6:208:89::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.18; Thu, 23 Dec 2021 06:12:31 +0000 Received: from BN8NAM12FT015.eop-nam12.prod.protection.outlook.com (2603:10b6:408:ea:cafe::a3) by BN0PR04CA0067.outlook.office365.com (2603:10b6:408:ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19 via Frontend Transport; Thu, 23 Dec 2021 06:12:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT015.mail.protection.outlook.com (10.13.183.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:12:29 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 1BN6CTu7025278 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:12:30 -0800 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; Thu, 23 Dec 2021 07:12:22 +0100 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; Thu, 23 Dec 2021 07:12:22 +0100 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 1BN6AkKZ017150; Thu, 23 Dec 2021 07:11:18 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN6Ajlp017149; Thu, 23 Dec 2021 07:10:45 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 06/15] phy: cadence: Sierra: Rename some regmap variables to be in sync with Sierra documentation Date: Thu, 23 Dec 2021 07:01:28 +0100 Message-ID: <20211223060137.9252-7-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: 84bf569b-01af-41ec-68a7-08d9c5db335d X-MS-TrafficTypeDiagnostic: BL0PR07MB5523:EE_ 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: 2VuyC2aJDN7laS6jB0o1O90nC/0qS7VXHRL2U8oFVvixsv4681QA8FRKGOz5CfrlIuWR7Esi9RQ+5MLkBMn655HpbA8zzUUBJz8URay4JD9jKykL6XgRrnyXsaOagpp75eFjoXH8294Ljlx+nbmynj5m7k2vcizCholdTTypQ3WoaIe88t2EFfIvL1JkmK9Gn8BDuFsZGiT8lcoBhUtgTx/3ExAWmTyHCgFIvlFLY1DvVqBdm2Pp3Hm+qOcInDpWlaqKPzxY8H9dYWU3LvlOFx4ChrAKH3Q95FMTv17tpkWrxYCXQktpZQF+LRrP+sqFbrofzZSlI09ezkSMYdnZeb1NhUGFpnBxS0SfLk+gBZk2wTdUhNomGL3fP+at3+UNHrA3qTdco1w+58WgiPBmG921WJyMnIab65/ol9eINSU8zMGfWcw4emFM2KMpD6B8vonTe9BsiJU3lSABL7aWK2UykLefcLlxnzLyqTvC/5TY+zdJiVlwVSOQ0n2pE9tcmB44jZhGUoWIfM/nTyPUJ/NfLtUnuVX4doMEItJh8lXBq+JopCyJk55jUituTSpaKdOiojLNmiI/erGifh5o0HoUd5N4cnZpKwb+0w/tbDLLvsjJXty1R4E8KpCL2Cd3YMZz1o/PHWSp2IBXwnjO/I91soGh4fuCHj39CRNf6Pk0ZX5ztrpA5VwVflIh66E5CkC9jjnHo/aLEqS2ljCwVww6XGAVnDmNgWOr1fTpHdckcyJQrXdQuLHDr+1ckmpn7Yp+31WAzO2X3BuDmnA2QBkdOph/oEBjycs813kUAemg8UU+s3ygeCySrGX6/I+gINLdATwFxn7rPr1nDubZrQ== X-Forefront-Antispam-Report: CIP:64.207.220.244; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:wcmailrelayl01.cadence.com; PTR:ErrorRetry; CAT:NONE; SFS:(4636009)(36092001)(36840700001)(40470700002)(46966006)(40460700001)(508600001)(26005)(8676002)(186003)(82310400004)(5660300002)(4326008)(336012)(110136005)(6666004)(1076003)(2906002)(86362001)(2616005)(426003)(36756003)(36860700001)(42186006)(70206006)(316002)(54906003)(47076005)(70586007)(81166007)(356005)(83380400001)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:12:29.8342 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84bf569b-01af-41ec-68a7-08d9c5db335d X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[64.207.220.244]; Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT015.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR07MB5523 X-Proofpoint-ORIG-GUID: 3LNF6wIuC8SyKgeoGGvOtd5W3g_cGUl8 X-Proofpoint-GUID: 3LNF6wIuC8SyKgeoGGvOtd5W3g_cGUl8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_221237_104570_C32FA6B0 X-CRM114-Status: GOOD ( 16.45 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org No functional change. Rename some regmap variables as mentioned in Sierra register description documentation. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju --- 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 4674328574f5..9f2b8aefee9c 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 Thu Dec 23 06:01:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7EA39C433EF for ; Thu, 23 Dec 2021 06:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dNvugw3vl3kfNjr5F9tgYjGeTJa0g+YH+UjlyEx3Vds=; b=KZMvDOxVQRHGO2 G31lNjSrKRf3YUCdnQyQJEptdYoopzQsegrAHkfS910sUJsqHfjUcr+3+YxpG1FS3o3ozbK8kaZJB Z97QcOTX2HETrul1k+bf69AsJvsA0cCSJgMQeSQMqtOh1TdHytO8aUxGDgG6Fmt+amxGmMwg9FxWz pTk8iWEqYrtaWg/5fRCfDUyM0tWq3J+GAG1S9Q4xdt5pzSjuwlCF4hMr1EufZPC7Fpa0DrEEYoxer m38SfY45kckqLw0z9Eamv0QBIudsvizLumy0dBy42UNJgMagHMLH3gdd2ILYS6bezpd8LkWLBk4s/ U0oStGG56CGPaFIZd7Qg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HMo-00BvAe-0D; Thu, 23 Dec 2021 06:14:18 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HMk-00BvA5-OL for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:14:16 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN4F4Su005438; Wed, 22 Dec 2021 22:14:12 -0800 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=TLuV1d95SXlzRwf2Jt8/PsQ9w45ubtPbcoD86nL/np0=; b=e51l9cjXW0RjE6PICc1L7yTgCwijtQqGi1UP5WF1rADM6pj+EopBfTrEHeT4hZ7ZllRN Kth+uXtum0UKFQl2iTnwP7EshV7nIDuo2Jjpb1LNMO8Pvr2khFcI/GCazN9nSsrt7l/o V23wAKrbeUgAmN92HxAToI0XOIgBcrzu44UH5rqcsRTkMScNhZf7GhxKg1hGYWMnEOK4 s9HyeaIm2/xiouqqRXaz9d3muCw+r4Gb/LuYwPcqJzXQN0DAOxTfS2ClDgunh9oIlND3 C6WY830SG9wtV314b0QqlxzSAJ71sNePl+1tHYtel9WnC5EV93LPM3P5fzog79MJ9AS5 Vw== Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2177.outbound.protection.outlook.com [104.47.58.177]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvkja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:14:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QwOuySR2U6sJNJFt9Af6JBNNgPWAM6lybEuOkg/UvD3N26Lo3691LsWNR4okNvNSAnNsvmzNf53LQj4/t/gK2vnV2FQLaN2qJyGRDMQcF911QH3ue0ovK2YDlGmNvmS62/+AAYIexYFx3mAFzBLe9CztgXJ7MjTsuI37JtcLxtH2b2vXllpiFfiHQ15g6c5H1QI63HFRfccBmoC+M0of3yXiKnh7/9fSon9MGBGRY94YGaL4Cc4IJEDz6YZU57d+MzBUToq6R1EwUk8QES427pz9gy6MnzDxMpTYWbCr4ssUZaXzpJOmE/4c4wDlbiofORvD5Tg+nzrquxocIvgrsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TLuV1d95SXlzRwf2Jt8/PsQ9w45ubtPbcoD86nL/np0=; b=UYz/iRKKOys0tYIXtBOTUbOrt+pIGcJVV+Z5ZLEoRbVlBitpveU0AmEnVzCaLU1VSSKNHvB3KNfX+/l92KtT3RHx73nN8+wUlb5E2aAAjy9OAEckgbbqKt/IDCw1JHLgv760SjuFmgRV1J0qYsuGh/txnIHoQ/5rwP0MnExGcB0vA/C1DIKnztpAxD2d1EgqKIVvS+KTnxR+n33GwzHoxe+Rx1yKOvF2YeJs5rRV3XKbeUn//NTexolLd/cznPBVPjgxv5/jl6gLIVctswRgE+zIv2jVUZfH+WjwuMwOVQPoD63pgnneLz/uub9bH76DItNFeeiJxSp9BFB8bYD8zg== 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=TLuV1d95SXlzRwf2Jt8/PsQ9w45ubtPbcoD86nL/np0=; b=2JpMoLFbC5u9aAC4P52tFnhkWvGFjk0wBmfCY7YkDlq0q5H1uVVDWG0i4wUqBVDVzvp/EQB0pIMPGIEI/1a2aCEDitHR8OwibFl2PrCULLezP9qU9Ah/2IDnVDyHMaAeAdBt9HxJp+iNXpn2MyAlgZEsBRHXOZcS7jrg8eUSLAE= Received: from MWHPR13CA0048.namprd13.prod.outlook.com (2603:10b6:300:95::34) by BL3PR07MB8802.namprd07.prod.outlook.com (2603:10b6:208:351::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.16; Thu, 23 Dec 2021 06:14:09 +0000 Received: from MW2NAM12FT045.eop-nam12.prod.protection.outlook.com (2603:10b6:300:95:cafe::ac) by MWHPR13CA0048.outlook.office365.com (2603:10b6:300:95::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.6 via Frontend Transport; Thu, 23 Dec 2021 06:14:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;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 MW2NAM12FT045.mail.protection.outlook.com (10.13.181.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:14:09 +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 1BN6E89p022258 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:14:09 -0800 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; Thu, 23 Dec 2021 07:14:08 +0100 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; Thu, 23 Dec 2021 07:14:07 +0100 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; Thu, 23 Dec 2021 07:14:07 +0100 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 1BN6CEIp017729; Thu, 23 Dec 2021 07:13:02 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN6CEbU017728; Thu, 23 Dec 2021 07:12:14 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 07/15] phy: cadence: Sierra: Add PHY PCS common register configurations Date: Thu, 23 Dec 2021 07:01:29 +0100 Message-ID: <20211223060137.9252-8-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: 3183f8ac-53da-4754-1104-08d9c5db6e7e X-MS-TrafficTypeDiagnostic: BL3PR07MB8802:EE_ 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: 3EGqZnPIPXYm4h0WSmHFWLab8kL2LRKqBAjaevMa6Syl4VLxdj1c8A4t6FiiG4qo+YVPVs1PGWe65EvWcaXJCF7vz5Bu4qPYeQAuekEp+1vSH2PNcqUd2g08ePOMQYn0t4jGBgJrR3nx1VMTmSgozgJIxVc0UWKj3wyy9Y32RJ3CYBNyAHBpjMbP0jj3zz/MEfMs8TLb8UPANttz0ja0b5CuLQY2ce4LKRZTThGqgam4sHRcDSEtqi1vx4po00K8FuLXMRj4/mCa2nLZIW+q70W6IKC7UtlTqVdGZl5gC63NU9wFFHWy/RTJTp99cAB6635vMrjStVvU+0IXIVC0+7sa/WdM0WBql5CRRicQjSptQBiBlAu8+Phha/G7GjOiBYqr5wlfW4o3U2zgTUt2jBLHY9NVDf3Oeo26TnyPamqL6dRzk2T2YXwuZlp0HAA8nDObR3NtpQleZV0d7j41jRyjwMV+G2+z6AA8wXq5X5NTctaI/BOPd15o4dcRkWk4IJ5mdKME8tSN1DzK6h7UZvoGNdVPympD17fCAeUUC0b3br6b5OY57nVMPd6RW3UVnZDJICZzPEcnsNG8WsVcZ7qZhZulEUMuRmaEmni75W0bhW1VOwsU14ArHyygiiLIsLulrhiNNftGdI/AEla+zOJSTKgv55TJLoy81Uo5PG8mTQ69gAGKiXdHVKyn5eAkqQGziBAj4sxkRy3Y5TcSbsA4GcZIYPznozx4++9eZkU6ECrfNt3BJ1WRGC4mFmKL1cy5vZ7ZUU9ZbYxzdu+Ux8FmPNzT4L4d+41K8nDvSrY= 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)(40470700002)(46966006)(36840700001)(42186006)(110136005)(54906003)(316002)(8936002)(36860700001)(19627235002)(40460700001)(508600001)(4326008)(186003)(26005)(6666004)(2906002)(2616005)(47076005)(426003)(356005)(83380400001)(7636003)(36756003)(8676002)(70586007)(1076003)(70206006)(336012)(5660300002)(86362001)(82310400004); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:14:09.1276 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3183f8ac-53da-4754-1104-08d9c5db6e7e 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: MW2NAM12FT045.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR07MB8802 X-Proofpoint-ORIG-GUID: 90RrYHm4CwmfM4jASZTWl7Bijg4Vp34l X-Proofpoint-GUID: 90RrYHm4CwmfM4jASZTWl7Bijg4Vp34l X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_221414_825214_1D8DBBBB X-CRM114-Status: GOOD ( 16.92 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add PHY PCS common register configuration sequences for single link. Update single link PCIe register sequence accordingly. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju --- 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 9f2b8aefee9c..0bfd13843f2e 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 Thu Dec 23 06:01:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B28F2C433EF for ; Thu, 23 Dec 2021 06:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cZRKbep3qO6Q+uxN/gq+xJWjbDbuebxNL1dp9tlvlhU=; b=pF0Tqmg3SzWdLU yXnoBciITSNVv7vlXNw3xmBCXvUNAQVxZrBJdidgv45GQM7YnmKTZv5JCjE/wI1ZDGIaxAQuysWVP YdDwdQ31oHpSQnWfudft4P003E4lwFuWX5w40XYMKAinw4JHKkn3IxK3WTD1jU5m1O5YKhfxYB5Zu z7Rf5jpnKfVnwN81f77R5wZJHWQZLBxlv28RjEkznCtwruXe8sMeQ7cWRpZNwnLtLHF11J46tSarA ++1WtxKgVSQYPgYRpxh9KM6+rZt7HvFy+4V1xyU74rAQkT0l8y9oMWfqcEDy1cj5aIEqnEsrLuxf3 1n7QiluzP0Al8kdHHQJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HOS-00BvGS-7D; Thu, 23 Dec 2021 06:16:00 +0000 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193] helo=mx0a-0014ca01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HOP-00BvFy-0G for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:15:58 +0000 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BMLxBKr002429; Wed, 22 Dec 2021 22:15:46 -0800 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=5B9ve2mpCGnaBjtQAIGf5JYjG/1v1jS1oXk9hKYF0LI=; b=GEi2h3/SqIeVqUY0PJik0Iijo0TzbrwTLoF2DQNbZj/tQlLBkW4UzNFgT8JITSO8FecS bM5MBJFm/jIZsYBBHksc5WUMpdKUgxzMMKaifFj9DTgISpr95ClFAjllyu/Fyc8REu9w qzoiwqRGxmiwHrxiJlcbotJXsIPiY1bPtxfpwXGejtCUYFLXYK5pdTpacLEhtluA5twa pyZdl8qV15oGv5aiC91aWdGkqR46GZYz8cRETr5tDlYAeDxJib0KdNTzVRwQMnYXs+Kr l4kCGR1/xu+eqxqsuiM2u9SkeL1R+2T+0+xX8nJak7vC1ltwA/Ro0hULPFdLHtUtyxff vg== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107]) by mx0b-0014ca01.pphosted.com (PPS) with ESMTPS id 3d411ru5t5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:15:46 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fJOAvFqfKnfDHE0BKTYrihcTzbf/JLUG+lli8jkRPgCLlxoGz218wNamSv9G0sKdUANr31Z2WeKBRovYvSkc3qjcjG40n2evOSGL1w657RD/mno7HGCIp54njK6rMoJiNQssZ5sH0BL1VDQlZo6mClsJ/D5IqzMOt7uis4k0FzXtedl492VfYoS3BWJClxYlBhC0PAiRlPZVaARFX5akSml1wZ0Crvdeywr3l/k16vqt+wORntTKh0z8WxX7uvjZOg2J9n0sK1noJi33VMIMObmBG3LVJixfcAZfo9FBUbtWvnIOG6SCn9QON9H+Hj7cTvSPhM3h7sYMSc4R52BJfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5B9ve2mpCGnaBjtQAIGf5JYjG/1v1jS1oXk9hKYF0LI=; b=mzFpjknxOJD8obEjFK53xSx7WhLgSpDSTnHNR70wnUsSfY+lbLxW+PA3zsb1mc8WsMW7H2V1fq62F6gXb8G8de1ko0fChpDKSnavOcjJR4odWHnDej2cw4t70mBAlOAtWHveNGsma0JvOFUPyzcV66xxrZU2Yoyu6bdCOnXqr/CHIMa3vVS8Kuu9/bJnme1tQQ+MHjL0S1BfrZBD/QTsBX32xtguXVNyTMignFGDNRdJ+pSntD1iyvnJXR/tCAyP6RNzf9ZXxviqqg7pToD/6NH68IMb66Zi+YF+RJ3axQKbn9eyKdFEvaZ8SLEIVsrcYVYtGkQw5FNxjikbsDynIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.147) 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=5B9ve2mpCGnaBjtQAIGf5JYjG/1v1jS1oXk9hKYF0LI=; b=VdNA3b9ihOR6fiyJbwh6dwEIThVGrYYTlScfmB/YBSJcoHV5YYAAfCpHpenizNgVfskXbODaCuiN00zeD4GvaJO7EMLfVR5UnXbrNcoBIJOyXio94nzH7amxOdRzwj7fDAH97R1eLtNJL2PckM/NEKT3f0cMZ8+B6hc1WVP/PeA= Received: from BN9P223CA0013.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::18) by BLAPR07MB7505.namprd07.prod.outlook.com (2603:10b6:208:298::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 23 Dec 2021 06:15:44 +0000 Received: from BN8NAM12FT040.eop-nam12.prod.protection.outlook.com (2603:10b6:408:10b:cafe::1f) by BN9P223CA0013.outlook.office365.com (2603:10b6:408:10b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.17 via Frontend Transport; Thu, 23 Dec 2021 06:15:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.147) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.147 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.147; helo=sjmaillnx1.cadence.com; Received: from sjmaillnx1.cadence.com (158.140.1.147) by BN8NAM12FT040.mail.protection.outlook.com (10.13.182.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:15:43 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 1BN6FhPn019446 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:15:44 -0800 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; Thu, 23 Dec 2021 07:15:36 +0100 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; Thu, 23 Dec 2021 07:15:36 +0100 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; Thu, 23 Dec 2021 07:15:36 +0100 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 1BN6Dxek018506; Thu, 23 Dec 2021 07:14:32 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN6Dxht018505; Thu, 23 Dec 2021 07:13:59 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 08/15] phy: cadence: Sierra: Check cmn_ready assertion during PHY power on Date: Thu, 23 Dec 2021 07:01:30 +0100 Message-ID: <20211223060137.9252-9-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: ea8a6fbc-d113-48c4-94bf-08d9c5dba6d4 X-MS-TrafficTypeDiagnostic: BLAPR07MB7505:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1060; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6zX5/t0mkhqD0+s2hi0ZfTpInUe3Yr1aHKj9EgWRnYP56eROdxzLa6KPR7tv7jOpP2aOsr2svRGcktdv4dVgoZHD88oaJypVv93sGc1o6CdKdZJDz6cq5Y26mAszyHeShL65C/fEozAyVwFEgjrJ6yGLBfuAtdPbBcSYRahu3B2geYUOfDwYRi69vmn3dvfvHa7oaUtzd2hJFPXtId8L0ZPpDQjHuhsTCPQzcNnwTMqFj/zjwKhDI/dKX+385IDJdexFHGJyh7cTdG57HUibRAYVVP4VBsaktz5CwwwUzGcsJD6uZbl86wYx3X9dGZwR4oqTF9SjHidqzoq0tjTdYirbY8PIGc8agccruqsrBT9H88CucHL430TVUAUrGaBf0nhaJRI5s0AIjotQ41KfwNfUPmXTGtjCJXnBFHSmOjeTLHtyirnaumy5xk7ZTZltNdi6JJIybpPkFOhL+JCtouLA5KnUTkV96PcVvkjiAHSicgXM3rl+9wOZxPM2Qd7ymzrBr3YAPFaoq0TzaiI3piZd7IX5NOr25lt1cwQt+/Jj2lF45hvsHy+7a5pjYRo9gsxE2L7VDoyegOrIA+H/XO7MJGCgbegzgqBuFSITGvD2rXt7THdUPdKJWJF+ppmEp7LGBSA7M9OJtw5PGZc5n31sgAw21TTl7Bd6tYZpJsXXBn+XBYCDVpMOqy7TzYP6cv1epLub9vFp37ANoT+GyPl2a1wyXO6qTMpEpI72z0HEpi7KJjjrk9tnwxoqyirHjYImE8k/uqyUC6ycIPZSxRJvVZ0gTxfrD35nMAlgScE= X-Forefront-Antispam-Report: CIP:158.140.1.147; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx1.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(36092001)(36840700001)(40470700002)(46966006)(1076003)(5660300002)(336012)(508600001)(4326008)(36756003)(70586007)(70206006)(7636003)(356005)(83380400001)(8936002)(26005)(426003)(186003)(6666004)(2616005)(8676002)(47076005)(54906003)(86362001)(110136005)(42186006)(316002)(36860700001)(82310400004)(40460700001)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:15:43.5688 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea8a6fbc-d113-48c4-94bf-08d9c5dba6d4 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.147]; Helo=[sjmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT040.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR07MB7505 X-Proofpoint-ORIG-GUID: RYXEj5WGxxeP6Dd0EKnpDhTVC94uuoWv X-Proofpoint-GUID: RYXEj5WGxxeP6Dd0EKnpDhTVC94uuoWv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_221557_191613_01217590 X-CRM114-Status: GOOD ( 18.55 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Check if PMA cmn_ready is set indicating the startup process is complete. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju --- drivers/phy/cadence/phy-cadence-sierra.c | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 0bfd13843f2e..13176208e6d7 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -151,6 +151,11 @@ #define SIERRA_PHY_PIPE_CMN_CTRL1 0x0 #define SIERRA_PHY_PLL_CFG 0xe +/* PHY PMA common registers */ +#define SIERRA_PHY_PMA_COMMON_OFFSET(block_offset) \ + (0xE000 << (block_offset)) +#define SIERRA_PHY_PMA_CMN_CTRL 0x000 + #define SIERRA_MACRO_ID 0x00007364 #define SIERRA_MAX_LANES 16 #define PLL_LOCK_TIME 100000 @@ -172,6 +177,8 @@ static const struct reg_field macro_id_type = REG_FIELD(SIERRA_MACRO_ID_REG, 0, 15); static const struct reg_field phy_pll_cfg_1 = REG_FIELD(SIERRA_PHY_PLL_CFG, 1, 1); +static const struct reg_field pma_cmn_ready = + REG_FIELD(SIERRA_PHY_PMA_CMN_CTRL, 0, 0); static const struct reg_field pllctrl_lock = REG_FIELD(SIERRA_PLLCTRL_STATUS_PREG, 0, 0); @@ -280,9 +287,11 @@ struct cdns_sierra_phy { struct reset_control *apb_rst; struct regmap *regmap_lane_cdb[SIERRA_MAX_LANES]; struct regmap *regmap_phy_pcs_common_cdb; + struct regmap *regmap_phy_pma_common_cdb; struct regmap *regmap_common_cdb; struct regmap_field *macro_id_type; struct regmap_field *phy_pll_cfg_1; + struct regmap_field *pma_cmn_ready; struct regmap_field *pllctrl_lock[SIERRA_MAX_LANES]; struct regmap_field *cmn_refrcv_refclk_plllc1en_preg[SIERRA_NUM_CMN_PLLC]; struct regmap_field *cmn_refrcv_refclk_termen_preg[SIERRA_NUM_CMN_PLLC]; @@ -358,6 +367,14 @@ static const struct regmap_config cdns_sierra_phy_pcs_cmn_cdb_config = { .reg_read = cdns_regmap_read, }; +static const struct regmap_config cdns_sierra_phy_pma_cmn_cdb_config = { + .name = "sierra_phy_pma_cmn_cdb", + .reg_stride = 1, + .fast_io = true, + .reg_write = cdns_regmap_write, + .reg_read = cdns_regmap_read, +}; + static int cdns_sierra_phy_init(struct phy *gphy) { struct cdns_sierra_inst *ins = phy_get_drvdata(gphy); @@ -435,6 +452,17 @@ static int cdns_sierra_phy_on(struct phy *gphy) return ret; } + /* + * Wait for cmn_ready assertion + * PHY_PMA_CMN_CTRL[0] == 1 + */ + ret = regmap_field_read_poll_timeout(sp->pma_cmn_ready, val, val, + 1000, PLL_LOCK_TIME); + if (ret) { + dev_err(dev, "Timeout waiting for CMN ready\n"); + return ret; + } + ret = regmap_field_read_poll_timeout(sp->pllctrl_lock[ins->mlane], val, val, 1000, PLL_LOCK_TIME); if (ret < 0) @@ -712,6 +740,14 @@ static int cdns_regfield_init(struct cdns_sierra_phy *sp) } sp->phy_pll_cfg_1 = field; + regmap = sp->regmap_phy_pma_common_cdb; + field = devm_regmap_field_alloc(dev, regmap, pma_cmn_ready); + if (IS_ERR(field)) { + dev_err(dev, "PHY_PMA_CMN_CTRL reg field init failed\n"); + return PTR_ERR(field); + } + sp->pma_cmn_ready = field; + for (i = 0; i < SIERRA_MAX_LANES; i++) { regmap = sp->regmap_lane_cdb[i]; field = devm_regmap_field_alloc(dev, regmap, pllctrl_lock); @@ -765,6 +801,15 @@ static int cdns_regmap_init_blocks(struct cdns_sierra_phy *sp, } sp->regmap_phy_pcs_common_cdb = regmap; + block_offset = SIERRA_PHY_PMA_COMMON_OFFSET(block_offset_shift); + regmap = cdns_regmap_init(dev, base, block_offset, reg_offset_shift, + &cdns_sierra_phy_pma_cmn_cdb_config); + if (IS_ERR(regmap)) { + dev_err(dev, "Failed to init PHY PMA common CDB regmap\n"); + return PTR_ERR(regmap); + } + sp->regmap_phy_pma_common_cdb = regmap; + return 0; } From patchwork Thu Dec 23 06:01:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03687C433EF for ; Thu, 23 Dec 2021 06:17:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZXnh29p1vwoV/tRMuPAldg+NjnOKI6t7GLgX74Od+7c=; b=mtSwgsFFn0NhPv gqqGK1dIo+CvkBzinBo25/cq7v/M+/Spasa54asjsVUetz8SSmWkduZasaSZO8PLZP9lJVRY9Nb+q LSrPCiZMuysObePJYnzy47rfLoHpOk+OB4mMQOqU2yhUK4af43ZpCP7rLfQT45IHEJ01sPFD/yY52 ZMUS2tk9NnNpcBdXyMpPOfeloFI1Nui91WVFaogIa5BSHOIus2owHScvRDaZpJs9qmo6pfkYFsfo/ c6/GK2xUs91VJBspovhRFWtqEYpU5RaZ9vRFNQjsK/MlR//QofZhyctn2lgyWkmjgjFU1WmS+jFcR 7AZYKotfUjXaIfR26baw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HQC-00BvMh-GJ; Thu, 23 Dec 2021 06:17:48 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HQ9-00BvMN-1G for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:17:46 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN4F4TK005438; Wed, 22 Dec 2021 22:17:43 -0800 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=MNcgEWJb/bpq9GsQM+jl493xbb2dyFyWZjgAPs7dybA=; b=j2Ge1BGw2FeCcv78JQbF/9hxgBrFm5G2xb+e3y1M2IIF5p4Qy/Vj20rDYgiyaTvU3akA dScTrPdY84mVqhI5vQQoVpfLPdWQu/+7RX2v9i4FYOacCTRLcHyGjPUkcZlsE9SThq48 u/sPpqQS2dcov83MkPTbKM8kmKqPQ9nl5kGkhi86y6SOIa/wqo5BI5wflpGBsz2oDskM ecg4DENLgUyj5QEeHluo50NDLO4WnAI8LYv4jpHchodfJBSPlP3mryA1GcQIt+qwHALV RGLC6rjR3KirUD0/lL39HKrz5WpzNmRCOYFcn12ObLVRnxlrNZOQfitTG79HiYfl+ckv 6Q== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvkry-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:17:42 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SXyO1zxZbfDjgKoNDQWdO8fzGxAbdx9tpCoQ5j79pL7EJpl7kModenRI6MxT1jpVsAo2tIJFDgGy5ykMXHvtya5i+XhgYjL+GTk9Yz3LF8RzUm+od/tp1v5RtTK8KgzVwaR/Os+LbgBSi4lOLz5eMssMZVkOUv3Rl+UL2oq5cvebQz6pnKTvNeJsCxcYKNbbxgx5VL+9uSPKaOWbO5/I8ar3NDlAA2x4GNgD+zK2tQHbwCiEF9z+c2Yrkgyka0HOyGArnYT155DVqJluD3o9MdP1OvQB7WmD24of4vBRBEHnH3EVxE1SbwRpufGnMjAXGcPWfeUb6/vq5mop4iTljA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MNcgEWJb/bpq9GsQM+jl493xbb2dyFyWZjgAPs7dybA=; b=DQN+95uMv11bPG27021ZyvQYh9OWde/5u0GuNQQEGvHqoCrtznKCQPz3Ya93Gy7f8/aeU5EUp+jYw0MEBfCitDp3XBsvhyajx9k+pg0KR8igS94XTrFitu+zEHIePwcwBUvKT0ZoBc+4YgExpKcJ0IjkzegviK8D1XBiz77R/tRVi9mEAtw5dS3xv6oLsfIgVIfcfmwV/aCYUiuoTSxti5fZR8nysoGqhFoUboZCU93cDIwo4xtYZCLQcLI/5diFf9a2jpcwyB3Fny36A1jKAmkloIBwkocmGdtGI7ePa1HVY7gPLUv82KOV0bQ33obLBA0wzvZlgGJWXFx0rVNF1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) 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=MNcgEWJb/bpq9GsQM+jl493xbb2dyFyWZjgAPs7dybA=; b=EUISdJrC1HZhqCWh3nye1WYURolsyjGO8WPDXypQdTxw06+nVnMk+YRKUwL392F/9VTwKM3jU+q87p1wn53KRYTDI96t0ND47VwKc5le6IeO/flyVZxDuzr6wcfHrtNAc+87pEF3wngtKpRu+7e3LT21FA1RhuOg+gqm6EDa2Ks= Received: from BN9P223CA0022.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::27) by BYAPR07MB5109.namprd07.prod.outlook.com (2603:10b6:a03:68::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 23 Dec 2021 06:17:37 +0000 Received: from BN8NAM12FT040.eop-nam12.prod.protection.outlook.com (2603:10b6:408:10b:cafe::71) by BN9P223CA0022.outlook.office365.com (2603:10b6:408:10b::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19 via Frontend Transport; Thu, 23 Dec 2021 06:17:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT040.mail.protection.outlook.com (10.13.182.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:17:36 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 1BN6HZdj025555 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:17:37 -0800 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; Thu, 23 Dec 2021 07:17:17 +0100 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; Thu, 23 Dec 2021 07:17:05 +0100 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; Thu, 23 Dec 2021 07:17:04 +0100 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 1BN6FSFs019105; Thu, 23 Dec 2021 07:16:00 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN6FSgG019104; Thu, 23 Dec 2021 07:15:28 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 09/15] phy: cadence: Sierra: Check PIPE mode PHY status to be ready for operation Date: Thu, 23 Dec 2021 07:01:31 +0100 Message-ID: <20211223060137.9252-10-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: 24391159-504f-4886-8c46-08d9c5dbea32 X-MS-TrafficTypeDiagnostic: BYAPR07MB5109:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IGtFQGxSzrODSZiQOA/XW1YL01tMtphu/h6ruVuhNkSlHbKAdzDjmSOTqO0Snji/Oe3yMU5dS8V9nxHIed2DXlyfi5W8quMCZH75G1JaJbf6M+HqmOioCTanqEmTXwBXjGEkWv4SnZKXd8u2mmWsg0LYRcC2eGpc7cncJ8qEkmmt65ELNrVMJqz7XNnO9ySQT5aWfyueQVUhA4deHF0BhLg2gVKU1AMPeUg5Rd17iOTaJDRicYKQUwB6Waf4UwKVEp8yju0EbEVuDObUS4lPY0czbUCGTZbYWZ/kRCPy5OE701gjndPjyS0NwORZHxXNJHmmUU2WadT7nTgdNRrUZ3PiguSK2OuDc7/UixM+gtOQRqL26Oc7kd+suLAJLHXK1osr1QCuBxeqGd4n7GtX6s8Kr+kpjPyZg2IECVRUewKy+P/RHIhOsl9lJmLPCkzqQdrEeV2X3pxjoHAYNahhmq4Uw3j4OCwcpfHI2uuEEl9dWy6ixDeczK2/+s0Iqwy5W6V9JLVSHNK36GMXsdi33eQi1iHeClNaofnEMHP3GdHmDsuoJJh/WohIvC5EXD6hEwNFV4Ep+xyXKNbD7CAux7AJELOjxSGS3GZ+MJaRQDcBQXzqnuC8EsQxRxQKCHgw7xIGOvXrL3x/8+D5SQ87iyFuKWZUqGNEeFF1bEDPUEvWkNMwQYAjPvqZny3s9WJAcjojhdppLLtrNJzUHwr+KXp5Awno9/AOrdrmLN+/To4dPB3pRUru92pB9w/99kAphZF7CmDiPau6qQYP9PfMVyI1H2+zH13+Gri495aVaW+BWZHSjGyQNqERbx0h4DfkeaHK3jr5PgG1jY2cR0BPJw== X-Forefront-Antispam-Report: CIP:64.207.220.244; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:wcmailrelayl01.cadence.com; PTR:ErrorRetry; CAT:NONE; SFS:(4636009)(36092001)(36840700001)(40470700002)(46966006)(336012)(42186006)(316002)(186003)(6666004)(83380400001)(54906003)(508600001)(110136005)(40460700001)(2906002)(5660300002)(2616005)(1076003)(36756003)(4326008)(82310400004)(356005)(86362001)(47076005)(36860700001)(426003)(81166007)(8936002)(70206006)(70586007)(8676002)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:17:36.5764 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 24391159-504f-4886-8c46-08d9c5dbea32 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[64.207.220.244]; Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT040.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB5109 X-Proofpoint-ORIG-GUID: kzyn6rhH5sytD_fEJiXc-Ca4CkWDgUux X-Proofpoint-GUID: kzyn6rhH5sytD_fEJiXc-Ca4CkWDgUux X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_221745_140419_2D65065C X-CRM114-Status: GOOD ( 19.06 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org PIPE phy status is used to communicate the completion of several PHY functions. Check if PHY is ready for operation while configured for PIPE mode during startup. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju --- drivers/phy/cadence/phy-cadence-sierra.c | 73 +++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 13176208e6d7..59458388a855 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -151,6 +151,13 @@ #define SIERRA_PHY_PIPE_CMN_CTRL1 0x0 #define SIERRA_PHY_PLL_CFG 0xe +/* PHY PCS lane registers */ +#define SIERRA_PHY_PCS_LANE_CDB_OFFSET(ln, block_offset, reg_offset) \ + ((0xD000 << (block_offset)) + \ + (((ln) << 8) << (reg_offset))) + +#define SIERRA_PHY_ISO_LINK_CTRL 0xB + /* PHY PMA common registers */ #define SIERRA_PHY_PMA_COMMON_OFFSET(block_offset) \ (0xE000 << (block_offset)) @@ -181,6 +188,8 @@ static const struct reg_field pma_cmn_ready = REG_FIELD(SIERRA_PHY_PMA_CMN_CTRL, 0, 0); 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 char * const clk_names[] = { [CDNS_SIERRA_PLL_CMNLC] = "pll_cmnlc", @@ -287,12 +296,14 @@ struct cdns_sierra_phy { struct reset_control *apb_rst; struct regmap *regmap_lane_cdb[SIERRA_MAX_LANES]; 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_common_cdb; struct regmap_field *macro_id_type; struct regmap_field *phy_pll_cfg_1; struct regmap_field *pma_cmn_ready; struct regmap_field *pllctrl_lock[SIERRA_MAX_LANES]; + struct regmap_field *phy_iso_link_ctrl_1[SIERRA_MAX_LANES]; struct regmap_field *cmn_refrcv_refclk_plllc1en_preg[SIERRA_NUM_CMN_PLLC]; struct regmap_field *cmn_refrcv_refclk_termen_preg[SIERRA_NUM_CMN_PLLC]; struct regmap_field *cmn_plllc_pfdclk1_sel_preg[SIERRA_NUM_CMN_PLLC]; @@ -367,6 +378,34 @@ static const struct regmap_config cdns_sierra_phy_pcs_cmn_cdb_config = { .reg_read = cdns_regmap_read, }; +#define SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF(n) \ +{ \ + .name = "sierra_phy_pcs_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_pcs_lane_cdb_config[] = { + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("0"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("1"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("2"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("3"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("4"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("5"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("6"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("7"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("8"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("9"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("10"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("11"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("12"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("13"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("14"), + SIERRA_PHY_PCS_LANE_CDB_REGMAP_CONF("15"), +}; + static const struct regmap_config cdns_sierra_phy_pma_cmn_cdb_config = { .name = "sierra_phy_pma_cmn_cdb", .reg_stride = 1, @@ -452,6 +491,15 @@ static int cdns_sierra_phy_on(struct phy *gphy) return ret; } + if (ins->phy_type == TYPE_PCIE || ins->phy_type == TYPE_USB) { + ret = regmap_field_read_poll_timeout(sp->phy_iso_link_ctrl_1[ins->mlane], + val, !val, 1000, PLL_LOCK_TIME); + if (ret) { + dev_err(dev, "Timeout waiting for PHY status ready\n"); + return ret; + } + } + /* * Wait for cmn_ready assertion * PHY_PMA_CMN_CTRL[0] == 1 @@ -755,7 +803,17 @@ static int cdns_regfield_init(struct cdns_sierra_phy *sp) dev_err(dev, "P%d_ENABLE reg field init failed\n", i); return PTR_ERR(field); } - sp->pllctrl_lock[i] = field; + sp->pllctrl_lock[i] = field; + } + + for (i = 0; i < SIERRA_MAX_LANES; i++) { + regmap = sp->regmap_phy_pcs_lane_cdb[i]; + field = devm_regmap_field_alloc(dev, regmap, phy_iso_link_ctrl_1); + if (IS_ERR(field)) { + dev_err(dev, "PHY_ISO_LINK_CTRL reg field init for lane %d failed\n", i); + return PTR_ERR(field); + } + sp->phy_iso_link_ctrl_1[i] = field; } return 0; @@ -801,6 +859,19 @@ static int cdns_regmap_init_blocks(struct cdns_sierra_phy *sp, } sp->regmap_phy_pcs_common_cdb = regmap; + for (i = 0; i < SIERRA_MAX_LANES; i++) { + block_offset = SIERRA_PHY_PCS_LANE_CDB_OFFSET(i, block_offset_shift, + reg_offset_shift); + regmap = cdns_regmap_init(dev, base, block_offset, + reg_offset_shift, + &cdns_sierra_phy_pcs_lane_cdb_config[i]); + if (IS_ERR(regmap)) { + dev_err(dev, "Failed to init PHY PCS lane CDB regmap\n"); + return PTR_ERR(regmap); + } + sp->regmap_phy_pcs_lane_cdb[i] = regmap; + } + block_offset = SIERRA_PHY_PMA_COMMON_OFFSET(block_offset_shift); regmap = cdns_regmap_init(dev, base, block_offset, reg_offset_shift, &cdns_sierra_phy_pma_cmn_cdb_config); From patchwork Thu Dec 23 06:01:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33FBEC433F5 for ; Thu, 23 Dec 2021 06:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Uohe+n1n+X89jBN637QXmbdJzoV9ArMbXbPATyOtJi4=; b=QI4Ox8TJ+w8llz Zgur6GsFLRRX6ZRQBg+JWvrgvQx+FsfNwkf60wYC7CcCHKf6FuINxi5ZbaZGN4bqaT1NXYEAbaxiT x8/UrvalDZaa4bi8HhmEI6JBHxy5Qs/tHeiEf3F3BPFDXkeLeXxwCMkgv0bt/aKnJQP9s+mHkEecl vFoJKAygDKv7zAOMYIRRPXuaJ6eV6EOVuypKO00KCiVU/MkAQvyRXzPl8L+TAZbn+V6ez98+g3BK0 aGhTNbbDnnRHwRTU6cFU5yYjaCpBFQDK0maT3tlZ4kOa4aVsW2a8U3GxPPcimUhoJi4v+V4Zc/MYY XhZYPWwxC+xv5yNDQsVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HRT-00BvPA-MK; Thu, 23 Dec 2021 06:19:07 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HRQ-00BvOc-3W for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:19:06 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN4Isni005574; Wed, 22 Dec 2021 22:19:01 -0800 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=TAFnHh/GnRl6A449G9Sz3vHV4YhKmXiqqN0hUP9aG5w=; b=hDCTUakxYmXXpUJQEi8WKZLtb+XQbh+I4Ij0AFHuTeNhlDztw/TOk9ewvTpBK5GFdFAV J3SLVrd3DY8HEHWdhDD6F0+Njge53UDEvWM6FGMuJhotIfr3/8g9H1QNfNq2rGFka3bw e7pQSoPBQYsCcT7rv84tepU2FVLb/bgJs0fsAqAJ256GL71qIN7mo5v0k6BWkAtqZnq8 VEJ8SltVvexmUwKBbnpUuUIEnh0OMQj9q4VXBAhaD85GFJ6JOYT8qW7SveX6+TtP5bz1 JZjHZI8iCTYwZBR7jDUA4o+fNbTrhhxP3PrcVZMRbYBhcI1Yr594c/p3PwZHHCrPnXDJ cw== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvkvq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:19:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XveKFi4kVdqqzV7xfekLFDUrYa+tZl3hJLA0tmyJgf23SzktRBekpqEtmroTrBmMfu9R6fWGUBBdMF7LcJR7BmsONUU0EYxAuEGkFrfwQhIXWLuttbLcFm+ZClePtmU16eUkdK1Ouq0X8iAOzmuoONP23E3QXN10+wL9h9Gx+NEG6eYxpy131KaBngJtz9SfrR2hKd7k2c5xMHydEKlg77BP5ADpA2ebXsH1xZdJ/6eptgd5cEoxhZ+UXIFxCvF57r8dqVaiZxi5DvOLWBIkjomoL8mTltakGYNzbvZAVWZMXa+e7RCtk66sHpzjOtxAU4ARVb1eAypLKJPOKsogVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TAFnHh/GnRl6A449G9Sz3vHV4YhKmXiqqN0hUP9aG5w=; b=h8k5VRVDNfmMFVvnkLTSlZmjHhFY1xWDS8iEdUHmyVljVsGp4y8wJOMB+9nSYb0yHW0R3UEOURnrgBjknr33kVOd0+HHvF1jyjdxcGDFrVNlc0bHakfnwbBuQw2n0VaVj406c07CyIGJxkL3/w50Ox2kxQHsKAltej9NKZKnaDhl/ors9qtqZnFrz3rYU5ajEVtzlN5wRQveoekdQflEA1EKmkZAsJ9HiI6rdvc07b7X8Uv4ywpbpipDYE18T3IM9tOlw6BbsoMlYf3eTXNEITQ3ldKQNXEAexoIgS+lOlBmQ1mrSt8G+vtWVpZPwtulh35ukFxHJnqHZs7hi6HT9g== 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=TAFnHh/GnRl6A449G9Sz3vHV4YhKmXiqqN0hUP9aG5w=; b=IqVYkSynaVQbvlfwVQ98/p3Al7F19aFO9wWOlMcEQkTVXFiA9BRWXIkrsb8WXaPEISU8QQ8RAvtuXk2aNoHer3qxPPtDreZYDsnBRoujiZJp2jtqA3LtMHcmDpdbe47KXq2gXQMVqcuEh2074mzfclcf0S2Wb+lzFEwZIHRucTE= Received: from DM6PR11CA0028.namprd11.prod.outlook.com (2603:10b6:5:190::41) by DM6PR07MB4585.namprd07.prod.outlook.com (2603:10b6:5:95::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Thu, 23 Dec 2021 06:18:58 +0000 Received: from DM6NAM12FT029.eop-nam12.prod.protection.outlook.com (2603:10b6:5:190:cafe::56) by DM6PR11CA0028.outlook.office365.com (2603:10b6:5:190::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19 via Frontend Transport; Thu, 23 Dec 2021 06:18:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;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 DM6NAM12FT029.mail.protection.outlook.com (10.13.178.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:18:57 +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 1BN6IvoN022714 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:18:58 -0800 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; Thu, 23 Dec 2021 07:18:50 +0100 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; Thu, 23 Dec 2021 07:18:49 +0100 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; Thu, 23 Dec 2021 07:18:49 +0100 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 1BN6Gvce019587; Thu, 23 Dec 2021 07:17:29 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN6GusL019586; Thu, 23 Dec 2021 07:16:56 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 10/15] phy: cadence: Sierra: Update single link PCIe register configuration Date: Thu, 23 Dec 2021 07:01:32 +0100 Message-ID: <20211223060137.9252-11-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: 62ecc05b-0164-45e0-4c2e-08d9c5dc1a77 X-MS-TrafficTypeDiagnostic: DM6PR07MB4585:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:454; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ho6rP3CzyberNaM2q6jvpC6RSnzujvIg6T4j6eNftpVSJD7qAEBCqpQJFUnWUBzga1Ee6W0USxi+3JzGFgvCSk2sPYJt6WM2LohbADUyLIcbI5AFw21WYg6qFPAlWWvaBbiFjQsI4Ys5bvUKGG2HjVSXYlqCrq1p3ODcKotX/navGLD3y3hHkah4a4lZ2wViN2gq0QLySF0lmbvHhI9dEh1b7W9NadASZfcVC5G7NP5Tod8TtvvC8pO3aygNjOj/ci3wlxdToNIPjFQSyTODDj9C5BrCq89Cwkoigc9irVb0sZz7P4JkK/qxLu7giFX7GJ2vCOofqa8Zzf/I25zRcm/R/pv3uJuCLvjpdmGSe2ssg5E7obkUFmMBqWV6t1c0N6/uob82XqIriYXgd7nniUuJp3CO36Ki2ZYvy7QiTW6ge8blW5pW0cC8ECBQ8PHXZEqz2lVyaNmMGClXsHtRc3wxhsbQSkWROiITTSVvY2Pp6XnkT7A09MRkrDmO14vNA2S53QMg/3tWbkldP8mDQMGLUy3SQjC0EBG4UHUF5ROAXDUAn47YV4GM3NL2y/M/5kuMcE3eC/+1d03wrb+9fun7yxxbshI6/QP97sNunWfc4UFvRI1CZfAUiifeJToUH0hdU+tM9PBKp/p8uVsR5F3ghqxd+na/hqxSB8l+6uahSvrd9tkCumfbBexg2mBYHq6r/is9MfWweJtmnmbC0eKW9Saxyj220ftiEf1Bdm0dt4Vq5R10e77HSSvAKddEzjE2bpYOMroDlTw3nEjR+HNnYbGmyoLIERPt4EJIBII= 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)(46966006)(40470700002)(36840700001)(8676002)(336012)(2616005)(426003)(36756003)(82310400004)(7636003)(36860700001)(4326008)(8936002)(70586007)(70206006)(30864003)(186003)(40460700001)(5660300002)(26005)(83380400001)(110136005)(19627235002)(54906003)(1076003)(508600001)(316002)(47076005)(86362001)(2906002)(6666004)(42186006)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:18:57.6201 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62ecc05b-0164-45e0-4c2e-08d9c5dc1a77 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: DM6NAM12FT029.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4585 X-Proofpoint-ORIG-GUID: T3flE_jhKmbPaW3gl8ST50k4Tw4WzV9u X-Proofpoint-GUID: T3flE_jhKmbPaW3gl8ST50k4Tw4WzV9u X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_221904_216093_460ADB4B X-CRM114-Status: GOOD ( 13.49 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add single link PCIe register configurations for no SSC and internal SSC. Also, add missing PMA lane registers for external SSC. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju --- drivers/phy/cadence/phy-cadence-sierra.c | 214 ++++++++++++++++++++++- 1 file changed, 213 insertions(+), 1 deletion(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 59458388a855..728abd14aa79 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -36,7 +36,12 @@ #define SIERRA_CMN_PLLLC_LOCK_CNTSTART_PREG 0x4B #define SIERRA_CMN_PLLLC_BWCAL_MODE1_PREG 0x4F #define SIERRA_CMN_PLLLC_BWCAL_MODE0_PREG 0x50 +#define SIERRA_CMN_PLLLC_DSMCORR_PREG 0x51 +#define SIERRA_CMN_PLLLC_SS_PREG 0x52 +#define SIERRA_CMN_PLLLC_SS_AMP_STEP_SIZE_PREG 0x53 +#define SIERRA_CMN_PLLLC_SSTWOPT_PREG 0x54 #define SIERRA_CMN_PLLLC_SS_TIME_STEPSIZE_MODE_PREG 0x62 +#define SIERRA_CMN_PLLLC_LOCK_DELAY_CTRL_PREG 0x63 #define SIERRA_CMN_REFRCV_PREG 0x98 #define SIERRA_CMN_REFRCV1_PREG 0xB8 #define SIERRA_CMN_PLLLC1_GEN_PREG 0xC2 @@ -52,6 +57,7 @@ #define SIERRA_DET_STANDEC_E_PREG 0x004 #define SIERRA_PSM_LANECAL_DLY_A1_RESETS_PREG 0x008 #define SIERRA_PSM_A0IN_TMR_PREG 0x009 +#define SIERRA_PSM_A3IN_TMR_PREG 0x00C #define SIERRA_PSM_DIAG_PREG 0x015 #define SIERRA_PSC_TX_A0_PREG 0x028 #define SIERRA_PSC_TX_A1_PREG 0x029 @@ -68,12 +74,15 @@ #define SIERRA_CLKPATH_BIASTRIM_PREG 0x04B #define SIERRA_DFE_BIASTRIM_PREG 0x04C #define SIERRA_DRVCTRL_ATTEN_PREG 0x06A +#define SIERRA_DRVCTRL_BOOST_PREG 0x06F #define SIERRA_CLKPATHCTRL_TMR_PREG 0x081 #define SIERRA_RX_CREQ_FLTR_A_MODE3_PREG 0x085 #define SIERRA_RX_CREQ_FLTR_A_MODE2_PREG 0x086 #define SIERRA_RX_CREQ_FLTR_A_MODE1_PREG 0x087 #define SIERRA_RX_CREQ_FLTR_A_MODE0_PREG 0x088 +#define SIERRA_CREQ_DCBIASATTEN_OVR_PREG 0x08C #define SIERRA_CREQ_CCLKDET_MODE01_PREG 0x08E +#define SIERRA_RX_CTLE_CAL_PREG 0x08F #define SIERRA_RX_CTLE_MAINTENANCE_PREG 0x091 #define SIERRA_CREQ_FSMCLK_SEL_PREG 0x092 #define SIERRA_CREQ_EQ_CTRL_PREG 0x093 @@ -123,15 +132,27 @@ #define SIERRA_DEQ_ALUT12 0x114 #define SIERRA_DEQ_ALUT13 0x115 #define SIERRA_DEQ_DFETAP_CTRL_PREG 0x128 +#define SIERRA_DEQ_DFETAP0 0x129 +#define SIERRA_DEQ_DFETAP1 0x12B +#define SIERRA_DEQ_DFETAP2 0x12D +#define SIERRA_DEQ_DFETAP3 0x12F +#define SIERRA_DEQ_DFETAP4 0x131 #define SIERRA_DFE_EN_1010_IGNORE_PREG 0x134 +#define SIERRA_DEQ_PRECUR_PREG 0x138 +#define SIERRA_DEQ_POSTCUR_PREG 0x140 +#define SIERRA_DEQ_POSTCUR_DECR_PREG 0x142 #define SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG 0x150 #define SIERRA_DEQ_TAU_CTRL2_PREG 0x151 +#define SIERRA_DEQ_TAU_CTRL3_PREG 0x152 +#define SIERRA_DEQ_OPENEYE_CTRL_PREG 0x158 #define SIERRA_DEQ_PICTRL_PREG 0x161 #define SIERRA_CPICAL_TMRVAL_MODE1_PREG 0x170 #define SIERRA_CPICAL_TMRVAL_MODE0_PREG 0x171 #define SIERRA_CPICAL_PICNT_MODE1_PREG 0x174 #define SIERRA_CPI_OUTBUF_RATESEL_PREG 0x17C +#define SIERRA_CPI_TRIM_PREG 0x17F #define SIERRA_CPICAL_RES_STARTCODE_MODE23_PREG 0x183 +#define SIERRA_EPI_CTRL_PREG 0x187 #define SIERRA_LFPSDET_SUPPORT_PREG 0x188 #define SIERRA_LFPSFILT_NS_PREG 0x18A #define SIERRA_LFPSFILT_RD_PREG 0x18B @@ -1162,6 +1183,146 @@ 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 */ +static const struct cdns_reg_pairs cdns_pcie_cmn_regs_no_ssc[] = { + {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 */ +static const struct cdns_reg_pairs cdns_pcie_ln_regs_no_ssc[] = { + {0xFC08, SIERRA_DET_STANDEC_A_PREG}, + {0x001D, SIERRA_PSM_A3IN_TMR_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_cmn_vals = { + .reg_pairs = cdns_pcie_cmn_regs_no_ssc, + .num_regs = ARRAY_SIZE(cdns_pcie_cmn_regs_no_ssc), +}; + +static struct cdns_sierra_vals pcie_100_no_ssc_ln_vals = { + .reg_pairs = cdns_pcie_ln_regs_no_ssc, + .num_regs = ARRAY_SIZE(cdns_pcie_ln_regs_no_ssc), +}; + +/* refclk100MHz_32b_PCIe_cmn_pll_int_ssc */ +static const struct cdns_reg_pairs cdns_pcie_cmn_regs_int_ssc[] = { + {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 */ +static const struct cdns_reg_pairs cdns_pcie_ln_regs_int_ssc[] = { + {0xFC08, SIERRA_DET_STANDEC_A_PREG}, + {0x001D, SIERRA_PSM_A3IN_TMR_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_cmn_vals = { + .reg_pairs = cdns_pcie_cmn_regs_int_ssc, + .num_regs = ARRAY_SIZE(cdns_pcie_cmn_regs_int_ssc), +}; + +static struct cdns_sierra_vals pcie_100_int_ssc_ln_vals = { + .reg_pairs = cdns_pcie_ln_regs_int_ssc, + .num_regs = ARRAY_SIZE(cdns_pcie_ln_regs_int_ssc), +}; + /* 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,13 +1334,52 @@ static const struct cdns_reg_pairs cdns_pcie_cmn_regs_ext_ssc[] = { /* refclk100MHz_32b_PCIe_ln_ext_ssc */ static const struct cdns_reg_pairs cdns_pcie_ln_regs_ext_ssc[] = { + {0xFC08, SIERRA_DET_STANDEC_A_PREG}, + {0x001D, SIERRA_PSM_A3IN_TMR_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} + {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_cmn_vals = { @@ -1316,14 +1516,18 @@ static const struct cdns_sierra_data cdns_map_sierra = { .pcs_cmn_vals = { [TYPE_PCIE] = { [TYPE_NONE] = { + [NO_SSC] = &pcie_phy_pcs_cmn_vals, [EXTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, + [INTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, }, }, }, .pma_cmn_vals = { [TYPE_PCIE] = { [TYPE_NONE] = { + [NO_SSC] = &pcie_100_no_ssc_cmn_vals, [EXTERNAL_SSC] = &pcie_100_ext_ssc_cmn_vals, + [INTERNAL_SSC] = &pcie_100_int_ssc_cmn_vals, }, }, [TYPE_USB] = { @@ -1335,7 +1539,9 @@ static const struct cdns_sierra_data cdns_map_sierra = { .pma_ln_vals = { [TYPE_PCIE] = { [TYPE_NONE] = { + [NO_SSC] = &pcie_100_no_ssc_ln_vals, [EXTERNAL_SSC] = &pcie_100_ext_ssc_ln_vals, + [INTERNAL_SSC] = &pcie_100_int_ssc_ln_vals, }, }, [TYPE_USB] = { @@ -1353,14 +1559,18 @@ static const struct cdns_sierra_data cdns_ti_map_sierra = { .pcs_cmn_vals = { [TYPE_PCIE] = { [TYPE_NONE] = { + [NO_SSC] = &pcie_phy_pcs_cmn_vals, [EXTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, + [INTERNAL_SSC] = &pcie_phy_pcs_cmn_vals, }, }, }, .pma_cmn_vals = { [TYPE_PCIE] = { [TYPE_NONE] = { + [NO_SSC] = &pcie_100_no_ssc_cmn_vals, [EXTERNAL_SSC] = &pcie_100_ext_ssc_cmn_vals, + [INTERNAL_SSC] = &pcie_100_int_ssc_cmn_vals, }, }, [TYPE_USB] = { @@ -1372,7 +1582,9 @@ static const struct cdns_sierra_data cdns_ti_map_sierra = { .pma_ln_vals = { [TYPE_PCIE] = { [TYPE_NONE] = { + [NO_SSC] = &pcie_100_no_ssc_ln_vals, [EXTERNAL_SSC] = &pcie_100_ext_ssc_ln_vals, + [INTERNAL_SSC] = &pcie_100_int_ssc_ln_vals, }, }, [TYPE_USB] = { From patchwork Thu Dec 23 06:01:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AE978C433EF for ; Thu, 23 Dec 2021 06:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ldt9hkiwZKE2/GCspwQRyUX76n3gACWNj2eRGMVYIKw=; b=cPCWskSCDK5Wct PNEX8MN3F6A7fOAOUs7UYQVA8LngoVNlMHGCaqCDW02TxGggNULs/ldGXtq5tk51qzyeU7EErwuJe o/mZjd4plzWdd5OVHcftnGHz+bUbIRJqvCiakKrV4nrqrXeoulsEgR8DIiLl3h3ud20bWovHYrvQA FlLc/wNWIgdCinPqVJU5HJgurFv+/lDHpBnZLFcyd/dXVrZvcMMdG7YWT1p+bTDh3t8MyeRpqQ+E0 ENaSfqZAL+IObV25rcyjovc1Db1b4yPv8eVModWAx3apeZ8QHWugxR2bG0o0Q9gw7r/LjYTvGvWZr fxavn2nNZyN1iHyhHMaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HSn-00BvRD-Ty; Thu, 23 Dec 2021 06:20:29 +0000 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193] helo=mx0a-0014ca01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HSl-00BvQt-AR for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:20:28 +0000 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BMN45kI002320; Wed, 22 Dec 2021 22:20:23 -0800 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=PLrvYGR0jUGOxOkqtxxr2QsHkbRlH7PQhIkiPnk0dr8=; b=A7KMybt04+DU9FNU5Sl5l/EGxzfBtBc8fYX2hR267g9m1lO37l45tSvQKCRIBCHDjNbD 8xneph94ZKvW+w81w74Nqc82Z8U0gEQp/lWncnCjC7TVbNQdxKiY1wzjuupRLfHDb8wo MrzkDaVRVSKCm9q5cH4MsRC9oArHEqjIHCJyj+pWjU+7dacFUzmJ3Ksc7AX82fznQ92v sNPC00mIDoB508/jpqu7viqGnnasKzi/QWwQ5OpkkdJr7dnKomCCmOJr2EWi0H0LdvaL aZ90XnVXF0cqAIl7kzn6yGmdfFoHjiNKw1vKHdbwy2Bxp78zwp+1rnN4UzicNef+/ig7 gw== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by mx0b-0014ca01.pphosted.com (PPS) with ESMTPS id 3d411ru64u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:20:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ws6dEFoeqtgwZVPP+w6hJsD158lMeoowE1VkMzNr6SIGZPjkKA/2TtVuri2E+tEMKtS1+e4saOMlhbq3SOtHLD98QwfziL/l+IrlYAUe+jqom1U6xb6nA4bnIKCBeJ4vnXLDu6OonT0XBNLC5Ks0KZEENh65jTsZYamDzgYRDib8cKjmm9oe91VBD2IthgQkU9jQzYV2FlXYmO5uPwrQbInmuxtelOa76h8hH7dFgjq7G7GoybYY/wxleXAAfM+wOF7Jtx23Z3jA8yNd+s/5i4abuVF+/fCYc6EYirg/aZWvItCxnRJIYnE/55MzAX3GHpFcBf7ZT7rR6Hk7twEWdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PLrvYGR0jUGOxOkqtxxr2QsHkbRlH7PQhIkiPnk0dr8=; b=U/fDLCmdT0teu2kQbvvmqcVW6nBxis5OjSRXqwTUIr+dolEJP3pJFvj0G/xRg9gv5jjUcfI7Ik7Vx1l2c0xpezmmps51+TgHA7mJPfOlz81mIbMUX0BsI922YxGfkKIa1Yu/urPuodPurHOJKEylOz0pZ1IaUFl0c6qugB8KfCyLgK6cwpTQAh64zGECvZAJIgk/lNzHCcyqPG9xr7pe0Q1zxAOkT1zZIXPfrrkuOajr39gKZXqZFMXs25EmM/kiQ35XFW+u1FxWohIy7ZKAyFj1ebhXlgzYyPl3Gjwjtq/9F0BShm7Kz/xjdMC0gtvKLa7mzzI2lCs/fAjzJ2Ozmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.147) 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=PLrvYGR0jUGOxOkqtxxr2QsHkbRlH7PQhIkiPnk0dr8=; b=UpADObB8ZahCS8SrtcA8TB+wio+8RDMSFpwFvYRD/IRkTzqMmGj6SmWNrRypVlH11zNsNR5MPPLyL85WDbJqreuYW/Pkn5KWMUZy85F853MZv+I+jtFN5QMgS2RLOa6ICy21Fd+aRLEKTd5fDlZFRkCEilTppOcmST7oAaQ3Qzo= Received: from DM6PR02CA0122.namprd02.prod.outlook.com (2603:10b6:5:1b4::24) by BY5PR07MB6887.namprd07.prod.outlook.com (2603:10b6:a03:1f0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 23 Dec 2021 06:20:20 +0000 Received: from DM6NAM12FT038.eop-nam12.prod.protection.outlook.com (2603:10b6:5:1b4:cafe::be) by DM6PR02CA0122.outlook.office365.com (2603:10b6:5:1b4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19 via Frontend Transport; Thu, 23 Dec 2021 06:20:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.147) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.147 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.147; helo=sjmaillnx1.cadence.com; Received: from sjmaillnx1.cadence.com (158.140.1.147) by DM6NAM12FT038.mail.protection.outlook.com (10.13.178.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:20:19 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 1BN6KJem019875 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:20:20 -0800 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; Thu, 23 Dec 2021 07:20:18 +0100 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; Thu, 23 Dec 2021 07:20:18 +0100 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; Thu, 23 Dec 2021 07:20:18 +0100 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 1BN6IfN5020165; Thu, 23 Dec 2021 07:19:14 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN6IfeR020164; Thu, 23 Dec 2021 07:18:41 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 11/15] phy: cadence: Sierra: Fix to get correct parent for mux clocks Date: Thu, 23 Dec 2021 07:01:33 +0100 Message-ID: <20211223060137.9252-12-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: 0d423bff-a6ed-4902-3734-08d9c5dc4b96 X-MS-TrafficTypeDiagnostic: BY5PR07MB6887:EE_ 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: avqbRauiYgcLD3qhoLQNzx2Hf42uxSmUSKCkGPAcXepMNejE6QEUCGwcCkS9CSYadw+DK7OJp/BOQLMOS247JZf9eogRFgQyx/3VyaTypbzyWAyf+n5CNZ5FxRoPH3VhjycJoQsA5wG1K9GIKRbMUaBxnGZeoXmuGYVHLDf97aU61ZK53HGGQgEOkbjrdGeWDNCIl+y3Fqhw8wN8OdK+uBrCmLHoUKNx8pGmXkEPco5IMVKPvpyXhCl6RYFcrD64SlacQrmdqru6Ylw6ZBXUXE+ho+WwwRcArA6zsyZjPZuBpkgRzt4ynzV/qzqUHel7RLz+e7KcbKmXbpqg1mCHbUon4PbwUDIwSF6Eiz/rLidfmigy6F5fNRlPzSNL46lTXBFATCUzEu5EdfwvRWVXQYkaW9jo9wYISMAiaw/te59RAOAkaTC2wNTZ/41fM7p+Uf4E/skQ4cAkx+CaVj4yZV0WioHLlDMm/+9kzoSCJG8qE1h11VT17cVY3BLhjIlj5Q6mNrNxHQvbqFxdJCZ7ddgcmHUeN+oAapZaCx9ADKvKtcxPGxAEmtMCmrN3uuuGZdU6lwKwNfT5AFJcsydH9oSA9UazXWH33V6YzmG4gQ1BznCIBICNQ1ut3/B2ilb2bDykH5KtX0KSb4GcRsRWjCvQVakzvl1goSGtcNzh11DBcoR42AMtz1tal3GbE07d6Xg5GOqkR737h+7QMOJjnE6Wr6LSZ7FqChYtmByhbk9NGYOlsudhhSXir4FOwGl3hkVLAmMTxBbR2Wxw/shZlsGmjhE+jBgOdFSOsaZLsec= X-Forefront-Antispam-Report: CIP:158.140.1.147; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx1.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(36092001)(46966006)(40470700002)(36840700001)(86362001)(356005)(36860700001)(426003)(7636003)(47076005)(4326008)(82310400004)(8676002)(26005)(70206006)(70586007)(8936002)(186003)(336012)(316002)(42186006)(2616005)(508600001)(110136005)(40460700001)(2906002)(5660300002)(1076003)(36756003)(54906003)(83380400001)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:20:19.5467 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d423bff-a6ed-4902-3734-08d9c5dc4b96 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.147]; Helo=[sjmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT038.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR07MB6887 X-Proofpoint-ORIG-GUID: CzsyFJ4HgfnWJQhn4kG5Db4DXAhtVMeN X-Proofpoint-GUID: CzsyFJ4HgfnWJQhn4kG5Db4DXAhtVMeN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 mlxlogscore=969 spamscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_222027_534339_1FA59AD9 X-CRM114-Status: GOOD ( 18.96 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.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 Reviewed-by: Aswath Govindraju --- 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 728abd14aa79..abdbc6ebd5a8 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 Thu Dec 23 06:01:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B422C433EF for ; Thu, 23 Dec 2021 06:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0EoORWfNxwrVRoNTwutwwqFMSvtEaCD2nrLizJZjA44=; b=Eno6yR3bcGMFqC fzOA0+lov83nWQa8tRU1xOCUBGfdm94IS/zdWK69P4mO6Os8s484e7v2Zo+MzJkTVlA8xvyDc+2z9 5rRJoLwBoSwa1FZX93O0/DtMBfOZ8fSHVfknfayxTSrxpIZbopfGvnqPTV6TMzEBFBwdSxMWF/5OH diZIMCIWjxjc0BthllGHotXUKV0A9ReGgW7JdIECFzv4oal0lNgeRNcLIIIQh3NPGiU/zq+8OXjsC /HwLU4HazPa3EMGqV0/8W4uPjR66FpYwUP9EJRf4qyltUodvp75gNGwYVeXxR+jZgsMRAzrznf1ys YNtS+coisCBnYuoJ3Tfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HUL-00BvWj-HI; Thu, 23 Dec 2021 06:22:05 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HUI-00BvWJ-RA for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:22:04 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN3qOQu005437; Wed, 22 Dec 2021 22:21:58 -0800 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=W5JYz3vRTyN7wWn37BrjLOz0EMc40/jKxgC0uwH0wzE=; b=sXLQhiuB916qoj8lSV6M8pnSpIyv02z40Pbja5L3LeqETxbPwy/SVI48Bq0D+mw2343a EczMniJjaMnGLHUbgUbMfHqSNKJf8jHOTRDBFQZl692LBB53ZTNctnFgeYxOdMNY2stV 4DEgH5JAhGjeDCVhl0pTFGCNfQFUbgexGDpT8K+WcnuY4wpARocsp2PTfWngidIS29NG dV0VkVJJs/7q+xwj3ytv5WuWb+BXndgbzFH+Us+JJXCY2v0rvkrXODRCSwsa1AXzu0zp PmlIJxU2ssAKFcKUR/SydDuxiVvp5U5wFtxkpj1F43Ap8+gq4dffX6NIuixeM2YNAj6q zg== Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvm4v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:21:58 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PJRs+4yZhNhXarUSBapBOABDdLroKzW8MoKQxDRAkMixo3yu2LMe52UiVdzZq6skD2GHFIRcivrx2Yuco2h5gJU0UCMJXm/em4ivM2gWKv4zW2+G7O70MzEkSGzQDqrKvdqbjX1QqbNQiJPNsw0yCRGb0sCKXppuXdyI9LUECEsKt7+pmgBFjSi+Uqf6pHeDYsXnC8r45vPjrWOD5Q4GLn9olkCz9lj/IPii7z57YTydG1hrPjkw5cn18Q385/3HETiv2NJEaRYkgMkQ+g+DhgWtdQjoPiWp+FjSqr0aHMmeBytUtHUDRLn4R2+aq/XdfJt/QIdLij05zNT7PmiAYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W5JYz3vRTyN7wWn37BrjLOz0EMc40/jKxgC0uwH0wzE=; b=cqzDcWFbWn5BkCrKtHY//snYp0DxzrX6VNg6ssyB4d2Ol7HHJLTkpEHawT/Pst/e/3SdMhDOg3gqaUq8wilyge4hy0fxXyMpebdR3poipZ48Z9gLaBcv47EAiRZ908vIqJr+Egt3yH3VtAqdHqNwh1hnddM9QbowFSQHq3UCXZY46ZzeyZLyuAVHH1YGjh7VNwyV5wO4XRImoNubVggx8lIB+2Oe3F2IVBJV0cPqtduo7XaX81YrVKtv52fiFOdpbHXe4O3cHPsZtsDdHA+UeVvipq2wgYnY20rk0fmOYqiIWpKSh2b6+og7ABWFtj+Ozk2/YzHkouQ2p5l4WeD8Yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) 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=W5JYz3vRTyN7wWn37BrjLOz0EMc40/jKxgC0uwH0wzE=; b=QfPHbDP0vFEwz+QnRw2c3yJmT7FSiCHQ3Q5zEtAbgeKnfxYkdR/vI05AZW/S3O57wQyBA+hcTAS/VEfFLmEsAr1pSyrYW14q9wZtr4BIaC+6EjFM6vCNdazP5Lo7zpxTJfZaLuxrB0qfeT9kfoBWMtgTohqjjAgRLBbJu1XGL5c= Received: from MWHPR1401CA0007.namprd14.prod.outlook.com (2603:10b6:301:4b::17) by SN6PR07MB5422.namprd07.prod.outlook.com (2603:10b6:805:a7::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 23 Dec 2021 06:21:55 +0000 Received: from MW2NAM12FT021.eop-nam12.prod.protection.outlook.com (2603:10b6:301:4b:cafe::e) by MWHPR1401CA0007.outlook.office365.com (2603:10b6:301:4b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19 via Frontend Transport; Thu, 23 Dec 2021 06:21:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) 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.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:21:53 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 1BN6Lrxk025789 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:21:54 -0800 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; Thu, 23 Dec 2021 07:21:46 +0100 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; Thu, 23 Dec 2021 07:21:46 +0100 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 1BN6KAMN020804; Thu, 23 Dec 2021 07:20:42 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN6KAAY020798; Thu, 23 Dec 2021 07:20:10 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 12/15] phy: cadence: Sierra: Add support for PHY multilink configurations Date: Thu, 23 Dec 2021 07:01:34 +0100 Message-ID: <20211223060137.9252-13-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: ec78a5d6-ab75-48ee-2a6a-08d9c5dc8378 X-MS-TrafficTypeDiagnostic: SN6PR07MB5422:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:813; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GxdSHx+8Sv5UP87ji19jlHGv9hbFFA0Ql6TZzj8TMHZo2DXkwcWk7Ytsp9+Ai5sfsXRltlzdPTym7BGd+XHj6dQROKNWJUSH6i7aqhaMc9NZAVobTdQA2CRRTClL1y0OG3DuylCo8rFPXALoVqD2V0X6/DCK6kDCdhUC7CIZORB3SZId/g/wKVN/Hq98Q1oRfkN3nvJTxswQn7at3JQ1GE0kwpsqSBQsihmc7tS/Gablma945l1aBLIy7EjsK+MZeAxqKR5+tVv7fE6eboc8nj/7v2g1LZyw4evnZE6NZo/dluS7pT9enPsw6g3vAgWhuAS1sNY0TsW1ttNlcAi3zGdrdc+qpXDYNyKZjdvyyqvRKkd8XMGvahx1IFVhu3F7oZwuo29u7+kxfQpJ0weoGXu/8uJK9ZrXuMj+sv++/SADxKVlnA1hY8ZpLMOmhQ0haYYIJPaSb5Wu6xQJhPlHg6++zHTDj7XOEBjU0G2j2CJSkZEL6E/Y6RH8cfN0lrhiaRdqeEwYVL+n97BZqj3khOq58UaeWz8zXNYYZ1Cf9OoyVA/3FVBtf5Yh3ZWviEafcuwXyemsGY1Y8RzTH7Ok+UJNr4Wpb9l7lvM27QpJMT0oKnXp9HEDsrdZkh8bSmutXUfvq8JZUJbqUpCQS/AWuU4HJtO/dZSuuJuKKk9kkEfDJxS0x3YGQnP6Im4V4z8bsKcnTdo7xH4QgaoLYKvSRl91DbKiiLWzkE2bocL5FJ5jsBlreSFAx5WBRVy8xvZBhSiRwDE0LxbL2j6gKQu/ZnqxKtW5daNjcDUklhMpt+SmIdu7oMH2S0PxwMuyAnZYJdPj3IkvbIxbd5P0mndrPw== X-Forefront-Antispam-Report: CIP:64.207.220.244; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:wcmailrelayl01.cadence.com; PTR:ErrorRetry; CAT:NONE; SFS:(4636009)(36092001)(40470700002)(36840700001)(46966006)(186003)(356005)(8676002)(336012)(426003)(4326008)(316002)(2616005)(8936002)(81166007)(36756003)(30864003)(6666004)(1076003)(2906002)(70206006)(82310400004)(110136005)(83380400001)(508600001)(54906003)(5660300002)(40460700001)(26005)(42186006)(86362001)(47076005)(70586007)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:21:53.8022 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec78a5d6-ab75-48ee-2a6a-08d9c5dc8378 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[64.207.220.244]; Helo=[wcmailrelayl01.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: SN6PR07MB5422 X-Proofpoint-ORIG-GUID: 51JDXn40KEEXTGZZvte4qlNNMjXxB6CU X-Proofpoint-GUID: 51JDXn40KEEXTGZZvte4qlNNMjXxB6CU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_222202_924317_838ABDD9 X-CRM114-Status: GOOD ( 22.91 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add support for multilink configuration of Sierra PHY. Currently, maximum two links are supported. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju --- drivers/phy/cadence/phy-cadence-sierra.c | 198 ++++++++++++++++++++++- 1 file changed, 190 insertions(+), 8 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index abdbc6ebd5a8..8f356bf38be8 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,118 @@ 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; + struct cdns_sierra_vals *pma_cmn_vals, *pma_ln_vals; + enum cdns_sierra_phy_type phy_t1, phy_t2; + 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; + + /* + * PHY configuration for multi-link operation is done in two steps. + * e.g. Consider a case for a 4 lane PHY with PCIe using 2 lanes and QSGMII other 2 lanes. + * Sierra PHY has 2 PLLs, viz. PLLLC and PLLLC1. So in this case, PLLLC is used for PCIe + * and PLLLC1 is used for QSGMII. PHY is configured in two steps as described below. + * + * [1] For first step, phy_t1 = TYPE_PCIE and phy_t2 = TYPE_QSGMII + * So the register values are selected as [TYPE_PCIE][TYPE_QSGMII][ssc]. + * This will configure PHY registers associated for PCIe (i.e. first protocol) + * involving PLLLC registers and registers for first 2 lanes of PHY. + * [2] In second step, the variables phy_t1 and phy_t2 are swapped. So now, + * phy_t1 = TYPE_QSGMII and phy_t2 = TYPE_PCIE. And the register values are selected as + * [TYPE_QSGMII][TYPE_PCIE][ssc]. + * This will configure PHY registers associated for QSGMII (i.e. second protocol) + * involving PLLLC1 registers and registers for other 2 lanes of PHY. + * + * This completes the PHY configuration for multilink operation. This approach enables + * dividing the large number of PHY register configurations into protocol specific + * smaller groups. + */ + 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]. + */ + swap(phy_t1, phy_t2); + } + + 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 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 +1328,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 Thu Dec 23 06:01:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59CDBC433F5 for ; Thu, 23 Dec 2021 06:23:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=grt5juA0nC2Lytcl8u+wm2XiKA2/xqvPvcd1mFAE9uo=; b=p0rL7cYPD/sOwu VuIlynSResBR/v6VWEeAzm7THET+cW2xuUmemu61gZ/XMsib6ABD8+C5aZ8CXkjES/pDFnYmeu+k8 FUQCczGBuYM/ichcnYGw65bWE0LKUI1Ck9JDXn6dvd+2PjTPmcFS5kN4dy89C+Z3Vw4nO6tu6SOBc 2GcFKIw345KrO38iXtqEw26iNzYIYuPBzpO3QnLOPw3na6nm9HTiZIiUDOobVPsxKXkT2D/0NnR9Q FlXInlpKoEQtipdfWdbVdrjaKn6FxLxF12eCH/xXqZHXb3EGlpTtNtDCaAJAlWNFcOPNse1mqMTSi k/D+tqS2SwY3Ffgdp7tw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HVv-00Bvd9-Q5; Thu, 23 Dec 2021 06:23:43 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HVs-00Bvci-2B for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:23:42 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BN3qOR8005437; Wed, 22 Dec 2021 22:23:36 -0800 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=AYcAo/izBFzA+7YDlOxlteToCyJvJyUp7sDLyvMrcBw=; b=dDih7RbYvZ/qthXXEsZBy33iPpnF7VsyvmStgrxee7AwCSF1L/Cp4k89t8urgZuF88ND iNniM4B6EDtt49zkrzJEpcQQo9kJLk7YSgGH/jZDUMaAGDAxRC0S5I1RI7vW7rnY5XTG AtxZ5Dh0Aah893sL7s4LWlpTxqMOOoKD010GIHoVlM6NukcIyAYuZvHx3ADZobf8qVrh Oi4QADN8Klf/ndJuikIrkZxj+f39KYaf8PfiYI971L+CxCxFqKzhBKXXqnlSx4MQ2pM3 l1zpmxMTk96rNc1sgNJkFnLmVgGox3LleXB5rAe3m6taKzg4ojUh0qTLJtOIsJwqdEjD 4Q== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 3d3rwxvm8u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:23:36 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K2TC2mR5Ir/sewzXNzGhmTu8qdzJcnyiqfpSjCDRAi7tfEMnYRAdcf+D8DA6IBAOLsTqvgMgtRmnUCfGvEa1o5o3fbb1YgTUh2ib1glUFc8BVZ/gvOHcp3Q2VjmJD4+hugmpi9KHUjwFdsHNlkBPTuj/E2P/vPUivGHk1ONUShCrpo8rGcYfxxUrCGNOLusdXZW6jaLd6NRNULVBmMVgMwim5x/VfSoGxqRfBTJ5z014IHA8f3nuNqCv9avaimgulEFpWeJR09lZ0YoRwLdxcT4pVgDGOkWiZjFjCh93+Y9j2dQNztDqWv+FtNnf3iK7iO0MmbWRGvHxO1b1zb0jXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AYcAo/izBFzA+7YDlOxlteToCyJvJyUp7sDLyvMrcBw=; b=jN+2hW+ytiH8bdneNaiNzQibmgEI2KuvlPzIDF0dEXINgXDyA/NFkyuHs7FS+N0Fc64IUvZqEvOB4ni9Vu1rROL5BL/llDe/aA1fwSxrSQ3W2+luXPCTeSoVSvo9uvfemLXSE2DrwX/wWjUW0NA8ppDuahBIgnN080F11qoTxHQAi9zRidtuvUam0H/+xa3H/ej7fUg68aYXJaBeSxCW4Xn88P8eT1ErjfHDOsx3b6RxfCiqKx7FcYGrvQNZmFwdlAE7IPBJ4pH0SF4/j4ybTAyNHE/oggytzHKP9ENPXNxGR+68FRlBIRz4CKBBI2Uq+JsGw/uHM3OkkahD4UJpAA== 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=AYcAo/izBFzA+7YDlOxlteToCyJvJyUp7sDLyvMrcBw=; b=NgwCJlL6F4rhKGRJV5tK042soctaxtt+fBnuIi607CN+ynXvKLayVH/h9PuuqK23c/9Lpcv9ropmYrgj3Kg+Tpka28rr9OUI7o35fDqitRuDqU66t9u0Je4ndZCcWFSbEqxU9I2ut1HGpZhxwU9r1sw/1VvwWiBDcg28KGveOJE= Received: from MWHPR12CA0062.namprd12.prod.outlook.com (2603:10b6:300:103::24) by PH0PR07MB9236.namprd07.prod.outlook.com (2603:10b6:510:117::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 23 Dec 2021 06:23:33 +0000 Received: from MW2NAM12FT064.eop-nam12.prod.protection.outlook.com (2603:10b6:300:103:cafe::5) by MWHPR12CA0062.outlook.office365.com (2603:10b6:300:103::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19 via Frontend Transport; Thu, 23 Dec 2021 06:23:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;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 MW2NAM12FT064.mail.protection.outlook.com (10.13.181.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:23:33 +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 1BN6NWQ3023168 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:23:33 -0800 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; Thu, 23 Dec 2021 07:23:32 +0100 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; Thu, 23 Dec 2021 07:23:32 +0100 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; Thu, 23 Dec 2021 07:23:32 +0100 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 1BN6Ld9M021300; Thu, 23 Dec 2021 07:22:11 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN6LcGq021294; Thu, 23 Dec 2021 07:21:38 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 13/15] phy: cadence: Sierra: Add PCIe + QSGMII PHY multilink configuration Date: Thu, 23 Dec 2021 07:01:35 +0100 Message-ID: <20211223060137.9252-14-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: e660427e-112e-4664-ce22-08d9c5dcbeb7 X-MS-TrafficTypeDiagnostic: PH0PR07MB9236:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: io/SsNQCdsO2mMkEf01eNYHZmRFui3FhkGzUHUpL0cGtgLD4wTXzkaSgah18KLjiJwgBa6WswY46Q4Iw/Kn28iTOGkD63nA7yh2H+ml6Sih86e32zbh8P2f38abKEaD+9eHDmLnE8KUWxKvVwbUoY+lyknzQGJtzoH+pdAkuGk0M1Cr3pqTZr6Q4VqlGRfJko6SBO0pCGIvX1KUV5Hmr7L4C/k2Y9pFMzp9bFpbNM8bF/uhiECi1y72sJ1ZWcMT5j3FjGTDN8pDj5B60QBAw5Scm52NaaPXglZb0hOvZafXCq/l+epkuFm2MWXmVlTGqt3vXMdsbvw7kNImzCZYljk/PSeW+cQvqAviaHJ+c9g9DPOIhDbEvOXrQgyxVk2QpcVG7dL5RqeTwNELPXOtInqBM2GHvqWykFGWNPYAZVS5PSb7ESOdO82gmIVG6W+v2oIeJ6NaGXagA27yq0tkOQ2Ca7REx3vSpDGR2QCoMRvq/i9QMBKX270kxr9RKMUSRNzhYIMXyra39oXZV2O5KffAqhheJPciM0V2DAUAXPdfjxOGSWHQI7sam+nCj25oSnfRODsJM0fQjSXd5zSOeECkmToY6fxuaW5OYIY+MHK2femfYhoWM+Dbe/KOs9xQImjpc4lNK8FIwUaYc6BVHcBlzvYcOW5GHQPSUhcCgXDjyzDF1dj6wqSrrvPuCQrQ9WUP3skbG4zh+E5WurTae4mF/gzaIoWrkthFT+VzJzcnYBvBNii5wXrWtXNNpgTb1HpsChKincHrSUc+Uv8RYHSdK4U0Ecyj3sBolgLsu118= 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)(40470700002)(19627235002)(47076005)(70586007)(186003)(26005)(336012)(36756003)(6666004)(2616005)(508600001)(316002)(42186006)(70206006)(54906003)(110136005)(4326008)(2906002)(83380400001)(426003)(1076003)(8936002)(36860700001)(356005)(5660300002)(8676002)(86362001)(82310400004)(30864003)(7636003)(40460700001); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:23:33.2361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e660427e-112e-4664-ce22-08d9c5dcbeb7 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: MW2NAM12FT064.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR07MB9236 X-Proofpoint-ORIG-GUID: XJD0r2plUEbF961jH8sOy8tXweL6hisr X-Proofpoint-GUID: XJD0r2plUEbF961jH8sOy8tXweL6hisr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_222340_155841_F5763A0D X-CRM114-Status: GOOD ( 17.91 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add register sequences for PCIe + QSGMII PHY multilink configuration. PHY configuration for multi-link operation is done in two steps. e.g. Consider a case for a 4 lane PHY with PCIe using 2 lanes and QSGMII other 2 lanes. Sierra PHY has 2 PLLs, viz. PLLLC and PLLLC1. So in this case, PLLLC is used for PCIe and PLLLC1 is used for QSGMII. PHY is configured in two steps as described below. [1] For first step, the register values are selected as [TYPE_PCIE][TYPE_QSGMII][ssc]. This will configure PHY registers associated for PCIe involving PLLLC registers and registers for first 2 lanes of PHY. [2] In second step, the register values are selected as [TYPE_QSGMII][TYPE_PCIE][ssc]. This will configure PHY registers associated for QSGMII involving PLLLC1 registers and registers for other 2 lanes of PHY. This completes the PHY configuration for multilink operation. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju --- 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 8f356bf38be8..e2b0530ca04c 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; } @@ -1199,6 +1211,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 */ @@ -1376,6 +1391,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} @@ -1386,6 +1467,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}, @@ -1723,6 +2031,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 = { @@ -1732,12 +2045,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] = { @@ -1746,12 +2071,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, + }, + }, }, }; @@ -1766,6 +2103,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 = { @@ -1775,12 +2126,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] = { @@ -1789,12 +2152,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 Thu Dec 23 06:01:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697949 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A212EC433F5 for ; Thu, 23 Dec 2021 06:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hIpuz9ldziUm+JkysLgR4aVxAUoBa7SouS7p2RzzZjI=; b=uCBmxS6d4+wXoI zaNk8zk6c3qEap3WDVkXlBhc1p3dwucfiTm0PS98rtIJxPbVAUj9Ob8ve3k9eQx9YjqXdf4sKZIB5 XyYWY6qPoR4kdjPYJDOaWUIHOPbCNEJ2+6nPgDFDjx6TrCePQXV5Yjl3DLGIZrB4kpLClTqC0SMMU b2wFDR+1EmXB234Of9MZzTJ2gJYJYZ7wqzpIbTOhKdWmERp/H74F/hEiDTbEwRFNMUxa1uoQScVQx lKN3ViovAduYeovjv+nxjHyWZ4K9NHBSzT0XfYH5NcsPebLzPbjbvRHZpYdqAV0tGbfeZTC5Xu6M8 zR7fss2n5MSI6M+yVeDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HXa-00BvjB-10; Thu, 23 Dec 2021 06:25:26 +0000 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193] helo=mx0a-0014ca01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HXX-00Bvip-1m for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:25:24 +0000 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BMN45kk002320; Wed, 22 Dec 2021 22:25:19 -0800 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=qyS93nZeZwh/+rMOjOefrWbwgrOpM62DuJyl0NmpwuY=; b=igxHf00S8Ar7h4iBXiFDIHLgzUiA3QCc0RvtP+fM4yKzoSGLZw7x19saNPEH1WTRs4Sa FyfRx2qk3z531EKA/zJ4WydKCu3RPGkUAskY0P2ckszSU/rx4ZUa6T7Hn4q4/BcaJ2JA IveBzA6xGcdKYJjnu6pprFUHZeQBpiAufxxsRJAQDakPJWqhtXMWkXwjkBTaZ7cRyyW3 pvZ+sVrlMrbRs9OwiyImxrBM+co41i9t+29IXQB+M9iqAbV7eWFfDOfKbrO4X+gHQclr e7+En1TyH4w/MX74PR9dmncwh6sHwMCmgOnPL5khbyiN7cOzTsqXGop9F/+MiodhnXX9 2g== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by mx0b-0014ca01.pphosted.com (PPS) with ESMTPS id 3d411ru6fn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:25:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZBf4SVfm9Lhro2Sx/JXlxFmxB+maHD5jVU8vBkbbTYOKE6GeAvHickR8IhaCAKBe1TY+LY/bFaLoQj3ftTT/ke2aAHahDMqGLdynOZif2ZNZbP4MKW2T5QswwNcEL5quxK/033glCdreW/xpeHbSXYs2YOYjVJ5oKjdhfwPyJtWrodiRVXz9Q882p4neqv3pIdZSvbmjuMprH3zFUTdES8YyTBU3DupXYAjHpXshzf1nlhwzUuxsG9CKZXs6MGZVr8MNAeD+39s1xYUFE9CNtdpLj+Hc7/uoUKI4xHmnhw1hWnwIS2hhdOw2D1qMjvOJZc6QHjbAzNlQvA+5fD1Ayg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qyS93nZeZwh/+rMOjOefrWbwgrOpM62DuJyl0NmpwuY=; b=QcM0yeh3BUpr3SYAMfnrgE2CfXTeg/fx06v0tSeN0k1iU+NX4GkWoMZME/3Om7hYst9+PhkNdfpY/gLcekW9ayHv5DgMvOEv5wGr1DAAH/Y2PEI7DbiYYHzWUBTHKYF+A+UtafYNArlHetxxtnqpL4lqIc5P06uEYxhZOhad61xMxEIXzuS9Sz66Vam3uPLV80RSwi+V5D/uTEC1ItKGRCeqIDUuR2t4ZIF9iyYuk5AX5C+YRGAT/X/hSQugEpbez21lpp85RmKUH+BErb+tyn+5OIVE5v75Qcles8/9ChhzMoov3ALmpeWbQKVS486EAwFJwI3hyZWk2NpBjC4U4g== 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=qyS93nZeZwh/+rMOjOefrWbwgrOpM62DuJyl0NmpwuY=; b=Azz0AeKS9zGX7coo5yRrTsih24E7zrhk1nGbXbxpZy6tunEj2+msuMx9/Iqld34Rbe2es1LU6Yq5rg8f3emmCkqy//5C1dEOPUdsV3FWo1rY41hnMIZQ9u8IycRU0bBIh2UPigq3GwzEoK1AMRgfjMoehvw3bcysIAaauIGmlrA= Received: from CO2PR18CA0053.namprd18.prod.outlook.com (2603:10b6:104:2::21) by SA1PR07MB9118.namprd07.prod.outlook.com (2603:10b6:806:1f5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Thu, 23 Dec 2021 06:25:14 +0000 Received: from MW2NAM12FT013.eop-nam12.prod.protection.outlook.com (2603:10b6:104:2:cafe::ca) by CO2PR18CA0053.outlook.office365.com (2603:10b6:104:2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19 via Frontend Transport; Thu, 23 Dec 2021 06:25:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;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 MW2NAM12FT013.mail.protection.outlook.com (10.13.180.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:25:14 +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 1BN6PE35023325 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:25:15 -0800 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; Thu, 23 Dec 2021 07:25:13 +0100 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; Thu, 23 Dec 2021 07:25:00 +0100 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; Thu, 23 Dec 2021 07:25:00 +0100 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 1BN6NOBe021873; Thu, 23 Dec 2021 07:23:56 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN6NOc1021872; Thu, 23 Dec 2021 07:23:24 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 14/15] dt-bindings: phy: cadence-sierra: Add clock ID for derived reference clock Date: Thu, 23 Dec 2021 07:01:36 +0100 Message-ID: <20211223060137.9252-15-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: 0271cbeb-e662-4dfd-de2f-08d9c5dcfafd X-MS-TrafficTypeDiagnostic: SA1PR07MB9118:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z+mj6TWbscp9OM4AEHCsHZF1Qyvfd0JMGGNR3AlpVdv0ibTJF4rsR6KOqrTRE0l+awXz2bWmFpw9i7obQr84ZUQsFYtJCqZCR6Yi58LPdXOkjZCC0FPXGclhAiJP5/RyK9K719aTWMDqGM3YvclkpaqG3+lA29reHNSIrQYH3cmJbT0UEWXy13JFFDFHVvZDrMbfj78lUgrUw2EXboftwbjkiBQh/vW5rjfEEE8vASQY6Gmcs941wqaw2A+fKN2TiaCHy0myyEGn3vkCGq0IV4Zu9t9MuxyP4s4Ug3bEWpZQRBart10MX3/Ysa6bDVzL5k5fzyk9sXY7J9Guu4YLIFE5ugGEdH33/M2YnzwB6zOTLw4hInQ8BTzqv/q+0OmFLkMGR87gHJxU6tPXeMNLqVXNL+ww3e/WHencYaE0as8iGBZHEMJSbihEcPEHpYmlqeM0LyjV+iRyY49Ik6VllWGJjMNFIm3g0ZHkdpFuFGQe2tpCLItcTqc+rL6Ds/rydWnR80V0tAPF7gOcLrVaCF5u61mp9Sq/0z6dO6rKB+PsFlyebhJtxTCl6B4+IhtV3uwSR4fxtCID4vb8KCW3WwetS0B9o8jYmTTGGG1w+NuNbGu4KG451JofzUiGEwyhTupkiPiCK1+WWbrzmlhqfDAzXGatDdT8C/+fOkqm5x45YH2OPqaVQ2U+uKlr/wSLdP7+SDAplPj13o+9nrKYEHGWA651YfqBO95TM9gPWm4kQynLXPH9eEONAPt9UAMB2O+wVqtxBBxEie6wjGH2sUhVmjzkj3k2Npow/kiV7BI= 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)(46966006)(36840700001)(40470700002)(70206006)(426003)(2616005)(70586007)(2906002)(8936002)(5660300002)(36860700001)(508600001)(8676002)(36756003)(110136005)(54906003)(26005)(336012)(1076003)(356005)(6666004)(7636003)(82310400004)(47076005)(316002)(42186006)(4326008)(186003)(86362001)(40460700001)(4744005)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:25:14.3585 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0271cbeb-e662-4dfd-de2f-08d9c5dcfafd 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: MW2NAM12FT013.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR07MB9118 X-Proofpoint-ORIG-GUID: 876iRbzdvk8d407CIovl6-aOHy9TPP5b X-Proofpoint-GUID: 876iRbzdvk8d407CIovl6-aOHy9TPP5b X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_222523_258443_8A765C51 X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add clock ID for Sierra derived reference clock. Signed-off-by: Swapnil Jakhade Acked-by: Rob Herring --- include/dt-bindings/phy/phy-cadence.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/dt-bindings/phy/phy-cadence.h b/include/dt-bindings/phy/phy-cadence.h index d55fe6e6b936..0671991208fc 100644 --- a/include/dt-bindings/phy/phy-cadence.h +++ b/include/dt-bindings/phy/phy-cadence.h @@ -18,5 +18,6 @@ /* Sierra */ #define CDNS_SIERRA_PLL_CMNLC 0 #define CDNS_SIERRA_PLL_CMNLC1 1 +#define CDNS_SIERRA_DERIVED_REFCLK 2 #endif /* _DT_BINDINGS_CADENCE_SERDES_H */ From patchwork Thu Dec 23 06:01:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Swapnil Kashinath Jakhade X-Patchwork-Id: 12697950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1D01FC433F5 for ; Thu, 23 Dec 2021 06:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sC3ayAebqJf8a3ZqTFZ5+YcXu/Og5sy/juKof7pSh7g=; b=vgYqJ8aXeFdBCn N9+QHd2yuYXIWUQJPOyhoyVBPxmUUKDMDkBMu27EXiX7nFnWdDTv5Rj/QGeQLQ8YXWSELXEyjHGfU WqiXUKCPKkN6QRxAlWwtANY9uGhpyZImURnNX4WWubojz1GzbxK2EXJ7QBMiE6UUOyNy3mIFegjjG sR4oCNxPi/+h/Ni3EyopftLyqs2MFpEqZadFJ9N0Nfh9HlVIIhhGn02oP6juUfg8ZmPDsTcVKf/2N j2Qff9eNQt/KqDhJIB+tea9Ck4l6oMoTF4f4SweQtIpC8iKwN7WrtajUU40zegyn/YsazrVV4i53U BQECT7boP2Uh482G3fvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HZC-00BvrC-It; Thu, 23 Dec 2021 06:27:06 +0000 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193] helo=mx0a-0014ca01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0HZA-00Bvqh-4V for linux-phy@lists.infradead.org; Thu, 23 Dec 2021 06:27:05 +0000 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BMN45ku002320; Wed, 22 Dec 2021 22:27:00 -0800 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=JjT7CiBTd8oFk6y4G/0DgaLt/Yhg0WdpUuVz5SsLryA=; b=ca3Pl4w4/7Hjf1UfNjGCh6pqWQB65tR6tAJjD90PtSDQQ5l2jopKAxpP+tQYmnUuzPN9 YAIElgWzIjBR5WZ3dhGnNYKXiinqmvfSzwv/p0OoZS6UYGBlSyxuAM82ae2fv7xcAjF/ XDDITCiCns3/bhbfGCRVlK/KdjU0rCG06E8LLyet7VOdRFBzju7/+Iaxe+I1EzVnT2Is UotbZ9+OAOCCJpWrdngzQvlDCQ2QMAH/fV6GD9iqlEY1K2ybDzsfoBK2NmsJndI85NoW tAGZKU2SsMvFaIn9+uN832ODFU1JsIsXx/Wq/PMLGBG+s4KKvssDYpjJ4UIDwnuQ2esb JQ== Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2049.outbound.protection.outlook.com [104.47.56.49]) by mx0b-0014ca01.pphosted.com (PPS) with ESMTPS id 3d411ru6ju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Dec 2021 22:26:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JqIafPf9o9ScLhNZ271KGDO/zPlBgCcoa9NDWz0Bq+hxZqN0/g56gOHvDI4nJ0o3QHl8hvgig0vAC2d60+vgYbIC+Gc8rqdyyahOG/AkYO/WJt8r2gEpHNqb/KkxY7ui2D6OaHC0w4/CXJgF87vVIAOKjlcX/4qirxKTEo4ouvt7yIpFA66WD/36Xsfpcnb0gr88yL4JGGbcXME+yxxOhNaWde3V68uOgBDMJGf0/4NqXcNbB4RrRIOKmt41C7K4A3kdibdcvKwsfBTSJc3CJoRYVYojGedMRsXC5XhXmRizqnUFFGMyHW6okOnfIvIhBDihoUDP2lACz7hl082UCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JjT7CiBTd8oFk6y4G/0DgaLt/Yhg0WdpUuVz5SsLryA=; b=jEwV+NV1eExg9BtdSCm1aFiOfajhQKBOOl3xbPxBWhbsB7Ls9+Vg6WhXflNXcgU/pPFnS060aKxtD3wvKF9p31y5Ot4U4nSPjHTBWbdQXJGDV3lHlAs9diEziCMr9B7ALLT7w2z+nm7jXq2ywSdtwRuYNShIl3sisxuwS2p0xXCQ/CaWa/a9kmmL806VHES5nH4tXO6sLeb35IT9ZNzEw44wtRwbbIZdr++MPHWDNWx7CCGRRGB5SjPXGvPOiSqP+XLBy9/Appbs/2hgNmCPxkqMwP/RoaLf6SUTcnr83Vc1SeSZHgROUYw3xCL9gmAXnUcbCyNHzkUc10UBLBMscg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.147) 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=JjT7CiBTd8oFk6y4G/0DgaLt/Yhg0WdpUuVz5SsLryA=; b=YO1pi3/EcJT/AJ6rVo07G/owqiBs7HAHcpKBnrY8GFQT8xuikLvDl+L8vySm7Fwby9dB05YiKj25oEntTAeuXug4o1Mq5zT+Y4Jt9CnVxCWSxk3J1AY+QOPCnGeV1flNY7eacvOeSf5IClzcJq7TjeP9GY1x7KeFAvzGIuWJK4Q= Received: from DM6PR21CA0022.namprd21.prod.outlook.com (2603:10b6:5:174::32) by BY5PR07MB6997.namprd07.prod.outlook.com (2603:10b6:a03:1ea::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 23 Dec 2021 06:26:55 +0000 Received: from DM6NAM12FT003.eop-nam12.prod.protection.outlook.com (2603:10b6:5:174:cafe::a7) by DM6PR21CA0022.outlook.office365.com (2603:10b6:5:174::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.4 via Frontend Transport; Thu, 23 Dec 2021 06:26:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.147) smtp.mailfrom=cadence.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.147 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.147; helo=sjmaillnx1.cadence.com; Received: from sjmaillnx1.cadence.com (158.140.1.147) by DM6NAM12FT003.mail.protection.outlook.com (10.13.179.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.7 via Frontend Transport; Thu, 23 Dec 2021 06:26:54 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 1BN6QscD020522 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Dec 2021 22:26:55 -0800 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; Thu, 23 Dec 2021 07:26:47 +0100 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; Thu, 23 Dec 2021 07:26:35 +0100 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; Thu, 23 Dec 2021 07:26:29 +0100 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 1BN6OqUN022355; Thu, 23 Dec 2021 07:25:25 +0100 Received: (from sjakhade@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 1BN6Oq5H022354; Thu, 23 Dec 2021 07:24:52 +0100 From: Swapnil Jakhade To: , , , , , , CC: , , Subject: [PATCH v4 15/15] phy: cadence: Sierra: Add support for derived reference clock output Date: Thu, 23 Dec 2021 07:01:37 +0100 Message-ID: <20211223060137.9252-16-sjakhade@cadence.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20211223060137.9252-1-sjakhade@cadence.com> References: <20211223060137.9252-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: ae4fc2db-1d98-417a-fee0-08d9c5dd36cc X-MS-TrafficTypeDiagnostic: BY5PR07MB6997:EE_ 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: QPdN+5L2p1LRyatB9xo2e6G6z58OnfXJNtJsvOb2OclFToaAtCfwdMUVS7Y9Rc0Zcs1glJilCwaMkiqDdn9ixR1SYgCzanfa4bgqrKgzjVPrkb70B6hYvm0VYWKPC2LaQEjjfx9378v/d/DCpyf85tFchJjnS78mNmxLA4RqOegBGrjeV+txsLvrw+SKkzdc7HopKAfRSNWIwmkoOjpJ2MH2Zh8at+TQSrgKi5vJ7/ks95xcEmYFeEcOLz//AzSgpqUZ7XHzyyczj9f35SNeRaS5c98Q48Q7nCVdfSx9So06r7NOdC3czecbJcFyaBbuN8++ZD6DSFt8p4gDgzU2PUVp/2dCfHC581TEINc2hOJIpq6h5aoVTLJKNL6/GUQzE2XU7DjoTlBwm1C2o2UzpmEGqq4h9XDhTQgJ3qQlTq+0uhH1GR5q6ZLwS/f1h3ZQ7PoJKtWus2LQCX22Wd08rj0CmGzdYFW4RroYHuysW7rlI4igfnVUW4JbyentaDw6tIai4M+6hUcyxjy8ZUIIlzFhLuwBFVkZMCrXjJrTV3NEWbvcjYCXODBX3S43yDNjVZncMU/NbKCAWStS+1NxZfyeK+DeH9VUpaZwfXWoYeUgY31oOTJ0Le7uV/d/WpyibkYST8SwZzqLsx+uvuaC4GnCbx0cavnK/QR2U9QkUwh2plYfx8r+dE98sXpGbcHbCfiw4aGB5J4zt3LlNrmEJfopN03p02RChSK/OAlyn286Q47Vzzz9LemuB/PmxxkneALWnP/jjsRa36QNnKEmT/gB27O37s8FI01Zm3LKRNTQVBFrLPWGFc8ws+0SIYhb1Wedjve/wnjGiA5Mnrdczw== X-Forefront-Antispam-Report: CIP:158.140.1.147; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx1.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(36092001)(40470700002)(36840700001)(46966006)(86362001)(356005)(36860700001)(426003)(7636003)(47076005)(4326008)(82310400004)(8676002)(26005)(70206006)(70586007)(8936002)(186003)(336012)(316002)(42186006)(508600001)(110136005)(40460700001)(2906002)(5660300002)(2616005)(1076003)(36756003)(54906003)(83380400001)(6666004)(309714004); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 06:26:54.6546 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae4fc2db-1d98-417a-fee0-08d9c5dd36cc 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.147]; Helo=[sjmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT003.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR07MB6997 X-Proofpoint-ORIG-GUID: yICFwlzp22XZ48Z_lNoXSfl6vUwgEFG8 X-Proofpoint-GUID: yICFwlzp22XZ48Z_lNoXSfl6vUwgEFG8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_01,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_222704_325264_C3AFA3FA X-CRM114-Status: GOOD ( 18.93 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.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 Reviewed-by: Aswath Govindraju --- 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 e2b0530ca04c..da24acd26666 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);