From patchwork Thu Nov 3 21:06:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1114559dyb; Thu, 3 Nov 2022 14:13:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6sJtpm6Ft+pRf6jNmWGCW+049bvcTE4/gRj/7KhfQxySlzWT6qbjqsPycoEABNbeYEetIK X-Received: by 2002:a17:907:7e95:b0:78d:e9cf:82c7 with SMTP id qb21-20020a1709077e9500b0078de9cf82c7mr32363423ejc.724.1667510020860; Thu, 03 Nov 2022 14:13:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667510020; cv=pass; d=google.com; s=arc-20160816; b=dCquvYlMrCD2LXq/YVsC12dKhsmlfrPeLm3+M8H0n/JJjxwsmp5jEv16Op3Qqllbsm DDJ9Pe7Nu+YB2pC7jPrrvTe1Y39gp8l0Zy69tNglncrlQKiIuO8nwJ92Pev8WHLfbeNs lllsIWHcUElkt+1/x3fcihwrxLrJivOc7j6RyBwYCT5z7Fy++J25+UWDWCHMbepSFbYp Yafu1V7LWLZOcyHjCBb3NsEFssl74D1l0Xf11zgmgn6mQ1EInhUHNnnPCcEv/onkLiFu 0g6HjiXgZKlPLN77aOWEYSKoFpb6WTW/DOic1mLtinRzd78Y3K+JirROTWCeKaHzSn3X vnxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JafJjLT0Fxzr2HeAil9LH6NrO1QPb5BMqNDiKrmCkc8=; b=hgPoxA8w5/qWEDEB0QNZe3FNzU03Lqwpf4l1JsaCYwkoLXW92NUXjxTS/HcWWPSMpj yVSAsFlbOa2ouamxgpNMo8wvN0G5Z5OfV8VLn8Ky5j0izkHKWt8m557bVQ9RCCkSfCWm KbNyAbtaBiqoii+NnjZ9rwByimgg2lXvoAh4eIHTjuN3XXzYoI8CGJQPulquRYbJLxRP PoNkRErwDQD1EL5kpqp5kTyu0niDs0qNVEjvBlqQbZBttU3ZapKJ6cTWB/2ZSfJ0VAfi i5RRnS2jDj5rjJ5i4r2f5Ei9e7uu+vGjSxiyVr6sksgu5EMVCSYcjq8qvc9mO8qqSJO6 jaSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=yrnD1nig; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz1-20020a1709072ce100b0078232bfe3a0si2755148ejc.331.2022.11.03.14.13.16; Thu, 03 Nov 2022 14:13:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=yrnD1nig; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231398AbiKCVHO (ORCPT + 99 others); Thu, 3 Nov 2022 17:07:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230526AbiKCVHJ (ORCPT ); Thu, 3 Nov 2022 17:07:09 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09CD32DC9; Thu, 3 Nov 2022 14:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D6S+7/kO3138QuyqxU8viFgV5D9i295gJrd3lmsJ8CSSvCNuQCDEOd8ozQ0DkXhvAaasqzGvZSMOlYp+1fJ/p8M80FX+07V03MHpsnn/WSH2A8nMIJBvyeTVzeeluaAT/d8OPAqzHP1p3vq63npOfmhnSBKgT0aBLCltbZayGuxFk7brPg3aR9uZxjUhLUKuX5Gxmzc2M6pp2KmfPlJ9XOJ+qlXZYBePu+DtNKXbSQja9IivrVKrpTj0pU233tXLo9clW91qQXfMbQNciFKAnU44C7jaWo6tAoepqgnD8AS8s00gyG9YMqGD7MOnuO3ZHaqcwy3kzqNP8LjE157imA== 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=JafJjLT0Fxzr2HeAil9LH6NrO1QPb5BMqNDiKrmCkc8=; b=gK2P3lDiolWg1krc7EVl/9ELBiwEV0+8vNY36W+pW9EEqvQ8RJ1jIDXSgchvo/2pq2JZXxqbytS+bO8VDnCXDNndcKafNFPSia0raU0+IfEIarbE8Ky9wRnjSU+3MHuyZRwN0YwYBwocsxyh/lBM6mrFCj4TVUtHq0i/gKT6O/vDaCG7ETVbbIyQMqUM7ajvvbYSJHYdScjogN7B0iBHINhP+/NhdstszlFsuv2Om98eFG7hYFWnnhIW1NYysrkZ4zNWbnWaehhnQpxKbqk2GoEChxeM2a4HsNqvjllb7wkOWryTmQqE6KGrfugDkiQX9+LUQnWFPxOX31dO9vFgcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JafJjLT0Fxzr2HeAil9LH6NrO1QPb5BMqNDiKrmCkc8=; b=yrnD1nigGQXyoFsnUVpp4YzHM9XArMDUsYTbPIfDYu7xoufpKrWnXOJTIHvzSSAzoOYZ8iiWG4SnPul7MmUP6QSEORKhSTEZU2r1rzFaFt1t+HwT+npKfhcNKFZj5ZRbTp0SuGwsabkdvpOiK4oM7kYqdtYBlf78irQFzZ3nvwVCKaVhSBwzL+iu8J3abFnU8veDMS6lQH5VazCBwWyw2SDCNyEX5Nmdkv9PqLUKV7aT3qkv3khPp0ZtlFRPJW8vwAPOnvOhf9unHAoJ5nMOOTfASMmWXOK8Uc+xMkrqbQMxPjFfkXhUcjlSdQT9lPUiEWm53riXWavAXkqlMFtgKQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:04 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:04 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson , Krzysztof Kozlowski , Li Yang , Rob Herring , Shawn Guo , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next v2 01/11] arm64: dts: Add compatible strings for Lynx PCSs Date: Thu, 3 Nov 2022 17:06:40 -0400 Message-Id: <20221103210650.2325784-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: b7b08589-9c72-407b-7ec6-08dabddf5c0e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z2DOfFpxHSnXQvvJBP4Y8hN0CgpdBjlu+97bFMBNOgmDUdnd1TZbzNnsmDuLq4tb7fUPH2yRwtw+CnexCzHjKYPUVRHbGSJOlpmWx9m4YXqlFiD6W15PrWL5KaSBt9e/AOTA0PURKuHJujTGB5fA4YqoojeO6qWqoon9jFaUi5tElBUp/yTBX88fMQStdYoPhSXWx2rP9SZ2Xr1IE5ZYPOKqphleCE3RJSrODmeSyXH6NT563vpeF1JGfZfYi4fLtdODv5jRoBoAXYfe0v75INZn9k+sNdmyB9sMKxpaqD+RpozXjucmqRpo946UMH70D0nRp04DM3AxfUKU/Uj1imMDsInzTiYB3eKI1QAabP+xWa83E1sI+p4wNyNwRyJbZa9r8XQ4EFtX7DSoLOjpncwTgQiERYTpogLJTaGCMiV6ts+7/HyeALNsMKNbbadMHLRZ5SoJMNIvo5dSAhxoIZxAnTkBwcJ1Je5AMSrP2V0IJRVxt8k6Ofgg1EZGjUak3xuSzL5PJ8mXWD0g2vSj3ZJZvqldb4/WrjalxSyDfrBP1CrNmwJ5a9Wwu065SOQ9ugE1wja1BwGprKDse76YF00sfipgtTodJA5KLUCCRwJHkKpn0TEFJ88ju8vfEP95dyjspDXa6Bft5aXiheaFb7SL37gBzdVmEaDq4RHq3c+mXi5miFV0h+P5CT+FxLCgMA8akdWZpRLG9tgzyLzbfJqYTXMObmHPCcnmwVfxHlKJSDsSDnKsQ1dRqmgQz3fH X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(30864003)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pKEP9QGubrBaAMXVkN8ZjklfHO28BQe2dAPMiyHXku+oY1SqKVdVqo7LYEQTEmL+oY96HVMAq4fKDklAL7U3dGsrrvWutuQJhjgeG5n0G8E+8o0t4CNrWgmPdb983Gn579uW5Qfy7iEMOfdV1kbNDJ+akxh8vHt35KpZjZsUQqqCLllLZmssZesuFVAelUipQKmC7LPcwnV2ctwcGp007STui4cEKEDCpA8Bqu8/Ha9CltILvIWAwhmPNchxwAVptq3UP73Wp0RekpDACNrsMWYB32FvgUyb3G98SGau5/DA2Ob6Oaq60IzoOlcZdR9Ay8d+2u6eHkB5lsy82CZcE9WUFgS4xdpge7Oy06BrE7SGUkuTKDY8DNYVEIUoGNrq/cSiWU+adt+IhfKS61u7iRwrBY88k4fAdeYJAj2dXMl5WF/ILIDevXhZ8ONVhHMk8S4SFnm9nVLUHwisHLqE2otSXg4kLdugU+4o4lZmbrAx2U4f2XbWmRUzlOkFgGyC2uZXG5f/AC3dK07a6pqtFHQZtc2/3WhAHp4vQufhjOA+4GAUzJa57B8fvAfDVPmNBbsJFNMeuIUAzgk6dMEaysTXG3yiBA3rgoJwq2k9O9ztGK4Bhvl3fiCqdUY32F+3g1TfIwkQ4rAQrqDcNfozSGq2bxPTc5KqTf9WnfttQvsAUWgkuTCmhzhJFnxP/umtim+Lt1g775mEqeaiheFtn4KyXHz3f1eMDJCE2GyqextgMviqt1o6WTnUgylz7wRzhGjx+DGxD1z4WM6WRZ+C5cgwyM/Li5dsPdMJ8Gp3HJSNRw0ee9Wov/8f1AEOY6oXRFqAVpgzwZFVXJIjozDCqmF9lRjykCJxk8o+FOPOp9gPtkfBZ5lePWDE0WWrA4kKuaXf6+S0n9X35scIrGDt0s70Sw79bJ1Ny9UrdauSZwW9v+JSK/+kknvM2Dh/45AHkUqAE4sLNsDJtl9iG9XEXyCzb/hKmsdDvFbCZ4dJ8PQAycsdZvqIE6OOzkUYWeT8fQAD6dClADX5+Zx/1HBjALiUzzSJAEfzJkpXz+i+Ws+JBhsGbckcD74JgXYrGKMh9Xz1+cYvb4wdDy4f4gC0s4a1H9sg28WkMhUyiO365Ut1dFL4FvONAGXO0BFNz44irjYKQLkY76Ukzn+k7bOR+xdB/l7DnuoghRPlxG147hKlc2n4kBHtNeW1XeIp2b3pw0Wtp/bgYU3uSAS3MJ1KNpqLNEqS096YBjFlA+bFICfvxz0JWXk6jyd+P3jU+8szxjuOVVbEFnEORZ44ujz8JcE5vSI0vVhiO2i/dPQowDOt9vd/J+ksitwBaxiaL7Rk6VFdPGqcLC23lLAZWQqSjtiaU/Sno0/qNzHLnEh8ouVy0FtHFDLlHBctjchZncF0m5ZXYm1UKh7YOVaBlu446B8DGAXu6IIyG+pXrrpdgJ23DEKM2QMPASB5FtAGufXSszZHTjKH8z8S84TamYL/5oc3FBNnpztXtUnenGx2/1sbenhXks4ClDUObYt5rV5fSRcy/UTIQEnZ6nYOObwOVmXyfOTEmk9k91KYiCp/vZ5d14Nzg8my6RPUbms0sdmKOZ6A+BngYDG4i27pEjJ1hQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7b08589-9c72-407b-7ec6-08dabddf5c0e X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:04.7875 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WddpRqMUf+dY7/0L0T0utPE175OhBAzKXMSLTt17jNMOHTw3fBfsPvgqEquFMmp4LjYXqBP0dnNJ/dmLnev6Fg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748510987736040266?= X-GMAIL-MSGID: =?utf-8?q?1748510987736040266?= This adds appropriate compatible strings for Lynx PCSs on arm64 QorIQ platforms. This also changes the node name to avoid warnings from ethernet-phy.yaml. Signed-off-by: Sean Anderson --- (no changes since v1) .../arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 48 +++++++++++------ .../arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 54 ++++++++++++------- .../dts/freescale/qoriq-fman3-0-10g-0.dtsi | 3 +- .../dts/freescale/qoriq-fman3-0-10g-1.dtsi | 3 +- .../dts/freescale/qoriq-fman3-0-1g-0.dtsi | 3 +- .../dts/freescale/qoriq-fman3-0-1g-1.dtsi | 3 +- .../dts/freescale/qoriq-fman3-0-1g-2.dtsi | 3 +- .../dts/freescale/qoriq-fman3-0-1g-3.dtsi | 3 +- .../dts/freescale/qoriq-fman3-0-1g-4.dtsi | 3 +- .../dts/freescale/qoriq-fman3-0-1g-5.dtsi | 3 +- 10 files changed, 84 insertions(+), 42 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi index f1b9cc8714dc..148061b9828f 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi @@ -552,7 +552,8 @@ pcs_mdio1: mdio@8c07000 { #size-cells = <0>; status = "disabled"; - pcs1: ethernet-phy@0 { + pcs1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -565,7 +566,8 @@ pcs_mdio2: mdio@8c0b000 { #size-cells = <0>; status = "disabled"; - pcs2: ethernet-phy@0 { + pcs2: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -578,7 +580,8 @@ pcs_mdio3: mdio@8c0f000 { #size-cells = <0>; status = "disabled"; - pcs3: ethernet-phy@0 { + pcs3: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -591,7 +594,8 @@ pcs_mdio4: mdio@8c13000 { #size-cells = <0>; status = "disabled"; - pcs4: ethernet-phy@0 { + pcs4: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -604,7 +608,8 @@ pcs_mdio5: mdio@8c17000 { #size-cells = <0>; status = "disabled"; - pcs5: ethernet-phy@0 { + pcs5: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -617,7 +622,8 @@ pcs_mdio6: mdio@8c1b000 { #size-cells = <0>; status = "disabled"; - pcs6: ethernet-phy@0 { + pcs6: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -630,7 +636,8 @@ pcs_mdio7: mdio@8c1f000 { #size-cells = <0>; status = "disabled"; - pcs7: ethernet-phy@0 { + pcs7: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -643,7 +650,8 @@ pcs_mdio8: mdio@8c23000 { #size-cells = <0>; status = "disabled"; - pcs8: ethernet-phy@0 { + pcs8: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -656,7 +664,8 @@ pcs_mdio9: mdio@8c27000 { #size-cells = <0>; status = "disabled"; - pcs9: ethernet-phy@0 { + pcs9: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -669,7 +678,8 @@ pcs_mdio10: mdio@8c2b000 { #size-cells = <0>; status = "disabled"; - pcs10: ethernet-phy@0 { + pcs10: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -682,7 +692,8 @@ pcs_mdio11: mdio@8c2f000 { #size-cells = <0>; status = "disabled"; - pcs11: ethernet-phy@0 { + pcs11: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -695,7 +706,8 @@ pcs_mdio12: mdio@8c33000 { #size-cells = <0>; status = "disabled"; - pcs12: ethernet-phy@0 { + pcs12: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -708,7 +720,8 @@ pcs_mdio13: mdio@8c37000 { #size-cells = <0>; status = "disabled"; - pcs13: ethernet-phy@0 { + pcs13: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -721,7 +734,8 @@ pcs_mdio14: mdio@8c3b000 { #size-cells = <0>; status = "disabled"; - pcs14: ethernet-phy@0 { + pcs14: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -734,7 +748,8 @@ pcs_mdio15: mdio@8c3f000 { #size-cells = <0>; status = "disabled"; - pcs15: ethernet-phy@0 { + pcs15: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -747,7 +762,8 @@ pcs_mdio16: mdio@8c43000 { #size-cells = <0>; status = "disabled"; - pcs16: ethernet-phy@0 { + pcs16: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi index 6680fb2a6dc9..9315d4ed0454 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi @@ -1406,7 +1406,8 @@ pcs_mdio1: mdio@8c07000 { #size-cells = <0>; status = "disabled"; - pcs1: ethernet-phy@0 { + pcs1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1419,7 +1420,8 @@ pcs_mdio2: mdio@8c0b000 { #size-cells = <0>; status = "disabled"; - pcs2: ethernet-phy@0 { + pcs2: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1432,7 +1434,8 @@ pcs_mdio3: mdio@8c0f000 { #size-cells = <0>; status = "disabled"; - pcs3: ethernet-phy@0 { + pcs3: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1445,7 +1448,8 @@ pcs_mdio4: mdio@8c13000 { #size-cells = <0>; status = "disabled"; - pcs4: ethernet-phy@0 { + pcs4: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1458,7 +1462,8 @@ pcs_mdio5: mdio@8c17000 { #size-cells = <0>; status = "disabled"; - pcs5: ethernet-phy@0 { + pcs5: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1471,7 +1476,8 @@ pcs_mdio6: mdio@8c1b000 { #size-cells = <0>; status = "disabled"; - pcs6: ethernet-phy@0 { + pcs6: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1484,7 +1490,8 @@ pcs_mdio7: mdio@8c1f000 { #size-cells = <0>; status = "disabled"; - pcs7: ethernet-phy@0 { + pcs7: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1497,7 +1504,8 @@ pcs_mdio8: mdio@8c23000 { #size-cells = <0>; status = "disabled"; - pcs8: ethernet-phy@0 { + pcs8: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1510,7 +1518,8 @@ pcs_mdio9: mdio@8c27000 { #size-cells = <0>; status = "disabled"; - pcs9: ethernet-phy@0 { + pcs9: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1523,7 +1532,8 @@ pcs_mdio10: mdio@8c2b000 { #size-cells = <0>; status = "disabled"; - pcs10: ethernet-phy@0 { + pcs10: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1536,7 +1546,8 @@ pcs_mdio11: mdio@8c2f000 { #size-cells = <0>; status = "disabled"; - pcs11: ethernet-phy@0 { + pcs11: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1549,7 +1560,8 @@ pcs_mdio12: mdio@8c33000 { #size-cells = <0>; status = "disabled"; - pcs12: ethernet-phy@0 { + pcs12: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1562,7 +1574,8 @@ pcs_mdio13: mdio@8c37000 { #size-cells = <0>; status = "disabled"; - pcs13: ethernet-phy@0 { + pcs13: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1575,7 +1588,8 @@ pcs_mdio14: mdio@8c3b000 { #size-cells = <0>; status = "disabled"; - pcs14: ethernet-phy@0 { + pcs14: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1588,7 +1602,8 @@ pcs_mdio15: mdio@8c3f000 { #size-cells = <0>; status = "disabled"; - pcs15: ethernet-phy@0 { + pcs15: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1601,7 +1616,8 @@ pcs_mdio16: mdio@8c43000 { #size-cells = <0>; status = "disabled"; - pcs16: ethernet-phy@0 { + pcs16: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1614,7 +1630,8 @@ pcs_mdio17: mdio@8c47000 { #size-cells = <0>; status = "disabled"; - pcs17: ethernet-phy@0 { + pcs17: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1627,7 +1644,8 @@ pcs_mdio18: mdio@8c4b000 { #size-cells = <0>; status = "disabled"; - pcs18: ethernet-phy@0 { + pcs18: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-0.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-0.dtsi index dbd2fc3ba790..4cf65e40126f 100644 --- a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-0.dtsi +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-0.dtsi @@ -35,7 +35,8 @@ mdio@f1000 { compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; reg = <0xf1000 0x1000>; - pcsphy6: ethernet-phy@0 { + pcsphy6: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-1.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-1.dtsi index 6fc5d2560057..de483c7e9ae0 100644 --- a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-1.dtsi +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-1.dtsi @@ -35,7 +35,8 @@ mdio@f3000 { compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; reg = <0xf3000 0x1000>; - pcsphy7: ethernet-phy@0 { + pcsphy7: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-0.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-0.dtsi index 4e02276fcf99..9c31b3b2292d 100644 --- a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-0.dtsi +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-0.dtsi @@ -34,7 +34,8 @@ mdio@e1000 { compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; reg = <0xe1000 0x1000>; - pcsphy0: ethernet-phy@0 { + pcsphy0: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-1.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-1.dtsi index 0312fa43fa77..72dbb26c7fd4 100644 --- a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-1.dtsi +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-1.dtsi @@ -34,7 +34,8 @@ mdio@e3000 { compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; reg = <0xe3000 0x1000>; - pcsphy1: ethernet-phy@0 { + pcsphy1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-2.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-2.dtsi index af2df07971dd..e7aa07964d1c 100644 --- a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-2.dtsi +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-2.dtsi @@ -34,7 +34,8 @@ mdio@e5000 { compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; reg = <0xe5000 0x1000>; - pcsphy2: ethernet-phy@0 { + pcsphy2: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-3.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-3.dtsi index 4ac98dc8b227..fb6b8d4eb786 100644 --- a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-3.dtsi +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-3.dtsi @@ -34,7 +34,8 @@ mdio@e7000 { compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; reg = <0xe7000 0x1000>; - pcsphy3: ethernet-phy@0 { + pcsphy3: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-4.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-4.dtsi index bd932d8b0160..1d9cc79bf7e2 100644 --- a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-4.dtsi +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-4.dtsi @@ -34,7 +34,8 @@ mdio@e9000 { compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; reg = <0xe9000 0x1000>; - pcsphy4: ethernet-phy@0 { + pcsphy4: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-5.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-5.dtsi index 7de1c5203f3e..b6151d6f6859 100644 --- a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-5.dtsi +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-5.dtsi @@ -34,7 +34,8 @@ mdio@eb000 { compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; reg = <0xeb000 0x1000>; - pcsphy5: ethernet-phy@0 { + pcsphy5: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; From patchwork Thu Nov 3 21:06:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1112995dyb; Thu, 3 Nov 2022 14:10:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Mpp/ytU0Y+vowGDRYzClFtSJE/suffKF54Mop+WOsbeDl1w6Amy817pQouXW6b94BZodH X-Received: by 2002:a17:907:761b:b0:7a3:86dd:d330 with SMTP id jx27-20020a170907761b00b007a386ddd330mr30635928ejc.34.1667509858598; Thu, 03 Nov 2022 14:10:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667509858; cv=pass; d=google.com; s=arc-20160816; b=mhJNVFdVS+NrrPFvnMMVGvzLjiDW8sRLi1Zz6TxzfOHL7niMA8WU1wOFMmSh3CcpDv jd4kT3nE2pZV+WqeRBP5htXEdf0wT3Y7el4ut46eau6Wz5X4oclexZ+6kP3pQN2mgs9Q LFr88dZOFTt/3hsJhYFUiUf7RiJ218/hZdXkZ6r+GAN1XNckhDtE97sCjDZNi7bohH1w JzQ6vK1hAkbeusKNINh4BpLYH0X345Z5htvwV/qsBGDfT+yJSe+MY4y00xw302rxJL5M IPr/rU07gNXTmcJbmLY2rOOUlmraBj3ZtijEaVluBmgIdZwcWYPKjsRi6rAdmoV6UTSH 7L/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XIUBlxgCTbbA73hCtpXysikkhZl2PoB4usvcQMIuKak=; b=YJM1vUKOdp2IT3wFCLR1nx5BQUisFdhhBvYzzHmjts9BKb6sZzZSEqyjnUvIlAmKMD xWMrVfeW1UaR+p45dmpvRn0Ww4GmuBMNiGFsF6OfLRqG/Fmh6AZbE5qr77wyEe31uYu6 fArDRp7l3pwLdgKagJijfFf1MIqfLkRE6ZDh1E9ySwsVxx58rFoLZv6UsmiepEAQJOzp hbw2YNck5DQUOjt9/UF3ntOIHv7uPBRc1eXaIZEWK6sBZM7/XrEiJqbSnwoUJEKlmnIY 9NvUmKjZEAEf08ounz4rg6NUEv3EWv6jHT06jFfZ/xc+5w6aOue5b/EZmgWN/63KPuZa flpg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=lOF558Uh; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs13-20020a1709072d0d00b0078d9b2facaesi3042746ejc.339.2022.11.03.14.10.33; Thu, 03 Nov 2022 14:10:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=lOF558Uh; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231474AbiKCVHT (ORCPT + 99 others); Thu, 3 Nov 2022 17:07:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231390AbiKCVHK (ORCPT ); Thu, 3 Nov 2022 17:07:10 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6921CB864; Thu, 3 Nov 2022 14:07:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TJkeCIZLAFDUWx+POs2qCF3YPiqptBPnoN2tDaF7juZG3cimsQ9M3RKwINbUHDwyDZfCeU8Du+ap2GOitrQ1MeEK/gzkJPzTRpgxfid2KEyGbBsAKYgKR1DZ4sPSWlZF9bBD6xsAg//JiE9zcajO7mNbGZ7sanBwX+4JirlQF4XL1cA4BHi8VTzobvEWAgq4kTlhOrii1s4MMWlJtnQsprHLAGN6RlKgnav7EQZIVd0IwJDltYBJjQ7eA8ce/LOsgT7HOwVBuQGPCdO7gCDFpsQjyBYwl4xs/pLZpXAowhcjJYYJLVhkjfc4TO/ZEvEiyYEtEHdb7SiRIJfintNwFw== 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=XIUBlxgCTbbA73hCtpXysikkhZl2PoB4usvcQMIuKak=; b=heCGDRPQ9iwfD6OnHZK+slWoo2RhRJ1eSuXoMvmTBGzRVv3ZO4tThTcs1E2O2rSZQdWlX+XfrmT1LwQmGpJpBeBrS+CCnY5C3ljBFY3JgJaQLVxnNKhYsPTZG/YqfJKk5sfTBCpv60C+4E2B0M5vAcy8dqixOiwy9Z9CnmfFcvk+KXTOE8hwfzQNNWdKb4qDtOCGMZeYkuM/O2teyEhmgkMsnf58fdYSacfMUMVwOggFXPagHb5ATGD6H75lZV1nUtTqk05pqpk+LX6+0IL5RAXJFsudZgzoNV1GdOSLLE30SmRHxkh1TBxLiKD1VMIX8tU66FpzIvW7N8Qoh/VFlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XIUBlxgCTbbA73hCtpXysikkhZl2PoB4usvcQMIuKak=; b=lOF558UhNzXMvR/thWm8jKSr2L5iwwNQB13cU2kitcvRoXh1vD43DKy3utAL5pmlezktGkNAkCvQPZQ7OPiGl6NjYzAG7t82UQuuH1mW0BOpyjc/AGvRzqw1UG2Xf//g1tWv1/BaJRHs09c93JOHNmJHjwzcVSVa5/OuKktdDUqk9bsv2Xpi33COfjwUvaejnqbB9KnbhNuvUZ1yO0YIY5ha3Hn5PtXA8RVmYcyjOJJan/IBghUiKAOUk7f8njt9lsZs5HXjv4CpJoxNqKxIDl6KDaU2N8i05NmdZtrNN5hjc+Dt4tDSakCuDZiMEq7jnFpwNSXl9FvGFIXDuU6Prg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:06 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:06 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson , Benjamin Herrenschmidt , Krzysztof Kozlowski , Michael Ellerman , Paul Mackerras , Rob Herring , devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH net-next v2 02/11] powerpc: dts: Add compatible strings for Lynx PCSs Date: Thu, 3 Nov 2022 17:06:41 -0400 Message-Id: <20221103210650.2325784-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: ea5f4609-eac7-4b29-08ce-08dabddf5d42 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xsu6cybi0nZlYACRrt7cOiaVP6Fpp7RV1efseyzXsvH/DBJ6T2l22uxvnyQTZm9ot1Hcbmc1UmoH+kbU808UyapbwZYDUA+6gRXv5IXJTg9RUhayYVatYQ5eG6EI+ynAlJNhEQ7SRjDrXZqYcE+ADS57pF+0Idm6kKSlmVgMOtBRe9+oCYXzckpNWlonpxAyZcYpxojonE0lIn2fRE7AaTLt0tTUMUZm1XQn5BDRrOzJ/+aDfpGCDKsXfMOU7tTVV4sxwhLe66FFLGVhMzTJc7smMPEcztA4Sn3UzukxaWzIcPdb37FWXfb4pz1+B1oJCo+/Wx2jpCeN43p/pYEVkHX1Xo0FULNBYT5CBO9U8v4E22NmX1Ovq8DnEyNVkvFsRmPOlRBOQypip6y7XtVeIJJC4TM7HGA3VkQCLh2l//nLd8BLuRNQVmEjT+gdn5JuGfDnLELuEEla7XMUbrbsE8VPd0P/D+U/+lj2kjo9Y9W0UJcgZ8efYPyaovkBEPAjQ6uLYRkqdtHz/FFOp4CLzRhLb3V1eDQCfIC+0D84BmmRC825g9xiasABZEGUmztaq15PwtdupAi+vEcqSb4MI1Z8wsdNCKpH6vUkhK1YfyoL0YNxGonzQCiBowR3HQqgrd2lbyQej0UCrF+aDzhN3b0e2cduTpS+49dvQI/0bdinyE4YGXh7IszoJQzQMZxNQYsW5DdIdpe+mZHxc8Vd7rKDOJNEYF4sRg4jgmPSKlp2VRykGN61YEcu3F3Bo0T8 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(30864003)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8q2+v3I7uzaSgNeupSyhlFZgO9Qwfe7D3MITTSgYFsFzwNKP1Pn+Hu35m3HGgDVsg8e71m+phavU5S4KHUkhwzka0WfOd26DkM7Fx2tKZj3VyJNhnO794VgPdRbQGz/d7tugcrLGMZDF89VDs9TLA+aGl1NUYMOOpy/bwCNFadBYuyPI5nJeQeiN6gU0QoHGjosDfVjaFhigr6SEz2SGvcnjaMhuxjASiw38dXMhSM/ntLLaiFSqLG7eAdSvtapv+U49QuO/dCmpCaDji/y6u8nyLNx0BdXUonLQpFpM+4BTJL4bGejAM0W14J7IeKS9aFfC3arfCPzNFKH18bWG9dtIgOzRzV7GR3X3JKKTO0xqYRzMKCC3ffa1MmKn/p9zYIWgM2kCq/xf3kQDdcu5bFBT+uv1FbqUn89bb7fnppjvVrxsFgrXHBC9laysnMuYdP0BH8M3gLFb2wjN1JkCSW0GtJQV/Sco+z/Pw9tZoKUOUFMWBXeuE5lFLjBJGxZfjWy5orU4G0vHR9YT4g+uLPCUocm0TFLOecbDiug6pZGmMpcD7hByM78iOzO+m+FEeETrJ+F5dUWZP6rNHnqJcWfqKhlE9gCHTgQcAienfRWvNC/uN7Ru3EVnN2ZmRVHl8Rrj+SEuhTR7aEoShJPc0KqBIDwsC+4GwBpa3lw8opJOgbewWfpu/A7ADRlcyrMdMw2gacJPk+x69IoRscoOQfbNm91ZmBA7z1a2u+yAoFm8DkdJLZcibAkVXCsLOpp/ezR+bHrorOO2wL93tI6TGEgR/KtXm13iV3r290Ebcs35EL4/XCjW7B8MMeqCyRIejntwt/Zpb15iAosqmIBSqPzDQfzfHFYtfqcgqFOBhmjwlsb4fnWwjcLVh4YfwGE9zkNkxQNu3NlhThANLbd9C81GtLa99u2oi0EjldHuQm9UEsHh/UrXXipE4+WFwFB0iZfPyWBqqkWrWEJ1VW8QPBrC0Zaekgzk3lPzAIancmvAeNMRTgY+5KCbHCunLn9Rmg05PfqwGL0XJdOq9FvpKNfGs6CjaCo9GBjQn7UYbfxe528f/98bz6pXLr0u3cUt3kyaRnjBEUK3GOb4FztWZCIPDtC2aCJM01xhXqNf29FtsH0m9xOdHESTW11yJu05AM1pRZBH4sX9dPGZUUnoQuFlEDikKIV7trM6jpgWNAlZ/ytuiu0GTaOfSIKbs0QbT00LG+tTOEd3yCG10EL0Cwr9oZmHO413JOdnH8Wpg+3aJegj9Imjq6SpFnhsTevKuzLlE6oxFLqPPdZ9FqB7W/y0r+LaxpkZw/XCXMUiUpTTJdCgaEcG0pGyEhk8aa5/vaEYnbsmw1x+Du++/7+GculGUcPuS9c7SjyxW7qleR3Uj/MDxqjBiwd/IdqrB78EbdjvxI5kFpCVz2IKAnUpb2hkP5wlnduvG6SOnnUYQmqoHTnnl2WCvwBmwH+3ernpJWaTPgUXufr9zvUGNrdacqT6RkG66xtf4HUIwbu9shTJClYeZ1nuqpj9ML1hL6ksYxWCLswraTq91AdVhQxf485AMbutqbBsfiVZ1upguByiX5tmnvNPk3l5AsvyoWjISEbOSsFFvzZp9Y4pzjJvpQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea5f4609-eac7-4b29-08ce-08dabddf5d42 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:06.7718 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VBfOJ3+AEZ/+denmksPYJSKbXX6sTSoxdrvN7AcuBNlM90xQcDBqJXU/ZGz5+oGxcdTeziIMPF8mW/FSUzlSfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748510817443466569?= X-GMAIL-MSGID: =?utf-8?q?1748510817443466569?= This adds appropriate compatible strings for Lynx PCSs on PowerPC QorIQ platforms. This also changes the node name to avoid warnings from ethernet-phy.yaml. Signed-off-by: Sean Anderson --- Changes in v2: - Add compatibles for qoriq-fman3-0-10g-2/3.dtsi as well arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi | 3 ++- arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi | 3 ++- 20 files changed, 40 insertions(+), 20 deletions(-) diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi index 7e70977f282a..61d52044e7b4 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi @@ -66,7 +66,8 @@ mdio@e1000 { reg = <0xe1000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy0: ethernet-phy@0 { + pcsphy0: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi index 5f89f7c1761f..78d6e49655f4 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi @@ -70,7 +70,8 @@ mdio@f1000 { reg = <0xf1000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy6: ethernet-phy@0 { + pcsphy6: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi index 71eb75e82c2e..5ffd1c2efaee 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi @@ -73,7 +73,8 @@ mdio@e3000 { reg = <0xe3000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy1: ethernet-phy@0 { + pcsphy1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi index fb7032ddb7fc..e0325f09ce5f 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi @@ -70,7 +70,8 @@ mdio@f3000 { reg = <0xf3000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy7: ethernet-phy@0 { + pcsphy7: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi index 6b3609574b0f..8e6f6c5f0f2e 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi @@ -38,7 +38,8 @@ mdio@e1000 { reg = <0xe1000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy0: ethernet-phy@0 { + pcsphy0: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi index 28ed1a85a436..2cd3f0688cb1 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi @@ -38,7 +38,8 @@ mdio@e3000 { reg = <0xe3000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy1: ethernet-phy@0 { + pcsphy1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi index 1089d6861bfb..9f8c38a629cb 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi @@ -62,7 +62,8 @@ mdio@e1000 { reg = <0xe1000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy0: ethernet-phy@0 { + pcsphy0: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi index a95bbb4fc827..248a57129d40 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi @@ -69,7 +69,8 @@ mdio@e3000 { reg = <0xe3000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy1: ethernet-phy@0 { + pcsphy1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi index 7d5af0147a25..73cef28db890 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi @@ -69,7 +69,8 @@ mdio@e5000 { reg = <0xe5000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy2: ethernet-phy@0 { + pcsphy2: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi index 61e5466ec854..4657b6a8fb78 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi @@ -69,7 +69,8 @@ mdio@e7000 { reg = <0xe7000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy3: ethernet-phy@0 { + pcsphy3: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi index 3ba0cdafc069..ac322e5803c2 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi @@ -62,7 +62,8 @@ mdio@e9000 { reg = <0xe9000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy4: ethernet-phy@0 { + pcsphy4: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi index 51748de0a289..68ffa2c65e03 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi @@ -69,7 +69,8 @@ mdio@eb000 { reg = <0xeb000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy5: ethernet-phy@0 { + pcsphy5: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi index ee4f5170f632..caf28fcbd55c 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi @@ -70,7 +70,8 @@ mdio@f1000 { reg = <0xf1000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy14: ethernet-phy@0 { + pcsphy14: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi index 83d2e0ce8f7b..6128b9fb5381 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi @@ -70,7 +70,8 @@ mdio@f3000 { reg = <0xf3000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy15: ethernet-phy@0 { + pcsphy15: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi index 3132fc73f133..a7dffe6bbe5b 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi @@ -62,7 +62,8 @@ mdio@e1000 { reg = <0xe1000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy8: ethernet-phy@0 { + pcsphy8: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi index 75e904d96602..d0ad92f2ca2d 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi @@ -69,7 +69,8 @@ mdio@e3000 { reg = <0xe3000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy9: ethernet-phy@0 { + pcsphy9: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi index 69f2cc7b8f19..b4b893eead2a 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi @@ -69,7 +69,8 @@ mdio@e5000 { reg = <0xe5000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy10: ethernet-phy@0 { + pcsphy10: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi index b3aaf01d7da0..6c15a6ff0926 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi @@ -69,7 +69,8 @@ mdio@e7000 { reg = <0xe7000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy11: ethernet-phy@0 { + pcsphy11: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi index 18e020432807..14fa4d067ffd 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi @@ -62,7 +62,8 @@ mdio@e9000 { reg = <0xe9000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy12: ethernet-phy@0 { + pcsphy12: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi index 55f329d13f19..64737187a577 100644 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi @@ -69,7 +69,8 @@ mdio@eb000 { reg = <0xeb000 0x1000>; fsl,erratum-a011043; /* must ignore read errors */ - pcsphy13: ethernet-phy@0 { + pcsphy13: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0x0>; }; }; From patchwork Thu Nov 3 21:06:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1113038dyb; Thu, 3 Nov 2022 14:11:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM58WZUJQoKypgCUp7hN0V5Wgpzlkrh4zMIBKJEeW7KL1rOOnNq2dtIKt62KvbfpbSONhzOS X-Received: by 2002:aa7:d60b:0:b0:463:596d:ba1f with SMTP id c11-20020aa7d60b000000b00463596dba1fmr24425563edr.291.1667509862696; Thu, 03 Nov 2022 14:11:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667509862; cv=pass; d=google.com; s=arc-20160816; b=RvMxNriSGtX6KTEE19g6p8gbICv3KOwKJ5VO0UgOgzbcISjDCLrccMigz5ubfspJ1x 5ZH2P8csnvXAi2/sX9W+kvtZ8Ew6t1jwdR/vN76KidGMXSwyk+uEBW5lUvHLSA+/Tv/7 9OjnuV9IrIlNOn66kXxnoO5clkmyDDRih33W4Z6EYTAC0y5oRbQlmBHIcJDXslZpWOVn Xo027fQWoIpnMaEs4QM/6wvPakVIpTJpGPublClXGqW5j9WwYlS0qbh1cUJivq9tkwmP 4bhtiKI0ODq51l3LC0TvoMzv7wQoUg35HEd5z+jO4RCeW3XmB7trspnH+cUXyOveU8Vd zoEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RbGswBWDLCsP3eJPxSSJJM0p1nxBrU6A1jUu3DhFUo4=; b=OFSKmGtcEqSSFRXfZzvEnVmPanc5Azj983gvNeHoajxJYCP2ZzUWFhp1h6xeftXg7E ckwixG1826/iBh25C7CaevyXMccRt4UZbi+/DSbL0y0h0dNvsxpDFsZeiEiRZd1i13mc BAa8NvVZnKwYkNircvPDYEAbBUiqRn2u53zo0HVT0jgmrTHgLrt5QFuxvvkzeh85fxlo QJpdvPTgwqf0jt4q+lwRxar6WTn2nJEkyE/8koarWwxay7nhMLeG+/tmufM26B2wjMR/ Ns9easPl5BO/tifNtE1Csunv+/TcjCdtfYapxQ77VZtS3sLW1ILG05kNMJ0B6NojIYsQ WTAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=ey1KFeOu; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l3-20020a170907914300b0078cff711da6si1989108ejs.976.2022.11.03.14.10.38; Thu, 03 Nov 2022 14:11:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=ey1KFeOu; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231484AbiKCVHY (ORCPT + 99 others); Thu, 3 Nov 2022 17:07:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbiKCVHL (ORCPT ); Thu, 3 Nov 2022 17:07:11 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C326221254; Thu, 3 Nov 2022 14:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VEL0k8Vx0BaYSzQa9JtrfHvWQ1wZS27f25JySxCu0YcOB/A2IEcYsyX9WioMidJQJFNqssbpLBbQ4AbyNC22HPqSCSzPjN7tI/Jm7e3MDaoF2BILgVN3HonTz0paBRXErNkwxc66uh3H70aERxwzRoGiWGljb4PKWGqVb7frYzS6Nf8F1M1Ess9yNNjnIa/J5ZijoBa96sxj35kt1JHkDS1E/xU08u3eXfB8y2vbjN4vQE/Ex97WXYz1jfdUlOdAommSJ5BsXUqL6SSoh6X0TeqMp7EvCWWICo/lg1O/FMaEn4/lLYLL+hDBOObp3AluFHya8cZPJQc9G5F59BiR+A== 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=RbGswBWDLCsP3eJPxSSJJM0p1nxBrU6A1jUu3DhFUo4=; b=k7kXcOCCbVaqZVchpxPxPJg2koQk5QucZvpdDJWsRrBPas5nsTvApXw/ObryAIPfNkmmdGGjgFpGPyhGm4S4/CZo8ZYRWQFlerYdp/ZKoTU+zDAkSbmyS62lzCHoufcrUj0c9pENnpDl2hF1EJk2ogcih2ToFaUOTp3h7jPxlSKBek2HqbOIeVbH03LP1U8vK10JoqfbsKSXwwXWzKm0EyjGUWq/tzU/QhXRB5szdRDeeSxvwIvBecysO+w4V0csHbS5jCetaDPaQNgKlBxrroFSIDvxguYFmqUQirmAyMhQsd+kJti3qdFtf3jDbJTZJ3wcQOqsnI3TB/Lf+YR+Yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RbGswBWDLCsP3eJPxSSJJM0p1nxBrU6A1jUu3DhFUo4=; b=ey1KFeOuR12hSMyLiBk6Vx6EtXGr+SNDceo4fEjQZv9tFYXIqJZy7OxSKfWytafhgXtn5WcBzaq2Z/HSEaA81hrISp/XVrE3u9vIZSgKOpzaQAdPXeIMFDc0ttn1FGVuGgJNdJ4VfJ4cK94ZIVMOJPRYrPYOloK8oCrxRLuyoXbTtrtjZB51wDQFW1WFPNtP2rXSHCOGp8LB0z2kuvZdL4hG8yi6A9NXWuybtYZO/1iJ3d3IRh6sdq40RUKt2L4SvzF0eiicDJksaVnVy+YbjLvQmtzTAnf9tqNXQuHH12pEJImultEYAGEmbVeXmKRG8nfgUpO0zmLDgbwdnEI5yg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:08 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:08 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Vladimir Oltean , Sean Anderson Subject: [PATCH net-next v2 03/11] net: dsa: ocelot: suppress PHY device scanning on the internal MDIO bus Date: Thu, 3 Nov 2022 17:06:42 -0400 Message-Id: <20221103210650.2325784-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: 8146fd42-bd1d-4db9-0d90-08dabddf5e2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PuCisP1xpDfpu+qv8nEBYi63X1uL7BmjBjlNMDNuTnyZXcClKzqKl9Py7qozZT8zy0WqAd+9a6fIpHYHmUfhoQhtTPuQbFw1dEtb2Ys/Ag8psd+dlfU3U+jdCLyu/IZvq/yT1TEEhQq4E1Jl0Ke2WOUgkNGCgyV2e9BR5tL7SOeu5aHoUqRyCu+w8AOetu54/BzsgWRWoc4/XVhGEIWuiLl/AtHnWoUWsCUz6Jkqd3Vxjt27ywlUiaYb2NjZVXdYW7cX56lAw9qugi2iimnv2+9mqwxT7UomZVdIPNg3BEZMQRRq9jiXrlrSeJBY7Si3D9QyQtnC/1Z7M8Ah8LF98ze5FMBhEMX1CNVkfxDhwsyfUmrU7ezb0Gsc9mAdgKbkxDILjiBYHby1st8GDkXv0BwtPdqOZBX21IkUJ8H/JC5Z3GkGBIHeOesf3XObCE+1X7shzksVTunI79PezidU+Bc+HTsZe/XovT2Ddyhh4nYbb/tMRzu1WvPN2ejdNdE9hhsXWYI6NojYllxXorl7U6C8J/kZbJmf7dz9fO/JYCBrzMtFJ25PolzV9xM2BrROLPCLRrB5ah3d7SEkPqQm/wAbcOtAsyaKd26+wj847aFfNTDCFC149VYyn/btHgQHyeDrnYexkZzRR6OWjg5YwyPL+PPwDPQSnokWPTN8q50ALGygEWSrEz1/Aaaey42XBRISNwyxQz4F7qNLX4WqbQGetggBHsOs+xXc3cznXdv3xi0ad8/2Ks7pPWkAxEDv X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(107886003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E//kU/FbHL93kgDPsKAtl5J2T+pj9f7twUJ1Tn5bHCyAgXQzJfc0W+MzXHkxIjkK5IQ+xPB4C4MBOHMwEt2O86q8fcTQkm+jfqFOgUc//MykelzEusMVMSSm6tz9thbUfZ/+aFRVHtaLnH8oF8k3LB81zoxHH81QlW+cBReDa3TcygPGybOdUIKJQaqttlV9fHsWn/aOtiF+PCvUudrRupniNJ0ow3NQ7S9r+hZ10JrJLdaJSeXkxqsBGr0GWG4bo17XNz64WFNQdQ0CL47FfSJ/ILkrb68GL51M1GgUpEKHrxCFSwFJ354hqxI9yUmSK2fTQ0jKbMSVPYWxBFkzFM7U+Ln6AJqu0a8BlvjByAR+cl+R2jQeS0aPCfGcWcTxNhqopGSVSIq19baObac1QLtc73CPhix0e3Ee07CGSqujKuydR2tVJSLb+cuHwaI+n3Z32PE3RJSivNMH+00pgisluK9azpM0CdfyAGJhwchsSWq3HXKCtaqOsNzBLDJ8Dip/IAiTCVkIQLQpCBCdSa3LzkZCqR6euD0P6kJnzTVp1a/Bay7VSiATuSXI3JF3fVO/mjICptpqDiG6Pmi6EUz326VHQye9q8t4Kf9WWdfPUpbbEP21yF22hDHe9/bkyCHgtc/213Ynm5rwdN81Mocb7WaqRHS+rq1IaxAgFzx1P1vaecJb87SHYHxUYdtYVuXfPazRZ0fjE0tHWnmQaeti4UJukQreoRXT6dSArmbk5I2oHfzEq/wf+16XXNKX0VckYUjlE8pcWTz4pLH2c9ixanlQzvAYKNrGFe0onK2azBzbBbGeHlIYfH8XmQPPIukTj7NQX8Di/8aBOdNVUc9rUChzAvdMw7Nb+P3xFy406pu8rpX5hDFvbhbrCaXYjbHF8bHETzNg2RNvy6thl8Iz8wytzeCg3DyE1nIGVeyl49w41TIrsVxG6h3EMKCn3tYPCQcAZy1VJC6qv1AbcCu12YD8y4F/h0OaDxMtJkm4vk3fjABo5qGAwOxPjz+iBlhr4ZgIDKqrblTCi9GywgLgVXF6GqqX/fcSFB45VIxQFDR62vAlANwYvEyREYmM7H2W+r1VhmQIJBF8ua2dixaAMkxHy2JZcPXWUNdgxtSmU190hnPe4aHrerZtt0bopLCcSCDSfo/KyzKSGpAZjnH5xurVU6tAT7KOH6Nka+xbDAh+2ehVJmSYftGAmZ3N+9PzAIjmkdnIoRol6QSWb7FgU6lLINaeUvKn+qwvrCzUvU1RFti3r0yo+qj2XpWEBKyY39zBiRNOweKaGW/5W2oryrRr3ImyIXqQU+MsR/8g9XJNn4ow2rzFAQg9BG+mQbVLAInUzzmx1VP9bJUajqmH9evy8Dje9eW0P8ULaGrWAKCeieRL7qk+a0Fvk8Y9s6hJdpKQwnfH96I4c3cgc/qO1Z6nKWG+tUtMEnYrsVI1gMVIF30clrqeZrnHpIb46hqPmPcOthZn3+bajFzlkcMVkdvv73GtGisbgWagfhY5hFvIsQzvdOauSOAHfIesTdczWTAWfnjxVvdN8s+6u+3Pc3xH6+ptrQaOI8boU4FkaU9Ax21Un/3VTveFqf0jYjCvqn+2eJ+1dv6hGkuKFg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8146fd42-bd1d-4db9-0d90-08dabddf5e2e X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:08.3810 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UToT5omneDNC/RqnBZMq+TOBvmqlma3EORakxjzmo31rOXweDleCIG4uOxoMDJP/Tzz4UhI7hTL1sKU2Cfx7yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748510821907170231?= X-GMAIL-MSGID: =?utf-8?q?1748510821907170231?= From: Vladimir Oltean This bus contains Lynx PCS devices, and if the lynx-pcs driver ever decided to call mdio_device_register(), it would fail due to mdiobus_scan() having created a dummy phydev for the same address (the PCS responds to standard clause 22 PHY ID registers and can therefore by autodetected by phylib which thinks it's a PHY). On the Seville driver, things are a bit more complicated, since bus creation is handled by mscc_miim_setup() and that is shared with the dedicated mscc-miim driver. Suppress PHY scanning only for the Seville internal MDIO bus rather than for the whole mscc-miim driver, since we know that on NXP T1040, this bus only contains Lynx PCS devices. Signed-off-by: Vladimir Oltean Signed-off-by: Sean Anderson --- (no changes since v1) drivers/net/dsa/ocelot/felix_vsc9959.c | 4 ++++ drivers/net/dsa/ocelot/seville_vsc9953.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 26a35ae322d1..ba893055b92d 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -990,6 +990,10 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) bus->read = enetc_mdio_read; bus->write = enetc_mdio_write; bus->parent = dev; + /* Suppress PHY device creation in mdiobus_scan(), + * we have Lynx PCSs + */ + bus->phy_mask = ~0; mdio_priv = bus->priv; mdio_priv->hw = hw; /* This gets added to imdio_regs, which already maps addresses diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c index 7af33b2c685d..1e1c6cd265fd 100644 --- a/drivers/net/dsa/ocelot/seville_vsc9953.c +++ b/drivers/net/dsa/ocelot/seville_vsc9953.c @@ -924,12 +924,16 @@ static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot) rc = mscc_miim_setup(dev, &bus, "VSC9953 internal MDIO bus", ocelot->targets[GCB], ocelot->map[GCB][GCB_MIIM_MII_STATUS & REG_MASK]); - if (rc) { dev_err(dev, "failed to setup MDIO bus\n"); return rc; } + /* Suppress PHY device creation in mdiobus_scan(), + * we have Lynx PCSs + */ + bus->phy_mask = ~0; + /* Needed in order to initialize the bus mutex lock */ rc = devm_of_mdiobus_register(dev, bus, NULL); if (rc < 0) { From patchwork Thu Nov 3 21:06:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15197 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1113322dyb; Thu, 3 Nov 2022 14:11:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7iB6PHPlLbqJH0tDmF3PJoq4nb7JqHASX9VsBWUHiCEbFkwp6g7uj/fvcqfayo154Y2z3s X-Received: by 2002:a17:906:db0a:b0:781:f24:a782 with SMTP id xj10-20020a170906db0a00b007810f24a782mr31514512ejb.399.1667509890104; Thu, 03 Nov 2022 14:11:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667509890; cv=pass; d=google.com; s=arc-20160816; b=ph9LWQMhHN+UyakFfzRZLzMCPWEKI27IhqkXyHx9gjmGzFwl1wAerip5fvcp1pwJC2 DwmzDpElhmLldwq+XAaDVQQYzjPgdQIElVUJVG2bqBqxBDyiW1+lKrAC6ZwTxgdY9J3O /VGGCuP73YzDdFGQRmzWNHUZF5O+edHj+ibzz+K8zd+K1CLGIg0tbdZfltNMcOSygmer OqfVRt8Mn616Ty0GdJ1/RZ6eyCWhDi89aPr4CJvuwnYXNiQ2MCOpNttszI6dpr9hvXpB eq+3NdBOmA8KF7CAYM2ZQf1hxEqGVvueGEue5Dc6oVFogUZT2vwcXIJ7GQIvNpjC868A s01g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aknaCMtWcsEhrWWEJznCG1QAmIGj6IIAjPXJdfsQHgs=; b=QYp7/pGhSHl7NKlZCelA47EUZY8UBTMtiuPuVEfQEir1Os2dtig1Nki2MykgGfNXIf 7/O5CWVYyST32r1dT5rlep54o76OAphMmTfQfRUp68Ry3xn8nUKLoGmIxtssZMoRLiNZ Tdi4awFwSUe2kibaL7yThIbc7mSdwLrBlhQxLm5+7BjLkmSk/uo1+XokSrUTksyuJYNI ovtjjfoNoUHvi0Q/QnOK5yXOSqQirj1AAkcFV+yp6719Z9lGB3iGglDB6rTg0hK3+Q6Z AQSSulPV1SoSGT7wOO5BAkh6/wzhmfHGLNYZwOOhZbEmEA0fBaabF6D3R9Cq5QW57X2S kY5Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=NoavuBjo; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz12-20020a1709077d8c00b0078e2828052asi2612406ejc.638.2022.11.03.14.11.06; Thu, 03 Nov 2022 14:11:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=NoavuBjo; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231491AbiKCVHa (ORCPT + 99 others); Thu, 3 Nov 2022 17:07:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231354AbiKCVHO (ORCPT ); Thu, 3 Nov 2022 17:07:14 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF51B9FFC; Thu, 3 Nov 2022 14:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U++dz/L6A8UpP8XKt5yznG3x1/skno+H0cFw4cNmjJPmL8b346nyYaQ4MbVo6SmSFo7qmF6AdbTsV6bteMKOGznT3YmGGTfd8om1BD+IJSvTbW19Sg0r1FJCN+3x8/ZGs/A6u4xCTkukZdYLtHjxChF3K9M8uzAqG8jUSS/7xSgrY9GnFsSmP2NHtrf3MoTFPyaAr53n5JohBxKkzBf51G87kU5PvefbtCP7AZtdND+Vzo+Vb9QVjETDFEG/7bBupEbGGx6mADqeFj2gJtLcmJ6bwN8156ctBGW5uz38Df0YHT9RZRXa98DA62xJ2eyOKiWZeqiN7S4XKUAFo6QbsA== 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=aknaCMtWcsEhrWWEJznCG1QAmIGj6IIAjPXJdfsQHgs=; b=ZoDAF78YRGM9BVg3aZWhsOI8wBV1/J6p7W0byx7MEisKRRyRzR+EaJiqA1j8fz3fXfnFKRC1gN3CI2BP+wYiF81xYocqE3UlEN15xUZweNBG6eSfqbeeMokjWg2uSoSGtPxOs/7kT2vsXvbbWFjATpovoa2q2tSZGMnrmM5/K1pcBjLuujSPW0hiX5awRENQAxfaToDQw20crntC5iJN9hpqEbox4+ysitt6ItGig5HKjVASo1M36opeZpGr/D62VstElUTeYO5lzPHMthbbthEF2PsGk3nLHO3sXbkgYWAX96m07OKD93aY1dbSl7P9yLswwZvB0vYMfARUefik1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aknaCMtWcsEhrWWEJznCG1QAmIGj6IIAjPXJdfsQHgs=; b=NoavuBjo3Nfs2rwTaVds95aRiyw2JuM4YmlpJ/4V/d6q0eU+BkU1Xs1kdkTjNMWaT2qfMCTX5sHbb7t6PncxM4N8+3Nu1wmAPUPVAU3ryjsx6Q8Fav5CaIWAAjK+azSC+hBgXD7lt+fuwyb6zgcji+DQT3fQ1WGqs3VtJp7oOfii1mG/KHcO/3mdQMktxBNO7bftsYq44T/zcgDtzLAcHZAJT4aH1az+MT/6DUOgE0gQEHM1ElPpZB9JgifUjgiQt8DLcAFrLPkjp1EIeND1MteffVXbFL/KyGhf9eUqpK6zhaYKpXpqIREphmwZ7+ZwyHeKPZyjhoJ8N0qj1RXO4w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:10 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:10 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson Subject: [PATCH net-next v2 04/11] net: pcs: Add subsystem Date: Thu, 3 Nov 2022 17:06:43 -0400 Message-Id: <20221103210650.2325784-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: c345a60e-819a-4232-124d-08dabddf5f1a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2uu27C4wOqSynBGcMHpwZB0ZCJEUbt6bYCRcFOCVsIAMvI3KuRlXNEWKqWHESHNmz5M0AIpUhaI9blQtHQhXqNyNfbX+OswIG/AB9eaMewYNMJOA94uvqf0PcUK5EJVrWsZvXzVoFSUp8PVcCJV84Wno1oS18hhthSj5Abud4hrgoGzGrKGx+3bNt/OdcbOwvKsw/MXbZP2jhEJQMW73BDcrJI3cgESjU72q58S5CSJWgfwPP05TaohldNDZBo9wiz3UpsujNacT5SaKmkXd74ukB8HvDxOtfC9z5q2gTZaIgT+GRXRfdK9QBrseri7nha0QH5RxmoEwX9HSsyUZtzm2Y06zwI8Bm4YHT7GW0XICaW70OcjXCDm7rYsNbGuQ9vzgFHwgzeUBCpbiK3+yCD9HCRWIPx2kr+YeGj6tFsuZsmvW0qn6kmRV2xiG8W0lnZ5ULWv8tAshXMSVNYAuWczULL52Ug8c3mksOI8EtdOORCJsoR0XH7wyHGohE6h1lzxIKIUHWu0eVl6Fn8p1KHrZaD626R7RYNmFkXeNOGVKi/9gFxkBu26xifncVljz/iAx/jOi+ykcpHeHLJ68ZcZFyxUeGP7vVrNbLmDdl4+X0NwyhbcLRKJwupbalsP/QcbWdmhGQaZPN1JaOWeuoZjauWnBOxpSekVUN0i2cMI+clEwUOSjUSTdadCLhh/7jmznRxQ0L4n+B1moH/eW9GSfw77MTLQ9G+f/pg4hXvMCkndn79m1xaDj1ewrAOtgsmfR9PVXNQBrxj6GSIlQ93wW+9IG+riXrXzwvysbbYE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(107886003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(30864003)(26005)(6512007)(6506007)(966005)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A3PXb1/ogkKuUfYeN5U16pyUmZkoCZL7PuGOt2b9+E2hW8rBMbL0KgNN2n028etnbU52PfsCoQ8YogKI3dxruVGxWGcY3la4NrVdO1Fx+jXl/UqWa37mABQSVkKKkk+0v80vu5chaK3Dp3jlPPH4K0La+SJ1DH05jODVICvEfv8ttKxICK4Rh81c57GwZoBWpwbDufDPE5gnuqBfkYlRCEVaW6NPTewgE3lP4XHBnqncU5nmN7ylo8BgombK2EH8fKzFFJxCqEH2lIG/Lzfa76OHxkuX8wpd/MSCEC3dmoFqFCnhghz23cBPDL9Lhc+I/UepctVijpEi8DMxwqdZceKQ6Og3bLJWPkDsEmY08NuZCbVlK7HkXe/wf69oX1Gc9f4eQfAiNev4cQr1zUG2ZGeOWj+U0HI77mnbsTZ/AIBocSPxTxKNKj4wnNA0RFFTS3VrN36kOpi9PTukwV6RdRivF5k/0oUWidR7SRXazK5h4Sji8i9c2AAZk7l9+NJW30H6111cz8NBkCOn+/JS9ksG72FWb0hUKIUThBDYD5elrqzY6A35opYb0o21YpaI/g1O3hgdf9JEGzn7Rndk0bpuV+rQ/rIFNLNzetcIjrIR9jfvAwOmYy8FQ/GmymtvDGsm4VWfTkeKBFy5WsJZXDYA77vG1RUh5PEhBPqiPtIPuAaBjm4bahHgRewu3YrQnB/Qc2OHreL60nv/LDltO0FYUt+ojMU30rtz/nc/GckTZqF8QiqMheHLe+e2UWIeVpxfvzCGXY14Y2yuzJY42OhLvdrLdAL5rty4uhA25KX4LKnMJVj36pfNF4DmD1vVt5LY63qkE27eCoN61gLbB6RZ/fFqKI43ZGDCNl1LLMEoPpxwGL5GQJq11TaIXnXfN8TX1hr74nhL+JrD+MGaWngFA8Blj2kXu9k59yIF8U1y8BfW27zxv0thLExknub7VsY/Tv2bIdvA+xtcALCClA8cG6cChHq5JuoiQyTT8igP0gOJMJ3XfM0tLRVW5lDj+ISKwWExAPxENxIshzJ08fMo/JUZsJxUa/9AjqMz6u4YaBxBrB184mSrfwLyxYKLHe2u1ZTRvR4XKGNtkxNRjNXjwKt7C4WydkKnkRQuE93RtVHE/eSbnjgPsG3Tr9VRebzxCTSBrk2FRYf64UgrbmSEW3MbNeUy7GgPmmz81E42MyHMnnSeYGB8Fxbp1PAZKqNM83/5EDpgBFLSLtljBjs2XueHwzE58RLp34oyNQZ00g5VvdRUj1Nz0T8gJjh5xSoFbHqAj/m/glNVTTHfszQ4LPlXe05uXbTgcO6lJPBJG9r3yqV6BEm4hIbC3TWE6AHFAjC+0lDLGnvLhSvC2XCAw5fTfSEkeY632RtQafIQTH1lQAPRoKfgn7+4T8BfIVBEjs2VVY2YqepyXk9wrACVLCYQ80QJSbnd9sGnOyfOI8DGDL4ou+FJjlrVv2VKyTq2kNuWLbr41YRSpGH5Esg8i5gNBZSqRLDgJxp1OMdUVuCYPDbUqZSDxIC0B9IncmFVMzH/f9RjI+leDTo/S+f1aO3a0G9crYLfUFdYRIclrIHNuIvDRSHJ1OCXYIEcWYic2iiErhYj5dwTGxUxfw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: c345a60e-819a-4232-124d-08dabddf5f1a X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:09.9122 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2uzhOC/tsi0G1C5xnHxnaq8F/ycGP8iuE2KQihD1J1AoNIqn9qRxTEy5elhioMWrDY5lsXHtJmzjrKscoCYW+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748510850977230843?= X-GMAIL-MSGID: =?utf-8?q?1748510850977230843?= This adds support for getting PCS devices from the device tree. PCS drivers must first register with phylink_register_pcs. After that, MAC drivers may look up their PCS using phylink_get_pcs. We use device links to ensure that PCS consumers are removed before their PCSs. This will cause PCS consumers to be removed when their PCSs go away. There is no way to avoid this without e.g. converting PCS consumers to be composite devices. I think that approach adds significant complexity, as PCS devices are unlikely to ever be remved. Device links will not provide correct probe ordering when PCSs are children of their consumers. In such cases, the PCS driver should set suppress_bind_attrs to prevent incorrect removal order. Signed-off-by: Sean Anderson --- This is adapted from [1], primarily incorporating the changes discussed there. An example of this series done with composite devices may be found at [2]. [1] https://lore.kernel.org/netdev/9f73bc4f-5f99-95f5-78fa-dac96f9e0146@seco.com/ [2] https://github.com/sean-anderson-seco/linux/tree/pcs_device Changes in v2: - Fix export of _pcs_get_by_fwnode - Add device links to ensure correct probe/removal ordering - Remove module_get/put, since this is ensured by the device_get/put - Reorganize some of the control flow for legibility - Add basic documentation Documentation/networking/index.rst | 1 + Documentation/networking/pcs.rst | 109 +++++++++++++ MAINTAINERS | 2 + drivers/net/pcs/Kconfig | 12 ++ drivers/net/pcs/Makefile | 2 + drivers/net/pcs/core.c | 243 +++++++++++++++++++++++++++++ include/linux/pcs.h | 111 +++++++++++++ include/linux/phylink.h | 5 + 8 files changed, 485 insertions(+) create mode 100644 Documentation/networking/pcs.rst create mode 100644 drivers/net/pcs/core.c create mode 100644 include/linux/pcs.h diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 4f2d1f682a18..c37f94d9b24a 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -28,6 +28,7 @@ Contents: page_pool phy sfp-phylink + pcs alias bridge snmp_counter diff --git a/Documentation/networking/pcs.rst b/Documentation/networking/pcs.rst new file mode 100644 index 000000000000..3f3cafee1a88 --- /dev/null +++ b/Documentation/networking/pcs.rst @@ -0,0 +1,109 @@ +.. SPDX-License-Identifier: GPL-2.0 + +============= +PCS Subsystem +============= + +The PCS (Physical Coding Sublayer) subsystem handles the registration and lookup +of PCS devices. These devices contain the upper sublayers of the Ethernet +physical layer, generally handling framing, scrambling, and encoding tasks. PCS +devices may also include PMA (Physical Medium Attachment) components. PCS +devices transfer data between the Link-layer MAC device, and the rest of the +physical layer, typically via a SerDes. The output of the SerDes may be +connected more-or-less directly to the medium when using Fiber-optic or +backplane connections (1000BASE-SX, 1000BASE-KX, etc). It may also communicate +with a separate PHY (such as over SGMII) which handles the connection to the +medium (such as 1000BASE-T). + +Looking up PCS Devices +---------------------- + +There are generally two ways to look up a PCS device. If the PCS device is +internal to a larger device (such as a MAC or switch), and it does not share an +implementation with an existing PCS, then it does not need to be registered with +the PCS subsystem. Instead, you can populate a :c:type:`phylink_pcs` +in your probe function. Otherwise, you must look up the PCS. + +If your device has a :c:type:`fwnode_handle`, you can add a PCS using the +``pcs-handle`` property:: + + ethernet-controller { + // ... + pcs-handle = <&pcs>; + pcs-handle-names = "internal"; + }; + +Then, during your probe function, you can get the PCS using :c:func:`pcs_get`:: + + mac->pcs = pcs_get(dev, "internal"); + if (IS_ERR(mac->pcs)) { + err = PTR_ERR(mac->pcs); + return dev_err_probe(dev, "Could not get PCS\n"); + } + +If your device doesn't have a :c:type:`fwnode_handle`, you can get the PCS +based on the providing device using :c:func:`pcs_get_by_dev`. Typically, you +will create the device and bind your PCS driver to it before calling this +function. This allows reuse of an existing PCS driver. + +Once you are done using the PCS, you must call :c:func:`pcs_put`. + +Using PCS Devices +----------------- + +To select the PCS from a MAC driver, implement the ``mac_select_pcs`` callback +of :c:type:`phylink_mac_ops`. In this example, the PCS is selected for SGMII +and 1000BASE-X, and deselected for other interfaces:: + + static struct phylink_pcs *mac_select_pcs(struct phylink_config *config, + phy_interface_t iface) + { + struct mac *mac = config_to_mac(config); + + switch (iface) { + case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_1000BASEX: + return mac->pcs; + default: + return NULL; + } + } + +To do the same from a DSA driver, implement the ``phylink_mac_select_pcs`` +callback of :c:type:`dsa_switch_ops`. + +Writing PCS Drivers +------------------- + +To write a PCS driver, first implement :c:type:`phylink_pcs_ops`. Then, +register your PCS in your probe function using :c:func:`pcs_register`. You must +call :c:func:`pcs_unregister` from your remove function. You can avoid this step +by registering with :c:func:`devm_pcs_unregister`. + +Normally, :ref:`device links ` will prevent improper ordering of +device unbinding/removal. However, if your PCS device can be a child of its +consumers (such as if it lives on an MDIO bus created by the MAC which uses the +PCS), then no device link will be created. This is because children must be +probed/removed after their parents, but a device link implies that the consumer +must be probed after the provider. This contradiction is generally resolved by +having the consumer probe the provider at an appropriate point in the consumer's +probe function. However, the ``unbind`` device attribute can let userspace +unbind the provider directly, bypassing this usual process. Therefore, PCS +drivers in this situation, must set ``suppress_bind_attrs`` in their +:c:type:`device_driver`. + + +API Reference +------------- + +.. kernel-doc:: include/linux/phylink.h + :identifiers: phylink_pcs phylink_pcs_ops + +.. kernel-doc:: include/linux/pcs.h + :internal: + +.. kernel-doc:: drivers/net/pcs/core.c + :export: + +.. kernel-doc:: drivers/net/pcs/core.c + :internal: diff --git a/MAINTAINERS b/MAINTAINERS index f99100cd37ce..bbea45c02e01 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7705,6 +7705,7 @@ F: Documentation/ABI/testing/sysfs-class-net-phydev F: Documentation/devicetree/bindings/net/ethernet-phy.yaml F: Documentation/devicetree/bindings/net/mdio* F: Documentation/devicetree/bindings/net/qca,ar803x.yaml +F: Documentation/networking/pcs.rst F: Documentation/networking/phy.rst F: drivers/net/mdio/ F: drivers/net/mdio/acpi_mdio.c @@ -7718,6 +7719,7 @@ F: include/linux/*mdio*.h F: include/linux/mdio/*.h F: include/linux/mii.h F: include/linux/of_net.h +F: include/linux/pcs.h F: include/linux/phy.h F: include/linux/phy_fixed.h F: include/linux/platform_data/mdio-bcm-unimac.h diff --git a/drivers/net/pcs/Kconfig b/drivers/net/pcs/Kconfig index 6e7e6c346a3e..8d70fc52a803 100644 --- a/drivers/net/pcs/Kconfig +++ b/drivers/net/pcs/Kconfig @@ -5,6 +5,18 @@ menu "PCS device drivers" +config PCS + bool "PCS subsystem" + help + This provides common helper functions for registering and looking up + Physical Coding Sublayer (PCS) devices. PCS devices translate between + different interface types. In some use cases, they may either + translate between different types of Medium-Independent Interfaces + (MIIs), such as translating GMII to SGMII. This allows using a fast + serial interface to talk to the phy which translates the MII to the + Medium-Dependent Interface. Alternatively, they may translate a MII + directly to an MDI, such as translating GMII to 1000Base-X. + config PCS_XPCS tristate select PHYLINK diff --git a/drivers/net/pcs/Makefile b/drivers/net/pcs/Makefile index 4c780d8f2e98..60cd32126d41 100644 --- a/drivers/net/pcs/Makefile +++ b/drivers/net/pcs/Makefile @@ -1,6 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for Linux PCS drivers +obj-$(CONFIG_PCS) += core.o + pcs_xpcs-$(CONFIG_PCS_XPCS) := pcs-xpcs.o pcs-xpcs-nxp.o obj-$(CONFIG_PCS_XPCS) += pcs_xpcs.o diff --git a/drivers/net/pcs/core.c b/drivers/net/pcs/core.c new file mode 100644 index 000000000000..be59afdac153 --- /dev/null +++ b/drivers/net/pcs/core.c @@ -0,0 +1,243 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2022 Sean Anderson + */ + +#include +#include +#include +#include +#include +#include +#include + +static LIST_HEAD(pcs_devices); +static DEFINE_MUTEX(pcs_mutex); + +/** + * pcs_register() - register a new PCS + * @pcs: the PCS to register + * + * Registers a new PCS which can be attached to a phylink. + * + * Return: 0 on success, or -errno on error + */ +int pcs_register(struct phylink_pcs *pcs) +{ + if (!pcs->dev || !pcs->ops) + return -EINVAL; + if (!pcs->ops->pcs_an_restart || !pcs->ops->pcs_config || + !pcs->ops->pcs_get_state) + return -EINVAL; + + INIT_LIST_HEAD(&pcs->list); + mutex_lock(&pcs_mutex); + list_add(&pcs->list, &pcs_devices); + mutex_unlock(&pcs_mutex); + return 0; +} +EXPORT_SYMBOL_GPL(pcs_register); + +/** + * pcs_unregister() - unregister a PCS + * @pcs: a PCS previously registered with pcs_register() + */ +void pcs_unregister(struct phylink_pcs *pcs) +{ + mutex_lock(&pcs_mutex); + list_del(&pcs->list); + mutex_unlock(&pcs_mutex); +} +EXPORT_SYMBOL_GPL(pcs_unregister); + +static void devm_pcs_release(struct device *dev, void *res) +{ + pcs_unregister(*(struct phylink_pcs **)res); +} + +/** + * devm_pcs_register - resource managed pcs_register() + * @dev: device that is registering this PCS + * @pcs: the PCS to register + * + * Managed pcs_register(). For PCSs registered by this function, + * pcs_unregister() is automatically called on driver detach. See + * pcs_register() for more information. + * + * Return: 0 on success, or -errno on failure + */ +int devm_pcs_register(struct device *dev, struct phylink_pcs *pcs) +{ + struct phylink_pcs **pcsp; + int ret; + + pcsp = devres_alloc(devm_pcs_release, sizeof(*pcsp), + GFP_KERNEL); + if (!pcsp) + return -ENOMEM; + + ret = pcs_register(pcs); + if (ret) { + devres_free(pcsp); + return ret; + } + + *pcsp = pcs; + devres_add(dev, pcsp); + + return ret; +} +EXPORT_SYMBOL_GPL(devm_pcs_register); + +/** + * _pcs_get_tail() - Look up and request a PCS + * @dev: The device requesting the PCS + * @fwnode: The PCS's fwnode + * @pcs_dev: The PCS's device + * + * Search PCSs registered with pcs_register() for one with a matching + * fwnode or device. Either @fwnode or @pcs_dev may be %NULL if matching + * against a fwnode or device is not desired (respectively). + * + * Once a PCS is found, perform common operations necessary when getting a PCS + * (increment reference counts, etc). + * + * Return: A PCS, or an error pointer on failure. If both @fwnode and @pcs_dev are + * * %NULL, returns %NULL to allow easier chaining. + */ +struct phylink_pcs *_pcs_get_tail(struct device *dev, + const struct fwnode_handle *fwnode, + const struct device *pcs_dev) +{ + struct phylink_pcs *pcs; + + if (!fwnode && !pcs_dev) + return NULL; + + /* We need to hold this until we get to device_link_add. Otherwise, + * someone could unbind the PCS driver. + */ + mutex_lock(&pcs_mutex); + list_for_each_entry(pcs, &pcs_devices, list) { + if (pcs_dev && pcs->dev == pcs_dev) + goto found; + if (fwnode && pcs->dev->fwnode == fwnode) + goto found; + } + pcs = ERR_PTR(-EPROBE_DEFER); + +found: + pr_debug("looking for %pfwf or %s %s...%s found\n", fwnode, + dev ? dev_driver_string(dev) : "(null)", + dev ? dev_name(dev) : "(null)", + IS_ERR(pcs) ? " not" : ""); + if (IS_ERR(pcs)) + goto out; + + get_device(pcs->dev); + + /* If fwnode is present, this link should have already been created by + * of_fwnode_add_links. This will mainly fail if pcs->dev is a child of + * dev. + */ + if (!device_link_add(dev, pcs->dev, DL_FLAG_STATELESS)) + dev_dbg(dev, "failed to create device link to %s\n", + dev_name(pcs->dev)); + +out: + mutex_unlock(&pcs_mutex); + return pcs; +} +EXPORT_SYMBOL_GPL(_pcs_get_tail); + +/** + * pcs_find_fwnode() - Find a PCS's fwnode + * @mac_node: The fwnode referencing the PCS + * @id: The name of the PCS to get. May be %NULL to get the first PCS. + * @optional: Whether the PCS is optional + * + * Find a PCS's fwnode, as referenced by @mac_node. This fwnode can later be + * used with _pcs_get_tail() to get the actual PCS. ``pcs-handle-names`` is + * used to match @id, then the fwnode is found using ``pcs-handle``. + * + * Return: %NULL if @optional is set and the PCS cannot be found. Otherwise, + * * returns a PCS if found or an error pointer on failure. + */ +static struct fwnode_handle *pcs_find_fwnode(const struct fwnode_handle *mac_node, + const char *id, bool optional) +{ + int index; + struct fwnode_handle *pcs_fwnode; + + if (!mac_node) + return optional ? NULL : ERR_PTR(-ENODEV); + + if (id) + index = fwnode_property_match_string(mac_node, + "pcs-handle-names", id); + else + index = 0; + + if (index < 0) { + if (optional && (index == -EINVAL || index == -ENODATA)) + return NULL; + return ERR_PTR(index); + } + + /* First try pcs-handle, and if that doesn't work fall back to the + * (legacy) pcsphy-handle. + */ + pcs_fwnode = fwnode_find_reference(mac_node, "pcs-handle", index); + if (PTR_ERR(pcs_fwnode) == -ENOENT) + pcs_fwnode = fwnode_find_reference(mac_node, "pcsphy-handle", + index); + if (optional && !id && PTR_ERR(pcs_fwnode) == -ENOENT) + return NULL; + return pcs_fwnode; +} + +/** + * _pcs_get() - Get a PCS from a fwnode property + * @dev: The device to get a PCS for + * @fwnode: The fwnode to find the PCS with + * @id: The name of the PCS to get. May be %NULL to get the first PCS. + * @optional: Whether the PCS is optional + * + * Find a PCS referenced by @mac_node and return a reference to it. Every call + * to _pcs_get_by_fwnode() must be balanced with one to pcs_put(). + * + * Return: a PCS if found, %NULL if not, or an error pointer on failure + */ +struct phylink_pcs *_pcs_get(struct device *dev, struct fwnode_handle *fwnode, + const char *id, bool optional) +{ + struct fwnode_handle *pcs_fwnode; + struct phylink_pcs *pcs; + + pcs_fwnode = pcs_find_fwnode(fwnode, id, optional); + if (IS_ERR(pcs_fwnode)) + return ERR_CAST(pcs_fwnode); + + pcs = _pcs_get_tail(dev, pcs_fwnode, NULL); + fwnode_handle_put(pcs_fwnode); + return pcs; +} +EXPORT_SYMBOL_GPL(_pcs_get); + +/** + * pcs_put() - Release a previously-acquired PCS + * @dev: The device used to acquire the PCS + * @pcs: The PCS to put + * + * This frees resources associated with the PCS which were acquired when it was + * gotten. + */ +void pcs_put(struct device *dev, struct phylink_pcs *pcs) +{ + if (!pcs) + return; + + device_link_remove(dev, pcs->dev); + put_device(pcs->dev); +} +EXPORT_SYMBOL_GPL(pcs_put); diff --git a/include/linux/pcs.h b/include/linux/pcs.h new file mode 100644 index 000000000000..41ea388ae3f7 --- /dev/null +++ b/include/linux/pcs.h @@ -0,0 +1,111 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2022 Sean Anderson + */ + +#ifndef _PCS_H +#define _PCS_H + +#include + +struct phylink_pcs; + +int pcs_register(struct phylink_pcs *pcs); +void pcs_unregister(struct phylink_pcs *pcs); +int devm_pcs_register(struct device *dev, struct phylink_pcs *pcs); +struct phylink_pcs *_pcs_get_tail(struct device *dev, + const struct fwnode_handle *fwnode, + const struct device *pcs_dev); +struct phylink_pcs *_pcs_get(struct device *dev, struct fwnode_handle *fwnode, + const char *id, bool optional); +void pcs_put(struct device *dev, struct phylink_pcs *pcs); + +/** + * pcs_get() - Get a PCS based on a fwnode + * @dev: The device requesting the PCS + * @id: The name of the PCS + * + * Find and get a PCS, as referenced by @dev's &struct fwnode_handle. See + * pcs_find_fwnode() for details. Each call to this function must be balanced + * with one to pcs_put(). + * + * Return: A PCS on success, or an error pointer on failure + */ +static inline struct phylink_pcs *pcs_get(struct device *dev, const char *id) +{ + return _pcs_get(dev, dev_fwnode(dev), id, false); +} + +/** + * pcs_get_optional() - Optionally get a PCS based on a fwnode + * @dev: The device requesting the PCS + * @id: The name of the PCS + * + * Optionally find and get a PCS, as referenced by @dev's &struct + * fwnode_handle. See pcs_find_fwnode() for details. Each call to this function + * must be balanced with one to pcs_put(). + * + * Return: A PCS on success, %NULL if none was found, or an error pointer on + * * failure + */ +static inline struct phylink_pcs *pcs_get_optional(struct device *dev, + const char *id) +{ + return _pcs_get(dev, dev_fwnode(dev), id, true); +} + +/** + * pcs_get_by_fwnode() - Get a PCS based on a fwnode + * @dev: The device requesting the PCS + * @fwnode: The &struct fwnode_handle referencing the PCS + * @id: The name of the PCS + * + * Find and get a PCS, as referenced by @fwnode. See pcs_find_fwnode() for + * details. Each call to this function must be balanced with one to pcs_put(). + * + * Return: A PCS on success, or an error pointer on failure + */ +static inline struct phylink_pcs +*pcs_get_by_fwnode(struct device *dev, struct fwnode_handle *fwnode, + const char *id) +{ + return _pcs_get(dev, fwnode, id, false); +} + +/** + * pcs_get_by_fwnode_optional() - Optionally get a PCS based on a fwnode + * @dev: The device requesting the PCS + * @fwnode: The &struct fwnode_handle referencing the PCS + * @id: The name of the PCS + * + * Optionally find and get a PCS, as referenced by @fwnode. See + * pcs_find_fwnode() for details. Each call to this function must be balanced + * with one to pcs_put(). + * + * Return: A PCS on success, %NULL if none was found, or an error pointer on + * * failure + */ +static inline struct phylink_pcs +*pcs_get_by_fwnode_optional(struct device *dev, struct fwnode_handle *fwnode, + const char *id) +{ + return _pcs_get(dev, fwnode, id, true); +} + +/** + * pcs_get_by_dev() - Get a PCS from its providing device + * @dev: The device requesting the PCS + * @pcs_dev: The device providing the PCS + * + * Get the first PCS registered by @pcs_dev. Each call to this function must be + * balanced with one to pcs_put(). + * + * Return: A PCS on success, or an error pointer on failure + */ +static inline struct phylink_pcs *pcs_get_by_dev(struct device *dev, + const struct device *pcs_dev) +{ + return _pcs_get_tail(dev, NULL, pcs_dev); +} + +#endif /* PCS_H */ diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 63800bf4a7ac..0edbf0d243e0 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -1,6 +1,7 @@ #ifndef NETDEV_PCS_H #define NETDEV_PCS_H +#include #include #include #include @@ -432,13 +433,17 @@ struct phylink_pcs_ops; /** * struct phylink_pcs - PHYLINK PCS instance + * @dev: the device associated with this PCS * @ops: a pointer to the &struct phylink_pcs_ops structure + * @list: internal list of PCS devices * @poll: poll the PCS for link changes * * This structure is designed to be embedded within the PCS private data, * and will be passed between phylink and the PCS. */ struct phylink_pcs { + struct list_head list; + struct device *dev; const struct phylink_pcs_ops *ops; bool poll; }; From patchwork Thu Nov 3 21:06:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15199 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1113758dyb; Thu, 3 Nov 2022 14:12:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM63ndtFWFw2kwM1vpLsHJ92X78Jyl+xn9jO2kNxXEFtQ0IBeEWi0TU6H0wa0xlDkUHitzgy X-Received: by 2002:aa7:c14b:0:b0:461:c47d:48cf with SMTP id r11-20020aa7c14b000000b00461c47d48cfmr31375527edp.83.1667509931809; Thu, 03 Nov 2022 14:12:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667509931; cv=pass; d=google.com; s=arc-20160816; b=WfAJIjtQX0t6MzNK/VrnnCwFyA3HzK0LdDMF+u49LGXA1VwTOnULWEUwes9YsAIUGM h//uVBRiM/lChjcp56TIOvITIOi5Z3gFGzWbMdecEvQsyp2aFI8uMxp/XvukVw4Rk2qR kK1wSKGJulbbduIke6yNbNBCpQ6j9IrFnEIlhlap783nF+fU2+/Sd8VT6Tf6/EVAjgoS S453P3wqPgOKtus4mK3CglVRY9jBJwg1eXPnkd89m5eL7TczrKs6HgUxMGIJIb81CKg1 5Rq9Rt5egxKtYT/ZcCATJ26z+k3JlHxB8jPds2lxpg+xCvGHm1YdTObabvIFTkHT1J3d 0NrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ub2D9zTatvWGG6IQyUZpnrTP1/6aaU5Yt4WSqDNSDf8=; b=Y3ze7GDEg/uYuDWNcrFnxPlbGfnELTbjA5soTarhQON/V5SOtZt2TWB2PXgRxulk4u q3tRE433ffqZY1kcYeypsGRlT4G91mKiwUnZjzEy6ywCGUHF7Nf9j/8OO9PyOJzlNNOA PChlMuLh/W3BwZWymW8/u5gMlzu6Awi3LovMPFnkVObL8FCSgxv0h/SYSIthbobgPxI7 YaK2AuSqAxUBjNAx5/lukx8hW+Ar7UOgz+Xp4WoEFKhh+aAMXZB2axUN6pmP4kNmJ+VX QybSqv9wPSMaPsLtMSk6x3lZRC84k9FrJL+1Zv9IVMHCn2INQiOhBqgTyXVq4uByDPiv 1VdA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=yeKJCzJA; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb3-20020a1709071c8300b007adcf865405si2592755ejc.601.2022.11.03.14.11.46; Thu, 03 Nov 2022 14:12:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=yeKJCzJA; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231497AbiKCVHe (ORCPT + 99 others); Thu, 3 Nov 2022 17:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231415AbiKCVHP (ORCPT ); Thu, 3 Nov 2022 17:07:15 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CDEF2181E; Thu, 3 Nov 2022 14:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JC1phC1gk2OPaxophj0WrYvZvwajf/X2JNHYDxHsBX9aBg6zVA5aoVKUCmWVEPjMjvolCiKRdClyHOtb0wcczewOTvfWjVap1NGke3qe7UibCKXDrnCqfF2T8ngED6oC9fUbus4yrQ3j1Qs2biNkmM1ms3d2cBZecCxni8i8xua2eLmAVOkQC2/GdJsoqjeevbM4sitRCORXEPBrhCM84ebeNE0v7CboSwh/F3JLOomOK0suHyPXAvEpGGi65BsonuKoW+1RyLObNDbdizyTtT+XxtktERGeRwoDK63G7dD7ia/t3SYJ89H4MCQ4aXOHXxrJzgZ8ep/Pgml4I4bcug== 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=ub2D9zTatvWGG6IQyUZpnrTP1/6aaU5Yt4WSqDNSDf8=; b=KyTicMLGpU6kaF8nbGBpR5O3rmbI5MWOym7Yw43ZqXdsWRMcqoA/nB0whXI59yWh1ldBz+tvV82T6u5q+9ej1nqSFmT4Zr3tIAc8nxQu4jNnetS5BQyjSGOgBm+mMGve0yu6oWpjTiy1lNm/qpmxaH6gXfXbj8Hv7GRaabbTNTqwOgpRxqo+xpQ9YinAOw3HIoZiqYgG7jvLMYOvW0LVEcLtMbZhJiHUViiQVU9/F4xv3NT0FToymzVCErRdcnMcojwHCIGl6/TSqpcMmAQ7vrue8n1/MVTu93cOuPVNY5axvJoGILwl6xU1JcpEStvMG9PjdfLtZZkor1std1ibiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ub2D9zTatvWGG6IQyUZpnrTP1/6aaU5Yt4WSqDNSDf8=; b=yeKJCzJAhDQmBMqq1wzbebaPuUBNH1UljShhX7ZjagsVpmas7P8EPO/6+7GbawQ3fJwRvnP7PyVg69uF/VS831y8wtPxc/GSCwLPpF3iGV5gXpZvmeOT7Vr46VFzAgLgtxdekHsyJLCClM7YbaBrlDw6ubKcSPNaOk71Z4SrcmUWRx9sAkHsG4phK74AL2SrfBzaHJ5ob0sWfjvMNZgGjlyplvI+BmMecsIOzSXtlATU0H82E7vBs2AsRb1jyzWL3PTus0zaIddd8AIWKsaTrrcHMW8WTOPv9YfU6HdB7MWfw3CTyZw5udieSJjcHkEsFk1eoK22s1BlOnUDPy+ZVg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:11 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:11 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson , Alexandre Belloni , Claudiu Manoil , Florian Fainelli , UNGLinuxDriver@microchip.com, Vivien Didelot , Vladimir Oltean Subject: [PATCH net-next v2 05/11] net: pcs: lynx: Convert to an MDIO driver Date: Thu, 3 Nov 2022 17:06:44 -0400 Message-Id: <20221103210650.2325784-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: 9b9a037a-44b4-4e78-7565-08dabddf6046 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9CcM09626v1THI9Vr2pJvdQ7PHKECFkLNr0yQMCGHuE8l22Okjk+l9gVFDGcDk3kBC8/gi7QH8cHq9Cuukz2Fy5B3NhA4ceSGOWux0fQYCmkKNXGPs+g24CI7FGFI2VBn0YqRtkwnIox5xg80R/B6dJquqAlUcD2A3djpYZo8uWFGEo+0R3lm2Vj/2OhKqsz8U4BiKorkJ7L0tYizGu+ki3U+RfUPb8YkJ/u4FrXsJOgLqsYCu8KN/kshJEhgWO3EpKOw63d+OR/Y/MIyVg7ON50UDVbUFWjhjNAaDBLmDc3tAtTQgcFdyKDfavQZx81SWqbohK0K9xSyayvEtFZFDT4rNTt3e0NkN8hihq6rvYBZheXwkdBbtWjwnEHDRHdLLD/y5D9x4grz2JK3IzqdKANhT/ald7VYFzc8jOHAFybWMD2BcEAucEDls3qlgguqIHWehoqCbWSxxerWsYbfTQJ6WulyHLBxTSOdNf70M9n+83SWGuvF5C7M5A/hGgGI58QwcsjUJOcpn4DGgLBUm2pbBkldWpy8CCu89pVRqyVC7Vg1WaXQTEFcS+UsgHxPkbyLcBm7zcJ3VRkuSslFdmwhejNafjN6v+LeR/cfUhtnLTbiUFayNsE4fM9FNvijNolE3gd1M+majEprSc98AHwgcN052C+8vOUGeUlA4k2RGxFkPfSz5uLj/KtTqoDB2l6mZhD3PE3cDDQGn83DJWBAjDkwDR8+yE5vtqBZMUDKFgOPzFEnGCvKI7/cufOqHdwhoxeutmNP4mXZomnIQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BiczTNFvWP8n6rZjP9u1uyIW35UHo421V2Qu+Bw83A7Hw6kuxskadim1GmWgcFyt/LwqRjw4+0AJLZLhxxNGqN9lpVxFywznqL1vTeK1L8HfvgO6j8LYFfiV+6jRu8pyZB8Mlu5HS006I+kRRE14H6XUbsT5/dTKKeW43jfnl8+g27dxafVMbdPQuCF66RfkEHAshqvdA0vCgFK68a7rg/Tc8MutE7ZsKSkQPlvrR7CBLDr2CLwU8qw3HKj7RU76xoAuPFM86x1DgL4voVIHLTcqhybTRrvz2b3AxQzuoQxQ43Q6SP+znYkOosofneqGCCrLs6UDhdDg1X/8h8S9BajN3omFlqqmZ3SIGghFavMnG2x98FtykSSwlTh0vgifSGy8iBSUbveOff1bmHTzMiTtA7qQ047RsxoyxhTbz51vIOyyL6tgL/5L2nahmmgP/T8aCfavQKxay2A4h+Y8JaCByZcUWz+l72zSCwx+TQJOg5ovo2SKs0NKLAQYZrmNCx7O0R0C+TGByOEYrxy4ywnrdqvQ7WAeg3FIvnzy+5hy8WP8xsZ3uu+Ug6UOj8uS20IQdY8+9CDUQswdsO0nUIGOBwViagRfPeGyT1P95pJ9PNmsjiuaTawOm86Z6dzcYsXhkfYzCMGCF0wyE2EGsQrelJ9zsgConjuhTw7ax1LIl2iX3bWxH6FWCsyiPcbaAtsoVcXSgw5WvCLrr7RUV10PvJ2GP9fimSQliOKb/RUqS52ztuapaSEHEdsfx4e+UYtyqeU5UvMjhncryUdO5RJuj7Bf2wI4V53ds0L+nW+wSgiYP2l/PoRtffLB5DE/FTA0UMwY7y0f0ZAxxRepKIT1PqSpyO9J4pxiV9RW6IBJcfVbDYcPshrVVAGormPWaq1D+b8fhcOaiMELLUJ92vOvLq/ajX6S5Bc645220GCl9Q8dnVvJdf8Q/2+Kv2Z67hD/liawk84XQM/3jBmOtruO77D+eV9wGRPQlkxM2K86vaOCCxNYKbMkPL73pGukFWDnOVQrKauRfhV3c8nf+3rHZbiDBbY2ucG0sz9yCqwtFG52g4kTb6K6GTxeFuhgp68PGL72XdrLTsk+kxAvdISoJOlbhFAi+lu+HwuaD78GNFqhi5fxbj0oFuQ/YS4V3tK6IOe56c3wk7i7VdP9TUIRfPqZNXapIwOasQuLWxWVcPbCghexTK2jXzb8yVF75lqxPvQQDvhursyRbupO8jmQWfAFsPO+EUokTHY7Qaa+KG+1dNWCwHXKY5qWa6izU6914uJxj2yfH1FiwlsvU5uDTZYGyfLdQG6BPnLGBbYWnc1qRjAw4L4Ck0ihPN3V1cMFksy4GWnOAn/uVdqg3srPnDE+obJBbpTTXjPnijRR8CA5YbpuXBsO1T++FDJlK6fHNudxQnUAIRx5bAmD59zbIYaQ8IvagnwA/dqBfK4+UkobPXXO4bfCwjgW+BhL18QPx5TdF9+C6mM+jKk6D0BYXdtz4JnjzyapbMDf/Oi92PmpxqKdzKI0pJ75hkWCb2CRJKl2QUEnoTScJ8RWeMnFj5CgaToBA9UGqowwbRuTr/yJwbk+TOFQ/4QW0QWAV8USzn24nZZdZGSjz5n/NA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b9a037a-44b4-4e78-7565-08dabddf6046 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:11.8339 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: d/OKgIhvOioNcOFqeabM+Vv7r/GFu1oRdBzhjyAyJ0cJYF3N95HUYuAcxZkQ/EO0K/xvlDu/rgvD14LMS5OVxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748510894260742952?= X-GMAIL-MSGID: =?utf-8?q?1748510894260742952?= This partially converts the lynx PCS driver to a proper MDIO driver. This allows using a more conventional driver lifecycle (e.g. with a probe and remove). For compatibility with existing drivers, we retain the old lynx_pcs_create/destroy functions. This may result in two "drivers" attached to the same device (one real driver, and one attached with lynx_pcs_create). However, this should not cause problems because consumers will only use one or the other. To assist in conversion of existing drivers to the PCS API, we provide a lynx_pcs_create_on_bus function which will create an MDIO device on a bus, bind our driver, and get the PCS. This should make it easy to convert drivers which do not use devicetree. Because this driver may be a direct child of its consumers (especially when created with lynx_pcs_create_on_bus), we set suppress_bind_attrs. This prevents userspace from causing a segfault by removing the PCS before the consumer. Signed-off-by: Sean Anderson --- Changes in v2: - Call mdio_device_register - Squash in lynx parts of "use pcs_get_by_provider to get PCS" - Rewrite probe/remove functions to use create/destroy. This lets us convert existing drivers one at a time, instead of needing a flag day. drivers/net/pcs/Kconfig | 11 +++-- drivers/net/pcs/pcs-lynx.c | 83 +++++++++++++++++++++++++++++++++++--- include/linux/pcs-lynx.h | 7 +++- 3 files changed, 91 insertions(+), 10 deletions(-) diff --git a/drivers/net/pcs/Kconfig b/drivers/net/pcs/Kconfig index 8d70fc52a803..5e169e87db74 100644 --- a/drivers/net/pcs/Kconfig +++ b/drivers/net/pcs/Kconfig @@ -25,10 +25,15 @@ config PCS_XPCS controllers. config PCS_LYNX - tristate + tristate "NXP Lynx PCS driver" + depends on PCS && MDIO_DEVICE help - This module provides helpers to phylink for managing the Lynx PCS - which is part of the Layerscape and QorIQ Ethernet SERDES. + This module provides driver support for the PCSs in Lynx 10g and 28g + SerDes devices. These devices are present in NXP QorIQ SoCs, + including the Layerscape series. + + If you want to use Ethernet on a QorIQ SoC, say "Y". If compiled as a + module, it will be called "pcs-lynx". config PCS_RZN1_MIIC tristate "Renesas RZ/N1 MII converter" diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index 7d5fc7f54b2f..3ea402049ef1 100644 --- a/drivers/net/pcs/pcs-lynx.c +++ b/drivers/net/pcs/pcs-lynx.c @@ -1,11 +1,14 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) -/* Copyright 2020 NXP +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2022 Sean Anderson + * Copyright 2020 NXP * Lynx PCS MDIO helpers */ #include -#include +#include +#include #include +#include #define SGMII_CLOCK_PERIOD_NS 8 /* PCS is clocked at 125 MHz */ #define LINK_TIMER_VAL(ns) ((u32)((ns) / SGMII_CLOCK_PERIOD_NS)) @@ -333,7 +336,26 @@ struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) return lynx_to_phylink_pcs(lynx); } -EXPORT_SYMBOL(lynx_pcs_create); +EXPORT_SYMBOL_GPL(lynx_pcs_create); + +static int lynx_pcs_probe(struct mdio_device *mdio) +{ + struct device *dev = &mdio->dev; + struct phylink_pcs *pcs; + int ret; + + pcs = lynx_pcs_create(mdio); + if (!pcs) + return -ENOMEM; + + dev_set_drvdata(dev, pcs); + pcs->dev = dev; + ret = pcs_register(pcs); + if (ret) + return dev_err_probe(dev, ret, "could not register PCS\n"); + dev_info(dev, "probed\n"); + return 0; +} void lynx_pcs_destroy(struct phylink_pcs *pcs) { @@ -343,4 +365,55 @@ void lynx_pcs_destroy(struct phylink_pcs *pcs) } EXPORT_SYMBOL(lynx_pcs_destroy); -MODULE_LICENSE("Dual BSD/GPL"); +static void lynx_pcs_remove(struct mdio_device *mdio) +{ + struct phylink_pcs *pcs = dev_get_drvdata(&mdio->dev); + + pcs_unregister(pcs); + lynx_pcs_destroy(pcs); +} + +static const struct of_device_id lynx_pcs_of_match[] = { + { .compatible = "fsl,lynx-pcs" }, + { }, +}; +MODULE_DEVICE_TABLE(of, lynx_pcs_of_match); + +static struct mdio_driver lynx_pcs_driver = { + .probe = lynx_pcs_probe, + .remove = lynx_pcs_remove, + .mdiodrv.driver = { + .name = "lynx-pcs", + .of_match_table = of_match_ptr(lynx_pcs_of_match), + .suppress_bind_attrs = true, + }, +}; +mdio_module_driver(lynx_pcs_driver); + +struct phylink_pcs *lynx_pcs_create_on_bus(struct device *dev, + struct mii_bus *bus, int addr) +{ + struct mdio_device *mdio; + struct phylink_pcs *pcs; + int err; + + mdio = mdio_device_create(bus, addr); + if (IS_ERR(mdio)) + return ERR_CAST(mdio); + + mdio->bus_match = mdio_device_bus_match; + strncpy(mdio->modalias, "lynx-pcs", sizeof(mdio->modalias)); + err = mdio_device_register(mdio); + if (err) { + mdio_device_free(mdio); + return ERR_PTR(err); + } + + pcs = pcs_get_by_dev(dev, &mdio->dev); + mdio_device_free(mdio); + return pcs; +} +EXPORT_SYMBOL(lynx_pcs_create_on_bus); + +MODULE_DESCRIPTION("NXP Lynx 10G/28G PCS driver"); +MODULE_LICENSE("GPL"); diff --git a/include/linux/pcs-lynx.h b/include/linux/pcs-lynx.h index 5712cc2ce775..ef073b28fae9 100644 --- a/include/linux/pcs-lynx.h +++ b/include/linux/pcs-lynx.h @@ -6,12 +6,15 @@ #ifndef __LINUX_PCS_LYNX_H #define __LINUX_PCS_LYNX_H -#include -#include +struct device; +struct mii_bus; +struct phylink_pcs; struct mdio_device *lynx_get_mdio_device(struct phylink_pcs *pcs); struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio); +struct phylink_pcs *lynx_pcs_create_on_bus(struct device *dev, + struct mii_bus *bus, int addr); void lynx_pcs_destroy(struct phylink_pcs *pcs); From patchwork Thu Nov 3 21:06:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1113639dyb; Thu, 3 Nov 2022 14:12:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6STvMOq4bStA9Cgr4Ac9g2NM3xbOZlJGfMOgvatAn+m69V7wx/Fp4BUXjcaBSroIghKtip X-Received: by 2002:a05:6402:2949:b0:451:fabf:d88a with SMTP id ed9-20020a056402294900b00451fabfd88amr31122956edb.324.1667509921149; Thu, 03 Nov 2022 14:12:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667509921; cv=pass; d=google.com; s=arc-20160816; b=yJzfzriK8NNRf05s0nUTIPRvYti4znz+lKe0taQ+mtpNvGnThjc2vjB2paj/ncgXk+ wauTIt7cFA3THZh/DBwu6AyKsVmqhlR4FNkoID5Kw9g3xpku9PcfqWchtULalhc9uLv3 ClQ37W1as5JS1s/L4gj80QzbnSdTZMFSmjR6Xj8WuKrR9/RJuti6/CvGlVAG9ShnGUYi SiPAwr+D++zaRuzWyuivb+3IPP3FhQUL6ld/yTA2jhEqPVcji5lPdHutG3C5NbuxLTng RKzKl4Wl+Dj5ZyCgxDQHt7q+lX8KnfD8iU0SFW96brw7b4GtTmiZoJbEoFlNSo9Hg0SL 95Jg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SuCtP7RlVuZsya4mFYQPAm/vwU+6Ay7rGbjbFvrDQf4=; b=iKxAq2JX9Tjo2XzAmu0U9rOr7/mWK9cHOYrr2FbEtSKr0PhSApdHa1+Det37hC4ZW+ kK1FQFsbznzKpn1Wm4omCmISFUjDFKcdQWF0vtnNWCGWffdfb74EBwhfLt7f4+UiedhL ed/tB5DmBR5I0ZeO2mZzGk4mtfGMKaZjkaesoF5P/QFuC3Ms7jQqEmLOWZIkk1iD0BSK wVi9nGxeKTSODjUdiRYkLDXj24T+f2J1AxM2vzkHZQNu7UEETqQtVgQeQlmaU3yOoAKX fehS0TyBjpIxLDTKWIFhd/ipPQi3og/xuT/SpMkvnUukn1Vt47m2Yr5UvklyhMQmEQEr iBqw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=WgJ+Z89P; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp27-20020a1709073e1b00b00783df65ae5esi2572493ejc.683.2022.11.03.14.11.36; Thu, 03 Nov 2022 14:12:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=WgJ+Z89P; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230209AbiKCVHi (ORCPT + 99 others); Thu, 3 Nov 2022 17:07:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231433AbiKCVHR (ORCPT ); Thu, 3 Nov 2022 17:07:17 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE357CE01; Thu, 3 Nov 2022 14:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Swqp3LtK9xTImVQk7xI5EYsGBk90+eAY3K3jPhWtDP/TLycEZigAxJDqHO96J+maAbSPfEcywnxMAGJH9E/lXQF17TJLOoS8s4CSBYb3aw/vcPz9QKAsA2xbYF6iXC6wtgYZbBUlGhV3XmKR9BBQ7mOUZMDBHcAOhBsb01W8mu8MvKbP9+GmIdgqK2S6AR3F1FG8JO4K1yuKiEFVPslbIe19hpnXfUct66UFae71nRuPaVSO5/We73BqOmLPShCxzGfuRRBTSQSFxdMha+3sW2h6bTqWxRYI7TnsORF+PnnahA/TUnNEUSDNTTNLIWThG39LUjxikL1gLOHYu3cKLw== 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=SuCtP7RlVuZsya4mFYQPAm/vwU+6Ay7rGbjbFvrDQf4=; b=LxlBd29ZEuaR+XRK43u5EyQWunsDthJ5RVhiWEFxOGfKfw+jVCRqchCNTsIqJBqaQ15zSXC9i/myLFdKfcUCEamZs13ofG2xM0Ayss7VZXrR0o4PDi4bEY5+R+gdpSaQy3PhnXKl5zbd/EEllkdNgT4OpWYLMR1kAm54NiCBxyBKh2hXAv0ZoBy88SUppG4cVb5fmDg8eDk7M7Qqqsex1fFUIhKOrt5av71muFcYZ2eWDFMF+zW+xGVGPZEP1QM7o/z0w7+RJN/sPoaYPytl+4QluKysj8ScgaX+ZDPVR4GfPJ1VAs31n4VJo++vYXFDdV+MtHqWgtzQmwrZybvCsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SuCtP7RlVuZsya4mFYQPAm/vwU+6Ay7rGbjbFvrDQf4=; b=WgJ+Z89P83ys0kaKgtxxDvSzMkNivh+oAKb8tPw9/nJPpNRTutIfiNaeR3FjpP3gXO2+MtgJlWXQtaHo9ZCxKeG75oSQGtcr20yfIGVgR666eatNJbn8VJqD4FOIkG+AzUBRz8aMDm3wA9jXEw76ORVSYqyDkhfOpE/5Fl9ZGPQc5m7H1zR+n63TAfKwgY+MZYOxNdZC6yuSUBh382GSKZl/0rhtw5Q3vpfyAofrgmSS83LfWke+plhzLFkZvaglbr8mXl2tUx+pTKocpR7Do8i38PiIqZIGgY+gPDZW+EBUtMRdYZ9WcD/sAfvRq4LLFB/zSngFY5f1NgZ2ygctOQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:13 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:13 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson Subject: [PATCH net-next v2 06/11] net: enetc: Convert to use PCS subsystem Date: Thu, 3 Nov 2022 17:06:45 -0400 Message-Id: <20221103210650.2325784-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a990866-a9ba-4519-2a4e-08dabddf6143 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b1pdKAUyqHYwsHafKX5+4fIJJLdYNc+w6UL751T0GjKKfGFv+sIwQUqCiV04ROiEeBThLmMp3Ojc3hbsbfE6tZ/BYfvy9A2c7NHOz5KgY+5z+h1FQJFIGfIyCbmEFy5Xj2wvJaBK7cn+QooFVxw756e2oE6gC17PE4skUgIWBXa8Y4UFLHhI4eVVtfIrxBSMhp+KfQhZ0PpzdX/LZmzukdQIxd4hmWR+PTmIXdNfD6zHC5ZbXiPmva6N8EZ7KoRMQm5bUstQpFNhX+4eNVYfie7xtXc4XbIG2pu6UBI91H86t8uysY8zA3aomJCY9whLuPH+IuCM8bR5M2ZbH9CzX9zOc12go3+MkSQfeEmvhIJXgANiKICgOvdpWjZAkQSSzM+ggi++cJoic/DIlJv/yjexjVPzIC0o11xftwp4T8jakQpK/662fOyT0tNRI+ipCxYiUXovpot0pGBU8bm9BwVpY2ynacx3ov6xtWagYv1BRvXxvXWmwKzpnBu1MNUBw38WVjnppzCtjVk3+AK/9c61I96jldJJHrq2X7H0P3U4pEa/cLurCaDUUsNw5C/u54TF9SZbeXPmS1POOAp6hFUeKiFR3EJNRhPVXgCfJjxIDxXNvYsV83paAGdHTYgYXBrhl6hhtvMOPaL8teTdXmB6QfIKC1UNQWxfXYyMObQLnnYmcYeDavHRFNxAyd6Zfg7y51y5D0rVdv8DCkrBG+pBJ1O+LM5FiV7rxMGD/gsdcAiTMvCxEL7Gv85D0RMv1HyVZGcH5SxIOaco6qlZNg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(107886003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Mjka91DDSZQSJMSopz79IWT+58rbKSNayLgydFCrkLtGPvlob/LzzYbWgece3VwBCF76inov45yQ+BXXuzbRy17C1aoLfwM5IPOcNusNFIxkfTatmOYBp3Nn/klbk6AZQ5xms1EbqFitK/PH/MSgw6V7Ijh9iYiqaQ5H48j8fxyPJsfvrUv9aHZpnNb6FAe8TzNYxLLdjLBaDDWqnkfADV7DsGgKFv/XhWQ7HPbUTYL9tuRZFJ9P8rxZLlyGab+M0UoWFCjgAdYYkPXkDOHcIHA6u2C+qVEZl+WIFwxwk5dIRdPGH3Fx5sLK5DpRGgCftwqEhJy0kQzDYtahyaDBL07+aNQVe5KmgBkdyBlzZRkQsA3aDFW0X1D64G8QZ68gXWr1lrnZb+8bLyItmSx1iEt9UTwwi+8orog9NFuKFoGxZaZpOXibwsJ0Ckm2Kmg3+Qrbj3RGpaVuywQ3X15wmTUM/dv8GabtAj6Tin/TZWdIV9pBPmSE5AaeZPSNaCEkElmXnZCsdx2rTQ/MKW8D+zrMH/f21vOQQXRg2/4W8m3IItkqxw00ApT/B1J7ccIP4N4H9LsOCkrb2PVP58oQ7LRy2B4PDOozRT7td54O+X1skW1UbP6zGu+CDjdglqnbX/0laO9SZvzbW0nklOTjxjg3azwfJHh+Eum26rLluVegLoOwerL6oj/eGrmon57bpSCYF+uX4i3V9wSZKqV7HUMTMLpA+T1NLLQpvzPkyPZiobTZY7hVxWH6LtFDrF1pfKaSIAGNz9PYlZXh8HHP1a5BXKt5QC0lxSM3sm8Ke8RA9ES/0yavijsf07qlZ4MGd7pJEc/iK7ZhZhTYZv3n+j7sxHqMBybzj7KNUJ8mzRRGIrQG6gEkDo+QCkIxqMmPq5O69v2i32oBzWCM8jFTWWKMyeF3ilA4ppNZdS9xZ/hh1+MXHXEEKBcBgF0G7SQb3nltk/b7Use0W7dLmqLOMmFVUmcO26R6Re8E26LL66tOuowfewYuvl7UNCUBcX6vREfwyHkzcJwofFrZQmbdr7AyXRcr3OXMled8fiPIvG7fzdPfYPY/o2KT9R4eOHS08UyjuXP07dFIwSZHYZ7bPMeG91z6SAL9MQJS7+KLy+y5IZj1aCIK0HAv1R4To8A0LSMG9siuifBdwXikp9d9aW/gpwo2ykE+ucL/xG+kZucz84cpbcNzUSDBk1yvMjxznZs6vgtFc5oJCqaS42MxiUpqlliacnyrbgRA16wWxx+EGBq/BfKMco8B9sqEYCBHqZcv/fgbIHI945i3r4iA5qKg312SstFgZRrQiDDP6e94tgBsVekq8UovvvrJNPmD3N6x6MhyS09tSsip8AmlQzfQYNaf47ZlbuOmwDEb0+OCFSUgoV7pItc2wdFlV29JZXX5i+ebl7KnOJ7fLG6sAzq42RbvllMxRfENNEdQ81x/5JPIxWlRNlUzg3UtPvzzFXSB2jIoO24KMt+yr+1/kno5PIh9Fp4Wvncb/b1thMnz9QkxTO+LNbkxcnVeBF3kXgDdoP9C/OxPv/cAJWwnpWjrUS2/FHaTEi+TmYcnAJh4YS+d6drW4m2Ck70NGYy0hN7M/NN+VSSKJ8i/Oy7tmA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a990866-a9ba-4519-2a4e-08dabddf6143 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:13.4901 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DSk/oVzKyJYZUz0wyGssBY4FNP+ukViHhKmwqJPkPiOqtnTSAVaHt6Tp/KIbVp+wJONdpeXZoZ4wLcJtbDqeEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748510882975615617?= X-GMAIL-MSGID: =?utf-8?q?1748510882975615617?= This converts the ENETC driver to use the Lynx PCS subsystem, instead of attaching the Lynx library to an MDIO device. Signed-off-by: Sean Anderson --- Changes in v2: - Split off from the lynx PCS patch drivers/net/ethernet/freescale/enetc/Kconfig | 1 + .../net/ethernet/freescale/enetc/enetc_pf.c | 23 ++++--------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/ethernet/freescale/enetc/Kconfig index cdc0ff89388a..c7dcdeb9a333 100644 --- a/drivers/net/ethernet/freescale/enetc/Kconfig +++ b/drivers/net/ethernet/freescale/enetc/Kconfig @@ -5,6 +5,7 @@ config FSL_ENETC select FSL_ENETC_IERB select FSL_ENETC_MDIO select PHYLINK + select PCS select PCS_LYNX select DIMLIB help diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c index bdf94335ee99..c7034230d7c0 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "enetc_ierb.h" #include "enetc_pf.h" @@ -876,7 +877,6 @@ static int enetc_imdio_create(struct enetc_pf *pf) struct device *dev = &pf->si->pdev->dev; struct enetc_mdio_priv *mdio_priv; struct phylink_pcs *phylink_pcs; - struct mdio_device *mdio_device; struct mii_bus *bus; int err; @@ -900,17 +900,9 @@ static int enetc_imdio_create(struct enetc_pf *pf) goto free_mdio_bus; } - mdio_device = mdio_device_create(bus, 0); - if (IS_ERR(mdio_device)) { - err = PTR_ERR(mdio_device); - dev_err(dev, "cannot create mdio device (%d)\n", err); - goto unregister_mdiobus; - } - - phylink_pcs = lynx_pcs_create(mdio_device); - if (!phylink_pcs) { - mdio_device_free(mdio_device); - err = -ENOMEM; + phylink_pcs = lynx_pcs_create_on_bus(dev, bus, 0); + if (IS_ERR(phylink_pcs)) { + err = PTR_ERR(phylink_pcs); dev_err(dev, "cannot create lynx pcs (%d)\n", err); goto unregister_mdiobus; } @@ -929,13 +921,6 @@ static int enetc_imdio_create(struct enetc_pf *pf) static void enetc_imdio_remove(struct enetc_pf *pf) { - struct mdio_device *mdio_device; - - if (pf->pcs) { - mdio_device = lynx_get_mdio_device(pf->pcs); - mdio_device_free(mdio_device); - lynx_pcs_destroy(pf->pcs); - } if (pf->imdio) { mdiobus_unregister(pf->imdio); mdiobus_free(pf->imdio); From patchwork Thu Nov 3 21:06:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15201 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1114467dyb; Thu, 3 Nov 2022 14:13:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ai8IbrMDk6JXRT1wpKjNuXn72am1b5r4zgDdSYRMzzIWT0SHcNbu61fTbTAiK/T/OJjjg X-Received: by 2002:a05:6402:5248:b0:461:f0fa:864e with SMTP id t8-20020a056402524800b00461f0fa864emr31614335edd.81.1667510010997; Thu, 03 Nov 2022 14:13:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667510010; cv=pass; d=google.com; s=arc-20160816; b=I3gP9Atay8U4T9gL9jegX5VDyjrpyQ0Rv1Zqt6BKujIBzo/7hR50ry6n1GgmVHRbwn jbEcdWnN5qIeTXRrDL0OF4A7KtH+aGvyC8/Cl5EOvs1Cje+kf92qD/2f3m08Leotgfu6 YzIM0H5eq5AVMhXDAXwXg1ZnLkDR/4r/k/vr09O/VPoH7Z2zv35JlIWlA5/F1uQuOdjb Wz4TrwBy3Au5Xccn9zLLazBEOLmjQsJKj7PGGsVawzk7Jzb3tA1kPmX59y6VnFb4Wzi7 Xbka1hz2+Bg25Pt2YjmHIq2vTxisWCWOYlxVVAV729A1D0XFLF0q1ECIBuwRRwOFLdcB 7hYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=353ZC1bC98dWQN3Jxynz7tWVUOoRY9sfJHJgIc2n6n4=; b=1LoYOMhXSjTQSo4JLXVsWd/TIHExQ5SQBHudIJiUeR9vZ5/eHaz3jXfv0V5SFzKSgM HEIegjWQjv0ktxkomuW2sZf4xUykaFanabeXpy252CRf276N5LQUp04gSMl/zmKlCuJx eAlLtGpqfub3YJ3dTmC3IXutx9xVXBWtg8DDI19JefcQ8hnv91uRV2l7O3c4ObIWGtLU MBTVqZw3E9O1C3P5ujDTA1ZI1kke1z9mATDgAaSfIizyDT4tXyr98CEEUxm7DDNaXUAT oRF90MmbC3aeJSMWkyr3QJ1H4k3DwJt7oZM+fIubV2KikI/lsH/A9Fe6w24Min71HW0d IOzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=X8s8dYyO; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc14-20020a170907168e00b0078789399a48si2714336ejc.870.2022.11.03.14.12.49; Thu, 03 Nov 2022 14:13:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=X8s8dYyO; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbiKCVIF (ORCPT + 99 others); Thu, 3 Nov 2022 17:08:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231473AbiKCVHS (ORCPT ); Thu, 3 Nov 2022 17:07:18 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 223B721259; Thu, 3 Nov 2022 14:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P/JkTg/Itknu0LZ6EsJOkE0QlnIx1Z1ex+iDGWD2ccEEEEfaEK/QuNFMEeW50VWNvGxZqJLg+MKZuYQhNQ+1EzCiiMByZteZTBSBxlGBQpEuG3gbOIoqNw0W8A+8jd/FIl/5cfX06RrteXtQ2RaUIKtz1qEVRtfHxvfB4ZdhggL3FApir9wEoyvC++Nx5WwJ6lUmAhoxGpOIndajfoX/lN3BmHCCnKngeMWrpKoiHskuiuIKmAAiKivUj/EJ7f52qOhBmx7CbQuPIk3Gw9vq5qEVWth+vGdUJpf2QmxfTdnte6YBCoQGPLhXqqfTlJO81RYrvwwODx9yjwSQQO43ug== 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=353ZC1bC98dWQN3Jxynz7tWVUOoRY9sfJHJgIc2n6n4=; b=cf7YwYucgMr7QQabDZYdfecA++QCC3MqIo+HNsOXbRiXkKSux249nc+Lp68TZz1RpWzI64I7D2Ms8yy1T+bW4NKmSO+mkvsX+YYSTo9DdM+rdnBmSa5cx/qgGfh23GX0MZ7pz5LFhcCS4UUwlm5puchaX22P2/9Ltk5GLRI6BqqK17/ATRYULG9OGG1NZVdfWEMQRqEhfOc8gFC35jRy2Hl3EHiS7XoUcKRv1YMHyFv6zPBPGCX4+uQqybjfvUYVkoFHY3dXJM0Im3VJACS5xPvrTahQ5Coy8Hgl1Rg1ND6+xQSEEmrCaec0rPS8c9ifWV8Q6fNyU1Ya8xRGr0X1Zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=353ZC1bC98dWQN3Jxynz7tWVUOoRY9sfJHJgIc2n6n4=; b=X8s8dYyOCQa6oQa0TgFLVPWbFWEVHjUpB1BqdqCSKDUVXsiBknSQ0mmdQi4WjCiZAi1tIdAK6pUJb1Sxu+KQB1kZWLSE5FRNauQioPzg0aAP4GQyNQefZxnTWMusF+l2WNB4sXoAp7SQEIxpk0oA16bKfi9CnxfmRKSNYmRa5xdsso0ryCWeZLD2VPhblvijl58Ea4abkZkqZzfQmggwsrQ0rKqLPlvnoQO75PnEQ6ipnt9r8LFCLkPrno6JZ0czTfOcQ69hYLQyu3m0jW9c7ucc6YR85NSNABFtdGtAmXhDqHFAJCXxE8v3pczXo2184wOEu1tEZxjdN0teUvUm/w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:15 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:15 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson Subject: [PATCH net-next v2 07/11] net: dsa: felix: Convert to use PCS driver Date: Thu, 3 Nov 2022 17:06:46 -0400 Message-Id: <20221103210650.2325784-8-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b233f70-9794-4b77-0823-08dabddf6228 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LejXoASdxyakKzN6VLIGCTM6rnfL2tgcAYVa5RCXqhzuBwTmYDBdwRowZJOfsa6qzobWL+WNkMTatkHaZrz/ZS5APctATK+abzLWvD9mIDp5Rk8x6eOQ1tYs+6+1zkH9FZoeEdZqi01YITOIV6uiy70CgXKld2r3W5ZDIwCVbH7mlNFs8v2KaGKV3SYCdr3Oao+v3swFbe7ZX5OyD6OyYpa77TpY3t6xsbux+7mEqBoMP3yXqXQ5LW3YiJDSX8fGScXP6ZcMbb39CaBJ8Art2Fv3BbjSKJozge95lFRkLDPoErzmLNhsTIqblmJd8M8eh+PWpeY6IdSzPSVifzhdlw06QZpDQS8UYJp/eeoJxFSs+v4uudrHRBgxiOSC9fIdFJ0xtwP2LK64LzNTlGWyfGgl1skmNHTT/h5Vn7O2toJdMmqP15WOJ2aO4YPYjGN2BJ6skZ+SelHlkRvYh03qm+KEMwcqeNRKbF5MijSl+CpPe/ZRe7DIiWfB7nJMsdZ2AgeW+ZtXANlW7YMwoedPud4h/Lq2r9iojo8JmLld5l6o/hcg1r2ERRTu6kkUFt5dJPa0FbdCTJb+Nw93VuBGtFEBYBt7wcKgBn6YAHJVjGq19pnJ9hj3RcUspdTZh3pztAP2eDVdRS4l+eob0s/6AL5Tm0fv1RmxV2kqyUKnfP7+sPJlVgHyEkLYih1+3deAvuhDuIMQlZLzyogdM0pFH0jJB/qZXbpUWnfCWa+QMFaJb9k35oBXmTixofZ4qOYJmbbSUbRfWM+js8e9Lta3oA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(107886003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LcNufqY87tNXIEtGeZWUHYLQsM46sztL6RXEZ/ddynqY8i9TwfLCtFGqOZ2TeBlUiUSMRTpgWf5mWhVn8A3W6CzhKpOd34wzR5/DEi9S+mDGWNAgriNcOvXDw1yyK33ANlx2X91MhOJvVeAIhUD+9IbQd9TznSPFtbCzrq+kDPJq7BGSXh1dDRJTaPa99cJMTbihJoEeO4dbprTQ1di3bZKP7vAZDVTYnV3tWVY/oL+DTFBevu/L7g4CI/TYuk8BJla6x0dZ0Zv/3njqhBl0Z5uHTzBrdWuAYjpRQ1uXslIL5A4W8hld3MyqJdYZxsPnlU6KIEX5h3AE3JEkEJH1dZw6b1TPKYMY9f7QVwqUiTEHO/VZ+YT3MhRRMBowMbjWs9AubrodfHlRt7ZIcfZNuFGohA/3j9cYydLDqK2AG0+0Jlqxr68bHyamQpMho0QVxV8OUjrcSNLwBiX/CNkPu0qt2nicb/H5SL2QZX2/wRVZQx5jjURmHvEeUtWobEp3bFTyVxsLrANAPo4F4g8HOQstevyG75OBDQ4ZvqQdVEnu7bu2ouG0HdraUIV08kz0VtF+gYBec+ROpzGhrTKDHY76/hfUuCwUdADDB/0kp3Gsr0V+Pck7Q23EzUBNZtJwIgjOTWdCxp5MqnMAxAc5ikqfGIBj0IO0qL9uMSpcklOb826A41A3jaIBf+477I9frV3iMROfwr3D+NdH8PdgeEqtSC07zrDJXaV8fYFsdHrIKJUXtKI5i2yK4FYTAIKifSKicKqCitiIYCs29aHd9OE94Aaz9jV/uDO8oi8vXytOTsdRWqRNwjmNLRNmhNuxKaf9YhyDS7SaVk7JFaz4D8hz8QFAc6uKuOkX/NuMug2v/o8C9SHpOlPuNIfH2U6P2pInXzowsllaJ62lwhtlk2/Lm2SIBkZZIFeUgt0Z2kGQOTKlcclbvdm3m5H57ruLs2P2k3To+UAEFgZOtV4y+HETmK9gYvTXkOsjs6v5P8ju1fpr4+KjlMFugTu5U3eb0sQXpjRZyC69LBKsufWA/yE24iRkAwAEzuaiw4b8A0IfJe2Ds66JXXq+d5ye0tTwh3LWp/jqDYQr60W4+73Hm9l7rOqVaPEDA6e+/J2eZUcMCOrH0dqzuTk13ikOY09SnX/v0HcXlJyIAaKzoo5mHz5Ew8zUD+JnEYDr7IdLVi1ond/iDGF6EgA7JwcDzPI6uMtQwTzY5eLnu7DIQ87+hvbeTkkANY+4gaDlMk9PejBhoyAeaeR484Si9D4D0R7Gq6bebnmAjqBoz2wKCge1j3arr3bSmThkRCFLan3r6q0GAxlDFwP5OIhiQmhRBRbQI5F8ome6/Cb8hHClJMmnrbKuVDHjXOx0xnmbbNx/vVsAL438S4o7lhRh4fy8Usr589ymVWzugC5BHJ5fTW1+LH2feKVlXHdxn1BU8X7CqV7cUedEb7pMofMmTJ53etz6IHq1/fISSHVwVzBvLDpaJWJEIvFb5M07dwRmskuEz9MnYKcqu0rRU6oCjlPw+iMxLlHztp/uLWpkWJLjtEFWcufNgFSY2q/8CzK26HIKEoY4ty0sRQo2FH9dgrcM6NMPeoyIlihf7A4gufY240urTA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b233f70-9794-4b77-0823-08dabddf6228 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:14.9743 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IdjPbe+1haJ2x5rtvt6u21wMnnwgg33lvx4sCKFF4Z39wEBjslSmeF3Z6VIJ1lgi7cBhDGuBDmYG//OyRnTvDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748510977561831937?= X-GMAIL-MSGID: =?utf-8?q?1748510977561831937?= This converts the Ocelot Felix driver to use the Lynx PCS driver, instead of attaching the Lynx library to an MDIO device. Signed-off-by: Sean Anderson --- Changes in v2: - Split off from the lynx PCS patch drivers/net/dsa/ocelot/Kconfig | 2 ++ drivers/net/dsa/ocelot/felix_vsc9959.c | 27 ++++++------------------ drivers/net/dsa/ocelot/seville_vsc9953.c | 27 ++++++------------------ 3 files changed, 14 insertions(+), 42 deletions(-) diff --git a/drivers/net/dsa/ocelot/Kconfig b/drivers/net/dsa/ocelot/Kconfig index 08db9cf76818..eeba3d35f9ee 100644 --- a/drivers/net/dsa/ocelot/Kconfig +++ b/drivers/net/dsa/ocelot/Kconfig @@ -11,6 +11,7 @@ config NET_DSA_MSCC_FELIX select NET_DSA_TAG_OCELOT_8021Q select NET_DSA_TAG_OCELOT select FSL_ENETC_MDIO + select PCS select PCS_LYNX help This driver supports the VSC9959 (Felix) switch, which is embedded as @@ -26,6 +27,7 @@ config NET_DSA_MSCC_SEVILLE select MSCC_OCELOT_SWITCH_LIB select NET_DSA_TAG_OCELOT_8021Q select NET_DSA_TAG_OCELOT + select PCS select PCS_LYNX help This driver supports the VSC9953 (Seville) switch, which is embedded diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index ba893055b92d..f45c9a3088c8 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -1015,7 +1016,6 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) for (port = 0; port < felix->info->num_ports; port++) { struct ocelot_port *ocelot_port = ocelot->ports[port]; struct phylink_pcs *phylink_pcs; - struct mdio_device *mdio_device; if (dsa_is_unused_port(felix->ds, port)) continue; @@ -1023,19 +1023,13 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) if (ocelot_port->phy_mode == PHY_INTERFACE_MODE_INTERNAL) continue; - mdio_device = mdio_device_create(felix->imdio, port); - if (IS_ERR(mdio_device)) + phylink_pcs = lynx_pcs_create_on_bus(dev, felix->imdio, port); + if (IS_ERR(phylink_pcs)) continue; - phylink_pcs = lynx_pcs_create(mdio_device); - if (!phylink_pcs) { - mdio_device_free(mdio_device); - continue; - } - felix->pcs[port] = phylink_pcs; - dev_info(dev, "Found PCS at internal MDIO address %d\n", port); + dev_info(dev, "Created PCS at internal MDIO address %d\n", port); } return 0; @@ -1046,17 +1040,8 @@ static void vsc9959_mdio_bus_free(struct ocelot *ocelot) struct felix *felix = ocelot_to_felix(ocelot); int port; - for (port = 0; port < ocelot->num_phys_ports; port++) { - struct phylink_pcs *phylink_pcs = felix->pcs[port]; - struct mdio_device *mdio_device; - - if (!phylink_pcs) - continue; - - mdio_device = lynx_get_mdio_device(phylink_pcs); - mdio_device_free(mdio_device); - lynx_pcs_destroy(phylink_pcs); - } + for (port = 0; port < ocelot->num_phys_ports; port++) + pcs_put(ocelot->dev, felix->pcs[port]); mdiobus_unregister(felix->imdio); mdiobus_free(felix->imdio); } diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c index 1e1c6cd265fd..99e8043fbc2e 100644 --- a/drivers/net/dsa/ocelot/seville_vsc9953.c +++ b/drivers/net/dsa/ocelot/seville_vsc9953.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -946,7 +947,6 @@ static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot) for (port = 0; port < felix->info->num_ports; port++) { struct ocelot_port *ocelot_port = ocelot->ports[port]; struct phylink_pcs *phylink_pcs; - struct mdio_device *mdio_device; int addr = port + 4; if (dsa_is_unused_port(felix->ds, port)) @@ -955,19 +955,13 @@ static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot) if (ocelot_port->phy_mode == PHY_INTERFACE_MODE_INTERNAL) continue; - mdio_device = mdio_device_create(felix->imdio, addr); - if (IS_ERR(mdio_device)) + phylink_pcs = lynx_pcs_create_on_bus(dev, felix->imdio, addr); + if (IS_ERR(phylink_pcs)) continue; - phylink_pcs = lynx_pcs_create(mdio_device); - if (!phylink_pcs) { - mdio_device_free(mdio_device); - continue; - } - felix->pcs[port] = phylink_pcs; - dev_info(dev, "Found PCS at internal MDIO address %d\n", addr); + dev_info(dev, "Created PCS at internal MDIO address %d\n", addr); } return 0; @@ -978,17 +972,8 @@ static void vsc9953_mdio_bus_free(struct ocelot *ocelot) struct felix *felix = ocelot_to_felix(ocelot); int port; - for (port = 0; port < ocelot->num_phys_ports; port++) { - struct phylink_pcs *phylink_pcs = felix->pcs[port]; - struct mdio_device *mdio_device; - - if (!phylink_pcs) - continue; - - mdio_device = lynx_get_mdio_device(phylink_pcs); - mdio_device_free(mdio_device); - lynx_pcs_destroy(phylink_pcs); - } + for (port = 0; port < ocelot->num_phys_ports; port++) + pcs_put(ocelot->dev, felix->pcs[port]); /* mdiobus_unregister and mdiobus_free handled by devres */ } From patchwork Thu Nov 3 21:06:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15203 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1114851dyb; Thu, 3 Nov 2022 14:14:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ssNxihtIoTdXWCX/jpShMbarzQovkVDdKbZeC4bJNxJdEQ228F6Y4UV+Vcf0xxYHECZdC X-Received: by 2002:a50:bb06:0:b0:461:4acc:4540 with SMTP id y6-20020a50bb06000000b004614acc4540mr33335762ede.307.1667510048648; Thu, 03 Nov 2022 14:14:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667510048; cv=pass; d=google.com; s=arc-20160816; b=YBLAJWbbeSosZWnVgDD7hnjoXRmTvLnJqoZyxy4s4mJHH6IL2cMyb1LqpGYLnUedl8 CAPEEsu75mHc+V7NeemLwwQOxDej7Wq8OrTbFkO0JKIR4HZh0bG8ROMz/h4znj20/ZJ/ CyETz9vlPBTX7s8l4fUa5RS2ZJhnH6zJbVVYSGf/7XxPDnHB6BaoUm6n4KhgG5cRY9xG VFuuWGfjx5c4c0yASdL0AN9PWd0pCcaYNUuTE85qL+Vf0/nqz6ngxyD3NO3gEWP3FY8m SY/v9NDQSkheOOUvk4dOMwOfAAvt8FSpsZxF7NyR5Y6g5ZtvxtLX7i+Jas5u/VYenD4k VZTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nH8rZCLjdLr+07EOpHDJGK02c7tWfdaStMYyq9v/igM=; b=T13G6erVTngJxQym2Dl16wkwTOwK7Hi8W1MFzzs4mzzDONMvv2IRTstDBaM5Cd4zgi 8xnbUqZWpFukhu5NLq/2AdkkfMSCRT6jubqbvI0eolEfbAbBL4ewMeIJVaf884rVJQ3R oZ+eZLXCWScBl2/YVar725PQbBO+id/ZyDZQevvbs7AIE0nPxavV0RYP8rrBgOU3yZt5 FtkqLkNwAg9QUx3a2Ga/aPp7+YJjT8Ln78mkAJkQom1/EYfOfUnk8crAnaH8sRoa7vlR TvMqKWOdHd2hD9JhrGH0qwUqChzBoT1bFm0M9AIR0EQ8dJXxV1vHWgeKzLXqyzw4F5MP I+bg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=ALun20ib; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m16-20020a056402511000b00461b2c460c8si3061147edd.531.2022.11.03.14.13.44; Thu, 03 Nov 2022 14:14:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=ALun20ib; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231465AbiKCVIq (ORCPT + 99 others); Thu, 3 Nov 2022 17:08:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231459AbiKCVIB (ORCPT ); Thu, 3 Nov 2022 17:08:01 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA12421E32; Thu, 3 Nov 2022 14:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xx9wcH1UDehecoRuT7E4TNhK0yHu+m/GAhZ6n/AoyAodJoNySDpMgydgkt7himLzaJ/B9sU219sBXu4nu07z7mCh3sMDG3Vdbt6lTXdfrYyCzfhWVkRwkA2iAt5UGn11J1+SQaXMHW9XeMYu3IvEJxAUF8e/js4av3jApKq73QXlOv5XaP878UR4XSg/79lAc9UJXWgXs+PTzaVi28ElhiRuh7/zQwT18A+a8tBGnzffozt0zEQ/UoYF4Uy0VmfMknc4vc6IqjsjSpwsQjjlUys/ezv4e3SHuJ4ddyAPo5kWkAndlpr2JnRgoyoJScSqksgcgnat2XAJOnkIwrU31w== 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=nH8rZCLjdLr+07EOpHDJGK02c7tWfdaStMYyq9v/igM=; b=MayScKEicD8reiLZe50WbEK8S0Mi70mkK6RT1M77imk8logLG2pFXaUnaJ15m8YmK+mdTiMlhqvEFW42T1HTScMgluWfgXOGpgJkofm4KFeW6K3ARUSTA18+KMtoeZpFTq9SsfnnAJjZiKmasecdg2hpmIbwycr+xeMYNnDa0M7vFLnCBmdsvkVrkeaaFj7srujQNIu7phGbVA0LPYJJ8cd4QuZ6BlmaNPvbu2W08GKAqpjr4Yw0uebRL7dNbBRPInKyNH509NMTF6VMOlxnrTK2MlmOLySDdyjycAsNHk1hDOLdkNw9qRudmPc4TF/wlhN3HiLiIRX781E50wt5Sw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nH8rZCLjdLr+07EOpHDJGK02c7tWfdaStMYyq9v/igM=; b=ALun20ibNSkbwRfv6vlUfawK6ODjNGk3oQrVJW8k3Gb2Oexkl6NJo5x6ZYYcenUjG1wqLuToxyrxrcQCFgl0seCbxS+LDsT8P03dgxieUOHR3Ax/86z/+FwxCHBlu/ceD6lSojPdRTSyFe6ZPoMEvcFsNq1a6AJoMFchbycHXP+jjsN3foBME6TUnrak/GrNg7tWaYcfTc0HXmSQU20q0mj5Rk8tVz2TWiafiWB/SfKd/prb1+n8gFBbznIDEMDSOPraHATlIkZHUc9gk1eH7+fOtLdXYrKGrYCBdvkjWa4YfipanS0+ZDjuoFTKJdN7b10a3DWiLa10t/EsIZn+Kw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:16 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:16 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson , Frank Rowand , Rob Herring , Saravana Kannan , devicetree@vger.kernel.org Subject: [PATCH net-next v2 08/11] of: property: Add device link support for PCS Date: Thu, 3 Nov 2022 17:06:47 -0400 Message-Id: <20221103210650.2325784-9-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: 275f29f5-b6cc-4d39-a89f-08dabddf6330 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2VMgq+cqwhDNvd1CcGCvAkK0flKVUfStLJ7MQZyXop+nlP3kdlujZdkEeXFTyS1/vTbQwjq/T//LaGpk1517j9/HJYKM248wYf7hws85MUZ3s2DV0d123NpJtFwfpJjxYa2tO4cuXogIqdmRs8kCLBW4xmWRsV77R9LdxyIpA0+BtM7OLRSOqsqGnjhxnuRwZVzK7QGsxhvktPL6ZqMU/lP/BlUbwuNkTNtOBeDLuKedMehgjTL0yds6H2n2XYMZOGJ1ugHWJLFq/cLOBpkfGnnWC5y/hpYZRImyLgMOcPNnmeNUl6eAE+igAGzPz0e4nxksztQmU4OKuaUnhbxnCf/omU69hH1yzCdpPHXzIWJ4jnktwTyipv5a9DpbZwVXfIYFqN99QknKxbJTYlXrNZsBxRKEyBY6UpmMeVPybLJ25PVxPABRI34CZpWKmmW1u3sb7PJ+72GMPP4FD67uIU/ArwCEONtsCeriOD1awDMo5s3AEsp3I4+tBMF9/FbfQzHPAGGl+oRgM9t6yPpYniABioYLRSLOYGCJreVpGA+X5/HzhS+32mX+FjPm/DjwfmuoU7aLK11GtAcJy3zb4lBcdBA4e9qXUUqgAJ6Tx/ysWPhof+/mODYjpNPp+DlQycwwQxTCKAw0Vp8Mzv9gx9tqusHdvo0+4Wn3lknpXq06MlqtynFCs/COdSkq5DLZ8AzEG3Mf9msoipnHBq6m6HiDtQSBywGB8cQMv9vhbcXzTFRQwQEdDwe6w9iIRYkX X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WTH/7OVEF81kBoegajrFzNYssBtMNlzPipWfdQQX2/gJBg3ce4owS8mRFvQoawsR2UYrAe2UsnTrIIqD6y19Z6CZb7PgFQHxPsCocrpTw4OykjPkMkXy5pMA3cNdsGDTPhR2ryHFCegMPA7XC5CI8hbQlIb7P7WRXVnbynPhgDI8JQNG83eJU/l1EjCyck0PAhF1BA2A3zOX0t0dPQo4xRm/cjeEK92bXkDIY+NBGueoKXpOVCchGA+A8cO1P5K9MKMT8ECZlNY9xzAG9SuNH7DGnmRqaaS74K8hNtTQReNhLz44Qr+Fi4GsHjjHRupH7ZTluQlNbM+Jaae+w1lTxooyaQx1W3wMcf4bwevu7XPh+557ijuU5nuN8ekghIxic5hd03DJzvtRjm7dEa7b8hIAWxGpj0+WHKxy/o1fIlZm0NYwoZDdb+eEW+fCd815dBUB2WzuVs3xsWVnXex76P8ryiPU3XC7g+7lUrGxxaEs/95Ag1XmZHhclrQiX12iAGJeZ/Og4Uz0n4Lp2Wo1GCBGQjXWkgoMkxDKfxiKCvs4r91BG0MiI8oXA8cF2+PCX4ojLrhCIopIPxq6GBkm8j1oewBMPe/d94u8E0L4nWVgHTyM3WP3ejAvqqjM2CZn3/wNVd5bbeRmSkDzokp/bVaEW9aLimpJe4OQ1brkJMzkyVScnRhsoiZjaZLnhnmCE2PxBsYe3ZXYbiIGhmIArFjZUPcyy3xVuvl/LvlAE6RC5dZZx8FsxmgSzmx675AxhuVVen6pv1SAfB6MAho9jUiy9Zn0x53p7RHRFagp3z54+aujghJ3vb+0rb02ja4f6daPJXMvyY6hXBMuK3VYv0sOwLvpHop1L4zum7M93rS7YYjJ/wRw4dh/xr4GeL1k5u+vBT6SA8oWbaqEXJ5Rx7/FP89uBLslvjCF6G4ANrUsXCzIcp3An4KIM5Pek9LQ3+UxXviounHAyVY2tY+GQQtgjE5EaM2uPNqE3MsZhJAngy9k6JrA3wEXrAMDQcoCTvjHcXIV+ekFKfNzqsGyF2GxliCcSgnbUHR2XW/LRDtBiofwgUxm+6ay2sdjQsbZ+EwhbzZfDzDDS3tOolAF0vO3pcy6X+nONqEcHCgQsHoQkm9ce4I4u8yNgDFvrE5FgAAFhl7epnSKbd/bFFs9gnjKgpBm90DI6NMqkQBX9AU3li8zDf5GYLXCwuytBEnvRAUhGz53uS+/TLydoyddTRLNaGC3mVDMQ2k9WfKK8njwqSkPgVnHkk7U3YB2up0gtQCQkyfaVn2d79VZfE9otuovNoYFgPgWvDndXiUzRLx95Iz+fJq84WErEZ5/vZMJLsxa3mU4RNd3qWS1l8TBj7FxaDzvEKO993nqpf4ha+ZCKaaVLaDcoyKXec36ANfFsuwIZHxcYjcDj/INm2pqnBK4l1eW0yW+E8NqYv0G+NECuVLEYE4AAfxuz89/gp4MuN+Q7SY/XJgjJFkVPiH8LTHpP78q5TW0RnhzfefQDbjrBniTE8sbHfw9i7/W8Ec/40k0CS52r68ogafRNLXtF95Zj7DiKuyLplDht69ou8lB7ho91pJhAMVVh//qWuuPoFqHHW9tVoQvlwLXOQ9hnQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 275f29f5-b6cc-4d39-a89f-08dabddf6330 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:16.7086 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iZR0JjIZ1Qi5xJ03h+RaqXza0wmD7ROlUeeWPd+jk9fbXSqyDbOoPHgyiN4NKETO76BFSSgA+q2rmyru5F3uAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748511016807818287?= X-GMAIL-MSGID: =?utf-8?q?1748511016807818287?= This adds device link support for PCS devices. Both the recommended pcs-handle and the deprecated pcsphy-handle properties are supported. This should provide better probe ordering. Signed-off-by: Sean Anderson Acked-by: Rob Herring --- (no changes since v1) drivers/of/property.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/of/property.c b/drivers/of/property.c index 967f79b59016..ec360a616d17 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1318,6 +1318,8 @@ DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL) DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL) DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL) DEFINE_SIMPLE_PROP(remote_endpoint, "remote-endpoint", NULL) +DEFINE_SIMPLE_PROP(pcs_handle, "pcs-handle", NULL) +DEFINE_SIMPLE_PROP(pcsphy_handle, "pcsphy-handle", NULL) DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells") DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells") DEFINE_SIMPLE_PROP(leds, "leds", NULL) @@ -1406,6 +1408,8 @@ static const struct supplier_bindings of_supplier_bindings[] = { { .parse_prop = parse_pinctrl7, }, { .parse_prop = parse_pinctrl8, }, { .parse_prop = parse_remote_endpoint, .node_not_dev = true, }, + { .parse_prop = parse_pcs_handle, }, + { .parse_prop = parse_pcsphy_handle, }, { .parse_prop = parse_pwms, }, { .parse_prop = parse_resets, }, { .parse_prop = parse_leds, }, From patchwork Thu Nov 3 21:06:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15204 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1115586dyb; Thu, 3 Nov 2022 14:15:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7FYFGgzsjhqAwBt02uUjnNsUdkPIeKCbI/gMTepEiD5gJkGrHtVYg3/sgXAc97+4vv1iXQ X-Received: by 2002:a17:907:7da9:b0:7ad:f381:b9f7 with SMTP id oz41-20020a1709077da900b007adf381b9f7mr15285208ejc.729.1667510109553; Thu, 03 Nov 2022 14:15:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667510109; cv=pass; d=google.com; s=arc-20160816; b=Q+lvRBwfRR5JLHvyWkYdWN3lx0kJFYZR8VwBt+pIOSdZIppoy3dk1K7pocHPfjeYxb dsYxebhHhxX5jJ2EnmuNP/LRLGq09xYgrRd4If6uB6321n1OPFG07mNeZUBjEezOCvjN PkOS4lqqpTeJoeKgHUIVOX7NG/PBY3wLFnu91X7noOBx8YRUwG6CIsYhbZ6pB6VV5VWo kz5g4FifrRPzzdG4nRtbtgY1CBKCbQ/WyKdt0Bqm2OfVJhWtxCOaoACQSajvjNP3GUr9 sDnd7VpjWmJfvvGL/gysOEuLGllWVlXt3DUHb9OvOdstvRtUVv0oxUsD3qN5LPxOfVNF +T8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9P97/4EQiRknWb1rlkyfzH0nFWRbN8q/Zzg6R8X7mQc=; b=0B7Oj0QGLPY2QZlPIYM6bu7WuCdqi7cmSL9r0t7SbMRKv/ffthhiL3XKsH/a/7sNog ztSE5BAPJVnj/cHSDMyXj1ef318RuApVze5G19LtCdcAxLCFGgDi/eUG6hytkiXh5/cp y1tU8OMyQzr6MYAvlMC1r96E56kPH6Z+4Y+1a/+zztHWGRcrRAm0CFAK0Fjmh42J3JSk CCoDmdVVE1OUSYueYssFtZptM9GKVm9kLP7qmyatlHzRlM1B5MKsiGhcOgU1fkmm2jfm QjysvCgveZ7+0PuxgfCYDIr9fXPRQmq0ULKJd2XLUi4mRfarPt9lu3mzcrTNKWsXmCz6 RUAg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=s4HfYFPN; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ee4-20020a056402290400b00458264c2df2si2279671edb.164.2022.11.03.14.14.44; Thu, 03 Nov 2022 14:15:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=s4HfYFPN; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231565AbiKCVJE (ORCPT + 99 others); Thu, 3 Nov 2022 17:09:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230527AbiKCVIl (ORCPT ); Thu, 3 Nov 2022 17:08:41 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2E8521E26; Thu, 3 Nov 2022 14:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jikYOXH0vHXpayigu3PkKbmPxIJBU0T1b2lA64Il7acca8KtX0huheXEFjtYJY6sCi1BPYcaBkrJME+Bt0roID7hvI/0NAQIB2QbLAkz7HnYRZxnJCiPvtNU4q1TxzGFb2uuuEUkd33mSWf6zXrPAkSerq81k/BHOEy3hj52Rrc09gC2lYdJT4ThIVAoVkz2+rd+ABOUp4o0ZJpDm5xEG+6D75sQ3XZeNpJCbijHsmfqVmM/TEKopbOvbtttvytK//U2kKh+jDxd0I3qbPJyL2PpA/hhaPTCCHuv442Ouo9GkAZI1CCntdRV+vDhKR7djVpBOpv/wIQSejRKSwYHeA== 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=9P97/4EQiRknWb1rlkyfzH0nFWRbN8q/Zzg6R8X7mQc=; b=fOSJdEcD/v0IfrrtL/KZt74N+crYXJDKI6tiQQWyfbSrZ6AUTAFw+hnPPVr3eoTw3J1Zly3PbcWY9/siWjquzb5SxANGwCxwGYDj5GBvbaxuMfWIbJGJLNT/CuvCsa3cOVEZUBVQ+BITuxRKu+WU7kmpQHUvHoHdO6cWdNRvRp6Pwk+DQKwOfrJ9hUiPuDxUUYJhgAq/0ubTZB1tyhw3aeiEoa8lLH2Us7WqDqxQ3Q3aRSZ3ikHvecYsU1cQatEkw0KmtEEfxvAnZURJSP4ZdEg/BoPv46dhFG6UGcDktL/fzt3FiiTyUw2ltXe0XFs1JCRMoUxM4vET3Z3Kg43mRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9P97/4EQiRknWb1rlkyfzH0nFWRbN8q/Zzg6R8X7mQc=; b=s4HfYFPNiW4dsP24NRd8sh5omXGmqbCttIMNLeIMOIS57cIpBUGXgyKzh/RseqA2+Qrehq/EBaX4iFdnp3G4CDQGOUHlX9YOeJTXqcdZOsL0mSFDF9tkbGCz4sQiELo8+oE6T4p5DUfD37WVuhQZ4A6GzfXecH3SasgZZVovS4IGUnZO08UnKsy6BxyFndTS2pfMEX46hmRAqQkU3UgxlXaXhI+bfG3V6z0cPLVTur03Kvst14V23hBiolu6/7HBwsDLpPMJ67AJKbfZGjs0ttAZ2iR0j6BhaSte8sxhNQrfuLhNzoJfLYf4PRuBdNE1vO1hjIBgXejNI+XpQShtqA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:18 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:18 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson Subject: [PATCH net-next v2 09/11] [DO NOT MERGE] net: dpaa: Convert to use PCS subsystem Date: Thu, 3 Nov 2022 17:06:48 -0400 Message-Id: <20221103210650.2325784-10-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: 478137ce-7086-4cd6-241f-08dabddf6413 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UDgP5K5Z41luvkVYudipssbPpTdg+iC7YfpRZB+mAUpuigq2mpJwOd/vruM9kvoLuPQNfqJ+tVx2hl/HBYBP+PWAsQTMgDO4mnqM0THSDVEm75CbKKBqHh70E9r55qVArGpkr51RBeGpQRHEGa3M7ApMkcPj711bTst3f+0f021zaiHqH/zAf0CsZyQTOgQ4KSIXKkVT9ULh33U7ocE99nYcSC/f/Ir3r/lDMqVninj+4tnTlblxpzJRsghn26w3Lo+i7X/PLID4n6Gwzqa3oh6XxeP9YCzjUD9a8e4wEG3IDPGjnfjnC53KQt3E0WKAtUI/90f8yZPum52vbh4Vu2W+QiNStfy1yL7FS8DZBZZfCxIdQOROuB60+iU8K1wclqxSe/u7yP3INDBwtQFKMMku8Z4VV+w3kArc06wSzW8+2JNd3MaGS+BwqpfBjZPEMByX38WWQommh5vhbew7tQYVc792Yg60pRm44UkR4cJo1zhQfAQGTdL28raTGDo037DOR/3eNcW8mD0/3rDmEEWtQ6ZwwvemZGcXk36EJn1Hu2yjIxPfjyDkb5sImVwyQIsWIhecCq011rWcKEiDQ6VCdp0WOE/DuuvIQj23y3ZEliQkZJ9dEja1tGdvg4rcKAJQkeraFH0n9vRvfeE9VcSusgCOj7Oth/HjNbt615Mjbkd2Nsr/TLaozOV7qugEHvl01SpokpLzpO7Z/ni6xOvsSo2AkEieu19pJ8MiS2ENHxvkCt5yUCdWZmEQgqZ/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(107886003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: v9MsnWXReTj8O5dNS2dYLJhMhZBsyBGCdfp3tMMgGWHY30Og4w3eCyn8TRAI3LOOokFovyPknMB5RRYRrqL9T/6V7Kr03R5Woa8dnazmSYR9Reho+Mgg9KA48t5tiTPsdt1Bwd3fnNYmY9qlzpDvsomXDbtYU1H90FJ7f/Zfsp97CC0kGULT6IxGFtw9YsccmaASffcnKj5reIwJZW2+8X3/Phvwdf1kl/zq2yn+jNxZqmnlrv/9aQVrMF/QQj59fAj2P5H03+MGnSVwcoB6J+NDJDVLaUpJ1268uBwmPaA1W2lt+nlcH1uazklq+a8p0jMXYfKe0JEiyLaSr5YaMuCcpaLnbD2mwe324x87PMlJ+GdxzAEzjc7T6Lqy9o3+yRe1wTRGu8/WDdJ/6Ai9qlzcWhJKR1QvyDSDSdgqFLibmOpFS/pYR0F7UcGcsCmUPFefRw7yAlSvj7dGqY5hNWFLAiJRhA9K6uJ21sdTEgfHabF07nzkXoLA1n6w3Lb8yh40WJxVMzk8lHAR3A0lp3DhD+bDt245zQ2rmWMG7hkQsNMk2ifU3Dcy+4zBFhiaDg9yTlU46Ig81rr0FVRaW5ws2iTQqw19QiRDPtKeEEzbpZkgh46rR5vT3K1jAMuonmfQEin7JSh7zUhKRZjcALVIC5aOoLLr9pm9KYlLl6LcoMQP8jk8dX7lpHk1GRE33DaZAgMcxZsXu7d7nSxvzAm2qVzEw4pvrMZcrRQ5eYFCiCU8Ts4C3S1K3QuVBsLZmlD6/Ia6oNmcBCLaMVUVlDw9Ed6KOnJTepsRzjKF983TPGw2wzncRSQF2aMEkzGcdzhYOgNHCRI+AvfmANuPse10w93EfaGladkmDoe4Sg2gRk6dHHumL7orW13UltLwt4GH0DD5lUbGO2H/zkpGJ0o1+2bc+WTg8PEMJ41eU7bc+bd5RwtQ6Zx1a66YmAkFtCSDiMpQzHgp4wRjTy5pEyieQk0PGAXk0N2sdVDQe4P6dx3Pc+2BFlEDvula/qfyZ4LRHqic+3+Zi7Jp6k5UANN20HKeS7pnBDBv5PZbHxAP/ifYHNBrgGrE6xW5t2zxhYOPMr4UzoXs7aUl1LszvS1u2RkL6eqh/2McmM/+ODSjUDK9X+Ohf2Q09zvlJ7Wqwm3AO1gfqLFiyT47HlwxAb3U1Ntjv/xlGe21R5djRXz7odtczTOIi5XpEUuHdvorq0eM2Y7hD2/4hjyx+vzxQItDqSMU+/XPkJdZPq2Jj5XTUClkI3sU6bkT1whd4euBECNljOLhecq1aXliiWSIpIa8lyjn9y46F3ak4zVuWCWCU908JA1E3SwUT75hGpMIvHhWCLpuyoaI1wt93kjBf0p+zRNltlJylnCGUsbKFl+1QAu4j2pjZo/m/WnwQm0JeJZomE5jNKOBIzkgrlWTocVqH1JCvcgRsQUYYayKDVxMqbxaD8b170SjyvfuHPTbVqVnoF/N4brUuiK6CRLeV7yy6afrUZTinWKdh+aBq7h1xZb79/GPbhlcDY3ujMXCUttYMp2qO7pE4V1erjq5h28+xgXwgy7sblWpbnc81H6edDI9zaFaMuoNOGj/b5aeNmebVd+8ija3RoyqM5TUwQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 478137ce-7086-4cd6-241f-08dabddf6413 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:18.1929 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: o97kLHUxCjOc058wkOCyMuJywwrPnrVAlxvTmCes0bbQ9bPK8uMsG+qpveJvEFZ4H/HXkeBpcH5Rb99HnD6SMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748511080607490234?= X-GMAIL-MSGID: =?utf-8?q?1748511080607490234?= This converts the ENETC driver to use the PCS subsystem, instead of attaching the Lynx library to an MDIO device. The control flow is now a bit different, since we don't know whether pcs-handle-names necessarily exists. Signed-off-by: Sean Anderson --- Changes in v2: - Split off from the lynx PCS patch .../net/ethernet/freescale/fman/fman_memac.c | 118 ++++++------------ 1 file changed, 41 insertions(+), 77 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 9349f841bd06..a88fcfbcb5e6 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include @@ -974,25 +974,17 @@ static int memac_init(struct fman_mac *memac) return 0; } -static void pcs_put(struct phylink_pcs *pcs) -{ - struct mdio_device *mdiodev; - - if (IS_ERR_OR_NULL(pcs)) - return; - - mdiodev = lynx_get_mdio_device(pcs); - lynx_pcs_destroy(pcs); - mdio_device_free(mdiodev); -} - static int memac_free(struct fman_mac *memac) { free_init_resources(memac); - pcs_put(memac->sgmii_pcs); - pcs_put(memac->qsgmii_pcs); - pcs_put(memac->xfi_pcs); + if (!IS_ERR(memac->xfi_pcs)) + pcs_put(memac->dev_id->dev, memac->xfi_pcs); + if (!IS_ERR(memac->qsgmii_pcs)) + pcs_put(memac->dev_id->dev, memac->qsgmii_pcs); + if (!IS_ERR(memac->sgmii_pcs)) + pcs_put(memac->dev_id->dev, memac->sgmii_pcs); + kfree(memac->memac_drv_param); kfree(memac); @@ -1039,25 +1031,6 @@ static struct fman_mac *memac_config(struct mac_device *mac_dev, return memac; } -static struct phylink_pcs *memac_pcs_create(struct device_node *mac_node, - int index) -{ - struct device_node *node; - struct mdio_device *mdiodev = NULL; - struct phylink_pcs *pcs; - - node = of_parse_phandle(mac_node, "pcsphy-handle", index); - if (node && of_device_is_available(node)) - mdiodev = of_mdio_find_device(node); - of_node_put(node); - - if (!mdiodev) - return ERR_PTR(-EPROBE_DEFER); - - pcs = lynx_pcs_create(mdiodev); - return pcs; -} - static bool memac_supports(struct mac_device *mac_dev, phy_interface_t iface) { /* If there's no serdes device, assume that it's been configured for @@ -1076,7 +1049,6 @@ int memac_initialization(struct mac_device *mac_dev, { int err; struct device_node *fixed; - struct phylink_pcs *pcs; struct fman_mac *memac; unsigned long capabilities; unsigned long *supported; @@ -1101,56 +1073,48 @@ int memac_initialization(struct mac_device *mac_dev, memac->memac_drv_param->max_frame_length = fman_get_max_frm(); memac->memac_drv_param->reset_on_init = true; - err = of_property_match_string(mac_node, "pcs-handle-names", "xfi"); - if (err >= 0) { - memac->xfi_pcs = memac_pcs_create(mac_node, err); - if (IS_ERR(memac->xfi_pcs)) { - err = PTR_ERR(memac->xfi_pcs); - dev_err_probe(mac_dev->dev, err, "missing xfi pcs\n"); - goto _return_fm_mac_free; - } - } else if (err != -EINVAL && err != -ENODATA) { + memac->xfi_pcs = pcs_get_optional(mac_dev->dev, "xfi"); + if (IS_ERR(memac->xfi_pcs)) { + err = PTR_ERR(memac->xfi_pcs); + dev_err_probe(mac_dev->dev, err, "missing xfi pcs\n"); goto _return_fm_mac_free; } - err = of_property_match_string(mac_node, "pcs-handle-names", "qsgmii"); - if (err >= 0) { - memac->qsgmii_pcs = memac_pcs_create(mac_node, err); - if (IS_ERR(memac->qsgmii_pcs)) { - err = PTR_ERR(memac->qsgmii_pcs); - dev_err_probe(mac_dev->dev, err, - "missing qsgmii pcs\n"); - goto _return_fm_mac_free; - } - } else if (err != -EINVAL && err != -ENODATA) { + memac->qsgmii_pcs = pcs_get_optional(mac_dev->dev, "qsgmii"); + if (IS_ERR(memac->qsgmii_pcs)) { + err = PTR_ERR(memac->qsgmii_pcs); + dev_err_probe(mac_dev->dev, err, "missing qsgmii pcs\n"); goto _return_fm_mac_free; } - /* For compatibility, if pcs-handle-names is missing, we assume this - * phy is the first one in pcsphy-handle - */ - err = of_property_match_string(mac_node, "pcs-handle-names", "sgmii"); - if (err == -EINVAL || err == -ENODATA) - pcs = memac_pcs_create(mac_node, 0); - else if (err < 0) - goto _return_fm_mac_free; - else - pcs = memac_pcs_create(mac_node, err); - - if (IS_ERR(pcs)) { - err = PTR_ERR(pcs); - dev_err_probe(mac_dev->dev, err, "missing pcs\n"); + memac->sgmii_pcs = pcs_get_optional(mac_dev->dev, "sgmii"); + if (IS_ERR(memac->sgmii_pcs)) { + err = PTR_ERR(memac->sgmii_pcs); + dev_err_probe(mac_dev->dev, err, "missing sgmii pcs\n"); goto _return_fm_mac_free; } - /* If err is set here, it means that pcs-handle-names was missing above - * (and therefore that xfi_pcs cannot be set). If we are defaulting to - * XGMII, assume this is for XFI. Otherwise, assume it is for SGMII. - */ - if (err && mac_dev->phy_if == PHY_INTERFACE_MODE_XGMII) - memac->xfi_pcs = pcs; - else - memac->sgmii_pcs = pcs; + if (!memac->sgmii_pcs && !memac->qsgmii_pcs && !memac->xfi_pcs) { + struct phylink_pcs *pcs; + + /* For compatibility, if pcs-handle-names is missing, we assume + * this phy is the first one in pcsphy-handle + */ + pcs = pcs_get_optional(mac_dev->dev, NULL); + if (IS_ERR(pcs)) { + err = PTR_ERR(pcs); + dev_err_probe(mac_dev->dev, err, "missing pcs\n"); + goto _return_fm_mac_free; + } + + /* If the interface mode is XGMII, assume this is for XFI. + * Otherwise, assume this PCS is for SGMII. + */ + if (memac->dev_id->phy_if == PHY_INTERFACE_MODE_XGMII) + memac->xfi_pcs = pcs; + else + memac->sgmii_pcs = pcs; + } memac->serdes = devm_of_phy_get(mac_dev->dev, mac_node, "serdes"); err = PTR_ERR(memac->serdes); From patchwork Thu Nov 3 21:06:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15206 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1116215dyb; Thu, 3 Nov 2022 14:16:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5dqCrurs5bU+SlxqPEpf8REUWPb+lAA3nXpM66oZ1Omja9ynJa5xo0y4cVAeLelIrr9Ero X-Received: by 2002:a05:6402:c45:b0:442:c549:8e6b with SMTP id cs5-20020a0564020c4500b00442c5498e6bmr32930263edb.123.1667510180700; Thu, 03 Nov 2022 14:16:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667510180; cv=pass; d=google.com; s=arc-20160816; b=wOrqqI68S1ljb0gdxZyCpL2BJOHJ7E8bjXjHIG35QLZ1Mb0FwlZ2BaG1eTgtucIKwi YKfVl2N/kIN4E31Q9Ayv9xWr5TxJwdrdDO0gVNqbUCUCT4d1tQ/scSxY3qJc3uHsSc6s qf1o9lOxH3UslqjgnSjbLPP5e1sLrexXHIu/BjngY0n2q2oHia4LkYQ8l/DyaSOi9EH4 psjIZB08BSzGzRptLyr5UFNvOJR6b6BJ/5KUY9M1XbzALwEmxFUevkvRaPS4BEb346Ic 7/rQvTikHgxXmN+NePD81T2wIsWm02oFnzRROLMJJQBvGZZ2w9Y7ZJe8dhcBuNcYdXlH 8X/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c3MtNRL413X3k/X7nxqUTT+4HJJ3KpfmqPoEDHL/cGo=; b=w+1ervJNvoCIEh1Dfq7igGWSjPOA2TqknK7dyp6IRnNO5o7NQfGXyW7Z6jtKaaKPM+ cE/BaaLspfhJoBxU9LeTTUYFMBy6Gx1aZONc4ykk0iWY/tYHhOnD6Fyu4xCQIBITMvwU igRxTQOfGtnsJduQSluH87B+IWP0Jmjs+P1pinNMMaF3qsKHeBNcDvRnkgEwvvHPqf/W RLR4zPJeXJf67h4QQf9nGCmUXwiTe/x/OxP7/RPaM+V+Os2C+8ywbai7+xrhAt7cCu0V GuJ8SP0t9wuYamnu0fyYsmyI4lQLREECzxaEGdguCK/fD5wZ0UeKLPIQ4jHYeMQ39tkv B0YA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=W6NQfrVH; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a05640226d400b00443e3fe60a0si2748486edd.622.2022.11.03.14.15.56; Thu, 03 Nov 2022 14:16:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=W6NQfrVH; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231564AbiKCVJf (ORCPT + 99 others); Thu, 3 Nov 2022 17:09:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbiKCVJD (ORCPT ); Thu, 3 Nov 2022 17:09:03 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140053.outbound.protection.outlook.com [40.107.14.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0841022BD6; Thu, 3 Nov 2022 14:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NJFVj9ZvnIPbN/eJA8fYzIc2GYXh4RHz8pJX1VFzyW2a081EUFyS+kvGLSY2goIfFliS0OiTNkXA/dWI6whFLEXOLYl5yjaoZIW+IvTdcTiazOv/lq6H6ppkYfcJYHE6DiJoKm7qdw3fiylX5yexRHs+1agt2GQcI13KLFWu4OngGw+LdZCsSgcS1X39/7nYLSn2BucCBjlbUzALSoOHAF1OZIFFGaWhPXd+CX93ZfRQSP9yz9X476mqs9Uxny7GztMzD5oD7CkkZBNC7P0LwK9/3BpvS5vMpuDP+QMser/dL/zzeZ1p6JbleEF45BwNUrr0y6blm7F+eECt99oj6A== 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=c3MtNRL413X3k/X7nxqUTT+4HJJ3KpfmqPoEDHL/cGo=; b=MN9e8tcAxpwdf+Rb7ZYPz5bwPb2hdL7KsNfmNSc5yFuuJE/5KRBMzVlkV00DvB7w71V00KMbnR4IXHdNeDFhRvnNK20RqKfpCy/ZiRBSdQ/ysbmAVyYRfcFlQ1Xdm3PgUzHBWo2tKcNyEIT/1QqulGs8rMG9hEbL4RHr6Rz0rbU1pTBpqlaTLIPlDQFA88G4ybgvCR56wYuXquW8JqYhrzaws1EiPyTG/KraNLMugBMzhGKPSZj599NQrfU5nYjI7NYx9ZtavgBmlEF+UyRRuG/PKl01sVg4JjZ7tHCzxm/ACe88RNlYb7MB3/z+0KC0eVRu5RnItCL4oCVJGGreAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c3MtNRL413X3k/X7nxqUTT+4HJJ3KpfmqPoEDHL/cGo=; b=W6NQfrVH5CvjXO59tIKLMPHd9AmVMFibiyIMhX6/7kQlD9pr44FXO4HD0EduZJcCDaNAxO8tK78mrfbKiBeNlBR7TR6tkmw+SAdgyDUmWhU079cK0F8mpb2VPRDYOAD1rjYQnhCvJyWXtWsw1odXHNs92iND+bzub/YtALm0Vvy6IentNozfmlRFdMmW1jqzo2kPOCeE4Qf9o8tM9tNC4VSRf2DoTxyu01+GiNLRQ7U1LX31zGBWX7nacmh0xV+j0wrVMHwQysN6UJEE3FunsAkLXLc3q+JtrpQDnXaK7nsKHZVRaR1i0ib/JI51guY3y7elmk5O1Hn1NSHIpQuwJg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:19 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:19 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson Subject: [PATCH net-next v2 10/11] [DO NOT MERGE] net: dpaa2: Convert to use PCS subsystem Date: Thu, 3 Nov 2022 17:06:49 -0400 Message-Id: <20221103210650.2325784-11-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e0949d7-8751-466a-3d49-08dabddf64f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dvstXsSKBG78h/k2mxolxow1Fk35OKzeyZ6KcYSmjCa5VEoMYf+3bXwyg40xEOv4T5jHbXQvO8jzviEYNgkgl+ryYjrNBjM+nOsS1MHWyFmaFF+7UuMghFWEl418h3lvbJ2pkQc6pjTJ0N1+nFsP2trKi6h9CU6onJ4pREsCtEm21NhExGVCaBdIwkBpqBuPN8pN9XfDbh2MRVi9oI0EenfpwnxFLPfB9qdMjywRoh0vHPQZ1cg5MKIsPpKlg4Q8uJZeSbAmRxldLwMATi1sTv/ga6UHGocn5RODyiJAozGVnxx/QUa2MhOPuYlTl8sPWG5gSCPkZvkjbXMjM5pDswQwYl1/uSyDVCY8p4yx9tXck2FUtG6OeuR0YP/yzZMU/6kLJ/zkfyV9ehBJm8mk8aXaO8/sOS2VAzUoODbQOS1UXf1vxulcECPCaayI+OiW9VF8XZf82SZTKb9Jy8dMOPASw8nrha1hLr8VTfz2SpJbH/ajQKw2vrv/gkcNdu9ojS89khraeVffE+h+2Ms/BbvhYv8fY7IQXKcY4TLfkyUKtQ9E4qdCCfOmoQ+kfvQtyfJ3qyY/cWur7f5L5ii7tJQ+RzTygXtuBcfhCKOw3sZ6t125Xl+H8g8+bFz5GVeExBkqJO5Ftaq1QFSzZmtyVvgHR/nHoO1rxVYAbBHPTG7yocpRHFDC8bCFg3gjGVbIzk78rwWhjDmM+5Dnv1nE9GJErRtH9xdo/NcvkMwZtvwiLOgzoMldjUh9czoc8tcn X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(107886003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kM4TUtl7DHANAom/zlxZSZTfjU2hA56MpxLiI8GXHUrTAUOpRZ+K27Xm/8ezYtS061E5+oq8hUwuDZkq+4xMpidjnpmS8+QBoVbWbfzrt7vRjdRmjVs380YUvgDJuBlF4FvnyyptfvOvSfkwirb6uJd8JK5q6PHYG0bBwnxiVIzpl82BdS2C7hbhkPh2HuukHKSMyjvW8Hs2wlc+NQ9lYenWzkePZpjzuKGnobFZ47thA241sVm2vHAeyyTUFqqzNQReaLlg0DP86kXLe14QDFwB35ycnLExp7dRbVMuruecKtVUoeOpfkig3JMhT5IM/LwRzLjGxIiJcPUwEXUl74ToB9mvkJy31v9uz1fIpCq+NoE+Q1kXtS4u650eSFSEntRNOBT1vfxfpRrfEkVDAI0H+xqwdjQq7+nFXiNqoPUfZIjavz0Tvd3YuIgDHbSzaV+cPXg1VBTqe1XlPXxmbqxOXFQoM/oRP4+rC/vdcfkNtY8OxjqCsf7IndR2KfDSBL4TR4/1HviTVAXTVGpA1zPgwPLruahENXdbCGzTm8TtcZ2NaXFabx3N9w8FYMyDx8aqZeP/3H301b3LUCmoPyaT3eAFnU0wxs8sQJKuYP72DHrwVceJRdOFqEgfGjwZUza162n4rDh4k1Er16Fg9KEjayPydAQnY5WP3og+dlFzjX+bHqXfJKybY++ipDo0+kUjqN/rwrc58FFjzy802PajXCoKN2Nkrl9dpJZsdbVSBJhsk3MA2f9s24vtdLh2SaVUCHeXhPCqMaE8nUJhk4gY6OlDmMpkXsbblddOSPcDGwiny5HRxshrOgG8l5sk22TUR+566fdtluNa6hSvODnRhfR1nwkAvSGcQWWtnmWUrmJ0/4Kn5l4Wr8JxTsTOV1LnBe0WEkTha7EkKTKnWiDe7hfx70mKyB7qSgmM17G/iWHcNKFA/h+Vv30erMhqFDhFmLuyunhU3SxmEI7C07uN1DfcG/G0ek3J2CxyPdnlFEpWCMR9d+ERcTmMqGCZ6i4xWHAacLor4433YxoLsnsi/bFqYrggkIosHmG8VHF8jzZ/5th2cZ+51jGlVq99RpXaKkARSb9Uda2m7gLUzfG1+TG59W0tGmmNzhGVIEkg4wjJ/VXCghr4qFewNUMBLGi6Z4YMKVE553W13gnDoYdc3kb1bwYRogItmos2CANIGbEM5wauhqFad2N8qydnk94Rm9PVRNWrsn8wf0DDATHKL9VXTH4cPDHif4LzoY8zXAXnSPV749MJcCJJjGrTvzQTuHL6q+eC+9ZBpWYIprH3gRD3wM85zy5+w6vwTSgxWET7tZDuIOiH+qCmEDTWNTdI3CtxwcbGKH/HmymxyVolKdvvHle+hpg6PBMg8SBRsWeDm5DIKCKOXe/kwp8Bf/K9wi4ZhPEBUyiniTahZM6pvj1dxSAJR8EAQbjdNuf5PT49taESwzd625DUCl9vXLp2Qa8JtOVhbQyzSqdKrLSyXutAMgCBDMzZFjiiSlQu85Gqn3vNICFBmfgAX1FiFqtOUTnktT8P4Xfyk5jj59PX6V1q50ZjfU1JLfG+oNbI0HIsiMUnSmErpR8hXaDNzUPJl9T0UyDFC6Eee3Zglg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e0949d7-8751-466a-3d49-08dabddf64f3 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:19.6771 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mAAxq4b9khpzurBgAAgMHQvcv+utKDs5aw7zi/AU36Tc05r86fam2dpv6nQxG5OaUQYhZElUbHrcO81tlsjjEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748511154937565289?= X-GMAIL-MSGID: =?utf-8?q?1748511154937565289?= This converts the DPAA2 driver to use the PCS subsystem, instead of attaching the Lynx library to an MDIO device. Signed-off-by: Sean Anderson --- Changes in v2: - Split off from the lynx PCS patch drivers/net/ethernet/freescale/dpaa2/Kconfig | 1 + .../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 43 +++---------------- 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/Kconfig b/drivers/net/ethernet/freescale/dpaa2/Kconfig index d029b69c3f18..2648e9fb6e13 100644 --- a/drivers/net/ethernet/freescale/dpaa2/Kconfig +++ b/drivers/net/ethernet/freescale/dpaa2/Kconfig @@ -3,6 +3,7 @@ config FSL_DPAA2_ETH tristate "Freescale DPAA2 Ethernet" depends on FSL_MC_BUS && FSL_MC_DPIO select PHYLINK + select PCS select PCS_LYNX select FSL_XGMAC_MDIO select NET_DEVLINK diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c index 49ff85633783..18f8f9f8d161 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c @@ -2,6 +2,7 @@ /* Copyright 2019 NXP */ #include +#include #include #include #include @@ -246,32 +247,10 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac, struct fwnode_handle *dpmac_node, int id) { - struct mdio_device *mdiodev; - struct fwnode_handle *node; - - node = fwnode_find_reference(dpmac_node, "pcs-handle", 0); - if (IS_ERR(node)) { - /* do not error out on old DTS files */ - netdev_warn(mac->net_dev, "pcs-handle node not found\n"); - return 0; - } - - if (!fwnode_device_is_available(node)) { - netdev_err(mac->net_dev, "pcs-handle node not available\n"); - fwnode_handle_put(node); - return -ENODEV; - } - - mdiodev = fwnode_mdio_find_device(node); - fwnode_handle_put(node); - if (!mdiodev) - return -EPROBE_DEFER; - - mac->pcs = lynx_pcs_create(mdiodev); - if (!mac->pcs) { - netdev_err(mac->net_dev, "lynx_pcs_create() failed\n"); - put_device(&mdiodev->dev); - return -ENOMEM; + mac->pcs = pcs_get_by_fwnode(&mac->mc_dev->dev, dpmac_node, NULL); + if (IS_ERR(mac->pcs)) { + netdev_err(mac->net_dev, "pcs_get_by_fwnode() failed\n"); + return PTR_ERR(mac->pcs); } return 0; @@ -279,16 +258,8 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac, static void dpaa2_pcs_destroy(struct dpaa2_mac *mac) { - struct phylink_pcs *phylink_pcs = mac->pcs; - - if (phylink_pcs) { - struct mdio_device *mdio = lynx_get_mdio_device(phylink_pcs); - struct device *dev = &mdio->dev; - - lynx_pcs_destroy(phylink_pcs); - put_device(dev); - mac->pcs = NULL; - } + pcs_put(&mac->mc_dev->dev, mac->pcs); + mac->pcs = NULL; } static void dpaa2_mac_set_supported_interfaces(struct dpaa2_mac *mac) From patchwork Thu Nov 3 21:06:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 15207 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp1116227dyb; Thu, 3 Nov 2022 14:16:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5uO4nRtS2gqXkq0yG2LsCgNrPVo8jSiDgNJjgaPeaVm5kK7+GgHiGGNJyNcXEtdGND80LZ X-Received: by 2002:aa7:ce09:0:b0:461:5406:20e4 with SMTP id d9-20020aa7ce09000000b00461540620e4mr32701301edv.5.1667510182654; Thu, 03 Nov 2022 14:16:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667510182; cv=pass; d=google.com; s=arc-20160816; b=BYH0EEDSlRr5NsrXc2v93v2kUmceqQ7MPfun9HZuUqkunfhY3Yr3lTEf556ZioY6su ws2neaaUrBv6M3N1nFSEGwe2JKM31ts4NfDRlNQvu6vU/bWfGXdmrQdfMhWvHX/dcPyw jIiWClVUKVSlMwckw1hWU3TfE3Qh2O9jE4wXFTbnAAZBEN7/YKYNznXjSC4DnqUX9x88 HJ0rjDCDBbLVSASX7g3BJdUa//1jMvh9bsfbV7EPw94ZomEfQREdQZAPc1rmoj9mN8ix OkSRBk12RWty7btpMJh8LuQY67ekboiIqNymd/CHUtGD9gVOcERiu8bmIHxJ5mvShWYq cu4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Wv+dx9OXnb81iE7XDcAOy4whLhL4bBbPl11NBAZi+78=; b=zdmuPfNDSIMz5YRxilHWpjkMSnnf9/apNd//v5uiOTNiKNmdsnCeID2LLxhXpogeP9 G8BlhV+D+FSYqhUNJLIcL0GtPV4rlc/fGDBdCh8A19rqOsNX3WFtR1hYQHsn6GknSf99 JJMUnYcXwHRYA5HIBMRNQOXgq0NatbzY15NcsHOO89zA7pTn+7tV0o+IJUxZoD3T4Pwh ze7YQE+wngzy68Ju6Afmh1SUOpSO2K9bi/djHJYE/HzfHbjLjpDwSFZXW+nK+P4OXd4p xrNj196fCDHPTCDmNrFKuc6v/U52SEMmObjQOsShWQjlcvNimAFgHw5+fFvZjHDNvT6B ddtA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=FBOvMLMs; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb10-20020a1709077e8a00b007ae2299a195si356931ejc.815.2022.11.03.14.15.58; Thu, 03 Nov 2022 14:16:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=FBOvMLMs; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231404AbiKCVKi (ORCPT + 99 others); Thu, 3 Nov 2022 17:10:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231510AbiKCVKB (ORCPT ); Thu, 3 Nov 2022 17:10:01 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20049.outbound.protection.outlook.com [40.107.2.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B38E313F58; Thu, 3 Nov 2022 14:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+Pe9sgUx25qtqTNZJZ7cUbSQK0VwI5hJ1UWWDarvdR3U5X5OfQRMZRheDluMHkoJ3Hd5rIjD2RssNxZqkj6to3CyGqkIRuS5zH017h9qu/WjpAsEVuzTQbQ1u5Xh61g5Ax7nyefZ8KQn8P49RI0r/g4Bdt5zIWKSmX3N4QHx+C0xpJtgyAEZFGkEl/1aQTb0Ci/xmOmFAXQJSsLhLNmgmRlgskgQoHZRI7CKkQMwbm4bpe/8+0xVbr846NqtoHMpKJca3VXqiRo0U8cmcUxumYljc2Xlq73hiRy9NRT1eMUdIdiQo+IyrknEccqZBgNe5sjOPuztiT/snLsYwGJgw== 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=Wv+dx9OXnb81iE7XDcAOy4whLhL4bBbPl11NBAZi+78=; b=cLzLGmcg8ZH1VECaCk3ksMgtvz6HUc6uG7Oqqfahp8rdQFzigl7oXuFTshxKsJg3jYlWnfx+Bgkpmo/B0j2QhXF5LsVO4wUF5Y+fhdxwTq52fesgy3iCqLjLEnSpsUmVB+s+AD4Rr2SwfrTtwOKV2xPhfce6DQEuqyzM74FnX0diXWn21tB211LQt6zPtZd7HJjdRrUP4tkb/Q4Xif94mwpNrJ6QiUw+D5m5HNho5T4LmVn6fCVbnqmHJWh4AfPftMiwJxJb0SfXC1eGWWovWyRZhcF4m81SD7IIcc5cUF7dCnydiUA1qxR2xwMZ6KkG7ajKZSfkZPlDyANFLGn+Kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Wv+dx9OXnb81iE7XDcAOy4whLhL4bBbPl11NBAZi+78=; b=FBOvMLMsGop/06ToggkcUck8BiwsW3XA/T3gFPwEtMfcBLXr9fQGdkePTU4kIxoK+dUyHahyR8Yr7fNcHV6w4AQnU/ORB/0cstPDRl5xiAavczW03zARL2jX8fufrYjjJGqs1FgZUCpqIrIwPHLpM94rOqWJsdzCSgmDzDgtPZdTN52JWDD1nq0QSWqQdFaTBq6jYUJa4CZvgTvUr+4GpY11I74ftMA0g5OdqjMT2eLDWBFBr3BV5fdXMH1tR5s7FFI0lz7e6IOVJiVoB3eX4kKPD8hklb0wFBdVZfkSh7GxBUHMiw2xocZWFfr1Egw1HKvSd8Dim9H8QyWeXimd9g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Thu, 3 Nov 2022 21:07:21 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::e9d6:22e1:489a:c23d%4]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 21:07:21 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jakub Kicinski , linux-kernel@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Madalin Bucur , "David S . Miller" , Sean Anderson Subject: [PATCH net-next v2 11/11] [DO NOT MERGE] net: pcs: lynx: Remove non-device functionality Date: Thu, 3 Nov 2022 17:06:50 -0400 Message-Id: <20221103210650.2325784-12-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221103210650.2325784-1-sean.anderson@seco.com> References: <20221103210650.2325784-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: 413f4757-3282-4121-b8c4-08dabddf65d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cM8u1QohOB+psZmFMnEWXUPPsynq7WSv6dSd8EIY0rYxuBiquNeqJbPyv+gMW2sX9apkR50ivgMKKoBIBZyq5ad+R++lIsyyHbELvQ6XuUYQXEADc0IwCHqHJRoV8geFvNsZbZK8kr+o5MqRm5cThjExLnMwShUHrGn/5lD5jLxQ4VVDFlux/aNfkTQMN2gsr8wj7o0AuqQrlwwwbu96kSbG5eb5xkLzy4RFVavyPWZpmZBli0dFMT8ibcXcn0ajSJVCZiWnfr5VlYkvs5FjetsPlKTrw9cnJqFWh4J7unzXF2CLZDjDmRlPtmNhkdq9slXBeIaNVEb3riDrFKRG1urZDR11y1KGrwgtzJMyFWD/I84l2uJ4iQjbYgoFimMetaCQoFEkVlECKsj28eJhkjRjXpUTZVAmf5kFFrbp2omwNTmfIf+i/7stve13vhi5qES+h61fhnhulPoq3ETkWiiPf2g/0+tVxNtmryb0vnmIhb0a6WwUtiiyrI/uH8oYjnnFpy1SlDI42rJZbuqX06y6KWGJMOI47LXlBHpKqslWRF0nuyQ99JrRqsGTwf8TovQu3waYxsEfBzXWpNuTjCEX/tIclrBmoc0WXgD268CdQOytQISsvhqPJNWzS3HFJAdpSm+FINfMRJvMuvBMDBGtveRMx5MZsAKx6LCUeLsXiE4HIzND6JJwFvLTS67DnoPbTlILCLBHvpIUaGRSxdtVEvyDPen2GEjUkwm2DYxQGB028w7A6z0rJV7+Gkwi X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(39850400004)(376002)(346002)(396003)(451199015)(8936002)(86362001)(36756003)(107886003)(478600001)(6486002)(44832011)(5660300002)(2906002)(52116002)(26005)(6512007)(6506007)(1076003)(38350700002)(38100700002)(186003)(83380400001)(2616005)(7416002)(41300700001)(6666004)(66946007)(66556008)(4326008)(66476007)(8676002)(316002)(54906003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Hu8ZkmU1BxS9k4YqEIIN3vkPNlDk/lNIOKOdExCNuRZoO7rfL2qsFeHPJ5wLeymijk+wywqtz1zyXLDCyz8VfOHEM0bvh6GWgaMiggs+a84nkxqty777YlidtdX9tr0udJMqxXkivLtTlUJ6c5VE6cJIMswTMpbPfhrFhmHLDx7PdHXpzEn48iI07W1fxo80DWy6+JGyN17VSPhNlcLNsFm98KSAL1oP3QKdEJ0vtvPV3NvY1LqQnXJ82dgVaRFkgtYIO+K2HzE7UdBxU0yKJTbT3U8P3mlhA6rDnWBOfOvnjL7rozxtfZVm1+9/Rh7zFV3u81qWMGmseXo+UYYszRThd0qFWWSZHiOoDiqXtLPV4sSiDnlrHwSyKDS2GyYpATHns9YhKfxC+XGbEjCojsHPWJQxsivPfVKgqVrKdWx7kaWaUDsvsMbjaYnjalA7RKQI7tE1b0qioCdyg/S+xXOLMHhQLeYUfndNWdV5trgFr+lcp7V1Oy296AgHvogaTgKRYEbMhTL+TK6i0Xdikunn9mTMT9ip8Z4xPTrmXHINnIyfqI2f13VaUQ3PsqsHFJMWg5FqcZzjk/fnw5HmG6S3xKnQKzHAncBmFZpy30nvQJClb7q4vr8MVGg6n6f58CwQQOKbskomDfSSitCpzlf/BLVLZrXvlIVhOUTTs0si5f96a+Zsjkwu4+fHkKUvc9jnahYGWsA3GFRHtlNrvcA2ySsbMji14JxnQvTvUwzDoDhhXEt+JEsUE+O4T8x9+uSZYQqa1SN0GcTPb0xXXSBi5V9WTxD1K/tK3VHR+yCssd/AP7SHvwAYz7iCOTbKVdxRLbZndyY8d4x4eB25FsVpVeTb8a5Q3EPyRBhzvnMhdtr1/7s38yeuMg5H8c9PTamMQQUG/k4Ve1IyyCSE8gqqqdoziT4E/WFAHXBH02t2qQEm5yiWa8sVMXlYRml35eugS6ux8jy00rFRlYqdksqIgrhUeupgLfw6nY+s5WGuHRxdYyaUFWb0mlbdTHFxaBVTJtnSrapd2pEWt2GJA5XaT3lD87QBeB30l4PPL4mQNcH4DwpJB9qyekW4dS2p62/TqKEMMToumQvRGKHbuWf7236ep2gENsET/yRvrrzsPGHEw5Pk+RpuB2dHJbZ5to1oxDNKVg8wVoIN0cbsqWBOQAsWLvBwAdOXpiqkaDVH7JTCOI/c8esvFh09ro+kBT4a9rr0hhfSPTxFvhgXO5YdoALjL7v7SMmQjtFVSjwzKceghaRqx1OHZx5HPHuHbTZpU1NU5rcICmGyUNHUUN2dUXpgRkmhSWklsghxirjSRK3XX3ZBLFcEHwJduGNI4fZQEyL762nMxxZ3EYYN9yOQmuQIM2P/WAGziNTL9ZFAQY+kUduyE8kVrUUPg5nDNf5Qwv7Fh47WbnSrks7nt++HFfjfP5qZvDRCczFr7ktnnr1mjjSSoisSkOdZKGnPH8JlEp4kVBwXSSfJ6wOopfTXEU41weLQN6fKv60E/xZfwR+dykhNz4jUl720qVaoWxsKw4hIVoUPB/8ND9DUM5z/SD3y42RJuTWn3c4ju8e0ZNDRGEv8YhwlUKGZrpQtY8xAYKq5k/kYh+9ObNMNuQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 413f4757-3282-4121-b8c4-08dabddf65d5 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 21:07:21.2083 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tpH8wjxme3cFeVFRCMOEnZgGMjupaRInLDPX/iv/qlR6sG/dE/g96D9vqiGOzneI2iJCN0AGPp5GaGLD4jwYeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748511157115798704?= X-GMAIL-MSGID: =?utf-8?q?1748511157115798704?= As all former consumers of non-device lynx PCSs have been removed, we can now remove the remaining functions retained for backwards- compatibility. Signed-off-by: Sean Anderson --- (no changes since v1) drivers/net/pcs/pcs-lynx.c | 51 +++++--------------------------------- include/linux/pcs-lynx.h | 5 ---- 2 files changed, 6 insertions(+), 50 deletions(-) diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index 3ea402049ef1..df9e8ad3f728 100644 --- a/drivers/net/pcs/pcs-lynx.c +++ b/drivers/net/pcs/pcs-lynx.c @@ -38,15 +38,6 @@ enum sgmii_speed { }; #define phylink_pcs_to_lynx(pl_pcs) container_of((pl_pcs), struct lynx_pcs, pcs) -#define lynx_to_phylink_pcs(lynx) (&(lynx)->pcs) - -struct mdio_device *lynx_get_mdio_device(struct phylink_pcs *pcs) -{ - struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); - - return lynx->mdio; -} -EXPORT_SYMBOL(lynx_get_mdio_device); static void lynx_pcs_get_state_usxgmii(struct mdio_device *pcs, struct phylink_link_state *state) @@ -322,57 +313,28 @@ static const struct phylink_pcs_ops lynx_pcs_phylink_ops = { .pcs_link_up = lynx_pcs_link_up, }; -struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) +static int lynx_pcs_probe(struct mdio_device *mdio) { + struct device *dev = &mdio->dev; struct lynx_pcs *lynx; + int ret; lynx = kzalloc(sizeof(*lynx), GFP_KERNEL); if (!lynx) - return NULL; + return -ENOMEM; lynx->mdio = mdio; + lynx->pcs.dev = dev; lynx->pcs.ops = &lynx_pcs_phylink_ops; lynx->pcs.poll = true; - return lynx_to_phylink_pcs(lynx); -} -EXPORT_SYMBOL_GPL(lynx_pcs_create); - -static int lynx_pcs_probe(struct mdio_device *mdio) -{ - struct device *dev = &mdio->dev; - struct phylink_pcs *pcs; - int ret; - - pcs = lynx_pcs_create(mdio); - if (!pcs) - return -ENOMEM; - - dev_set_drvdata(dev, pcs); - pcs->dev = dev; - ret = pcs_register(pcs); + ret = devm_pcs_register(dev, &lynx->pcs); if (ret) return dev_err_probe(dev, ret, "could not register PCS\n"); dev_info(dev, "probed\n"); return 0; } -void lynx_pcs_destroy(struct phylink_pcs *pcs) -{ - struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); - - kfree(lynx); -} -EXPORT_SYMBOL(lynx_pcs_destroy); - -static void lynx_pcs_remove(struct mdio_device *mdio) -{ - struct phylink_pcs *pcs = dev_get_drvdata(&mdio->dev); - - pcs_unregister(pcs); - lynx_pcs_destroy(pcs); -} - static const struct of_device_id lynx_pcs_of_match[] = { { .compatible = "fsl,lynx-pcs" }, { }, @@ -381,7 +343,6 @@ MODULE_DEVICE_TABLE(of, lynx_pcs_of_match); static struct mdio_driver lynx_pcs_driver = { .probe = lynx_pcs_probe, - .remove = lynx_pcs_remove, .mdiodrv.driver = { .name = "lynx-pcs", .of_match_table = of_match_ptr(lynx_pcs_of_match), diff --git a/include/linux/pcs-lynx.h b/include/linux/pcs-lynx.h index ef073b28fae9..f8fe134c63e5 100644 --- a/include/linux/pcs-lynx.h +++ b/include/linux/pcs-lynx.h @@ -10,12 +10,7 @@ struct device; struct mii_bus; struct phylink_pcs; -struct mdio_device *lynx_get_mdio_device(struct phylink_pcs *pcs); - -struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio); struct phylink_pcs *lynx_pcs_create_on_bus(struct device *dev, struct mii_bus *bus, int addr); -void lynx_pcs_destroy(struct phylink_pcs *pcs); - #endif /* __LINUX_PCS_LYNX_H */