From patchwork Fri Mar 17 18:54:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13179374 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA820C6FD1D for ; Fri, 17 Mar 2023 18:54:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbjCQSyt (ORCPT ); Fri, 17 Mar 2023 14:54:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbjCQSyn (ORCPT ); Fri, 17 Mar 2023 14:54:43 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2108.outbound.protection.outlook.com [40.107.243.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9929510EC; Fri, 17 Mar 2023 11:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gAOhMrmooQTIfYqwxfp2O7MdI5qR8LSNp12QtnKgO+ET4u/68I/ejsy/jVBk3QpOGM/ol8qzmU42YtbRm8Dpn7FUULsZ1BnUyraC72LnbdExzYXqQR1WUKKqXIBD+7qVQG2aXzjo3uoEhn7VtkS3H4rxZpOlUejZff3h9MgHmCZCVLey0wkLpXF2BsS95tT9IRo+i7/5yxiQy+N2ZKao+ydrX4AThDjUXRwEKvRjCuZnXUj/FlTwhmLzwlpU/MiMcCD58yxYq/LsyVjiTl/+RJU1hC309DetbZM8irsKCy3ZghGi+fnPPkiyRfahdui6enldPbtXyVaZ8s+k1UjMDg== 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=9XmS4W4XcXKLTaWLZDu9UZjtQ1auKAN3lUz+O+ZHaW0=; b=KEQpJCfTGI+RGgA58APZ4fLAK+nHZsUkCR1tpDT2H3Rmzq35rvHgumxh40e8not/632qgwVBIdX5QqBD1hCt3sv29UtRS0fsNDqyAtrsCS4UitMDlYLMOYlT7DLIqz8UwzEY+b23AoIGCXVvul0x12yx+5beohQJkHg9RxoJHSXSQGwhLuh3nN4/ZoDiysFf6fzDHWu+SZmOQXq2Vq4rrjlfXv1E4XG21VLhQKwcx8CfBmHgUB+mjFiHNGyciPj58XpaVLeHl2bvoREC2m9BfcHwZt+viJinY9Bt1i04mlCw/jC3ZkxZKJ9E0Pxv/E1NhCd0w962hOUaw8+5XPVRiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9XmS4W4XcXKLTaWLZDu9UZjtQ1auKAN3lUz+O+ZHaW0=; b=wSZR5Z0ToCL9bh5TF+/ZRU1Y+58071EUk4zl9hf7sm/krh3bG9N2yiG1TP8BHLcbUnSK7BiT2UHW3Np0uu9VTNQfQaCwxHXEAC9Ql5vWP6pMplP4V/pVbCZG9htAZIUjSGG4p/Cl2p9DBIfHy9LHDn43ty7ziUb+sGa9rqweyD8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by MN0PR10MB5959.namprd10.prod.outlook.com (2603:10b6:208:3cd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Fri, 17 Mar 2023 18:54:30 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa%4]) with mapi id 15.20.6178.035; Fri, 17 Mar 2023 18:54:30 +0000 From: Colin Foster To: linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Kishon Vijay Abraham I , Vinod Koul , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [PATCH v2 net-next 1/9] phy: phy-ocelot-serdes: add ability to be used in a non-syscon configuration Date: Fri, 17 Mar 2023 11:54:07 -0700 Message-Id: <20230317185415.2000564-2-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317185415.2000564-1-colin.foster@in-advantage.com> References: <20230317185415.2000564-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY5PR16CA0025.namprd16.prod.outlook.com (2603:10b6:a03:1a0::38) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|MN0PR10MB5959:EE_ X-MS-Office365-Filtering-Correlation-Id: 459f9084-d41f-477d-e07e-08db27190a04 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TtwkO2dk/E2z1C6qXkhY0NrR9opxtcbPBtdYgnMk+aktuHDAySgDe7mkGMbo6zNKhnEujQE5x5jS4GcLNnVNWQ0cI6wAc0/8AndzpGtlykAbAIfgTwKLw+QWJ9fPKi9qSy09+FR074FubLratdfnctnDZcmBuvCEAk2lmV3pAhvwxF9Z/3eR5IfHHBeZ9dMshFkVZCRuBElgi3fEhIbqnDkC7olAOIpBRCwnv2S610G6/yRhuClXsibn/vlJkuzCWT5Dls/UisO8qd1E5KG2FypIF6K7hzTdQuABeL94C528DvgvuBtP5qwWopoabQWBllwF5P57Nl5P03B6rPaAmn0xH/5fIwcoN6TXEI5IZ+RokKZDj7FznhAxONsbUY/WDAF2wHJX3aMZzu1W8HiKi2OhcUC6AdH6gRGKWMwUU/pmFbZ2kf1hAOVwKSrcjo9Vl0zuCoGMkPw4AoYmBadTAVPwmsDNeNN2hHe4fxSFH2jFxwWqp/AeEuLp36DJ3Y2h/uKs8/DfZJr4lGg7DlO1hfzXNBi4K2VHRxYd6acsdBR0E/jztDHyCpS9b7iTLSAp/VXNTY+0C6oZDKUed3eSm0cMdbGodxnYfyvdngDGnwjGKJX6eyp+lGp362U2jLnz2pJXMg9oK4QLPYJuISTr/9GAWgInR9A4//VORF9Kxej2XAJfdZusmTt2iutWGzJiBWCK1OfvhlmfV11GeOcBmQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(396003)(346002)(376002)(39830400003)(136003)(366004)(451199018)(8676002)(86362001)(5660300002)(44832011)(7416002)(478600001)(66946007)(66556008)(2616005)(52116002)(186003)(38350700002)(6486002)(6666004)(2906002)(6512007)(1076003)(6506007)(26005)(36756003)(66476007)(38100700002)(316002)(41300700001)(54906003)(8936002)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KL41bgeV0Qse0KWxPaYRQHZNJXKOR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kID53vN1444ccEa2xCI9KQNkIxHR5rIGPJWXUL8tcY9WPJXy5oH4paAyxcK0H1/4CoRN09+8STAENsjwtJBXTekAw7dB2TNPwmy+mFEEYHvQOtnTHN/GE5oVdqQRsuwZ7+m7CpegfeJHkvy/skuQe52T3G42b60VI7mUubu2RX1/ozbLDGB/mSuSepM39ABBGBFcbswC03z+Etx0ZNQOz1Q55G+UKwcBaVsM3DMApgtEnepcDbofADsNirZiQSrbDfxlaZ9sV/ZAPLoOuAUxbaJuVmYTnI06HVEu+SFq0kvXzFvChtnqpDUvw8EiEKrf2WVtychcj23I16kmGVluZ+klBIFw4556gFNtQknbsNS5GMqMGuSALloZRTbTUuPtli43qvHCvzosdwtPL79HMPeXKNxvetyGmcfhnAQGdJo0siDBtSU3jw3xOUCsDJo3TLjfxgFetTV1BWk1ygETgXw2fMiwnII9FPalbolYdLi1JyyEWYOkAX7JVOj7lqm2D+ZPRHWBWQgQ= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 459f9084-d41f-477d-e07e-08db27190a04 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 18:54:30.3657 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rEXPcjF1HnD03HoxqaRpACb5RWhN4o0Le/Ha58Al8vzftE5RPHyavQKQ57M94wnGmE48elZT0RWiFEUuZiKP1yXB+hjPcNO6OQlvKLWZozs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR10MB5959 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The phy-ocelot-serdes module has exclusively been used in a syscon setup, from an internal CPU. The addition of external control of ocelot switches via an existing MFD implementation means that syscon is no longer the only interface that phy-ocelot-serdes will see. In the MFD configuration, an IORESOURCE_REG resource will exist for the device. Utilize this resource to be able to function in both syscon and non-syscon configurations. Signed-off-by: Colin Foster --- v1 -> v2 * No change --- drivers/phy/mscc/phy-ocelot-serdes.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/phy/mscc/phy-ocelot-serdes.c b/drivers/phy/mscc/phy-ocelot-serdes.c index 76f596365176..d9443e865a78 100644 --- a/drivers/phy/mscc/phy-ocelot-serdes.c +++ b/drivers/phy/mscc/phy-ocelot-serdes.c @@ -494,6 +494,7 @@ static int serdes_probe(struct platform_device *pdev) { struct phy_provider *provider; struct serdes_ctrl *ctrl; + struct resource *res; unsigned int i; int ret; @@ -503,6 +504,14 @@ static int serdes_probe(struct platform_device *pdev) ctrl->dev = &pdev->dev; ctrl->regs = syscon_node_to_regmap(pdev->dev.parent->of_node); + if (IS_ERR(ctrl->regs)) { + /* Fall back to using IORESOURCE_REG, if possible */ + res = platform_get_resource(pdev, IORESOURCE_REG, 0); + if (res) + ctrl->regs = dev_get_regmap(ctrl->dev->parent, + res->name); + } + if (IS_ERR(ctrl->regs)) return PTR_ERR(ctrl->regs); From patchwork Fri Mar 17 18:54:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13179377 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85D9BC74A5B for ; Fri, 17 Mar 2023 18:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230011AbjCQSzG (ORCPT ); Fri, 17 Mar 2023 14:55:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbjCQSy7 (ORCPT ); Fri, 17 Mar 2023 14:54:59 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2108.outbound.protection.outlook.com [40.107.243.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAB1831BF2; Fri, 17 Mar 2023 11:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eJLHl/y/ooe+fbMvW5U1G2Okcb+kKuHYZ4E9rMWqCdFupjKGdxAX/JDGufmcY465v4MM4fEbL/NVitykpJd1/3VzuAmevb+t5tvGmg8uXQl+kyO5PuMLCwe2w5ct5YNlXgPo3fZcbDFlDlQNVoGLjcz410l6Zq6ok7Iv8A+4fFMox2mTYeri3KJKzHNOntbTKCugoJMdsRgJf27vFYtBQsdXcH2kqhiNOjciCUgtMjvGEJnJsd3QtdoAK6lTd1dDKL031kF4/qmDgDk3uSYYIBjlddfUClmjIUZ1c8UIvDIjSyRsepSrxvMRqekjgjIfgqo9oRjE64V5ouYzp4BdIQ== 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=xfnS5P3qdu7uR1iM6c8Tsq5jTS46ptug4GqRB2JXMtw=; b=XU8WsjdZmvaznYrq8TXCrExx/j4xF1drxISzdDB2BcxyKDmpT7quWccoqGhglwMweUWMpiwtpb2pxTzXCKHnMjOmYHDMscNxOPapW0z5n0hvdPCrK9A4NTgHfSqzKWFBAetizrmVQB0FOEw/Lan+m6qLP+3Vj+N+OyfbCvi2KX5r7nPKsrACzMXf4uB/B05bg1P4dcs4zkoiPHkZzqkQ5rx5Bm2poOb7OGL9oSaahELpCGptJdh8Nf5ygVmmylYIzIJ5pxM1nB/kfD14rAzCNZeeUc3saqFn6gTKFtU2/+dZx9fwFT4Iz3jeBZxkPJNbzKdm+vve3m6SQkvakMVqSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xfnS5P3qdu7uR1iM6c8Tsq5jTS46ptug4GqRB2JXMtw=; b=zxTbIabgv4tqUotK8gzpmiAJyGvE9kgYmoXJmRsf+hZFQT0WfNVDFgnB5ITCAquOLNzibwjCx3qFKbiEBl8ixCxnUtdpui6uaPfxW40gGUXHR1+83NUhTjyz3rHFTzZWH+1+eNY4QyiCzWjEpaWL28CBtdfjvSllSD1IJKR2m+Y= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by MN0PR10MB5959.namprd10.prod.outlook.com (2603:10b6:208:3cd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Fri, 17 Mar 2023 18:54:31 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa%4]) with mapi id 15.20.6178.035; Fri, 17 Mar 2023 18:54:31 +0000 From: Colin Foster To: linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Kishon Vijay Abraham I , Vinod Koul , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [PATCH v2 net-next 2/9] mfd: ocelot: add ocelot-serdes capability Date: Fri, 17 Mar 2023 11:54:08 -0700 Message-Id: <20230317185415.2000564-3-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317185415.2000564-1-colin.foster@in-advantage.com> References: <20230317185415.2000564-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY5PR16CA0025.namprd16.prod.outlook.com (2603:10b6:a03:1a0::38) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|MN0PR10MB5959:EE_ X-MS-Office365-Filtering-Correlation-Id: fea970c1-b617-4293-472e-08db27190af3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8x72/k+HHdlXB1flU/zt4ZZNL2YkRZWuYGwa74L2nGWisw1tglbeOtFDg7mG/SHMzJpV9IlvMp/vBsU3K1ETeRzbznWQpChdXCi+RH2HzW5KZ/okDQeY6Ag0HOnefK03aZ6FAugTig9wpOWZAT0m8zHBAALc8grkFCn8Nc1NB52nUeo310pQU5qOqwt5WyHn+DUyhhzed+g+c269DkuLHoLyqCjJrEa0wJo8pZI7v/7ZoxY4xSMelauS7Oz7P34ZMf0HWNDvSb53DWne9wjXP7B3SrcHyQDHe2fCpUJNp+5V9HHEl4GOAlLXR4kxLOcSJy9sk2wrNQvodW+DMiZ6+rVHifQi7NQyHatqWJNK7s88rzGRqnYBPSjicKpD/1GNer53d0Rin0dy+JHGJd9rl6zs0rfiP1QX2bbYnB8f8fgbmzqs9/eoFHwPFtMnCP4WoR40S1d4usfuQjzrkz6JOyb8wbP4LF3YVZkzM3Gdo4mVNZ83ObzviRjH95yC8AKuJmUuxbQ65wt8h+EXWgKyevlN2wgkunLVSuJEHOQ8IggQiqqMkkybpFk7Rsc6dxJVARUF9z9XihuAuDrHrG6SS783qCzp/dKq3g1V0NFh6MdMN71u+vYS684WLvIlnCthP6kIRNtpLQtn8u2TNZRNuIPFHQn1BAdLHN6Vebs9RdekP4R3i4Xna6AMgPAjvAWDXf57ZLK3KvXc/WQ30S2RZw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(396003)(346002)(376002)(39830400003)(136003)(366004)(451199018)(8676002)(86362001)(5660300002)(44832011)(7416002)(478600001)(66946007)(66556008)(2616005)(52116002)(186003)(38350700002)(6486002)(6666004)(2906002)(6512007)(1076003)(6506007)(26005)(36756003)(66476007)(38100700002)(316002)(41300700001)(54906003)(8936002)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +iROkzIQtIduCc2fXbwocyTVEwUVjaZwlqClhpH3x1rIwaZlckGDqKiLjQWfbu1+eh7d06QVp1mmVHq6EA01kTzqWy49fWU0ogTpkyoGhuOp1WT+01V86hHpGf0e4EfolnPNWAWkISXN5c0vhY7RBnzaHuvg2Cbsuyp01PFrxQS+m4hBNXjXJIyYv/cq7y/8/EnDGDKe5S1fl9aR65I8uJ5Mq5BDs8TpnGS4i9IMysi/1hUN5cKurztEIYYf9gVVYYUbR33B4hB9InuofyKCbzN1Cecl+b0XeShCLU0P5f35pJFk0UKEkudtwvCZHkhx5rcp7FLnVHraRv6Z54d1Z+VLBCg7mmAaGYtcxCxbDjm2dqBzPOVXd+y0B8ne3V6g9a40wWvRp+obimWBxFgcb5npIX8RvTRqPyNfMBW28PIn0MIoI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YhIYMu7bczx2P3536S42+y+fnzdrWZnwqPk43hS3TeTRjF1g3tySSMIvYCukmeXBDyB4Upg9ipcFDydrrJuOLyKyjhdCWNDNPqF/XDCAF8fh2kkui5nE= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: fea970c1-b617-4293-472e-08db27190af3 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 18:54:31.6157 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2mmKN9qBWZ1fATCiW8xv3+VhlHIyWRn5EOenkAMK5Y0iY1Ru4p8L90T0KMMUca4ZCvDqbL78vMlvmJQ5g/g6m/jkQ3sYU1NrR5vSC+DiUNU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR10MB5959 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add support for the Ocelot SERDES module to support functionality of all non-internal phy ports. Signed-off-by: Colin Foster --- v1 -> v2 * No change --- drivers/mfd/ocelot-core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/mfd/ocelot-core.c b/drivers/mfd/ocelot-core.c index e1772ff00cad..9cccf54fc9c8 100644 --- a/drivers/mfd/ocelot-core.c +++ b/drivers/mfd/ocelot-core.c @@ -45,6 +45,9 @@ #define VSC7512_SIO_CTRL_RES_START 0x710700f8 #define VSC7512_SIO_CTRL_RES_SIZE 0x00000100 +#define VSC7512_HSIO_RES_START 0x710d0000 +#define VSC7512_HSIO_RES_SIZE 0x00000128 + #define VSC7512_ANA_RES_START 0x71880000 #define VSC7512_ANA_RES_SIZE 0x00010000 @@ -129,8 +132,13 @@ static const struct resource vsc7512_sgpio_resources[] = { DEFINE_RES_REG_NAMED(VSC7512_SIO_CTRL_RES_START, VSC7512_SIO_CTRL_RES_SIZE, "gcb_sio"), }; +static const struct resource vsc7512_serdes_resources[] = { + DEFINE_RES_REG_NAMED(VSC7512_HSIO_RES_START, VSC7512_HSIO_RES_SIZE, "hsio"), +}; + static const struct resource vsc7512_switch_resources[] = { DEFINE_RES_REG_NAMED(VSC7512_ANA_RES_START, VSC7512_ANA_RES_SIZE, "ana"), + DEFINE_RES_REG_NAMED(VSC7512_HSIO_RES_START, VSC7512_HSIO_RES_SIZE, "hsio"), DEFINE_RES_REG_NAMED(VSC7512_QS_RES_START, VSC7512_QS_RES_SIZE, "qs"), DEFINE_RES_REG_NAMED(VSC7512_QSYS_RES_START, VSC7512_QSYS_RES_SIZE, "qsys"), DEFINE_RES_REG_NAMED(VSC7512_REW_RES_START, VSC7512_REW_RES_SIZE, "rew"), @@ -176,6 +184,11 @@ static const struct mfd_cell vsc7512_devs[] = { .use_of_reg = true, .num_resources = ARRAY_SIZE(vsc7512_miim1_resources), .resources = vsc7512_miim1_resources, + }, { + .name = "ocelot-serdes", + .of_compatible = "mscc,vsc7514-serdes", + .num_resources = ARRAY_SIZE(vsc7512_serdes_resources), + .resources = vsc7512_serdes_resources, }, { .name = "ocelot-ext-switch", .of_compatible = "mscc,vsc7512-switch", From patchwork Fri Mar 17 18:54:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13179379 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BC5CC7618A for ; Fri, 17 Mar 2023 18:55:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbjCQSz3 (ORCPT ); Fri, 17 Mar 2023 14:55:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbjCQSzV (ORCPT ); Fri, 17 Mar 2023 14:55:21 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2108.outbound.protection.outlook.com [40.107.243.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D16283CE14; Fri, 17 Mar 2023 11:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jok9LRFX+imZnyBgiR6YlJyAlLVPgzVBWsIWVmVa+b2bhbW0n5OsYTxW1fCtG/CpAU2cmf1HjwpwtKYcDsIzwTAMK/568ljOfc1s9X44ZRnREZwKIw7RH7h27NqDYi37FGhghMl5spu9qGsLFuJZeGwv9ytg2CeFusQqA9dsVSJhs1wuBp+7i2YAHU5HHic5xzmHchuRtvnkpzHvbi3V47PHzh6DVHIny+WIHjs+XfmggN3MVDtu/2pZQi7OciBOahiKy8fCZIuLOLcpF+qvH/L5DiAustVMPLsr7tzj5vvBi+nLg9su2auVnGf826wfay9qwfjMLrOOAoWAS/l3gA== 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=nKdPx6upBumRJjgzgp7KlHeXQjQnTGcwoz0pWCK/fpg=; b=IEPYcHGIGmGxsjdaUt0Udv4fonygoFeDtMKkxJqenxI27y/3U973ry2NYRD5lYJd8UzIcY0i1kv1PW1CRa+m3jQzM5CGQpk5Pr4WfSPXfNmU35Huu1MtU/BaQVWoPFGTcwqP1w4PD1tfeg1hbuWZC2NlRTSRPOh4HWz96VM265JjNmkOzAFUDes5hlYjPPC3/fCh+Mwku4gSlCvW+4Z7F25fQyIF60Wkv+JDzQOo6xBLhgw0DejBtvGXjCeQuQwHD40A8JtyfJQYEEgmwI86tzDrxXFOKk5Ch4cbL4uYzbQNyCbaoXxqwUnHePOafgoX8vjyeL54SNBI59/lD2kEbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nKdPx6upBumRJjgzgp7KlHeXQjQnTGcwoz0pWCK/fpg=; b=yRNIYnG2R57x5mik0gnjkk7lyoz7KJl0XvBpsuvGvgXF2bTfLC8TeTdOupPusWZtlO6zPOG1uqTZkf1gFdZIEbRKIr23XZ9a+WtKCwGJKLm6APKkzVNzZ88Hddla9y/X7Og1d1eYOKybtRUyiqkNKd0pdTPZfXqc1na1ztt5qLE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by MN0PR10MB5959.namprd10.prod.outlook.com (2603:10b6:208:3cd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Fri, 17 Mar 2023 18:54:33 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa%4]) with mapi id 15.20.6178.035; Fri, 17 Mar 2023 18:54:32 +0000 From: Colin Foster To: linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Kishon Vijay Abraham I , Vinod Koul , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [PATCH v2 net-next 3/9] net: mscc: ocelot: expose ocelot_pll5_init routine Date: Fri, 17 Mar 2023 11:54:09 -0700 Message-Id: <20230317185415.2000564-4-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317185415.2000564-1-colin.foster@in-advantage.com> References: <20230317185415.2000564-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY5PR16CA0025.namprd16.prod.outlook.com (2603:10b6:a03:1a0::38) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|MN0PR10MB5959:EE_ X-MS-Office365-Filtering-Correlation-Id: aa1bf46f-04ba-489e-6216-08db27190bb4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qPIGR7sGnv4hu8P7DX4E0Rizxj2zA8nMIYyOVdVC1W8I645IW20qSvu/yep6f8+YtQqJX3YcdAuxdkctRFJXe45O9wvI3f4YQ84vYd6R6DTbGWAgRhyd1A7D1Wfpag0K8IqZfIy93YSk7s6QSQWdmsCK3p0JHboh8bTB0dPTGDKn4msvH5DH8yoquouqo1iOKfnbRjlRb6kn+7HguUlJwKBkUwdG7lu+iuHSCl4kwxkrDOQBXc01fP2riSL3UGjJkx/F0LNhqCjgLHNm20ST8/pZVAdFtp0xhNlK1GT6m7fUl68KJkl/uvsuod+c0mWHyEq66zfBzgjaY86Qvt0LQQSg5vLT20t8CSwmqqoAwa+oitAe2M7YD021LyxUAUPcJRHdZwh+PWHpwmLqqJLblscvPdPwmgkV17/P7/8w/y/kv12JxsVZner5kd+l6dPf9IAQzzCilXI3cpZQdhUdTldEsAmsz6U34Ega/ligfhpoDlCWoemi0q0jnfUjzFRTjDbzQAiaVe4sxfSYq2X/6Mu6KJ+E4FRXxQ4a4LNuXD+s5Ef0zB8kVawyuruj2QleVQu8COSEEu4JqJRsMHYCD6rZ/yEPwXOMUS49E6vzo9okrrqslEqCF8/IdvCe2UCb68ZhkK6AvHFJ3WYmRfacRYqd+TuC4KhzR4HxSGaJtW8frrovo70PsLs53eucxaztxiqX/xJsKvAbCV/TFCc6Ew== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(396003)(346002)(376002)(39830400003)(136003)(366004)(451199018)(8676002)(86362001)(5660300002)(44832011)(7416002)(478600001)(66946007)(66556008)(2616005)(52116002)(186003)(38350700002)(6486002)(6666004)(2906002)(6512007)(1076003)(6506007)(26005)(36756003)(66476007)(38100700002)(316002)(41300700001)(54906003)(8936002)(83380400001)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xIdDDfeuHyMQIH9BXjCrnAirGmjeErLZ8rv9h4WFDqhzDcbCs6NEqhF2xscFl80SifhJ0FggGn9joKsJbXFL4fse0kUCRGi4pwFTYr3pGCBcE3SoXuONMsZB5E4TLZwrWVWao7p/Ixl71VZ8QEw4Ks97Fktse/FI1CRKJ6NQg4Nziq2TwDzeeAApniCYg4PFNeo8Yu7yQP34xD5l7aK9sG1oymnS9TLTVfLXHDpfqXKp10BksyJVoP/f42JJSAB5QNu2dnAEmXA22Sgg5gOnC10fU5OPLDgyhfasUH1hDS9nuDwSnS3O+HFiO/uqMNiADrFMGCdyOMDUQFbntwPv6cxmyCQaJ1Brzoyo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boa0++Ly3+YRfQsUhhxCkborWQmTwWGW03Ocuxyg0u2A9TVkX8nGIlB0dnlSfQFt2I4C9/9ZC4gzZunEXK+5MXqEBiRguP1vbR4TDwzt/oFUcbTM6x5ScwmrD9RGd4j75Dlu0rmsfeAtccJipV437eviAs/HXM4Xq4hikFII+l8KW6U72h0ZB9EsmQy/ukNdFgPeACAXRI2wfslr2HMm9Xs= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa1bf46f-04ba-489e-6216-08db27190bb4 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 18:54:32.8968 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Gj6GtdgsWJHWuCw3i5zL9BwhG/a2IL/yK5UH/O7cx9R2X2Z4hTcxxlLFEq1tXnLMPAzlijZkDGO73AQLz5uQ9/yl4b6LFQUMKu5v7q3WAek= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR10MB5959 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Ocelot chips have an internal PLL that must be used when communicating through external phys. Expose the init routine, so it can be used by other drivers. Signed-off-by: Colin Foster --- v1 -> v2 * No change --- drivers/net/ethernet/mscc/ocelot.c | 31 ++++++++++++++++++++++ drivers/net/ethernet/mscc/ocelot_vsc7514.c | 30 --------------------- include/soc/mscc/ocelot.h | 2 ++ 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 08acb7b89086..9b8403e29445 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "ocelot.h" #include "ocelot_vcap.h" @@ -211,6 +212,36 @@ static void ocelot_mact_init(struct ocelot *ocelot) ocelot_write(ocelot, MACACCESS_CMD_INIT, ANA_TABLES_MACACCESS); } +void ocelot_pll5_init(struct ocelot *ocelot) +{ + /* Configure PLL5. This will need a proper CCF driver + * The values are coming from the VTSS API for Ocelot + */ + regmap_write(ocelot->targets[HSIO], HSIO_PLL5G_CFG4, + HSIO_PLL5G_CFG4_IB_CTRL(0x7600) | + HSIO_PLL5G_CFG4_IB_BIAS_CTRL(0x8)); + regmap_write(ocelot->targets[HSIO], HSIO_PLL5G_CFG0, + HSIO_PLL5G_CFG0_CORE_CLK_DIV(0x11) | + HSIO_PLL5G_CFG0_CPU_CLK_DIV(2) | + HSIO_PLL5G_CFG0_ENA_BIAS | + HSIO_PLL5G_CFG0_ENA_VCO_BUF | + HSIO_PLL5G_CFG0_ENA_CP1 | + HSIO_PLL5G_CFG0_SELCPI(2) | + HSIO_PLL5G_CFG0_LOOP_BW_RES(0xe) | + HSIO_PLL5G_CFG0_SELBGV820(4) | + HSIO_PLL5G_CFG0_DIV4 | + HSIO_PLL5G_CFG0_ENA_CLKTREE | + HSIO_PLL5G_CFG0_ENA_LANE); + regmap_write(ocelot->targets[HSIO], HSIO_PLL5G_CFG2, + HSIO_PLL5G_CFG2_EN_RESET_FRQ_DET | + HSIO_PLL5G_CFG2_EN_RESET_OVERRUN | + HSIO_PLL5G_CFG2_GAIN_TEST(0x8) | + HSIO_PLL5G_CFG2_ENA_AMPCTRL | + HSIO_PLL5G_CFG2_PWD_AMPCTRL_N | + HSIO_PLL5G_CFG2_AMPC_SEL(0x10)); +} +EXPORT_SYMBOL(ocelot_pll5_init); + static void ocelot_vcap_enable(struct ocelot *ocelot, int port) { ocelot_write_gix(ocelot, ANA_PORT_VCAP_S2_CFG_S2_ENA | diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index 7388c3b0535c..97e90e2869d4 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -18,7 +18,6 @@ #include #include -#include #include #include "ocelot_fdma.h" #include "ocelot.h" @@ -26,35 +25,6 @@ #define VSC7514_VCAP_POLICER_BASE 128 #define VSC7514_VCAP_POLICER_MAX 191 -static void ocelot_pll5_init(struct ocelot *ocelot) -{ - /* Configure PLL5. This will need a proper CCF driver - * The values are coming from the VTSS API for Ocelot - */ - regmap_write(ocelot->targets[HSIO], HSIO_PLL5G_CFG4, - HSIO_PLL5G_CFG4_IB_CTRL(0x7600) | - HSIO_PLL5G_CFG4_IB_BIAS_CTRL(0x8)); - regmap_write(ocelot->targets[HSIO], HSIO_PLL5G_CFG0, - HSIO_PLL5G_CFG0_CORE_CLK_DIV(0x11) | - HSIO_PLL5G_CFG0_CPU_CLK_DIV(2) | - HSIO_PLL5G_CFG0_ENA_BIAS | - HSIO_PLL5G_CFG0_ENA_VCO_BUF | - HSIO_PLL5G_CFG0_ENA_CP1 | - HSIO_PLL5G_CFG0_SELCPI(2) | - HSIO_PLL5G_CFG0_LOOP_BW_RES(0xe) | - HSIO_PLL5G_CFG0_SELBGV820(4) | - HSIO_PLL5G_CFG0_DIV4 | - HSIO_PLL5G_CFG0_ENA_CLKTREE | - HSIO_PLL5G_CFG0_ENA_LANE); - regmap_write(ocelot->targets[HSIO], HSIO_PLL5G_CFG2, - HSIO_PLL5G_CFG2_EN_RESET_FRQ_DET | - HSIO_PLL5G_CFG2_EN_RESET_OVERRUN | - HSIO_PLL5G_CFG2_GAIN_TEST(0x8) | - HSIO_PLL5G_CFG2_ENA_AMPCTRL | - HSIO_PLL5G_CFG2_PWD_AMPCTRL_N | - HSIO_PLL5G_CFG2_AMPC_SEL(0x10)); -} - static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) { int ret; diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 2080879e4134..751d9b250615 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -1183,4 +1183,6 @@ ocelot_mrp_del_ring_role(struct ocelot *ocelot, int port, } #endif +void ocelot_pll5_init(struct ocelot *ocelot); + #endif From patchwork Fri Mar 17 18:54:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13179375 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7F1FC74A5B for ; Fri, 17 Mar 2023 18:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbjCQSzA (ORCPT ); Fri, 17 Mar 2023 14:55:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbjCQSys (ORCPT ); Fri, 17 Mar 2023 14:54:48 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A44463928A; Fri, 17 Mar 2023 11:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aMr8NKU5IA6ewurLyGFO693Y7GEIkGsENDaKEYVqf6OPcAeFkZ5gyCenbJp3Z3teqKyvJDrySyTG6lwWYZNqmwc7iAy+uO2ToJ/IS00Q+AE6VaD5nMud96X1YMP8rBjWUPRj7dmHdK6MU0eF0lrOxgOCbClxL+RuRjDJeIBaMrG7uzdeYklZqppjQMOBr+tGDH7zk7p/kOiVMOE0zhlN4e0b3KGCqlxbdTY/PoqwxAbg5gUPk5HfunzR+fGXSI36uoscjf15rF3bl6n0rEOxHd/+Fv7hcW6DLbpaRQiD4O0P7gTebG/40fBsitWN60oYck2LczlTO5fZBBVPscqopQ== 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=+0ufdUKS0RnlyM+q4OcDc8qdZPRU3YB4wxPLaAJjtxM=; b=g6X1PcqXnfXZh2PlifCnRk/YcWw4qrM4Zz1PIp2/MQ5gL/VNqKDGBJDGAZcp9reG8mOPtdMQN436uJb2aDPzACYgCaAuHLo5Wy5sVTN6JF1w5Dxryslo+rUCAZ6wZAiaFIeHGDOlYn7KjMay6T2qcEw9Hx+L7q7i1718uUw98qmvAFfemI/d63nfUa5JrlyFjthiuse09VU1As58afSwpKr0eSHGLKUbwrxSi/fv+8PsmdQkypNXh5rTLrmv7ZxxyY/TuKx8OANSTGly12p7AS68UlTAqjt6lRlQSOvrC/PcfZMrVXUDaPDEPJ4BHwkkptg6ZQ/7bRKfTubBsBuYmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+0ufdUKS0RnlyM+q4OcDc8qdZPRU3YB4wxPLaAJjtxM=; b=YyezYYw84v/6OP5YSvPE76ufgy0PNJ0sWyJ+kiiIB6+0Wimxp/1IbJu0jKUThNF6aQLc2ZBwPhFRDdyw6+2R3JDJ53VMWIJPuwFQzvRfPeOngOLHbNki1TnRQsH3UJhm2/QjXPGxw7uIuB5Ucez1dvC5MUV+V3CkqQOTsps74u0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by CH0PR10MB5289.namprd10.prod.outlook.com (2603:10b6:610:d8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.35; Fri, 17 Mar 2023 18:54:34 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa%4]) with mapi id 15.20.6178.035; Fri, 17 Mar 2023 18:54:34 +0000 From: Colin Foster To: linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Kishon Vijay Abraham I , Vinod Koul , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [PATCH v2 net-next 4/9] net: mscc: ocelot: expose generic phylink_mac_config routine Date: Fri, 17 Mar 2023 11:54:10 -0700 Message-Id: <20230317185415.2000564-5-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317185415.2000564-1-colin.foster@in-advantage.com> References: <20230317185415.2000564-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY5PR16CA0025.namprd16.prod.outlook.com (2603:10b6:a03:1a0::38) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|CH0PR10MB5289:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d969a9d-5986-4a35-a3e6-08db27190c7c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ss9/WuWuUcRlUEwiquVB47MHmZKl9g9GHz91K8MxTcU0OOqaEuh5+DzG5/XRyVZsdIYneyRfnmGiPJihNYY0yDsk83mlgyorvYHtW46ejyGE+xPTzgINgpcM0z9ga1zNGo+p7ZNWCrs5ReyXXO5RTksij5joJXl7RGok2YE1eQsw88Ycum27GaQr5eAe6bd+D5HBbliPhDHeuNHsUaHfotvUgCGvclutd1h5B+5IG8VswBZDOkVvgWNqFkoI7aB9jM8aaxg8DYM0j5W3V3TgVZkz/CJuiyYgzseyyvYUqR0mgS8udvr1qcFRrNW6MT7WqonGhfljfHBVzxmcjQ8zu5IUWORbCh9cxYnUrwgxs2GnCcfXBnT7if+/eQgvuCWpFVhVM27U6+NE/AIR2i1jf1ojbPECLhi+MBXZWfWrjL//suRe5gIOJGZCBu6JkYsLDq2FGkJ1K0n6mo06kdaF1f3EGOXTdhh5GlUP38oVryN9hDuEHZmwoXY7PTZOAX2q4hgy4Xt6vOxz+lYCN7QQGSfhmsJPkuBBSRCWEjqy/WLAgM8GBL2gLZm4Yv/fEjo9WRaaQxYS+EkElmZWHzaBRQU8MqR2W2qHbFaTX3VNKZ4kTFu7O4GGT36YIJNRaJkBV3MAZ3cFiNh24A56Wiub8RjQ4rcYK95Vo6dbi7uv5rI9QWYew4u/Zz7Tp9YhH/PiIARlC6blLVV+ae79B6dZ5KrzH1C6xBqsOxrWP0FedcM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(396003)(346002)(366004)(376002)(136003)(39840400004)(451199018)(44832011)(41300700001)(8936002)(5660300002)(2906002)(7416002)(86362001)(36756003)(38100700002)(38350700002)(478600001)(52116002)(8676002)(6666004)(66946007)(6486002)(66556008)(66476007)(1076003)(4326008)(83380400001)(54906003)(316002)(6506007)(26005)(2616005)(6512007)(186003)(41533002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E6/gKIXLXdVlJ+FS/53UwG0IV0CV/S9mKJoW9K+Dkmk+Ibb5S6ZWfOXzAKuyI8LXxB5Ia9HTq6hJr7LIBKPtb3Mw9cRG8i3l3TuVjR1umlBcnpwKLdYYwTdSU1egJPRy6DsIMfAs5GRSJxq4FZaQbiUG3bcAj1wRi0ggnWj/5bPBEKcCvZEQXQeBtJ3w+7mhV7Ub+75aPFJCP2+Mzxg+1COsIT09CVskInK9j7AdfIpHV5c3ox/LVFYa35FV5I7M2W4+wN9BBSllXRIoVRh0hu8Jbu81eI7m+MWjak/UhLOPdFsPBcXweUZXuPZqhvQ1KOQUXkqWdB6/mqlbsJW9/MWN4x/l6D8tcDnyuGEsPg/44lRoV6E7htoxsAaraSHnQ6RolwTRfRoFbxsOaNdTGL0ReVsASaNRhjF8MDniq+S6590AIoGSkYs+VaTfMdubzMAKJixaC1kdtr89RVdFsgiRCyb+KH3MZb3Zo7A2HaYGugqYmbDoEW8oo3BlJkYASuFAmSVLk0sxIHMTBGUTBJYzncnT0AiWy6JDJij0F/zXx6A4ZvwwSMcRXoBZHkYWYZUvLAIPxPglQ5Tal8OLBbCkmoUJDrUVMXlDUedpdPyHCOXViNujC0Yf8RhLO4x82b4w4i3fDlQkyfj2nHqBJ6Nl3MA4w81wufgg7GS/TiZI7kBd48vghOqzF0n4aZhS5mFErqT70s9KU+9VjXqbDHW9r4VcDHnxu/IX2vqrWngwI+1YhQmqvDrQniQFfd7PAln+9c5Vr5390nsEqhZJYpkSFGuOYEezVHvQ3Q0YV2q5foI6t95ykwxzUsDB5gAtXyPbCiQO5rguRb4LLuA3BswP58opy7/+naW0UpbvQm6yfuO0G/j4RIgGS1MR6IEec975lvrmTUkXMPLzQ1eKialRKqmH7FTL4xH+6mkstLEpL6UGOW2YuwkoceXMI0jdehyt3ud1pblhPZ0jLxEcUs7h6QqV7c8h2TVvrZt9CIQsQjtpR66G+udiCL+yxrS88Ciwn0pjk3vD2Ow104xhJKo8IMQCuKQz/wVlP/G2lfy+FUzs7ipHKsc4UyXhSXEDSz0iSLNEskwqoNpfyxzpSQhovzYCOXI5osnpl6rWRiN1YVjAbWLwUmK4SxfpRBIu/rDQhwv8PCINn01dB5h2HIqEurSvOMoBZmIVV3qmjuG2afHEVqaHr79kkkblW9PGGUUw+G5p6kxTnY2ItkCANUveprSb/i2KH7ft/+Xc30UJtjZJX/c4vDt4QC0zo6bn9lk8MafalB+9kjnOD4BYOZ3hHqj48PP6xRXnSHbf/UKk3WPfAhzqVHeIawN8A+2tPfarAwaPuVovY4smEl4bqv0TglNzC7hX5tYEhUArcessnJEyqIIBE0exk4GBuN7zTj3ZezJovaAvmKrapXKb/Mp6kNE2+2x1JcxqZykOSTK0xpBpm63ltEzPLbXc6wt9ZbGygS2pfImwyseBwGKTwIffaEeD9YkMF2X+B7BnyOO1MS8MHutMQlR9ZqcDZzyX5RbqRzj/eHLznwdORN2tLqad/3BZhJDMUdBJ6Es2xKPm6LqOIZyoQOtlRqxEPI51RCbLItevGkK+0WOOXz5emZcz9LG0HF7O2aXwGye5ZUo= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d969a9d-5986-4a35-a3e6-08db27190c7c X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 18:54:34.2092 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3LllJtHX5OQFFSvI1WY0rLiLvlf2v+krwT8g0bhQAPAx2FcNwhPcz+MJAYhfo9k27rhjkTghwTcMQyqIpbHQlF8bDasGqhpefSBZzLj+iag= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5289 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The ocelot-switch driver can utilize the phylink_mac_config routine. Move this to the ocelot library location and export the symbol to make this possible. Signed-off-by: Colin Foster --- v1 -> v2 * No change --- drivers/net/ethernet/mscc/ocelot.c | 26 ++++++++++++++++++++++++++ drivers/net/ethernet/mscc/ocelot_net.c | 21 +++------------------ include/soc/mscc/ocelot.h | 3 +++ 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 9b8403e29445..8292e93a3782 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -809,6 +809,32 @@ static int ocelot_port_flush(struct ocelot *ocelot, int port) return err; } +void ocelot_phylink_mac_config(struct ocelot *ocelot, int port, + unsigned int link_an_mode, + const struct phylink_link_state *state) +{ + struct ocelot_port *ocelot_port = ocelot->ports[port]; + + /* Disable HDX fast control */ + ocelot_port_writel(ocelot_port, DEV_PORT_MISC_HDX_FAST_DIS, + DEV_PORT_MISC); + + /* SGMII only for now */ + ocelot_port_writel(ocelot_port, PCS1G_MODE_CFG_SGMII_MODE_ENA, + PCS1G_MODE_CFG); + ocelot_port_writel(ocelot_port, PCS1G_SD_CFG_SD_SEL, PCS1G_SD_CFG); + + /* Enable PCS */ + ocelot_port_writel(ocelot_port, PCS1G_CFG_PCS_ENA, PCS1G_CFG); + + /* No aneg on SGMII */ + ocelot_port_writel(ocelot_port, 0, PCS1G_ANEG_CFG); + + /* No loopback */ + ocelot_port_writel(ocelot_port, 0, PCS1G_LB_CFG); +} +EXPORT_SYMBOL_GPL(ocelot_phylink_mac_config); + void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port, unsigned int link_an_mode, phy_interface_t interface, diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index ca4bde861397..590a2b2816ad 100644 --- a/drivers/net/ethernet/mscc/ocelot_net.c +++ b/drivers/net/ethernet/mscc/ocelot_net.c @@ -1675,25 +1675,10 @@ static void vsc7514_phylink_mac_config(struct phylink_config *config, { struct net_device *ndev = to_net_dev(config->dev); struct ocelot_port_private *priv = netdev_priv(ndev); - struct ocelot_port *ocelot_port = &priv->port; - - /* Disable HDX fast control */ - ocelot_port_writel(ocelot_port, DEV_PORT_MISC_HDX_FAST_DIS, - DEV_PORT_MISC); - - /* SGMII only for now */ - ocelot_port_writel(ocelot_port, PCS1G_MODE_CFG_SGMII_MODE_ENA, - PCS1G_MODE_CFG); - ocelot_port_writel(ocelot_port, PCS1G_SD_CFG_SD_SEL, PCS1G_SD_CFG); - - /* Enable PCS */ - ocelot_port_writel(ocelot_port, PCS1G_CFG_PCS_ENA, PCS1G_CFG); - - /* No aneg on SGMII */ - ocelot_port_writel(ocelot_port, 0, PCS1G_ANEG_CFG); + struct ocelot *ocelot = priv->port.ocelot; + int port = priv->port.index; - /* No loopback */ - ocelot_port_writel(ocelot_port, 0, PCS1G_LB_CFG); + ocelot_phylink_mac_config(ocelot, port, link_an_mode, state); } static void vsc7514_phylink_mac_link_down(struct phylink_config *config, diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 751d9b250615..87ade87d3540 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -1111,6 +1111,9 @@ int ocelot_sb_occ_tc_port_bind_get(struct ocelot *ocelot, int port, enum devlink_sb_pool_type pool_type, u32 *p_cur, u32 *p_max); +void ocelot_phylink_mac_config(struct ocelot *ocelot, int port, + unsigned int link_an_mode, + const struct phylink_link_state *state); void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port, unsigned int link_an_mode, phy_interface_t interface, From patchwork Fri Mar 17 18:54:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13179381 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BF8BC6FD1D for ; Fri, 17 Mar 2023 18:56:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbjCQSz7 (ORCPT ); Fri, 17 Mar 2023 14:55:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230127AbjCQSzZ (ORCPT ); Fri, 17 Mar 2023 14:55:25 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2108.outbound.protection.outlook.com [40.107.243.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82DE21689B; Fri, 17 Mar 2023 11:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RrQFb73nji7IMN+vQIgck/lzexEcBQyYtWvOzo7VQovdxns+aYzgFdaWrL6rFT3G8V/oL1PYxJadxRHnPf6AqEaKTq6WGmEQ6+2DdG3/Rm+RSHDcadyQeDc4z4a4f2mabYRWjJl/QpLcotfycfntP+erLZ+qCg5rcPV6GrAIzpzKbjQDgZ9ePP6ThBjwnhB14pbbWQkA2zqBdvVEzoR9JlWWc9EBQEKVTvdbT+xtpJ3iA910ZvQIQ6/C50luQvvSgrbwkwifCP04AzBvl6vDvv8J6ucVSG7nabB+1ZbI+JIPIr5rmyTZvRv5YXeHwJtP9pdiyLKgFOhy7LUjsfcr0Q== 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=afirkYxq9We+wpvbVE/YgSrfNUSP5IDRkvzeyR2TCh8=; b=FD1L537UgvTeVxmOTpgCQ5f1GJ78RwNsx6ED8ERkLCSgxmHQ+p3kT0PxOt5WtgLo/ZTwTrcyfFNfcXIclFE24n46bcBWUVkPBNCJQdBoDHfclzjfMqYyt6ZOlpN1/O71km8RHF5h05BGGbe6CiZRYXsHk9/83FU6jht6yPjqwhHoC45SEKtAwUxrPSzCd3K0rAvOWHPHTa5ipj6hk/VqVp5R35FBLEoWOw7u4YyVodZPHwVNHNeMAR0E1rIw/Tla+9axXHsK0iLTNFZlr6Jg6ymAKoDpfMSlLll13KGLbwnNu3/uV3pAfFDEaTK5kFU/Urum2ZHSLOlF2Oz/glf3iQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=afirkYxq9We+wpvbVE/YgSrfNUSP5IDRkvzeyR2TCh8=; b=j21L1ROKZETjJSWdRClxv0FdXDm8VAuOxC8EQ1IEu5CBCmIiRJKIHCcyrPfIsfu6tIqFE5XcF7cjtaTksQ7CnAjURqLHvqCDQ2Q/OfX37xI7WeBurhEQvFBYBfCS97I4iJa4zj7Z/oblZgcY4gMLMxIkATHCy6AVL8ESPmCCImA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by MN0PR10MB5959.namprd10.prod.outlook.com (2603:10b6:208:3cd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Fri, 17 Mar 2023 18:54:35 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa%4]) with mapi id 15.20.6178.035; Fri, 17 Mar 2023 18:54:35 +0000 From: Colin Foster To: linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Kishon Vijay Abraham I , Vinod Koul , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [PATCH v2 net-next 5/9] net: mscc: ocelot: expose serdes configuration function Date: Fri, 17 Mar 2023 11:54:11 -0700 Message-Id: <20230317185415.2000564-6-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317185415.2000564-1-colin.foster@in-advantage.com> References: <20230317185415.2000564-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY5PR16CA0025.namprd16.prod.outlook.com (2603:10b6:a03:1a0::38) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|MN0PR10MB5959:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c9bedf8-eb8f-4d17-e5b8-08db27190d44 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NScfzaKpkD8MnKUGG8ObVZ3z5nhQ+19SybrFUnkrMIZ8+w/ZE6/+WSxd2vnwvq/Yvz4E1on6yIbp9LoZZeQgLh3wSY3KkBUofMj+44O6GKWIWS8Kjbgej6CInbn83zWV5J2WoUXnKWXD2jl0IigHMzE6afDLPeaCkCiIVieDx2EdvaQbDtT38vqcvwGmOj/+YkmWCnlM5rMy0Ab2kNsl4QSZr3P0uuCxnm9EcaxoDvf3GeqKvfeIxC/xnRHD8I/c+tdmFDvtvD4udIBULIQqc4KnMjjZjMnMifpoIejXl8/UmnHtL43ceyNB5mpA9awX9fjw2qm12kaCmbD5V1JVBBAaqnjg6d24KeygAGeOwXv9G93wRK+7P/V4kJsCE/oN9WjDOHPjdQ4wLUw3RdcpFuIFx3aHYSTYsnTW9SkjrOFaDBYqf7azCEQ7qB6cDLgOmdHm0i5iFz0cvN2y59NEUxcfabSvzrkEqWK+AivPT77UMwhNGsdpbAXTv+wb6IMMfWdarhkpDRewYbMpmy3VRllKOKAQEjZctEQwPM9WLlBVzXOZ+IN7uIlrVjS4Nc+YZh+e7HE8/s7OqF7SdmjsC+rb34fjJ7rzGpGtL2YNhHAl3bb8r/VGbpTgRDTaPv1bQLSHYFGL1aRFc+vMYR/4ZfXNQt9bNcJBb84jk/Q+TNnL/MC9lrVndadjrf5BSFVAf0cYT5O910ApEFsC7rhnow== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(396003)(346002)(376002)(39830400003)(136003)(366004)(451199018)(8676002)(86362001)(5660300002)(44832011)(7416002)(478600001)(66946007)(66556008)(2616005)(52116002)(186003)(38350700002)(6486002)(6666004)(2906002)(6512007)(1076003)(6506007)(26005)(36756003)(66476007)(38100700002)(316002)(41300700001)(54906003)(8936002)(83380400001)(4326008);DIR:OU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GCfigaEqJwdN+DoMKLl0ReOpUuOaP3y9s454Z5wIRBy/j3rCvAd32N3Oe5k8MD3m9n7boZsFa35XLykWbjH6Hbmx7JOIdcQ5bArcMe0nRvefnDXK9KfqwwCW7hyfRwnnCcB83cYZyIdoHOrMQW7MBWYolJJQ1nDUKDPhjJdEj4CAVXi1E5Ki1MCUG3Ds+A3nTEp2ZIUhlzW11yP+VSayFAq9L8UTqCwO3ncqASeG/rYR/u+1Naaxp3LH1SXTji4m3XjsIp5n3p/bD1IyrtC8vNv8vkYRvnjStSTjjPdVNpHC7gV2niTqyHuZqsAuDd898BNtTMlv5FO+TLiNKa3bo5qtWf+vcvvCAQFXZo7kPWWrvnNJL2jEEWoyOCeSDW+DuQlKfV4YiPlrVo9zmFR0xW/zlr4xnS7xXK8dglc2QH3giCKPTvWltp0jrnXSez5I3NgiOOI1VI3PGPjnTa052a7q3G5rYl3ppkX3am0CCjIHP8PAolhIfUgf3qR/99W6qjXACaYaDDETcUU8P2xX+fBizLDh0qHPCKGFUjfZ36CWhK2BXQeq49uHcKnVYlWJtto1oVf+TfcCvyMEc4y3pQg3jDCq+61zqIT8xdG/QMgEp5ttxez7ZNydDIbFKfDc6nCCz6k8sdU= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c9bedf8-eb8f-4d17-e5b8-08db27190d44 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 18:54:35.5372 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: V3SiKB1XFAX9tMwkTPhlL28oNOLrT/XVwQyU29S6oHYMALgVlSMEKtRSSJ/EK8X/fEzpvaem0DhlfZ/LI6q4LV1f4vJp7CL+JEdGOyoYd5c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR10MB5959 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org During chip initialization, ports that use SGMII / QSGMII to interface to external phys need to be configured on the VSC7513 and VSC7514. Expose this configuration routine, so it can be used by DSA drivers. Signed-off-by: Colin Foster --- v2 * New patch --- drivers/net/ethernet/mscc/ocelot.c | 40 ++++++++++++++++++++++++++ drivers/net/ethernet/mscc/ocelot_net.c | 29 ++----------------- include/soc/mscc/ocelot.h | 4 +++ 3 files changed, 47 insertions(+), 26 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 8292e93a3782..1502bb2c8ea7 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include "ocelot.h" @@ -809,6 +810,45 @@ static int ocelot_port_flush(struct ocelot *ocelot, int port) return err; } +int ocelot_port_configure_serdes(struct ocelot *ocelot, int port, + struct device_node *portnp) +{ + struct ocelot_port *ocelot_port = ocelot->ports[port]; + struct device *dev = ocelot->dev; + int err; + + /* Ensure clock signals and speed are set on all QSGMII links */ + if (ocelot_port->phy_mode == PHY_INTERFACE_MODE_QSGMII) + ocelot_port_rmwl(ocelot_port, 0, + DEV_CLOCK_CFG_MAC_TX_RST | + DEV_CLOCK_CFG_MAC_RX_RST, + DEV_CLOCK_CFG); + + if (ocelot_port->phy_mode != PHY_INTERFACE_MODE_INTERNAL) { + struct phy *serdes = of_phy_get(portnp, NULL); + + if (IS_ERR(serdes)) { + err = PTR_ERR(serdes); + dev_err_probe(dev, err, + "missing SerDes phys for port %d\n", + port); + return err; + } + + err = phy_set_mode_ext(serdes, PHY_MODE_ETHERNET, + ocelot_port->phy_mode); + of_phy_put(serdes); + if (err) { + dev_err(dev, "Could not SerDes mode on port %d: %pe\n", + port, ERR_PTR(err)); + return err; + } + } + + return 0; +} +EXPORT_SYMBOL_GPL(ocelot_port_configure_serdes); + void ocelot_phylink_mac_config(struct ocelot *ocelot, int port, unsigned int link_an_mode, const struct phylink_link_state *state) diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index 590a2b2816ad..21a87a3fc556 100644 --- a/drivers/net/ethernet/mscc/ocelot_net.c +++ b/drivers/net/ethernet/mscc/ocelot_net.c @@ -1742,34 +1742,11 @@ static int ocelot_port_phylink_create(struct ocelot *ocelot, int port, return -EINVAL; } - /* Ensure clock signals and speed are set on all QSGMII links */ - if (phy_mode == PHY_INTERFACE_MODE_QSGMII) - ocelot_port_rmwl(ocelot_port, 0, - DEV_CLOCK_CFG_MAC_TX_RST | - DEV_CLOCK_CFG_MAC_RX_RST, - DEV_CLOCK_CFG); - ocelot_port->phy_mode = phy_mode; - if (phy_mode != PHY_INTERFACE_MODE_INTERNAL) { - struct phy *serdes = of_phy_get(portnp, NULL); - - if (IS_ERR(serdes)) { - err = PTR_ERR(serdes); - dev_err_probe(dev, err, - "missing SerDes phys for port %d\n", - port); - return err; - } - - err = phy_set_mode_ext(serdes, PHY_MODE_ETHERNET, phy_mode); - of_phy_put(serdes); - if (err) { - dev_err(dev, "Could not SerDes mode on port %d: %pe\n", - port, ERR_PTR(err)); - return err; - } - } + err = ocelot_port_configure_serdes(ocelot, port, portnp); + if (err) + return err; priv = container_of(ocelot_port, struct ocelot_port_private, port); diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 87ade87d3540..d757b5e26d26 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -644,6 +644,7 @@ enum ocelot_tag_prefix { }; struct ocelot; +struct device_node; struct ocelot_ops { struct net_device *(*port_to_netdev)(struct ocelot *ocelot, int port); @@ -1111,6 +1112,9 @@ int ocelot_sb_occ_tc_port_bind_get(struct ocelot *ocelot, int port, enum devlink_sb_pool_type pool_type, u32 *p_cur, u32 *p_max); +int ocelot_port_configure_serdes(struct ocelot *ocelot, int port, + struct device_node *portnp); + void ocelot_phylink_mac_config(struct ocelot *ocelot, int port, unsigned int link_an_mode, const struct phylink_link_state *state); From patchwork Fri Mar 17 18:54:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13179378 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF9D1C74A5B for ; Fri, 17 Mar 2023 18:55:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229987AbjCQSzZ (ORCPT ); Fri, 17 Mar 2023 14:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229985AbjCQSzB (ORCPT ); Fri, 17 Mar 2023 14:55:01 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EF7F38006; Fri, 17 Mar 2023 11:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SqUR7yDhyfaQBCOCpzeyGv2NNcDUUJGiZwsuiMNV/fbeT4CidSpz3IFR1khWEaL4e8t/LatkMSy6WcoftYO/WJZSYOBpDwfwdPj50EptFBGeAMV9Mhu7G/q3Hh0pGjMpSrNMDh/9IkuGGTwqcbLarvjM3yY8srF2kHhEtjRNjw9nyFLxW3YaJ1YzcgariqpRkDeAInpQhyXg1cciWo4S8Yb8ZIkLbI3UCYPHd8XFt2a3IrTp7Nkk63TJswyhXZw83UYgGFwMpNxDrbFvnIsv0zy7DQiwfNkPkPxlamyLsDQzhLl1jxiu6i6d9hdStOE4mOJl1njhMD0SHEtkwv8MjQ== 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=ECnQlW8CcTHfw9R2rNPzg6MoANDLlmn6PgI5oEwVaAY=; b=grXGE5eWSJN5gKKcwrDprvlWtOrdS2CqIR161sl0eIVzfuHBCTBhefJfi48FN+u695hHjy3SNAYAEGCal2jakpTsG6Soo49pfvzWaTzf/eZXrkPnTbmBN8Pe8rrdspHM5NW0OeGjSKgbhOIRlJA4YrNhFjlvGmNWunMgjksjXogVYNiYWDYGEiFQSIQFus37Q8pto3hCRx6b+J5m1PoaRnMsDAdpyytCqfOx8ZdUyhTpPDV2x9VxwEZfdcJf0+6SicVMao8DMlZRYD74X+Z/XlgE/lUrfIoTe8z0vTO4IuPuP2XXrZ7oMY7SglOysdp8KxDtWZDENSqRk2K+wiXgrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ECnQlW8CcTHfw9R2rNPzg6MoANDLlmn6PgI5oEwVaAY=; b=hc1ds+WRlUUze2JUY3z9TnLY8cr+eyn0VQ8LCfyq5q/fvAGdQh4BMf9OOyIHu+MQk0dNor+/TGEFM6IWZNFpg2yyWIrvoTaTXfDhZ4j8WRCdWarC9skJv67tN+dlMrDakCTVA0zwrrVledk8eOWFtGgFB5XO7GvdxOYs0DRjEgA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by CH0PR10MB5289.namprd10.prod.outlook.com (2603:10b6:610:d8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.35; Fri, 17 Mar 2023 18:54:37 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa%4]) with mapi id 15.20.6178.035; Fri, 17 Mar 2023 18:54:36 +0000 From: Colin Foster To: linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Kishon Vijay Abraham I , Vinod Koul , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [PATCH v2 net-next 6/9] net: dsa: felix: attempt to initialize internal hsio plls Date: Fri, 17 Mar 2023 11:54:12 -0700 Message-Id: <20230317185415.2000564-7-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317185415.2000564-1-colin.foster@in-advantage.com> References: <20230317185415.2000564-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY5PR16CA0025.namprd16.prod.outlook.com (2603:10b6:a03:1a0::38) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|CH0PR10MB5289:EE_ X-MS-Office365-Filtering-Correlation-Id: e92919cb-43d7-4821-62ea-08db27190e08 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JwBlKbUGTTQPxoQX6hMes8RAQZlmOgZYNindHCYWIdcTOcb6bYNjH6cUlCSvLvQBZPomq74o2raUhzrk1co9Sf9Cs7ps657sK1D7Q1WTPEm7/vYmzRaNZFMX6wskhuPLBF8gLTjVO24c1xKlFHBvcTfGdIk6LUitTT0J1piKVVCN2Q8Ggrc3XnQcc42AzaAEC4TRYncDw/WmEhx9TPIfRoUMxAa7JzCWg9PP0E5KWM6JxG1BcKgSuJ4xHKiRx9SEasz9HBnBqXa4vfZm81aj2E/p/7g9q4q4q/yxrzBxRy6Yu/bSbcpLMxKe04sbkQ4bno/rMT8sRjdGRQM6dQzgHcPqAhFsj4roIDGc6hgmvLTFJwGqU/qRbAsWMa3znvh4xWK9qyfa3y1o61XM1M+G7hwOR82Vjj/yNdBMtnbVGHrgcEXD1wTKUt4vquI1J4S4+LDgetcocZ5IjdyivkVW1fM6SMAVOp/B6JZyYP9NGJ8HgkK+xRn+GhUnulsV/kcVFt/UJxz2X9JbHWJVEG727B76P36qOr/4AiliMHkBFil9GYG2uZm8NEorWAxlxCkyajVV8n/QH8Nq8++r9gPMnG7LslJi4OECA9okd8IYqKdiHRsbqO5SQkQLlCE3QbZZw4x4W/mATpDawaPpoSsPPFUnSR3F+v9/eBr3Lvx/VrINdw304IvzZGJ1xLxaPY5/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(396003)(346002)(366004)(376002)(136003)(39840400004)(451199018)(44832011)(41300700001)(4744005)(8936002)(5660300002)(2906002)(7416002)(86362001)(36756003)(38100700002)(38350700002)(478600001)(52116002)(8676002)(6666004)(66946007)(6486002)(66556008)(66476007)(1076003)(4326008)(54906003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LmjCi9DuMwks6GNpZqxgr2+ZgrnqeFBu3NP5coAKdpdADUO++e5NYEfngMiqSYGc2pbjmoJDXACtxwy0FNKHH4b/qtMpoXTezJWw9apzbZXnmYvVs6XcyJDD2tZyJ87MMJcbrXMxJcY6M9TVkVRPsyPtWe/qm5eau2/Ngbswquk34rla/FlD/GjgYjRw5QscEMAQ3rksDLYHSenaBg/eb0uxRbQlDJFl0jGY12mOQKZQuibbwr0pUsKiKqIGNaDrk55BblnO1HF+fXFNU0nf56hEU56Z40ppB5IN5U0xKi/CDNl8MzWYSSWhzaDDN9LgIGbIK0tppoWk+CPDW9Skf+QE66NSFvNM9G2deMPu1yYDXtHwKK+n6w2UYBfUE8miRy7Nm+lftHz1T8LNYzYB+/G7TvtAB2UEfUxMGGyt0sZ+BXA9obtVWadj2SlIlED+0qfYiUS0AevYKI8ZoKy76exINla/pUezZ7G8CjuGqDRmvnHOv9rctGND6o/DWhE22NO+i1hEBNDwLTt/wCeeT+hpk83R8IIkzKi9mkGaGNynPOYxauimucfMbvvoxLsin5m6nb5ZAAvjUaOFLwdZ11SwpzlAzlkrC4LdRPbn74+FSJlBWQvMvKK9i70B3Ri01NAMOoHFlPjzhV6Rt3VQXLEfvuWgmjPurA= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: e92919cb-43d7-4821-62ea-08db27190e08 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 18:54:36.9122 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FUJXuHienEuo99Q1MjFR5RbEaS79XOAwAqc4a5m4khQmg2hUaF7s6wEYCigZN3bfaUbikqnpnvnWBvn6MFRI8CVrmG/UwFokt5bxiZV99bI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5289 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The VSC7512 and VSC7514 have internal PLLs that can be used to control different peripherals. Initialize these high speed I/O (HSIO) PLLs when they exist, so that dependent peripherals like QSGMII can function. Signed-off-by: Colin Foster --- v1 -> v2 * No change --- drivers/net/dsa/ocelot/felix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index d4cc9e60f369..21dcb9cadc12 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1555,6 +1555,9 @@ static int felix_setup(struct dsa_switch *ds) if (err) return err; + if (ocelot->targets[HSIO]) + ocelot_pll5_init(ocelot); + err = ocelot_init(ocelot); if (err) goto out_mdiobus_free; From patchwork Fri Mar 17 18:54:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13179376 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B443FC7618A for ; Fri, 17 Mar 2023 18:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbjCQSzD (ORCPT ); Fri, 17 Mar 2023 14:55:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbjCQSy7 (ORCPT ); Fri, 17 Mar 2023 14:54:59 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B4CC33CC5; Fri, 17 Mar 2023 11:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q6n4+t6nyV3pDhqy/B4r1jpxwAJgiHoB9G3PYgAMes7bbIh41IY0uL7eoStIEqtbPntHk/7XrFyGdKg2S4pBHnwrcElqy82fID7uy0Jh9FQCvgClXeqY5UROVZLb/9YUsxtc5NwXgi601H3+ZWtnBNOoG2JJDSbd89YqMxAgUdbtqv9K9cIp8WFORRdoWXesFpaaA37Vn6BXtWeOttiKGCOS4XcB4bIaVo4YQE0jDIE42Bj16PdZlcpSfBMaozt2z8RKAEY3/+YPw85/2OR38q5S5caD7CrxJaf6SfnCfWpgN0hyzCXGYQlNcQbXVcwT2jl/5nDx1KUmHDeFU+yuPw== 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=U98yt0frVEXxN7yvtH3nxyAM2KDkva4smn9pvieFhn0=; b=XSz8S5oh/BQvOXLFK34+cxBY+8CpFaFJymZG0clHxjbLZRG+gRgLQnWaiL8smDx+V5BAMoJo1qZkPt+xR7M2lsG14dWAk7bID/qkSQkzyHqoUWqS4UuClgXrb2IP8QXXBVyfOmi+JRLu6am9/L5Vgqrg8V2dgaKc47bKeK9Px7q7F1shXJ72IU1exje6Jaoil+DWjp8FcRWMfQTQwT9Jp5vyTpSH4tySR4kq408lq5utr58ut/nnmj9mTX6KbsUBs81TPxZjFw8zeXNU1G97f7qyCKnJgYpdV9JglHNeA2dE1q+DSkAlNW8WMFeMJxfrfkrqyfa58QS39wvEUeelog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U98yt0frVEXxN7yvtH3nxyAM2KDkva4smn9pvieFhn0=; b=CJtS81MqQ+sPf4zTD3WRRCy6Opji+kWavYXfeBdYS0g13PQsvKSYfruEYiWCk2qrsYVa00rpOBSlCPVcydIuSDZq+7tCGcsBJtLsi4YUeJAq7emVgTcbjja2qkbNhLtwI2bOIwXG3H0jl18KWur0jWsIT+Bme4d0seR8AdoJ2U8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by CH3PR10MB7530.namprd10.prod.outlook.com (2603:10b6:610:155::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Fri, 17 Mar 2023 18:54:38 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa%4]) with mapi id 15.20.6178.035; Fri, 17 Mar 2023 18:54:38 +0000 From: Colin Foster To: linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Kishon Vijay Abraham I , Vinod Koul , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [PATCH v2 net-next 7/9] net: dsa: felix: allow configurable phylink_mac_config Date: Fri, 17 Mar 2023 11:54:13 -0700 Message-Id: <20230317185415.2000564-8-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317185415.2000564-1-colin.foster@in-advantage.com> References: <20230317185415.2000564-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY5PR16CA0025.namprd16.prod.outlook.com (2603:10b6:a03:1a0::38) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|CH3PR10MB7530:EE_ X-MS-Office365-Filtering-Correlation-Id: e0a4937e-a1a4-433b-b737-08db27190ee3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qBIS8Tx2pd93CVFM+wN2aC1FT0YKBAvo8cWBElw625Z5hsb9siRWOrH4AHjO3xkTy4dTvYZwta1t56tlnzNxXpafl4l7Bdd1r5i6WnRzlqSpo+u6ThorPOLIxNIUhs8xe3fykAYMTCRHXrB7+8sWsH4uquyaVaL9FvfdpdCPII8qXAz+F4C6O/e5PAjqewUsDUZWt/gHYbp9dgZY+yoPnp24G0VCY6iPjo4HCaWCW4c6g4L6GWp31Xn9H0e5oJBqGbVH50pxoDg0WqIjVA8CRIpOs67Vrw3UZVGTA+CbO8CtUp9dAqQp/Aza0/oVHJNAJJn8uqiu58JwRur8As/p/ByOxefX53eww0O93/V/SWCngYL7UC9cv1MdvlqHUJlXNRnQsAPaXsmmvjQQEgkTElGp361Hkv+DoPgZA36tEwPLhGzBLnD+FGtdtqGPkpBLdbscVw6jRQnDEQXoHMscanQA4ZgzzqSG9YfzXUhslJDNLu06O6aeNmoIFjFqWB2PEDZMiH5pjVJaAVIlmsfX9QVN5/6nhw5h2pWXdCVWPBFIyqNbZNldoIKQyw0PEMvGoEEnAccRu71RBM2MsQypuFtWGIDA07+6IeCfbabtAhp8cCq1sVf9IzSW2TdEbn64Nr8vWwqHsc4d7gELD2bg/3P6Z8N+WNRHkEqKC+x2Jct/rrfOFBALGmfVJozjMzmOzBK3RB33ka0DlOGgGl2Uyg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(396003)(366004)(376002)(346002)(39840400004)(136003)(451199018)(54906003)(478600001)(41300700001)(66476007)(66556008)(4326008)(8676002)(36756003)(38350700002)(38100700002)(1076003)(186003)(26005)(52116002)(6666004)(8936002)(6506007)(44832011)(316002)(6512007)(6486002)(5660300002)(2906002)(83380400001)(66946007)(7416002)(2616005)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FixaEPj0yFs7FFqxPfm8qkDNuQCQmEGdiS2ef/GdlJaWnxZhvLUTjACyZP3fExA7yCRnzJe0P8Y4g4dd6a0BSeuy71ZHQSiTPDgAlWz5GBE9QTqXZAzy1e6Oov3KMPm2ukf0OSfwTM27HkMsIyi4c6zoqDTt1iTHRmY1QC65K1/dTI2rAy9wXblw8wmioAAQGUSdkuEmt9OFcNg0frBJ40u/pKAtrdnOIDTpHUZfwh1bIf5q8hf7rKfK9DtvAN267HbPvwma1186N3UfNLhJLmfoOwedHSMZF8Kf83egC+2E3eNVkHXMx+Os218XS6lOYlRCDJutVe9NFT+gARyw+VgNe2rvCqU2z6xiNe/K3MIiNbhFjnk233QagerkZCn2IX2GGmaPyU4vWrvx0Y5euVY7VxFmnvkLYNZOpG1AC3qryK+qIMFJiyca2zrp/vgsLszFsQywHzbpUo6A6FknXgH4L4+bmMq/CiITFbnirGUz9O92YGC6UJXOe1F1E+fG06ZA4Y7JX5rz5JzsCttMSS5oQg3fv8622ecYEMO69/FziaOQ2dmQGp4HYOmmpF/qVEF3ojIvVANxpAIe/r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Network-Message-Id: e0a4937e-a1a4-433b-b737-08db27190ee3 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 18:54:38.2402 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DK0GpjbrcuKKq8+mk9SDnQF6q0vocXkqDCFDUjXcdeIJ2EPATbrC6s3f+4qgBEsH0eYQ/3jEUqpGs8JmSIwBTjNA4/vrdQId7l9EPj0x1cA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7530 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org If a user of the Felix driver has a port running in SGMII / QSGMII mode, it will need to utilize phylink_mac_config(). Add this configurability. Signed-off-by: Colin Foster --- v2 * New patch --- drivers/net/dsa/ocelot/felix.c | 12 ++++++++++++ drivers/net/dsa/ocelot/felix.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 21dcb9cadc12..845068bcbeb4 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1056,6 +1056,17 @@ static void felix_phylink_get_caps(struct dsa_switch *ds, int port, config->supported_interfaces); } +static void felix_phylink_mac_config(struct dsa_switch *ds, int port, + unsigned int mode, + const struct phylink_link_state *state) +{ + struct ocelot *ocelot = ds->priv; + struct felix *felix = ocelot_to_felix(ocelot); + + if (felix->info->phylink_mac_config) + felix->info->phylink_mac_config(ocelot, port, mode, state); +} + static struct phylink_pcs *felix_phylink_mac_select_pcs(struct dsa_switch *ds, int port, phy_interface_t iface) @@ -2088,6 +2099,7 @@ const struct dsa_switch_ops felix_switch_ops = { .get_sset_count = felix_get_sset_count, .get_ts_info = felix_get_ts_info, .phylink_get_caps = felix_phylink_get_caps, + .phylink_mac_config = felix_phylink_mac_config, .phylink_mac_select_pcs = felix_phylink_mac_select_pcs, .phylink_mac_link_down = felix_phylink_mac_link_down, .phylink_mac_link_up = felix_phylink_mac_link_up, diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h index d5d0b30c0b75..98771273512b 100644 --- a/drivers/net/dsa/ocelot/felix.h +++ b/drivers/net/dsa/ocelot/felix.h @@ -58,6 +58,9 @@ struct felix_info { void (*tas_guard_bands_update)(struct ocelot *ocelot, int port); void (*port_sched_speed_set)(struct ocelot *ocelot, int port, u32 speed); + void (*phylink_mac_config)(struct ocelot *ocelot, int port, + unsigned int mode, + const struct phylink_link_state *state); }; /* Methods for initializing the hardware resources specific to a tagging From patchwork Fri Mar 17 18:54:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13179380 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A349C6FD1D for ; Fri, 17 Mar 2023 18:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230256AbjCQSzu (ORCPT ); Fri, 17 Mar 2023 14:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230079AbjCQSzX (ORCPT ); Fri, 17 Mar 2023 14:55:23 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A28474EC; Fri, 17 Mar 2023 11:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yn9Xqdh1Q4+DZPHLGO/PcCajm/fKegrjRuORwqtd/6RQCR/Uz/0hrbZpYHSdya+KWinsKXINc0ZLt6eK+0VCUe5WIkAF7wXlLGkV2UifpgLzgkTizR+m2INWWGL7NPG/jCtAXKJ4KLHvvohZPLmhA0SKayb98/DUlDm6I9sFVD0Kf3Ehn+ma2glKvzJPESW53B+u1hymzbAOnmZ/ftCSSpfBpREOJJGyDXD91zeb5iuGerkQJNS065DPBpGuIHpHFS0ZoXzWCM9/DgQzuQdgjwioNouUK454NCKEAUBT0SX55/faFVmiGUyCCK2p4QrTtD4MO/00oKlYttEvuTaKKA== 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=N0c3jSAaoRCqaweuae6hEaYOqfgSm14WlCDiu/BgcAc=; b=JArcy5t0a37Rw/Pj738rmIk9RWypJy+rkA0WyiJXrI1OpO5hYmQ2uFlx+DuTBbDNPp4OLGwJ/1xoawIF6tkAIK69IYohamgNb/jiVrgJqZ31JJbk6rsRf2t4rmZniwj4RDK6GxNaWoqYDAGHks9kAs45kA08At9FCHFv+1RCWy1RJpPABF/sl1fT+Sezdkaxj36YwZ/fZfFr5VVwlE37vpRKliwEFxKCEylTORKRHzgxFoINCo7Q4C4kE8YcyMp8zujiaJyCOl0YYc4hhh87T2huHjiMch4L9PNMQVR4bR0sKcflWv5Z4uhdtv/+OURYRg1F2Pq0sHWblfn+pdbbWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N0c3jSAaoRCqaweuae6hEaYOqfgSm14WlCDiu/BgcAc=; b=fupqhLzMJnujcH/7ZnfY28YIUxMl+DrrlPEPFh1ww6NyQBgyq6IX4wuAxQnq++7EFOoJokGpTxGCqaC67qUSSBfp3pZ44FwfIPygA9iMeqZNv8HaH/+JSIfYG+ViAyPhq666CNEE8y5Cj8rC/j2WdHXuQEGs+0HvSQYw9UNA4Ys= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by CH0PR10MB5289.namprd10.prod.outlook.com (2603:10b6:610:d8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.35; Fri, 17 Mar 2023 18:54:39 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa%4]) with mapi id 15.20.6178.035; Fri, 17 Mar 2023 18:54:39 +0000 From: Colin Foster To: linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Kishon Vijay Abraham I , Vinod Koul , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [PATCH v2 net-next 8/9] net: dsa: felix: allow serdes configuration for dsa ports Date: Fri, 17 Mar 2023 11:54:14 -0700 Message-Id: <20230317185415.2000564-9-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317185415.2000564-1-colin.foster@in-advantage.com> References: <20230317185415.2000564-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY5PR16CA0025.namprd16.prod.outlook.com (2603:10b6:a03:1a0::38) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|CH0PR10MB5289:EE_ X-MS-Office365-Filtering-Correlation-Id: 3afc251d-89ce-4416-96ba-08db27190fa9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o98XC90W+tNe43kXHT22JR1hHGcOhtmuS0BOGXYgC2C8xt3p6hMceuk4+qHgCbdXPn3Qe/WqSaz1ll5KHnW0RlVcEpIZH66JvW7q6sgjmOdmrUW0gLjzoRQdxPpSt3Ll/LH4oQH/azngY/vSI70p8vAi3C3PZfWWqp7iXu8UprNUEghFeawW/2blpUhEFAcB3Z9lq5nHO/dKWRikEGvm2x731JLxdxifmgsdZKPCkIfYyMmKnIMURU3qxvLVHbg/v03kWJ2JAdXpVC8YObn8UCJkPSY6Qt7S8TJ/WNpylAwoUx+HYOZgWrkSaVfFz3gKukuPhm9AyiubMrn3x+NCDwXnAu2yCuLOScasuCuNqySwqU3jNpROW2OBt7v+EUilL9VwVJtxaKBBZbdKR6+svV+LH6MC0UfW8T4JE1bor7rwHeWBwjHuc6RtR8ql/to4cYLQ+1FzMYYV6AjePZbrE4zICHCfCm3MnzsgTBBbhlDTVo2aTvPhrGt6djnVtMYaYN/YvkPkaVFEyfq73WLe8bqp2J7v4xsoKCeB2DGI1HahxjL5xLO6sMQT//+qjlct+RjR7kAsKavd4kmCNrj1dCldlb8wGdiHZCk6nCMw6exIclZ9rMlkblR5l0PZfkShvZOJipON9IDYNT4HqETJdvFp+WWdSNeX+UXVofIUqgLRdkZHJUZQLe10YSPDE/FHQvj0zsp2HBQD8sAvYC8c3A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(396003)(346002)(366004)(376002)(136003)(39840400004)(451199018)(44832011)(41300700001)(8936002)(5660300002)(2906002)(7416002)(86362001)(36756003)(38100700002)(38350700002)(478600001)(52116002)(8676002)(6666004)(66946007)(6486002)(66556008)(66476007)(1076003)(4326008)(54906003)(316002)(6506007)(26005)(2616005)(6512007)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZDpXDeEbM1Hjaw6jnx+RXbysGUsf5kRY4XyC3WqzVQpwnE+LtG/OZFAy2sKwVPzlbDPhP/30qeohkXAlVg4NE4u/8pafpIq0tn6hLHIWED3GCpevD68yL7pRnhFmt/Bbx8mnDo9EH/8A9705oar786aMd+zGiXVnjY1EOnDNvGj+M9IA6qTRy5va1WyPsZsghhLJZjScvpBEW0TYPsrAo5ggqIiLy+HulQMMiB0BK6awOK2WUusPd4ONyR1stJyQmBFcUowGx447SgrZ32Xsr+N0n/SyCt38WSQ12onDCbZO0vobt8iMi/96rBZGBf7zVlyY1FRB9OmaBk+V+oITItfo8f0DiR+ZkS8FYNhBUdKTF1AI80+OfnDQ9DE82YG26gAI95aYcQF92p8qrSXQCvdf1JTerZvPTiNEuHQXL7AhPzIfcjNU53HAIHmLAdIld3V8QowDhDTTrTKebzMyykzRu+VLplymp9/wsBT0LsE2ledzKtVuQT61viiEq7LT5esel/mONtl5bwaF+l5nAazEB58jSr1FDHN+Znx7KiLtJptq5/e/7jM+B5eu4ViuQSJuVYl3jJ99FamdztyRzsu0HEnisQoA0QrSeN86LBlTvLffF+axbc+vBSgdnCutx55qnQ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27190fa9 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 18:54:39.5370 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4xuPsZpcy+ljpEQmUhy3JQFxFkg9ld1JkNCI/6eV+DPVhMZK1BS3bjWty32dRnGHeXfwa1tDuox6qlkOm+LmtgpgrTWegVYPOfvHoD9tWpE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5289 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Ports for Ocelot devices (VSC7511, VSC7512, VSC7513 and VSC7514) support external phys. When external phys are used, additional configuration on each port is required to enable QSGMII mode and set external phy modes. Add a configurable hook into these routines, so the external ports can be used. Signed-off-by: Colin Foster --- v2 * New patch --- drivers/net/dsa/ocelot/felix.c | 4 ++++ drivers/net/dsa/ocelot/felix.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 845068bcbeb4..6dcebcfd71e7 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1585,6 +1585,10 @@ static int felix_setup(struct dsa_switch *ds) dsa_switch_for_each_available_port(dp, ds) { ocelot_init_port(ocelot, dp->index); + if (felix->info->configure_serdes) + felix->info->configure_serdes(ocelot, dp->index, + dp->dn); + /* Set the default QoS Classification based on PCP and DEI * bits of vlan tag. */ diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h index 98771273512b..96008c046da5 100644 --- a/drivers/net/dsa/ocelot/felix.h +++ b/drivers/net/dsa/ocelot/felix.h @@ -15,6 +15,8 @@ #define OCELOT_PORT_MODE_USXGMII BIT(4) #define OCELOT_PORT_MODE_1000BASEX BIT(5) +struct device_node; + /* Platform-specific information */ struct felix_info { /* Hardcoded resources provided by the hardware instantiation. */ @@ -61,6 +63,8 @@ struct felix_info { void (*phylink_mac_config)(struct ocelot *ocelot, int port, unsigned int mode, const struct phylink_link_state *state); + int (*configure_serdes)(struct ocelot *ocelot, int port, + struct device_node *portnp); }; /* Methods for initializing the hardware resources specific to a tagging From patchwork Fri Mar 17 18:54:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13179382 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21B64C6FD1D for ; Fri, 17 Mar 2023 18:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229798AbjCQS4P (ORCPT ); Fri, 17 Mar 2023 14:56:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230174AbjCQSzr (ORCPT ); Fri, 17 Mar 2023 14:55:47 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66DE1CA7BB; Fri, 17 Mar 2023 11:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fO5t4aDvwJA3Bf0AQ1LRifhtcJFlTFN/cIU3eGMxMhkQ+S6CHuz+B2z9k8w7c+4+0LR2cYbBiJZDemPDlg+sYhpt6+yBCn+X7kOZ/mouH61ME9gt6dYRO/Xhz3FXScuALlV5EP0Z/p37fB3HKi24lOWNqCa6SNe7FTptrHrGX/jjfbJJ0yolyVHBcyja5UQpY5PGitI8/JGabEwoEbvW7oDNJyPd2WvdPZQKpFRl9mSwNhgdHf0ckTRz3MKxTweDIY5aZtaWn8shjyJk2xTCpiWgnOTuXcFr4RdbJabnymjsuUvlq8+B/xkpJoKjDCL4wrDJ0tzhlE3Ac6giVveDgw== 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=F+M2V038LGiL9tMIiom4sHLQO6ssagWlXVlL/2pPH9k=; b=XW7PTWfa2DyGECpWlp6R2fNd/PDwrcoZIh7pCKY/igwA4RoEX2UcvebmcSOzazHsQLXwuAuFQTn+v+lFl3yXhSg43ZYUpVKhKdzyVAgQtJmiti5uQaklX0rHCnAmvSf2QwnOHJ2aLz0yNGWfJMscAQWNY828TZPENqrjtHxR6VqLPRO9i+DUAtpGjCA3l7v3ZwiQPuud32bP2rdV67Fgg3qU0x/XehB9iVqbgMEFvarBKCuRKtJMz0vzuh269bRiv9fmfKm//hMW5g/RN9BhILoEU8fGBeP6ti2LR7lMBV8cM+yF99ROGoTA3bNRszDzfY2iTlGhuTa5Wi0z6ePJ8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F+M2V038LGiL9tMIiom4sHLQO6ssagWlXVlL/2pPH9k=; b=B0S1Ta2o7d6v2RM4IFOl0SswL1cXaycP2vqgg0/zOBgXczBhKv3Cz/X9kVOQ0n1F7l8dhRJ2/GPxIWuNj99hZNChFe+bM69AO5Q/Ayr3dPSC/RUk+RgmxKJEL5gPrMtOnzjAykt9WPxulGeAnIkXFABuMeA57KSY7aFdhsscr2M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by CH0PR10MB5289.namprd10.prod.outlook.com (2603:10b6:610:d8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.35; Fri, 17 Mar 2023 18:54:40 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::1897:6663:87ba:c8fa%4]) with mapi id 15.20.6178.035; Fri, 17 Mar 2023 18:54:40 +0000 From: Colin Foster To: linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Kishon Vijay Abraham I , Vinod Koul , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [PATCH v2 net-next 9/9] net: dsa: ocelot: add support for external phys Date: Fri, 17 Mar 2023 11:54:15 -0700 Message-Id: <20230317185415.2000564-10-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230317185415.2000564-1-colin.foster@in-advantage.com> References: <20230317185415.2000564-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BY5PR16CA0025.namprd16.prod.outlook.com (2603:10b6:a03:1a0::38) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|CH0PR10MB5289:EE_ X-MS-Office365-Filtering-Correlation-Id: 322f3f0c-c9f7-4d37-1403-08db2719106d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: popmzIip9UHGPZJE7aV5zNB211ILC9egvT4AxDPMHTzhaEz1w5KDhFEzFczid/98G1qo1EvCZP0BBfonCSOGNsrFhmyNz1KpsDnxmC68nTewC2aeksZrMLZuUlc0aSCAnYuRgH3He9XLX/i2Aws44/4FRA9nO7HIeOq+lwejvx60FMIw5Su0/xRAi+dQEQb6s9ddCf8NSNUWln9XVfqO9auTY0z2AW/8/8cRomr078sxjqFcF8vh75TmGeIVbusxe5LmCd3hjVWpZCybwD6lVS2jwCVsM7zh/gehIlV1C6hUMlOKjbkZs/WPQXnGhqJmPkahZQN1nXoQrNnx+BT+FdADREzDs9VDyAne2orLc26NxvbdskKD93d5cWdYsMtICzqv+q/KVmrntWdL1QzFTJFAmQKJHvb2ptfES9OkOVDXmRnJFq3Mqao1AQZtLZqXrrl/D9yX8JlDTZlwg9TNUMgFfjMMb7bIgdhSAHAi1KL61BDTd/a2w0ireo8Z4JbfErT9dHLJDDy7ua5mw3C93sZxw2o5wH/jC+Gx7Qz+un459oesch9ImTi6DsvMYol1eVWUGUmDhZFMBDcGLxU9LH4D5LdogJm5hUmyMF2+d/FkPmMIvWyQsEgTzil4oUNs7Jrt24cnSnnsG4Ibc+Haa39+eA7jrjF8TkA2xPThTptBxxWMvbPwhgA4iyLJ/kWsCH929EZcporFrXZVihDVWA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(396003)(346002)(366004)(376002)(136003)(39840400004)(451199018)(44832011)(41300700001)(8936002)(5660300002)(2906002)(7416002)(86362001)(36756003)(38100700002)(38350700002)(478600001)(52116002)(8676002)(6666004)(66946007)(6486002)(66556008)(66476007)(1076003)(4326008)(83380400001)(54906003)(316002)(6506007)(26005)(2616005)(6512007)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lQat/2bnXgHYUWkYE6KZO7xPtZUII3ODLLmjIp8a5Uq0YaGEqadA1gxUqBofnwBhnP35U8iLQfRwKXiBBxqtt6/DI17XaOtt4YBbLLuaxnzSTFb3qgDU7dCZtR6VHdbcIKtbNCnA0LGEhvdt9E2PF8UANCHf3uGN+H/FKxAuX2bw2wC5Hi/07THuYmOqZAcVC9L8sI1pAI0lj41vhRG19rHfTpiHeUfAJix8H6XuGUivKYKm+38aT2ushpXokoF5CIDHsBs5AfLbjC9tdtDPxgtq3CakRxgU3M2VPpPD7eMxJoNx92WORTfFTW6q7kuSkhsUzpgrxlyIkefHBw0w4L285xlPKLX+QZbvxfCOWnyDhgPdCloVDwJbkRXA5vF1bzmgU2zdexo4SJEjurar/mh8O8rTAJV/jCjon7d3vsN1CMZ0GjzURWIJI0GesG75Hjawl3QQvgwWKAXS/agmVRMztCycI2wAgqtAo+DEyGy2SAYzTkv0oXGqRbFTt8oTHLQ7YpGcgsVymh5jLFe0aQtsWlDteDtlEHzOJ9rhriP21amlF2P7dB7Y6NwJUSG+BbcaMBWvrrna+33kx9UWaxrH3iLSlG/yJiYel8vy4Kq543J+CmxwaAVFRyLHZNQY7aqRewhshVI2GAAxmuvXKOLOS8nFBsTZi7riAfo3QXdk1tE8JJsUnAMKNCcjetQEKRjXlr4wr5r5Od2Ozdsu/p4FIFLKFEGy6SvgwWt3HzLG4TGbs+dd9xFpKgABSbBhm/Mb9U5u1k6JqhlmsrNVyJylowvDLZz14vAkx9FHvLu/iyoAXsMlKu0Qp67s+EqH8eYi4zRU0pZ1Y2t0Er46VXXFf9SaBHonHThQnrQgMGFBxMvP7IrTtASAE0DSsVl++T7qwP9uer+3itWRQEv0k8WaNwWZeMqxnMHw50LfuRW0zN6RgC6rOO0CnHFgDdJw5NR9HdiJOKtPcMBGBEsWJ6E3sIDDgldMtJWtQ07FqDtULLUmAQDwIBeEx20I1+L7SnoClzYNev9zgJ7FU1Gagl0vGha6eJgJ9gcndxqNn3Zb+kFZ/SdTzn5YVeRSiN8AHizRl1N+lzV6vzKqfaOmTMBa0DyQ2lGizDHNvEDr4LUmFhw+JHNrDs1++S70JhbvRHqcsIok1eQUXnTP4iX4lYvKduUnPSBxfxUSxNMG4JbmiHw4xW6E0FCSq1A6J2Nu3utV+vISVNtIjnssSyJCRlxeSsLM//iwIKnp7QOFh5Z9AMUZKJ7p8nitAx2yb6m/9b3VupZip6RsTuMusxenxHIP8cJOi4kCiPlGdbD2Rh7wakjtJ+wsqu/D5kp7Oc7/fp438Stzr4Oymnpy1bjvLqHa0bYGJeqhqhJVm+rIpTJ2TQPqGRm2mqA6x3+KaVkKm+Pl6clUBOacvw1p4UBoehbGK1HYYUrb8VAGsc8cXybuvrarEDHvx/U/Oz38rgMYoJaNq0vfeL/cuhw7dDegXVDb8Z03IaKf3MPHH7ngCpbUqyhohhktgT/c8fX9B/ocgDXjGXKL2CpJavMGlKIGrUsQU7Vd6MDFgNJchMtJtD5Ts6D8pAGiTKhiJy77Zb0Zf7IKJaNUl8eWLEWrl1FQt8OQ4N2LP6YV4zLucZgbODo= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 322f3f0c-c9f7-4d37-1403-08db2719106d X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 18:54:40.8181 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mMpoDZSqM34l4CabOJMxVD9+kZDJFYvj5kwS4iADXr6ZH6yn3HADLYIQXzPfXbAu30GbMXXpbW00+7u0V7ohbJi2ogrcubyM42RMySuzMvU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5289 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The VSC7512 has four ports with internal phys that are already supported. There are additional ports that can be configured to work with external phys. Add support for these additional ethernet ports. Signed-off-by: Colin Foster --- v1 -> v2 * Basically a new patch. V1 was off base, and the already existing ocelot routines add all the needed functionality. --- drivers/net/dsa/ocelot/ocelot_ext.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/dsa/ocelot/ocelot_ext.c b/drivers/net/dsa/ocelot/ocelot_ext.c index 228737a32080..c29bee5a5c48 100644 --- a/drivers/net/dsa/ocelot/ocelot_ext.c +++ b/drivers/net/dsa/ocelot/ocelot_ext.c @@ -20,13 +20,13 @@ static const u32 vsc7512_port_modes[VSC7514_NUM_PORTS] = { OCELOT_PORT_MODE_INTERNAL, OCELOT_PORT_MODE_INTERNAL, OCELOT_PORT_MODE_INTERNAL, - OCELOT_PORT_MODE_NONE, - OCELOT_PORT_MODE_NONE, - OCELOT_PORT_MODE_NONE, - OCELOT_PORT_MODE_NONE, - OCELOT_PORT_MODE_NONE, - OCELOT_PORT_MODE_NONE, - OCELOT_PORT_MODE_NONE, + OCELOT_PORT_MODE_SERDES, + OCELOT_PORT_MODE_SERDES, + OCELOT_PORT_MODE_SERDES, + OCELOT_PORT_MODE_SERDES, + OCELOT_PORT_MODE_SERDES, + OCELOT_PORT_MODE_SGMII, + OCELOT_PORT_MODE_SERDES, }; static const struct ocelot_ops ocelot_ext_ops = { @@ -59,6 +59,8 @@ static const struct felix_info vsc7512_info = { .num_ports = VSC7514_NUM_PORTS, .num_tx_queues = OCELOT_NUM_TC, .port_modes = vsc7512_port_modes, + .phylink_mac_config = ocelot_phylink_mac_config, + .configure_serdes = ocelot_port_configure_serdes, }; static int ocelot_ext_probe(struct platform_device *pdev)