From patchwork Mon Jul 11 16:05:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12914005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31C36C433EF for ; Mon, 11 Jul 2022 16:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=VFkBM4WJiyhF7ANtKwaBVL2x5vFEUh0bcn59D6yXFAU=; b=IWZh2ihbKr0c2P 4vgqitA/79I6LLSYLhoffMmDanluo4BCp+LvE8HrKj12cXfbr7zsTZ+3mbxI2u7flY7feBmLgl6nS tpMGL5bB73sqT5inEV/KKSoD9bXptwsq+toba51W7c40JWamxSiI4g6ek/N70CPdSbJsuiI1sPqeT DeOZA7F6ArX/UR8ZKq5tjUafqEzhyJ80eqGK/iPYL7yCKExCGY6wYXCNighBaVs4h4u8ylw3JXnS4 j4TypiiniP4yd1IjhdOLkX9QaRUxmGi1BuV+eS5Xex82dFkwYA9ahLG9yz1l1wRfIeu0bKMQ14R0/ nuwTwyH1Is3pDum/4rTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAvuv-0036dI-J0; Mon, 11 Jul 2022 16:05:49 +0000 Received: from mail-am6eur05on2065.outbound.protection.outlook.com ([40.107.22.65] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAvur-0036Xw-Aa for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2022 16:05:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P3iWNCixxTv0m8fs7RUQM9nS9PwhHkl0/ABlRyoQEBlLRO+yDXrzV7eTekfwIOgp7RQmlVlo7e+c4k6VcPsmYvx2cu8tzYwGNp7s5DOrAKewFrDk47/DXzEVO5mw00MMkq60KopqByqGJhIHmJMKP60S/GQn1S58Mq+GAxRA5G7tuNFXaEiWZKwWvUDPsIqxCRh3s3vrp9bQCZJFQnhHWhVyjssSJSu8hMrCkSfcP/cu1+xjBGYRWMIlpG63UEnTufuz+Yenva+I3Gq+CeY3ESnEE8/ReQelEPD0TKw5xCFbnnDKpYg3yuXET7Nggni2CYeZQEi3ZoiBua9rrJOY6g== 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=NUmtofNdeYCBJLbdCb8eHTiJkS1i9/O5L4WOZfZXd+g=; b=CKL6W4Na5hdLmFw1H8XL7gQHalY/84Xk0pVzNQECCP8YGSNetEmj4Z7Bf7i3ZuH3t2VdrvdrVZJQHbJn5J00bnYgBGfMGFjBRa6BmDDXR/ScGr34bBM1cFjnEATbalBD4KSr6NHCnSfMvfwpUetixSJJDmCJ4RCDxxkH8CnDShnp8FNVjWjOJQFNb1DnTRQk6hEUvZO/L66hEECOuBKHpyyuwAGORy0GC3Jh369+1cNt8XqMef3cnKCuqn7tkqwIvs6JLp3Lcdbj38w5TSL9pHZtrrqc1Z/tTtD2UViN5hKveKFi8fHQbrb++T9VU7ydf1EWWXKwuPQs+jRuVD/8FA== 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=NUmtofNdeYCBJLbdCb8eHTiJkS1i9/O5L4WOZfZXd+g=; b=GCaFz7QMy++1xue5viRc/6Ii3rJWTWUQSjNlGdKGJZqKBWBH1nUtelRa33i6zLoTVm1ZZV2yhimC9W9qQmGLK5nFVe0gTMiMXOVllhYuxOfBEWkdUR1h6BY0ounQz4bvXzltHyvl5GCn25/CcsZ/qRsYXdcoym2TYx9hrFSZaOz3vvBEtB76/K70NmTIsAuhNnnBgsikzTKLQyi+EPUmYb1Bka0WJvLO9CRTLfIxNXogpQK4rjrWpoaLVgvCVIrf3Rt36DX5F086cdpf5pNHasYyN25vI1F8iMBljEswLjudmGSqN1f7m8QjjPDepvuM80wX0cxrxruKBsBTv8cl+Q== 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 DB7PR03MB5113.eurprd03.prod.outlook.com (2603:10a6:10:77::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26; Mon, 11 Jul 2022 16:05:39 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::757e:b75f:3449:45b1]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::757e:b75f:3449:45b1%6]) with mapi id 15.20.5417.026; Mon, 11 Jul 2022 16:05:38 +0000 From: Sean Anderson To: Heiner Kallweit , Russell King , netdev@vger.kernel.org Cc: Jakub Kicinski , Madalin Bucur , "David S . Miller" , Paolo Abeni , Ioana Ciornei , linux-kernel@vger.kernel.org, Eric Dumazet , Andrew Lunn , Sean Anderson , Alexandre Belloni , Benjamin Herrenschmidt , Claudiu Manoil , Florian Fainelli , Frank Rowand , Krzysztof Kozlowski , Li Yang , Michael Ellerman , Paul Mackerras , Rob Herring , Saravana Kannan , Shawn Guo , UNGLinuxDriver@microchip.com, Vivien Didelot , Vladimir Oltean , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH net-next 0/9] net: pcs: Add support for devices probed in the "usual" manner Date: Mon, 11 Jul 2022 12:05:10 -0400 Message-Id: <20220711160519.741990-1-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty X-ClientProxiedBy: MN2PR16CA0056.namprd16.prod.outlook.com (2603:10b6:208:234::25) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c916d062-98e4-4cec-5244-08da63573248 X-MS-TrafficTypeDiagnostic: DB7PR03MB5113:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +nHBR0Dpf2Qs2jjt3rPMvtqZgttINN3kC34xQHVW8tk0L4gSAFsCRiWdWMZqg70d2gWi9/SX4AabG8UMo7eSTp7UcDusd2j6gRE37Kwqc4hPq4ExyVWaWKP/lt52xN1tcqeZfRsiuLMr97K3FdeKmyCofITfWPREwtrfb1Z4M+CO18ojG0hxI2r25gnh402e9pVjDWzypS+1rw0q9JytepTWR/ty0t/ucRJs1g2R9uPI8DKyACWKoWLg9sKluMElE6Tah9Sdwh6qbZWJ7F1HtQkpoVdd7GsdK37EyZUJ6liGeix9ojMoyacLpblCtq8pNZ6e+M+l/eH81C8NsfAy2XXuXy0texqw+9SLRky7c+EJwBsyNGtlh8dN98JMGgISxr1RRn2G/pOoUAxSAwUlg7TM/ENTvKWMv3lUlbXWOnDAK08YKj8ls5gptDypEvTOUWFwXOkeabwNMEUILKC9sKFmtUc7paTY+I86aoTERcU2pYJzBFgt1gVvWPF5ZDqk/LkpKZZnCp4UTFyhb1TssRchIwDtt1Er6YDqSVwv/y7koXywiDQDiZYJBQQZIMXdl1JSj7q7zqvXFLKwiOkQ1vQGYUPCjzGCXX10FxjPjtCuEioqubTtSXmmc7Lqk/wEX9U3u5213lMiblMEe+CEu5zgDb6B0sqQ/piiOsOOxuAf7x/tRvIx8MGYX9UBduFZGYoZZqXamBw1P2d331vmiFqZX2T+JR/7YSAIRNt9luiMsLxCRSv5/JJZVcaRdKjOpLjzIVQetuHc243j6Mxef9f9ZZeocknNp3BO5ZV7+g3OaFQCos7zvHE7tV4ivgwO 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:(13230016)(346002)(136003)(396003)(376002)(39850400004)(366004)(83380400001)(86362001)(38350700002)(66946007)(38100700002)(4326008)(8936002)(66556008)(66476007)(8676002)(36756003)(6512007)(316002)(54906003)(5660300002)(44832011)(6666004)(7416002)(2906002)(6506007)(41300700001)(26005)(6486002)(52116002)(478600001)(110136005)(186003)(1076003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mZc8TfzylDUjgDvkcIgMylG5Nsg86h1YD521JYF3Op67QUEbWwn6NOqDIzMM3bxL4puLfGC7JrAZ888xE+Zdsg3Zq3wtoVEl9X9RByFDA1zZBWYh41YSbkufzt1HJUs96Ow7kMCNUZuHqPts6q4jD5mSjJIAoTfRjxk0AueJbDs/QK8VQCQZoFSvyKvIUpS6rqZfzYFC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ggOgoBq2hUlfTQBfdppfpF422vb5FW7g+MBPD78bLggMuItJ5sBSmQbS9oRXKhw8HbIPqZndOsnc3uuwNziMTQchQqW9IIMqFJf+EkIKR3c80WIRM65eQpc+yDMzb+Eu6/4FGe1U2VfsYd/X8sEBnOf7vtGlV3sV8gVzOUlad77HRJDGfk9pZvNzmBiOmcTtuBFonsrB+SkKEJmjlkb3FuSQjIGEOtoeev/WVimeKSSIhsJcojNEygDf8V9F2nhQ9oDIzacG75OdOC3JRNs1dNs8FcVyy+s0ZZef3gQVNBcHIMd3uP2alIoWjUKOLqd7ZJYIQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: c916d062-98e4-4cec-5244-08da63573248 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2022 16:05:38.5595 (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: UkjF6GSlFU1E+d3SPlkJ/vbSdCLVFfJ4G8PKAXzV9MOIPUe2vqWajN/U7NK4t7VrnGMzCw65X0evQcTOCN7tvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5113 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220711_090545_892263_5A38BD9E X-CRM114-Status: GOOD ( 16.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org For a long time, PCSs have been tightly coupled with their MACs. For this reason, the MAC creates the "phy" or mdio device, and then passes it to the PCS to initialize. This has a few disadvantages: - Each MAC must re-implement the same steps to look up/create a PCS - The PCS cannot use functions tied to device lifetime, such as devm_*. - Generally, the PCS does not have easy access to its device tree node I'm not sure if these are terribly large disadvantages. In fact, I'm not sure if this series provides any benefit which could not be achieved with judicious use of helper functions. In any case, here it is. NB: Several (later) patches in this series should not be applied. See the notes in each commit for details on when they can be applied. Sean Anderson (9): dt-bindings: net: Add lynx PCS dt-bindings: net: Expand pcs-handle to an array net: pcs: Add helpers for registering and finding PCSs net: pcs: lynx: Convert to an mdio driver net: pcs: lynx: Use pcs_get_by_provider to get PCS net: pcs: lynx: Remove lynx_get_mdio_device and lynx_pcs_destroy arm64: dts: Add compatible strings for Lynx PCSs powerpc: dts: Add compatible strings for Lynx PCSs net: pcs: lynx: Remove remaining users of lynx_pcs_create .../bindings/net/ethernet-controller.yaml | 7 +- .../devicetree/bindings/net/fsl,lynx-pcs.yaml | 47 ++++ MAINTAINERS | 1 + .../arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 30 ++- .../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 +- .../fsl/qoriq-fman3-0-10g-0-best-effort.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi | 3 +- .../fsl/qoriq-fman3-0-10g-1-best-effort.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi | 3 +- .../boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi | 3 +- drivers/net/dsa/ocelot/Kconfig | 2 + drivers/net/dsa/ocelot/felix_vsc9959.c | 26 +- drivers/net/dsa/ocelot/seville_vsc9953.c | 26 +- drivers/net/ethernet/freescale/dpaa2/Kconfig | 1 + .../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 43 +--- drivers/net/ethernet/freescale/enetc/Kconfig | 1 + .../net/ethernet/freescale/enetc/enetc_pf.c | 25 +- drivers/net/pcs/Kconfig | 23 +- drivers/net/pcs/Makefile | 2 + drivers/net/pcs/core.c | 226 ++++++++++++++++++ drivers/net/pcs/pcs-lynx.c | 76 ++++-- drivers/of/property.c | 2 + include/linux/pcs-lynx.h | 6 +- include/linux/pcs.h | 33 +++ include/linux/phylink.h | 6 + 47 files changed, 566 insertions(+), 197 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/fsl,lynx-pcs.yaml create mode 100644 drivers/net/pcs/core.c create mode 100644 include/linux/pcs.h