From patchwork Mon Jul 11 16:05:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12913996 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C4E9C43334 for ; Mon, 11 Jul 2022 16:05:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231484AbiGKQFq (ORCPT ); Mon, 11 Jul 2022 12:05:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbiGKQFo (ORCPT ); Mon, 11 Jul 2022 12:05:44 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2086.outbound.protection.outlook.com [40.107.22.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D48354CB7; Mon, 11 Jul 2022 09:05:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dYdzCGV62SxTbnokAm+QRy9ywPsEWaqVFCrpQHkgZLPczLZitxByhKFS3yHbJgNEY1kewBb/cDuzdjOsICgnx1t2vKKDGybon8ZK0BU+f80g3oJ2jwAgZoExoSuDuDQcwNJD2Uuy3RVRh1lE91N01N1aXORHO9xpk5y6PTWEJ9PpjUsIv62AASiGCOQvMH13hAWElmtYz5VWVz9xPJDN6TikPRpCq0GLeAsurGJ4lrLU0/jVkqQzbUfUDwdb69FkryT6dwsWeZrUZdwwCxVMYrK6WT5veJxn7x48A3VmfWmPjZloKP1VzZFXqjSZK9JXivxYFg8dEPDKTGcTwdWZaQ== 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=LcnwVsgd68nk/gEc8qJoiEfvKm3rTwm/wMiG9OkwjIQ=; b=bT4212Ml5TJ88ZQIxfQHDcKffaCemkITmMcsz2uKicEDNsaNBy4yCDMFN4bvs5KuDJGqNKd6qothd4aBmvFBXOWBGugSUqU5MxFGdPSEa0ZVLT9d9zvF8nao20MDqLsksLlHENGQjI0Rko2DHnoQP+G4Qitoh+25t7MEP3rvmfNyLhbpVNqdJLhjAF0ekgYL3wvveOJDRMcvQExGY2ns7Pgo/Jp51mw71WkrlELgfOLJ7dTBkmguiVEYO/1Iv+nByEiGwgUzDnIrlR4D4AvQW64lwmW/rYolAPZc0ciBME66rwkmfHUQKLSW2KsZPh0y5Gx+hB8G1H6Ew52J3CbPMg== 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=LcnwVsgd68nk/gEc8qJoiEfvKm3rTwm/wMiG9OkwjIQ=; b=bgNrb08VZyaQaye1f9fNhvbrW+1DWUG01zHeMpBvpikgzSYbOC6M3T7h2RBr7WqvGRGp/mzvIQlBwt/ec2MSRhtkAVs4D988JgeSljtxZmdVO6YVNsS89HdQq8jTL/3itKl2uD641KqSLXX3L9Ml4iKH3F2U3wyaP+wcVc6J3nTk4zlDlEuCBj79/7114oEHoWTaix0zW9I5L8OnVchO/4uy1SYdMwk+viA65OlKbV/g1+RQwa13UHb+0+VkiYp5zOfbyH0S1szRz0JzGgQDw00XaCxqscbkZAEhGlfADX0G66tndG/uBhFjmtTTXamhEwD3peJqEb3jT6TlahS1hQ== 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:41 +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:41 +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 , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org Subject: [RFC PATCH net-next 1/9] dt-bindings: net: Add lynx PCS Date: Mon, 11 Jul 2022 12:05:11 -0400 Message-Id: <20220711160519.741990-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220711160519.741990-1-sean.anderson@seco.com> References: <20220711160519.741990-1-sean.anderson@seco.com> 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: f06916b0-9490-4a59-9b36-08da635733dd 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: e5Nz715TGdXbDYqS+1Oa3iLnx9jafzcJPQCBjuiwk5IcUbTWznT3lw08kpdqfgDK8hNJhKzwefLKImj8d3hICptYm2oD3YtAGNC8UnzswtLERmGy+oLx0zP2UxFdZVlEBToJohBh9eO91/Aj8ET2wO9cdYgCr9svCRVaISLZa0ZnhReftMMN/v8Tb/wiWrT97J8N/NrjOwhuZ3Qhj2g+70Ucub6BvQCq4HE+BiBqOuegWAke/FX4E4kotezJlOhB9zckJT0k5EarzfbCkcQ3U5iUUL/tkD5ijvA/8gLtAvaK7957S+ShZCBVDJxRB7U26kHyUXtRitt9jwxit2b7gf9peXaeVzfNVABjZ/6m46ViTSqXpMSp29VqkYCNlhDcEDLiXJKxR6sXfg+zHBcqMaVBVL+k8CIjgxmBEiD25O/LFTfm1NM3OPBTftradkc6MpdigcEkv6PkVCWSPmrW2hJBDz61/wnOPswaZx7trvtpmgXKVvlMlwUDZiISmww7UD2ZlQT9iV9TLwTvDovnD181k6qf1P5JK01PN/rBIgQkcX8xFtb/nO8VQ1000IstOASqy+s6nh4bNcAjbARsuKryUHf3EevIbz/YT9ggXhPGlaaNKL2CAQ1hxiNW+gpTqBk59k9P0yUvpUz3zC0EHtAI79xfaIs9b8qdEKJK6mAHBW7Oohu9biYVoOq6L/oFHO5kZyUZ8BhyutMv8Ww4HKxevYAsTnDJ1MaJigJKO8awVo/enBgwmyL3LIZXwFyV8CCqMIRgTMBb3ohmgqusfJSJ1c4BfZArON07NLeXdLflPtwfvZ7/ERXIlYBT2xLU7PsRven0N31V2s6v16Y+sg== 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)(966005)(52116002)(478600001)(110136005)(186003)(1076003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DLr10dTaqy4iwbnQhjticB1EgbyH5NllLNZDMsSoBcGlxztQRIxyZ8eTYRA0UumNab0q+XYfnl62hJ/RQi1jiFouwul7YNPtqJPYj5TQssBTonJaz7zblkD3qTb/DqN4kbMZCrV53HbfkwRqN1P9bmglorSH5imtk+O9rjMVhZ57kb8SuIXTYs87bSD9qC4Y0n1ODYKNVuU7bSQd6Fvecq91ZihW63A4eXaa8wsR8eFfCffB2KxaDbOsOX7UHuojJfkkYphJT/x0LpM1P8mYHsIhujTRhOZkrlk0SraXJrbvIajzi4DXdKdCM2xrF8P/qqXCc3iQoVJ6ukGaOrwBSDFpv2bm9k1boFdJd6Dp7BgS5rTyu4oCW9++lL6wxIcwwxTYJcYzwBQm/Fqp6DRMgJAxp4cyRMBj7y+MgqBDdB4+OANIhBGaEGDLHuNcVgkbbZEniIHTr35KF8q870oh90SfHTFmW9g2rCnRvahCdkkaX0fZmiD6JYYpPpvQcplcKnAuh/AhRhfnrQ8DFwNuth8Wr164G4qNzmZ/aCz8MUv6SPQCQi7FurJg5BMLu4JGnG3mL/0O8TQ79gOSsTnlFApl18TpYRZPoZhB17HjTQ8Bw/O+HfNqHpYvSrnMgZR656Q4++RwORiOuc3jZIYJtMAZCmrgGcFqYoFvuacIvEPAChH5+1FDN+vWifojXzLpHEWSBYMg5k70LAgaQB9miMzFtSFSZ+TjYyg/jOvkOW7DFv0w2Acp5JrKdQ/HS7+foagPVt91td1i0syOv+Q6btloEXRa9JDqxrnFHsJSq1umf10DUwS0/TTKtq14JSfU0OpX3lbkQADKt06rs6DG14bjshrGsU8NnJ2iiUCMrG/crNP9ov7SfV+BoQyoUnDng4lwlbrv13l227hswXEn8dwnLuLJU3Lcxv4WBeG3CD2hGflBe5p99rzcuo0ESdYsdbzw75Nv2p53iiNYYz9bZn/VAFqnohLXrhnUNljzbrS8LW05+ZHdqscXLdD9c+eaz/Xb9/0ZLT8C+astd8we4/mnBkhwsU3blQiUEj683Qdd+eEPYy/NZ5W/g2TQ7i67QahIxJ8FnokQ5toCdewYXsVC9ZztTBFMbKMrCuFo7E8qeKrif2kzenWDKxugYaGxGqy+ijl01Q9A3lEgkITUgBD2zh7gR1xoklulNb2ZpfwlVbGFtV69cbcdK4L67lD9LCMjqDWdkfs3iV5fl6as7snxafLMI3AH9D8+/SDRogfnH1+I/qk3PPqotsKs2KqhAZ++umWrw4vqlyQJRODQk/g9jCNseOYNfnSZt9Cd3wdO0f42C+CcGN8k0VHR1TEHe51lv9q74dtaxAAywN4kn8zocI3p4Vv5Gxm/K6MLrUcEiUc6hI6hraTAhMqa0FLYR2q6BM+dsds+fhfrXdS0U3ExFC5ob3Q0ZpXI2CrEScaB4GomhQn8e/TgeSYXBFBlmgBOY7rgRLRpHlp82usKXoRkyy/91kjXRiZB9MBgqUj6OaUirJ3Chvpe52dAlclp9MzDKpfe+0qw6GH6znxXmkKbt3o7QvJ/ZjXG5eBndHfPQegGW8GT79Mf4EQB5WFFm43chumjZ8gE82FC2EI6QQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: f06916b0-9490-4a59-9b36-08da635733dd 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:41.2624 (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: y7Z8r+ARAx9V+HLX7k0kFiMqXqfAFhRIXKYJlpZPlUpv1gZQ66TC8cVqkWKEHiBZIaa5Cs/TbX6a0QFX7IpXwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5113 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC This adds bindings for the PCS half of the Lynx 10g/28g SerDes drivers. Signed-off-by: Sean Anderson Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/net/fsl,lynx-pcs.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/fsl,lynx-pcs.yaml diff --git a/Documentation/devicetree/bindings/net/fsl,lynx-pcs.yaml b/Documentation/devicetree/bindings/net/fsl,lynx-pcs.yaml new file mode 100644 index 000000000000..49dee66ab679 --- /dev/null +++ b/Documentation/devicetree/bindings/net/fsl,lynx-pcs.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/fsl,lynx-pcs.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP Lynx 10g/28g PCS + +maintainers: + - Ioana Ciornei + +description: | + Lynx SerDes devices may contain several Ethernet protocol controllers. These + controllers convert between (X)GMII and a variety of high-speed interfaces + (SGMII, 10GBase-R, QSGMII, etc). Unlike the SerDes itself, the PCSs are + accessed over an internal MDIO bus. + +properties: + compatible: + const: fsl,lynx-pcs + + reg: + maxItems: 1 + + phys: + description: A reference to the SerDes lane(s) + maxItems: 1 + + phy-names: + const: serdes + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + ethernet-pcs@1 { + compatible = "fsl,lynx-pcs"; + reg = <0x1>; + }; + }; From patchwork Mon Jul 11 16:05:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12913995 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 567A4CCA47B for ; Mon, 11 Jul 2022 16:05:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231433AbiGKQFs (ORCPT ); Mon, 11 Jul 2022 12:05:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231424AbiGKQFp (ORCPT ); Mon, 11 Jul 2022 12:05:45 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2086.outbound.protection.outlook.com [40.107.22.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EBEB5B06D; Mon, 11 Jul 2022 09:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QCV/x9M6giHnd0kKuELnOCkEqnBHIuC99ug2wTz15+aU67EWOQNxSRs5vxKa3WlZ0Iioje7rSy/I2a74bdYzh8POgk2ewyx3Aw2uEUQuiv+Q8GwZRbWkcvUs44ZF6C0RDvHABLxxmQtGq9EDPaJLKSTGP8DrwWRkALdVjKrlW8egEwUX+3K7E1PaSfs/Li2JFkYuge4t2HoRgXVXVUn1YcnAqicYtGi0WyOAaJjwFFCRRn/yAOnNF3KphIzqXht8DN0pBDPB7WuILYcChCXfXXRacg/qPRXOQqrC/MdkAvzlv+HjemvmVUXB7zgEUj3lO1qDSHg9U6Gzq2AKBjbiwg== 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=6iBtrq30T0RrOjtlRzniyo8IvI8c8OArbpgHc2d4xGU=; b=ZTTHBL3LAprK0Dpv1BG8Jt078dBp5BUWWqjbeAbtGCJBIPTnGhLqF4ZN65Ng1i88QQZMp3Wc3Mf85ysdi2aWcXKq8uSoQjk6gNdrQ7c0LEQIplemu1kiftyGLuR3CWn32LygAc67SH5hXDIU6ewcrE66jp8cD08QX+VptBmT++jbfL9yBVDEo57gNSmfM4VU/d0vMGj6I7DqBNxa3hL6zzSzRfrqJRug04ZNnXE/TLgD5m6rrZ0Eq8JKWuWyCxHWerz0WXRwhUzg+8hxinTH7ZtJ2U14arpnWZfHEqAN28t/OOLZMKEtGWBKcz0HWaY0DvDQH0vT9CuUF2maJdOOnw== 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=6iBtrq30T0RrOjtlRzniyo8IvI8c8OArbpgHc2d4xGU=; b=nQ8TXwzxxXxrBCduQgp0fQ8LaxEbFPdw9+WH4xekZhUMu6kqMauoA0Q1Q3CfY3/91ovRnq5nXASBrLSUiaInufZyn2KRS5gIHPSLmhVGo/YyMrh8pJnG2TLgCUMzXKXdBSu3gyNH/EOJuc4oASIjyXr2HYqkCCR1KmpiCqUvtualWFjZY5c8hR0o2vKOr9iNMXDIVagVOC+1bSxNYsLCOoi0KNRBVttUFkJAzpAPCoPbj29cjiKcHJXU82m+GGL0cbvFkljb4+4lpsDsc0zgNvazbKVrJZitZ13+Ez7Xn5dnmOZLuH5e3d+lcurfvOXE9tFlP8isL5ZtvTmgX564qQ== 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:43 +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:43 +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 , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org Subject: [RFC PATCH net-next 2/9] dt-bindings: net: Expand pcs-handle to an array Date: Mon, 11 Jul 2022 12:05:12 -0400 Message-Id: <20220711160519.741990-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220711160519.741990-1-sean.anderson@seco.com> References: <20220711160519.741990-1-sean.anderson@seco.com> 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: 7479ba74-9f66-4207-c319-08da6357350e 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: VNcdqs+K/4yPL3UCW8H8GoIpyNPEtTfmBxaIkAbZU4OT1IkJEXV6PRV6kVTGgCOttUt+8UcXP2XhqQkIC35gYGV7PpVlugkCh0lVXp0/1Ta8+8zvRQ/yw99SriONvI9HXyim3SRImbLw99oo4AyRjKI+zG+OFxssTlAGCXw5L+Sfulfef1zvWAx0gJCNQqG0P38/mvsF//cvpq6TTkbmlB4tbzAe1KSa+wdC5+BtoQvdcyHM/YrnchB51PXQf7Kq/n8J2nquYgeOhO8xyvNOdfduQx2NhGi7UD4ltFnbE+tvAEXUGaUmBdwWSMwgNjb1onSLJabXr5OHzC7Rrv2L2I9Yte2HMFx4hWD0BkopBIMzJ49V+RjwcUxZ1UJ9bl2RW1uhBj4eL0b67UvrXYjlxp5uZuzyfXHoB6WUdUqhXItgS9N5J8T8FLOSKIjFOAqGVOl4S2dgy05W00j6S/TToUyNhoLkTBDGOzeBSdRuzsynzrbp6ufF+87sdxju475IZ0Cc6qtY7A6Ikzi9UKlgBYUmu/VvnOjzwsnEH0E1S2oF2OrQIUFFCFH6UFU5qY33e9nWwhCJVpteysGJQll8xmEQJvCCDPeepPcG+1BXSj+RJoZycw9+ZB2dPBkQ7iM4Y/+6pDn++AX/s5sQ+/PSDmHKcRjs7mmdKh4qhnE44sHo20UJTRXDlq2+ywAr+Qr2QvVYDrCoMvKXq6vFMuahVGQCgiUezlKaEdo0TbQPat1tKyeYXALoxfNHBLnP1cyfDMCNeriSA4e9oGn47+XXxnBf8pQlQsgJ+TgG25j7jTrBprxc5dinnAe1xIK4WdD+ 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: enYfwUVt3iaE3E+b4ZjounqXC6cmIAIE3nc3ft1q+WQ6msdB8OlPkLs96ij3+lal+omNdUog2/MHrN14HrqZzH9PtT+HIMhMIZ4rhfUmcac4lni3sNPW0DiJBe+KAeM1XEgQQtHnabGE/VoAVqHYqvrxLsnrPAL8VZzpsLx/6VnVk3m6wGRbE295Ld9whjZ3km1IRPPOD7kA1LKd572KcqWHbfvuae27i95cRLNkDfgDXeIMppNFj1rUNg/QrzFf2StA2EyKLnmcVr3H+KdtVwgm4cTIzZ27Xdlbe/Dh8IqsG8c6FwsKgZHHwmHevxLvRJQNBskaVpobRNYOer4kl9yWWmfBKbrq1CX87wSiIPaSxXoavJ4yQepGHyGL0bge6djBr70shrrp8x2COQaG2vIDHh78Ff49GYQgd/tzaE6xbWA1wrWfGF1ATGjMOHy9hbKGeWrvbO4uv+hHsC46VL7hLm2NwcM++jddmDK7Rh7ebZC0RoJ3HonUOwKlrTj70x6jPHpaMnaI19Pw8mbAzIlMkmJmD0QikzM8wZPB9hOYcWN36GwearLFt8x6IEJ3MS2xcntv593+JyowmXkA6fQvuyR85Uj8ry0fl3/ykvnItnG20ycYTmTQAkGgEJJNfg6EkbkW5C17dFatq37UAbpKIZ22uj0vG6Dcf5MU/RowQrwVagM2K1we32gJGJsyMXOIKZYz89v3PlHOmgmnBHiCOWBw8SsZ+34h7rs1KhgPPnnuHM/AMBOgj//Z40/WMBXWln2n1TUT8QaWx9DAR4CzSIZ4GIUHAhQ0Ym6Olzb43co+SLgmWd1RSU+bDxWpKoKK+RyS7xF5Pc9tb/iHjEfzoskRUxsTmGnEhalxlAW5nDNLfVpz2V8Okih3sRHuLu5dvfF61+tqbat/Pu+lSv8OmGMmgCED8X7DJ7DmPcSLPljL0G1jRB77/1Yt3NmGKPGj+6kkuamWhUsiXTvEdfjKTzGotPVL1SSfkbOwfmrv5LMctWQ3G6Rma93YugOYrgFb8kV6mgDPWGvRCjDCkp4BSk6qNl1KZL+IN46xVvclYwrDvfik7DPoE42CS4XSkjfbDA+Lg2ayiAERwE8xltKJN28TdsJwzc2n2jSpWmjsWR62bAu7++dWOO4FkVuLou9g1A8V36LfRg4FjJgkmSnNPbZlyqVfm8q5dZhlH4E0RAN3yCNo/XePOGpkxSZDyubnF/sTNznc1GYyWQYG/X6IQMI9QJzLZnmT1jo72yJuk8sySXl4C57T1crsfgbd+IoKVWrdq40Bd4dOHBrIFIQr1zuITBcRtp/h38XA4en/Ty5RN+InbC0fVf+VSx+NzU1rakTYKuJtYVyRo+mhGl4Ibhf0c3ZuR0ARSfj7CdZC40iBwaJluKa0XY9GHRCXVaJmMDygBxc46gvlbjdooAE7lcaxkMhYub5g2TlXT4x+BBL6EQizkxOBFF8dL75rs/fF68s4H1SWe2syaMVp6jwDcmX0hdevBZOaNzSpPlPmHd6q4poisa48X4lSL9fk1+xEr34V3VYi4ht7aeHjaKBZl0Gsq1ZI2j5YoxEwlzl/80I6tV+U0zx6aikEHYh6sO20yTsSRzhp7qKmK9dVBA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7479ba74-9f66-4207-c319-08da6357350e 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:43.2467 (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: PGGF4qSNEoCa22JE4L/kYf5OOuLgx6i5b/JnlGfJ+xKbxeKlsWD+NhV8tY0MRgBTfgZ9Iwg0DN2NH6FtW1ZjAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5113 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC This allows multiple phandles to be specified for pcs-handle, such as when multiple PCSs are present for a single MAC. To differentiate between them, also add a pcs-names property. Signed-off-by: Sean Anderson --- .../devicetree/bindings/net/ethernet-controller.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml index 4f15463611f8..c033e536f869 100644 --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml @@ -107,11 +107,16 @@ properties: $ref: "#/properties/phy-connection-type" pcs-handle: - $ref: /schemas/types.yaml#/definitions/phandle + $ref: /schemas/types.yaml#/definitions/phandle-array description: Specifies a reference to a node representing a PCS PHY device on a MDIO bus to link with an external PHY (phy-handle) if exists. + pcs-names: + $ref: /schemas/types.yaml#/definitions/string-array + description: + The name of each PCS in pcs-handle. + phy-handle: $ref: /schemas/types.yaml#/definitions/phandle description: From patchwork Mon Jul 11 16:05:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12913997 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7590DCCA480 for ; Mon, 11 Jul 2022 16:06:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231652AbiGKQGA (ORCPT ); Mon, 11 Jul 2022 12:06:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231417AbiGKQFu (ORCPT ); Mon, 11 Jul 2022 12:05:50 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2077.outbound.protection.outlook.com [40.107.22.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E5BD66AF8; Mon, 11 Jul 2022 09:05:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hNReJdH7g+h4ss/b7oGxw19w+sd1VRPMzURYgdgPckgn8uFHzkD8UL/F04zicrHOV0XC9eOljQo3CWu6pDlp3mEzHJhDrhd2HeYQ7Q4X5vHnhjvk1dlyRCnRS+Sw15f0a011JdcqA1vzEF8WWHpawsA4DVLFbaNVAPM0eI15AeRLWcALF1IYigHy8cxbip9Wa92qZjjhhvR8JcqDORhuNMSypQNkZeLM0gxaodpow6922+3gz0OsDHmswZgWi3Kgx6XmOWm+s+PSStWqeFwZzERnHl6XPlvlhpVdpFhMvVoSIIpL1mGW9NUMt6tG5cPyv7E37rprl0wbtwPbUIguRA== 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=mGcFzBn3+ID1/5PE8Q8y7BYLqPH86+MBINx0XPSEA6U=; b=McaKTiAXOI+yFwWLEGe0GSm+Y5Tv7rKuugMlGdyHLAojIyPq3hnuCKSv6i/6o1sGZXu+Ljjxjdp4ae2nuCFoa9KBOYpd47O3AgxJapWfY4CubAZRmzFnGEmyCLh4Sakpzt9pVOP6M0XcG5k1P/awsgFOfaMQq3UK/t3401BCN1TrDQNSIFtUsWeDRTl7TF5oe27jmtohnpysEkPkAwM+XPXIwdFkc+AtUhbiGWhnGNfSmOwhLmyrJoGbTK5UMazE47oW1sY/pADxDANQKBUgH2n85b5oBsgn8MTwXGsLwLOMEIPMgznypzZW8hImRCakm5mWtt41AN9D49xR/4qhbQ== 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=mGcFzBn3+ID1/5PE8Q8y7BYLqPH86+MBINx0XPSEA6U=; b=OwNBhKZInoKsxZ7XD5LTZ4K39NcjIz3EoGZrEIH6ZBohLcorCEQ4iYi90/kD7YUxleDboPyskXxQv8NcUMz7AzD25mmQtVodChWmF11A2qJPvKhE4oV1mUx6inJprv701D3Uy+z6DsOEduQ0X0QTI8drEw7k9mO+kVILIUWqSR71PrVtj+ejp2DXhBYZel0BmBtNTLB8JtJc9mnoCYbwxes6qWeeX6SDfOA9CJ2AvmR2CYuzn0PzbccIewGqFqOhpRj1Us6AJJP7HdNtyAiss9GFM7/YntOpZoKaqL8vlthSbB3fsuxsKNZddCskNmWvRVt7y06oppoaG8Z/Wddi0A== 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:45 +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:45 +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 , Frank Rowand , Rob Herring , Saravana Kannan , devicetree@vger.kernel.org Subject: [RFC PATCH net-next 3/9] net: pcs: Add helpers for registering and finding PCSs Date: Mon, 11 Jul 2022 12:05:13 -0400 Message-Id: <20220711160519.741990-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220711160519.741990-1-sean.anderson@seco.com> References: <20220711160519.741990-1-sean.anderson@seco.com> 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: 92213d74-bd56-418a-c3fa-08da63573638 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: Gu4olcUnNys6qgC6HsEIyrGAObufz0ugqfWthnHppB/nqqKy4Ch/qh8zixGO2AYxs0xxOD2B0RBHWyMceera1CWtfagMqthBoUU4iW84CxWOYNfX8FIBgTcr9YvzompRW/UpXI4l8ImJcnUjtUWs6GVzA+1kkGTTjj9unc4kTmeIJWkkrTs+Cy/k45E54AtsMAf+zEJdBHwtzCRn4Gh0FiIXBhtU9Ssol+12YVn3Ug7dI1gPn5TXW0x8xXQmw1zJvbHhZ4Xcq5owxEPfngAatpf1qj4zUqvdTxxB60D12Z6+U3kM0spvUuKvqFs4CkY4JZuhqWQb30lsU4DKxeLACrlrnBIjedO0FYx8gFTGQU2cft1q50ym46qNX5N6adxAxbtgcerX11MY9g2C/YkUldwxJZZ8pssWyjuabZLhnGc/Z9/jRf25XHSzuRI+VBlxq/LLgJe9VrjHUaN/W6os6Y0fsYpYtBr/I6V/cNgBZl7r75HCJDCGdFFvxr8JZcTk1upXZyvpoH/gShHoEBRObAS0N/5XgDhdLc1mwISmq4Mc2tFbQ8BuokaQz8TQb9oj8rqMqxpvbz/12A/KJX+ihBQB6747k7x8aLNylCFZBI6bNQW9NvgZnFTRdROWZVgJ0GUz6gkU1rvvIqiH0oqz8xDBz1UklKXR4QzyKbasmfvAXDigaVTL7CNFke0b0qbEOfKVpgmSrRTEF7SI3ZoVLQArFQXw7U28ohP7TMcomYmXpctxH5SNa+0WzUQogwsfo2RHT50uTLE6MxKVIY9i3S1B0xkScLNRtcRAAWB6noC2KcPb9Wru3/QTywE8jvEweEilHMQjh2/Do0AvDiMhJw== 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)(30864003)(5660300002)(44832011)(6666004)(7416002)(2906002)(6506007)(41300700001)(26005)(6486002)(966005)(52116002)(478600001)(110136005)(186003)(1076003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KDFBSOFPL5K1Gc0r50A2vzVSTVsqFC8yd1QDPv6b8PptmEHvLVBcnPyRP+gnGj0PDzmJ5l+H2k5gBcuzqukUDJRe2CQkZmEITqz/YDfWRX2Btcuxq7O7J7gTjIF6bQbJbLR1OwQZl/rjeSZgB5rS6B+Ac8oUio7+UAY4abMc3UYIWt9yHvPkaI0ePmyHmRLzmdtgiTW01S2ehR5hjnvwQmTjmElJ89+mcCG9tSTWwrwHh8yRdcUKkKe9+oBIOrJ1O/TycjgMMEj84mg9hXrPPcNKN/IvXlUmmMzidfrciT6/mPfYme8jhrDK4GttdvdBDZxc5RDkXm4EeWn1+6xi7CUqAT1ROnb52YtQqMVaICmwVP5TzYCvzp9UfbL7K9Iu6Q2eswbN2Gm/0ZeANjSmvZ8DnWnMVsELUUzHbDp8UnoeoB5SX27p+cDGztW12BbWXqcOKB049UeOQRDd8q133J+5J8L3QBUCj20sLm8vxMiaFGbw/AIfEwlnc7zCcZ6UX+aIHqhi6EQE+BrIgI9Rpi3p0rSlNPBEMmkt0pn9iXIZNOYo87bJpuWyaiMDN3+rXeaBlA6mT1uuB6ynm0ISqhmHDZcO4ee5h6zD42Z1GH1El5eGRABe3bHOHnlTwEnckV1MRLNnkOjFTS7/zOzGNTFr5sG8e4/BDzgVku/2CehVEOLCDMo0PI6YcMNEIukoDd9BnW/v1zfHTd4ObjRMLV+xs5a9wcAviEBClOJ+DRRR4KGUmiEwn/UU4wvUOGDeqcJ/me3lvLDA7NpNWme0BLQbHWj9zqY294933ZqdDywtoB4fyg+ns6ZUUT13zEtlle9hus6++mYcYVXg1twpuuFqpoItS5fR9o/StVz5M3ZyaeiNvo88KnYr21Zu/iwi6FcDXNZHbT8oh7CRzJq3pyoIkN65IFdrm51qv1gKWFmHIu6GECcRKe10PJzgk6AGHp0QQfBC2BI0phjZDe+OKLDx1E1wQEdsl/NqiK182DgJZyrGhCmW/YJ+NHbwG9VN/+aa9H9w7XKFCimOV4ZQrsN/dYJYt6gLXqAgNHB7htEq8DPqzti/yEtWJHtr0CcWciVcIOwlIwGbASwdQ+nKRVhNuDZpvmgjsZ3/p/dMN9Hu5itMzfATm6ZPNxayi+s9M1VJYJf5HydnSYdcZqBUMcGGZMIAeHLABXF7IBNc8JtPTnwI3OpDDU0wi0O5UXUoahmWxfIgIP6kAp2QH6c6YfPVxvGU4e8qpHYYxOV3jjzjgRYamkQl4J9heNX/DIjHtQJ4KltgP2rnuSfAsyd5rw4p17qDaMc4NfIRSC4ZlJ4zLItc7vfzceL4ILyYWZGcgokAnvyjCk85XyqJdvk0GQHAN5lho3tQCmOIlbXgR9PvO8gy/GQE3h4ELKu5sbeAOxzcOTLuMlUxQof8qPbyfIvLNXJMRhwZ7fs7O5+X7xVgRPd5hlBCE9ivLIEX+tHwronY60ob76b1uj9ytZm8NqCxe4sP36b/5xk0Py/HJttKj7RAH3qCwMrrT5dsHLA/ycONjyrlZyUINWzfpScZjbo2LfKa3jn4mbxRM6t//hZlfENEuobnI321QmbmNF7s7x6PGedjF2ABTWg0KoWQGA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92213d74-bd56-418a-c3fa-08da63573638 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:45.6059 (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: SJVq4GnuehlWEYIOssmyGJEBGHfJ91mMI/40CRDy7sWUURfWx5Zeb4HPj1POENno+ewy6VmDq27rNXYDEJvH3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5113 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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. To prevent the PCS driver from leaving suddenly, we use try_module_get. To provide some ordering during probing/removal, we use device links managed by of_fwnode_add_links. This will reduce the number of probe failures due to deferral. It will not prevent this for non-standard properties (aka pcsphy-handle), but the worst that happens is that we re-probe a few times. At the moment there is no support for specifying the interface used to talk to the PCS. The MAC driver is expected to know how to talk to the PCS. This is not a change, but it is perhaps an area for improvement. Signed-off-by: Sean Anderson --- This is adapted from [1], primarily incorporating the changes discussed there. [1] https://lore.kernel.org/netdev/9f73bc4f-5f99-95f5-78fa-dac96f9e0146@seco.com/ MAINTAINERS | 1 + drivers/net/pcs/Kconfig | 12 +++ drivers/net/pcs/Makefile | 2 + drivers/net/pcs/core.c | 226 +++++++++++++++++++++++++++++++++++++++ drivers/of/property.c | 2 + include/linux/pcs.h | 33 ++++++ include/linux/phylink.h | 6 ++ 7 files changed, 282 insertions(+) create mode 100644 drivers/net/pcs/core.c create mode 100644 include/linux/pcs.h diff --git a/MAINTAINERS b/MAINTAINERS index ca95b1833b97..3965d49753d3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7450,6 +7450,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 22ba7b0b476d..fed6264fdf33 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 "Synopsys DesignWare XPCS controller" depends on MDIO_DEVICE && MDIO_BUS diff --git a/drivers/net/pcs/Makefile b/drivers/net/pcs/Makefile index 0603d469bd57..1fd21a1619d4 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..b39ff1ccdb34 --- /dev/null +++ b/drivers/net/pcs/core.c @@ -0,0 +1,226 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2022 Sean Anderson + */ + +#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 automatically 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_find() - Find the PCS associated with a fwnode or device + * @fwnode: The PCS's fwnode + * @dev: The PCS's device + * + * Search PCSs registered with pcs_register() for one with a matching + * fwnode or device. Either @fwnode or @dev may be %NULL if matching against a + * fwnode or device is not desired (respectively). + * + * Return: a matching PCS, or %NULL if not found + */ +static struct phylink_pcs *pcs_find(const struct fwnode_handle *fwnode, + const struct device *dev) +{ + struct phylink_pcs *pcs; + + mutex_lock(&pcs_mutex); + list_for_each_entry(pcs, &pcs_devices, list) { + if (dev && pcs->dev == dev) + goto out; + if (fwnode && pcs->dev->fwnode == fwnode) + goto out; + } + pcs = NULL; + +out: + mutex_unlock(&pcs_mutex); + pr_devel("%s: looking for %pfwf or %s %s...%s found\n", __func__, + fwnode, dev ? dev_driver_string(dev) : "(null)", + dev ? dev_name(dev) : "(null)", pcs ? " not" : ""); + return pcs; +} + +/** + * pcs_get_tail() - Finish getting a PCS + * @pcs: The PCS to get, or %NULL if one could not be found + * + * This performs common operations necessary when getting a PCS (chiefly + * incrementing reference counts) + * + * Return: @pcs, or an error pointer on failure + */ +static struct phylink_pcs *pcs_get_tail(struct phylink_pcs *pcs) +{ + if (!pcs) + return ERR_PTR(-EPROBE_DEFER); + + if (!try_module_get(pcs->ops->owner)) + return ERR_PTR(-ENODEV); + get_device(pcs->dev); + + return pcs; +} + +/** + * _pcs_get_by_fwnode() - Get a PCS from a fwnode property + * @fwnode: The fwnode to get an associated PCS of + * @id: The name of the PCS to get. May be %NULL to get the first PCS. + * @optional: Whether the PCS is optional or not + * + * Look up a PCS associated with @fwnode and return a reference to it. Every + * call to pcs_get_by_fwnode() must be balanced with one to pcs_put(). + * + * If @optional is true, and @id is non-%NULL, then if @id cannot be found in + * pcs-names, %NULL is returned (instead of an error). If @optional is true and + * @id is %NULL, then no error is returned if pcs-handle is absent. + * + * Return: a PCS if found, or an error pointer on failure + */ +struct phylink_pcs *_pcs_get_by_fwnode(const struct fwnode_handle *fwnode, + const char *id, bool optional) +{ + int index; + struct phylink_pcs *pcs; + struct fwnode_handle *pcs_fwnode; + + if (id) + index = fwnode_property_match_string(fwnode, "pcs-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(fwnode, "pcs-handle", index); + if (PTR_ERR(pcs_fwnode) == -ENOENT) + pcs_fwnode = fwnode_find_reference(fwnode, "pcsphy-handle", + index); + if (optional && !id && PTR_ERR(pcs_fwnode) == -ENOENT) + return NULL; + else if (IS_ERR(pcs_fwnode)) + return ERR_CAST(pcs_fwnode); + + pcs = pcs_find(pcs_fwnode, NULL); + fwnode_handle_put(pcs_fwnode); + return pcs_get_tail(pcs); +} +EXPORT_SYMBOL_GPL(pcs_get_by_fwnode); + +/** + * pcs_get_by_provider() - Get a PCS from an existing provider + * @dev: The device providing the PCS + * + * This finds the first PCS registersed by @dev and returns a reference to it. + * Every call to pcs_get_by_provider() must be balanced with one to + * pcs_put(). + * + * Return: a PCS if found, or an error pointer on failure + */ +struct phylink_pcs *pcs_get_by_provider(const struct device *dev) +{ + return pcs_get_tail(pcs_find(NULL, dev)); +} +EXPORT_SYMBOL_GPL(pcs_get_by_provider); + +/** + * pcs_put() - Release a previously-acquired PCS + * @pcs: The PCS to put + * + * This frees resources associated with the PCS which were acquired when it was + * gotten. + */ +void pcs_put(struct phylink_pcs *pcs) +{ + if (!pcs) + return; + + put_device(pcs->dev); + module_put(pcs->ops->owner); +} +EXPORT_SYMBOL_GPL(pcs_put); diff --git a/drivers/of/property.c b/drivers/of/property.c index 967f79b59016..860d35bde5e9 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1318,6 +1318,7 @@ 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(pwms, "pwms", "#pwm-cells") DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells") DEFINE_SIMPLE_PROP(leds, "leds", NULL) @@ -1406,6 +1407,7 @@ 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_pwms, }, { .parse_prop = parse_resets, }, { .parse_prop = parse_leds, }, diff --git a/include/linux/pcs.h b/include/linux/pcs.h new file mode 100644 index 000000000000..00e76594e03c --- /dev/null +++ b/include/linux/pcs.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2022 Sean Anderson + */ + +#ifndef _PCS_H +#define _PCS_H + +struct phylink_pcs; +struct fwnode; + +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_by_fwnode(const struct fwnode_handle *fwnode, + const char *id, bool optional); +struct phylink_pcs *pcs_get_by_provider(const struct device *dev); +void pcs_put(struct phylink_pcs *pcs); + +static inline struct phylink_pcs +*pcs_get_by_fwnode(const struct fwnode_handle *fwnode, + const char *id) +{ + return _pcs_get_by_fwnode(fwnode, id, false); +} + +static inline struct phylink_pcs +*pcs_get_by_fwnode_optional(const struct fwnode_handle *fwnode, const char *id) +{ + return _pcs_get_by_fwnode(fwnode, id, true); +} + +#endif /* PCS_H */ diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 6d06896fc20d..a713e70108a1 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -396,19 +396,24 @@ 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 device *dev; const struct phylink_pcs_ops *ops; + struct list_head list; bool poll; }; /** * struct phylink_pcs_ops - MAC PCS operations structure. + * @owner: the module which implements this PCS. * @pcs_validate: validate the link configuration. * @pcs_get_state: read the current MAC PCS link state from the hardware. * @pcs_config: configure the MAC PCS for the selected mode and state. @@ -417,6 +422,7 @@ struct phylink_pcs { * (where necessary). */ struct phylink_pcs_ops { + struct module *owner; int (*pcs_validate)(struct phylink_pcs *pcs, unsigned long *supported, const struct phylink_link_state *state); void (*pcs_get_state)(struct phylink_pcs *pcs, From patchwork Mon Jul 11 16:05:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12913998 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3FC6C43334 for ; Mon, 11 Jul 2022 16:06:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231669AbiGKQGU (ORCPT ); Mon, 11 Jul 2022 12:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231579AbiGKQF5 (ORCPT ); Mon, 11 Jul 2022 12:05:57 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2077.outbound.protection.outlook.com [40.107.22.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7AA6643CA; Mon, 11 Jul 2022 09:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f06GTROKfhQwkMhYDDXzClDoihOGTYrsKL1+0rXajReA+FTJP9QzNU37Tva4ooDe0d6dCX4QIfXInboNnxLK4tK9VGhfm2hhU2aFvfDy+o7JUTFfb2alRN9no223cWg+uWyoeQt8PCkWTdRacXkpDZwjj7AN0dgcgJMOhQgP/81ZKLZTh/wg38QauDq7B+02WQoan/GakDKV221/6Xotv6BXD+uxbwG/rc9WQ5LB+h8ma/t/x9WGkcWMts4fQokTqwlZb5UnD0TMV6xyJom0ezcE5r1W2CKxgkL0DWuAG9pi1QyLvD1SCbmFpV4bFx3U6feB2HWVEVvVMAPPN028MA== 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=rJhoeHaS2RoLe/8oyfHiZlAmUj9I5VVBl6zSPK/jRzk=; b=O/e2z3I46O1qs77/3+1/lp9keNYvulfB8y21HnB+N7s1yukrvMNEbhenCd9qVHLG+fGIr9E6Zjyh+slkUVykT4S2M01uqWAQ5wwlm8M4xcUynrWSnjzOL8d2cSZZR/qQ4hUELQMjE9VUXrsreX9+hDYg+T1XzJPRK0EIKrVXjvcZB91AzjLmP1+uVK39NZNIHnxYwGqmH5vtn6fcW9ifT1Bny3gHWpgJ9Xbs481+UYw/AecXAqYNCZGQ/UYuU899vLBz4wzQsgF3q6YR/SP6g+WvAkQ1VsPIn74MG5mxJ1OFfFHX+Ak+hAl4d1BATCT7mUiGlAhBSEhyZTAI/llE6g== 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=rJhoeHaS2RoLe/8oyfHiZlAmUj9I5VVBl6zSPK/jRzk=; b=SXnvNkcTiUK2bchmCrS12wDSAHyO56i5kkWMOF1jMVUqjOuQe8Qx2U5Bl2SYMPwBifWhAzqw+uXQpmt/T9KqkyvUOgN/5xNaBXAnjHJo8WsYVgBfdO0rwrlYuyZUVZyJVkiGJKiD0yDnoo88ssLMXKWk7KQJYK1lZF241QejahrrPBhJFJhjLY17FJ2tkhdFdY+V2n+qIAA/oA463rK7R1UAdZg0ScAHLpD8qMJTGBxaLabcw09bnm/8jGBvGZNCMQhxJ1EfG7mSt/ZefKiyAg3nq1b+j7XsaqDZYnNwOt/54axb2FQDtfzwMfw21HNKpwSdZwUqtiyEjRw9yyUEEw== 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:48 +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:48 +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 , Claudiu Manoil , Florian Fainelli , UNGLinuxDriver@microchip.com, Vivien Didelot , Vladimir Oltean Subject: [RFC PATCH net-next 4/9] net: pcs: lynx: Convert to an mdio driver Date: Mon, 11 Jul 2022 12:05:14 -0400 Message-Id: <20220711160519.741990-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220711160519.741990-1-sean.anderson@seco.com> References: <20220711160519.741990-1-sean.anderson@seco.com> 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: 1141b8bf-020c-4856-81cd-08da635737e3 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: fLHzg4j5uMrVXcNcPBkXughwixB1sTI0JZt1StUrTvrmELHwSwhjOdE33Hokrrcna5sJ1IRh9z8q7WsSm6+azwLfzO+fS3xCwKE5SPVkmV3p+PrxLkdwEkaGpFg1GLNBFdYUlQaJ1W1gnS7p2VUYctYWCI8ewMqau1QYikYD5zgMoVQ3TeEBP6gGboV1Zm060RxTvarCRKNQW1M5Ppd4LGUR/t4XUn2KS6W6JBLKQ5YIsFRNAGw7xFmrmUfdy+uBP8T8JBeeLyg9fLRnRwIT9frU6Km3lZCmERjguqQvJC4butvwlG+cjrcxOv25Gg3Qb91mmsNsoyXFmbVfeAnL71tB5EylUQ8Xd/Oh1zYTLcRKOttfOTLtnvhP/bypzXKLy/AYjr0SMUIw00BNshCqWFEFtsyMD/wFwNKYUi/fzYp2bcmfyyAELoav49mcp4WyfYDLnTVpEIopSfZqQuh7VLaatXoF0iICvHTBRsjssmI1j+LeLuITXlXuEiOTbNJkWnHFp9ipdxlys4tK0imJDcIJ5O7LYv/jfr7WewNGP10Yk1QxQJa6zJGQxw9jMIF9WmrzFSBAwgyT9s4DUWGHrWWkix4JXJnbmhFln8x2mxPE7SsZQiaHaGS+5k0T49n05YTGYp0eSXlcPqhDGM4+dX7RQadTzHZxGuCeTERhajUDivqEFcXLY21bNQi1dKb8issfL2bM7tIX8S9CcYtA+ngZqedDoeXn6xRpg81cMoJ1bcT8FR/xnMn7N5831dcou6eBr6CtNlJnMaP6Yrp0sSO6S8raISTQCADQUVbcGTEwQxZ7egISpfspea14frdG 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: Hz1SlZ7xmZR1mkygIDDZtJ9+IMgcT4YW0oVxbqZV7FuxMLOX0NRfMlAKreRyMw2QOViNj4bEYHLcOo8jFULkAS+lNdQ5Eb4MCcn7hAQ3VDqgpc2pPSctjS7zj4NOYH4skeTs0hNOuRBeCrK2vyeNOJzc8jAm6L6SvjRlmTsDoKGCsMtWdrLwvetWWRxptv8pYw69JJgLBumoQ7662NmdbAOpKOQuZKElDBZWcWry4ngLK6H7t5Vy9znmPwSz7MllEuMTE+2Jp7hseOuGHIia1xA5KMYxkAAG7j8YO48HFEuUm2EquU3UxzVG+YO1Ll7Rr8I8CLBqx22ioRMRmJM8V2qc9yOoGf+mgWpoZI8DZIji9zkVdP59EslP1FOCGj6XnB3rNtiYdst334yTcebyXHCLLqPrvu82JZL+s5VBPN9aU4DsS2Gt5oiYOM4dcxdRiJXnkYM0DVu+f4r1bQszJh37hng0X7L7TwzCbETHZpRwELi8kHhX8PzwQIikKTOJS3DgT7DqJwNGtv3XfVg01V4i0Ja9r/O0yqQ91bpO98Z4qYf/b/f3SQKYwoDvqoHMSlzF75ObsgyZYXW+CAi5LI+UB+/XcfNZ42p+L5tjzLTHrwxFiPQPC4677Z8EyL+eGPv69Vvw3PENLwdvw1/iFZ9OduYiELUIfruAwzXY56U7OGrZ6z0G3Ze/F4VQ2nKrjKoRPyrywo1V9H+xT8rQb+4fyyJhlEJDv9srVoP3RMMDlUxiI9HXHrlaK9lVZ5T13y+jVPAGNk2+FGhPXOrtdOClzgTBsdMy7opLzBS+o5BhUXYpOBHRtLmyE38mspW202sLWpt9XuB1Aq50pMVS7Vf8tuFVQFx2xeW5AJuT2XY9QRyHU5sUdih4QCnsW6pT3L5A72yy9W5ubEKJtjfMrR/tu3F6ipyDf2r/C+Ey1Gj3K755Zwgd0wrq1Br68lC3tFdzTFJ3HFYmSnPeguekOdSpclhUPkk2UfzCpgfxH7Inn+tYLPL2IA/mWMs8dVfui/A1clMRiUCpAmHa9XlfGP1RW8JH+/SlXA9g+athVf+mFRL5++tZKiQi7AVyeBYRKTICsYSQGyBBVjdf+/v+PRcy/sN3VZmO6hkhCxuE15InX00IcyqliZYNdV2rONZtKNVLcHcrQ8ryBThHYBwv0h3ObIaHx1k938qZlUGKZVgVVUtMikulmrT67TLrfP8qDggqtvgfN0c6zBVmRQexV0cPVQ7uhXVISyY5HIyIIBd3kivpiYbiTsz19FiYAvIfEFev+k+y9RQ8w11mIzgzP2+mHOx07jLYB6sIJeE3eQ6zObGoqONUSJMieR8G9BR1cpcn+5qjmgPyteO0uv9pFctObiwrLyveqLA+LYgIIxQcoeOwJI6fXno4P+QPfXrlxQZyCH/+fhHmsk1ztFHiYt+n1st7qtUxO292NpVTlbxXJJ7tpZUNXS+JenZerYZSHDbOaGWg0pLH6XT1G/9NoBNrxiQaJ5aIdg9wNk62+jm16HtP8ciccE+66fm0dOqfA4Oi0wCBEH5BownSkgUF438oFc56AI8oZthPRJJcob0J3eZt7XTjevzGAaNpqIVuluPpzpP88plxB2glHGUT2g== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1141b8bf-020c-4856-81cd-08da635737e3 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:48.3244 (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: NofFABC9XLCHZZyKARyrfmuS9EmLVX2Qezqn/wCbq6u4mskta0lI4Y0Aeju+5PEWY9QGSF1BTjHbAGh+IHJFGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5113 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC This 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 device trees lacking a compatible property, we bind the driver in lynx_pcs_create. This is intended only as a transitional method. After compatible properties are added to all existing device trees (and a reasonable amount of time has passed), then lynx_pcs_create can be removed, and users can be converted to pcs_get_fwnode. Signed-off-by: Sean Anderson --- drivers/net/dsa/ocelot/Kconfig | 2 + drivers/net/dsa/ocelot/felix_vsc9959.c | 2 +- drivers/net/dsa/ocelot/seville_vsc9953.c | 2 +- drivers/net/ethernet/freescale/dpaa2/Kconfig | 1 + .../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 4 +- drivers/net/ethernet/freescale/enetc/Kconfig | 1 + .../net/ethernet/freescale/enetc/enetc_pf.c | 4 +- drivers/net/pcs/Kconfig | 11 +++- drivers/net/pcs/pcs-lynx.c | 65 +++++++++++++++---- 9 files changed, 72 insertions(+), 20 deletions(-) diff --git a/drivers/net/dsa/ocelot/Kconfig b/drivers/net/dsa/ocelot/Kconfig index 220b0b027b55..cbb0ced3f37d 100644 --- a/drivers/net/dsa/ocelot/Kconfig +++ b/drivers/net/dsa/ocelot/Kconfig @@ -10,6 +10,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 @@ -25,6 +26,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 570d0204b7be..57634e2296c0 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -1094,7 +1094,7 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) continue; phylink_pcs = lynx_pcs_create(mdio_device); - if (!phylink_pcs) { + if (IS_ERR(phylink_pcs)) { mdio_device_free(mdio_device); continue; } diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c index ea0649211356..8c52de5d0b02 100644 --- a/drivers/net/dsa/ocelot/seville_vsc9953.c +++ b/drivers/net/dsa/ocelot/seville_vsc9953.c @@ -1049,7 +1049,7 @@ static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot) continue; phylink_pcs = lynx_pcs_create(mdio_device); - if (!phylink_pcs) { + if (IS_ERR(phylink_pcs)) { mdio_device_free(mdio_device); continue; } 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 c9bee9a0c9b2..e82c0d23eeb5 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c @@ -268,10 +268,10 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac, return -EPROBE_DEFER; mac->pcs = lynx_pcs_create(mdiodev); - if (!mac->pcs) { + if (IS_ERR(mac->pcs)) { netdev_err(mac->net_dev, "lynx_pcs_create() failed\n"); put_device(&mdiodev->dev); - return -ENOMEM; + return PTR_ERR(mac->pcs); } return 0; 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 c4a0e836d4f0..8c923a93da88 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -859,9 +859,9 @@ static int enetc_imdio_create(struct enetc_pf *pf) } phylink_pcs = lynx_pcs_create(mdio_device); - if (!phylink_pcs) { + if (IS_ERR(phylink_pcs)) { mdio_device_free(mdio_device); - err = -ENOMEM; + err = PTR_ERR(phylink_pcs); dev_err(dev, "cannot create lynx pcs (%d)\n", err); goto unregister_mdiobus; } diff --git a/drivers/net/pcs/Kconfig b/drivers/net/pcs/Kconfig index fed6264fdf33..a225176f92e8 100644 --- a/drivers/net/pcs/Kconfig +++ b/drivers/net/pcs/Kconfig @@ -25,9 +25,14 @@ 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". endmenu diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index fd3445374955..8272072698e4 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)) @@ -337,34 +340,74 @@ static void lynx_pcs_link_up(struct phylink_pcs *pcs, unsigned int mode, } static const struct phylink_pcs_ops lynx_pcs_phylink_ops = { + .owner = THIS_MODULE, .pcs_get_state = lynx_pcs_get_state, .pcs_config = lynx_pcs_config, .pcs_an_restart = lynx_pcs_an_restart, .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); + lynx = devm_kzalloc(dev, 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); + 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; +} + +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, + .mdiodrv.driver = { + .name = "lynx-pcs", + .of_match_table = of_match_ptr(lynx_pcs_of_match), + }, +}; +mdio_module_driver(lynx_pcs_driver); + +struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) +{ + struct device *dev = &mdio->dev; + int err; + + /* For compatibility with device trees lacking compatible strings, we + * bind the device manually here. + */ + err = device_driver_attach(&lynx_pcs_driver.mdiodrv.driver, dev); + if (err && err != -EBUSY) { + if (err == -EAGAIN) + err = -EPROBE_DEFER; + return ERR_PTR(err); + } + + return pcs_get_by_provider(&mdio->dev); } EXPORT_SYMBOL(lynx_pcs_create); void lynx_pcs_destroy(struct phylink_pcs *pcs) { - struct lynx_pcs *lynx = phylink_pcs_to_lynx(pcs); - - kfree(lynx); + pcs_put(pcs); } EXPORT_SYMBOL(lynx_pcs_destroy); -MODULE_LICENSE("Dual BSD/GPL"); +MODULE_DESCRIPTION("NXP Lynx 10G/28G PCS driver"); +MODULE_LICENSE("GPL"); From patchwork Mon Jul 11 16:05:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12913999 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E35D6C433EF for ; Mon, 11 Jul 2022 16:06:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231696AbiGKQGX (ORCPT ); Mon, 11 Jul 2022 12:06:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231645AbiGKQF5 (ORCPT ); Mon, 11 Jul 2022 12:05:57 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2059.outbound.protection.outlook.com [40.107.22.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E29AF6C116; Mon, 11 Jul 2022 09:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rp9iHtVxIrmwK5SdX1sNpbzXzrehZCcUIxJxX9hwZG7daAVjXsu2RjGCsdFAt7YOeQXv18TSUtAnYkbBGZ2D31ni6UuuzUjCzmlSg8xwGnE87nhr/tvqCECz3iqA4f7Iqh9QYWnx3LQYByFRAp2Hw0SIp0M9OfrW63/VWrBs3mvOJAX+3IbsLP63HnPaNswIvr/6yfzMw4Gq7JYIKE83kUX1yjVcA1mY2g+x+GMBviS1eEZ+WctV/9V0yyT31Pys15EReCQOkstiwsf57GSr9CPVE6Ch8bXk8Mjd2SuDuE24hfP7BMKUF4Pt4zMlJ/zROGakXbcYBGC/KIv/HQMkTg== 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=B3jcfX4LA/ZGnQOBcEiA1eFhvPLhnXo6KxDN6qgmZbw=; b=RUA4ZH1/c8SUCjpqrhMC8u+TYn/a7W3oT9xUpLhlKlmeDL+CXE7U7+XkimrRqz5xP57yrUOMYjwG+Cd8iCHOdUoAWafQLtclRweoOBKXkF2vPxtnLVk2l4m2YCyiSac1rfWWtYyBJ2V4edqeJLSYsGoF6ZICkQTvVHAPVibntqWYDFGMUgeEtdf9F/cSLtEV8qQmvWnwIL5Htf7ayv5A5eK+e12jG4PJrmowz/6AEf8rDZg5V199KhWEVdwHu1wkvAz3EZ34xvPd2imK5E2yJ0l17E9qad3/bgVKcRA8okS/IieCv96zlbd7oo4yoIKwEM9x/FjFa2pOAPVjFgmTsw== 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=B3jcfX4LA/ZGnQOBcEiA1eFhvPLhnXo6KxDN6qgmZbw=; b=g12GwZh2WwIE5oq2uekF5sUYVc6BmQ21QwQGg+v2is/ytpYed/PK5QuKJQcB0m932CbwW8kXFXiAtKEfpXalJn253uKu3DsuB36h8hkmdz7QPHITAfC+b7ZHBjUTPbiscKywYqXVLXEvA0DPJj1jHJidEUsWLlUhDRFxR/ybH9/QM8F3JNf9ONGR3qE+z4yHHXBM5PbzaZyyrHOpC5zhLUdv+KUId4p7T+QLZvD51ooYmKDQ1gWBGCM5GWpYQcgr1maT47Ehqc7wqzX1LqR0sZ5gzsfoYh0BjkE3s9eoL7fCr8exdpaZV5/LodWRDW4csZD/kVvYSn+fihEJe7GUiA== 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:50 +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:50 +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 , Claudiu Manoil , Florian Fainelli , UNGLinuxDriver@microchip.com, Vivien Didelot , Vladimir Oltean Subject: [RFC PATCH net-next 5/9] net: pcs: lynx: Use pcs_get_by_provider to get PCS Date: Mon, 11 Jul 2022 12:05:15 -0400 Message-Id: <20220711160519.741990-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220711160519.741990-1-sean.anderson@seco.com> References: <20220711160519.741990-1-sean.anderson@seco.com> 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: d56cdda8-1162-4d08-7ad1-08da63573989 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: BzdxLeM8BRmqnxJIk3DK0/ho3e0edW2kGGOgsY37K0B8fle7VDBdh/SPyxDESx9iEuhoA481ZbNpn9525OBJIEEbD54HQAEQ+SnHWgjEGxDqO3vtbS6HxhNF37mDmrulxASc/w+4zbutGd8tEBl8lTXp7bilhCp76FTlyX+/cyjQ7mJH2iwPycwOSqxWR56W0F9zHob2P0kB+ovMOLSte5HGCcO8cu7HE/sfobQ8k/QjKkZKbXfAzSxg72JidPd4q0IT/dN9NIqGWWh/9HMbYdQ/t2bqhOFL0FY0tLTtQg93j+ulhgxQozX0jufAhxz5kQbSnjg/m759/84FbpejQ9qBXsryGMY3tkPXb/OsHksr147A2Ll3Kvnqa7SwAwS4gJLI8bJVf/lZn4S7KTFlli3nar1/nKKIyjDAoM483OGVpztJoNdTxuCtaamV9MWns30bXdkgZ0hZaklLuWjg4ln/xiT6T/rFiX2yhLTX7KKzWheN1YV/pm+eKfTWX8VeBNx5CFm/zC4iklhEUqfO1BrlBb7aeWMfN9JCqUGL4EjerFkYzMtF0mPlcHL6Qxd+3L2kcPud5W5TAzi+APULfzs7RNSNY+Q3spokhAK675EN7ijPPAT6+/lLUCYlJ0ygZvfwzXHpLbl1bTcge2KeMC/+egc6AB0pQaXzavT6/mxxkRT7vBFNy/AtH/7mxmjLVb7Sbz+IdcMtxJpdJOSlEQooA9aoUrvM2Bx7n0NrnQhON6aiq6VrqsEvpq4hV97S1WFjlu19ti+ocWW9KkBTlvKDi6hvJeA3C+pFoZD9N2oRbK+cGV+0A7IXqyrNRL0h 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: Pg8Xd4fdQ0XMnCa5ivPZOUzQ+Q80pA62O2qxXjLZPIs8CXMM9sHGzFphO/8LAb0qfPBY/19EVZrIZXqKgPeQOCOcjq7sTDrsWmpB8paVeQA8JZ9nAFhqJUsQOkga0MRyS6cHdGNj2DouNrmKMIuQpkKDQHnaSyMCwJH4Vk/H2IZkcy5PCZCJGr5P+ixYRp+X62Zmw41OdT/E2gSzmWvwZLPrMx2NJ07Wyo+nHl9NGE8K/do0VKWmoT42fsyJdlIPam5uesxY6728+kx0lTex8vckS13g/ue0DOBtWzET6cGDe18tMRKTPmNDtXb8e8xDc0+M2yk0AHHWUcLgAdUh5fw+b14W+0eI1qQJHnw2X61fZaVjOGqWeN45ClRUaWdegvvCNxA6qVTUMEty6VUmQ2Hh5JLjfhtxUjZbhHx9DHc491ZAH/Mh3oHeucjKJJyDajkKZ+73umUrvNF3tNXStbR9ZsEmrJMzjBzxiL2NxAQsy27N0TKK0Gn2Nv1kYjYtFm4x9hqBNvqRWvVP5my4VON3DR480SA+0UnDZabq0N38nyfYZ/XBUB4ydUdGCgfulo302g3aD+T1JUea19PR7/2JEqFCnCOB6NV5iesfj0LNyniGAEWNAjMPgbLBI2yaiyFXduDQfsaoJsUXfGa0HJMBlCu8rY7ASRnenDD2JTu5mh28vyY19MtSOO7gH/oGIc1mdS6XIEgOmHJfux957odr+aDNmWk0dw1HORnnbFtJwn4cXhCVGKW2dRJ5dGaSDRqqzQJIDkR6Sf1QHsx6aWOv2vIh0rnYDQ1wrx7jePrJakUCDY+1jZAjYK4FBKNhJigAnhXzrqAe3apkOf+ckQus4qFgq7qjVslHB5jJ5d4esRPY4QJuGDX8RFJneGjIknDE/4VB+7/H/Ulg7sJdZD7XQxB5pEWubk2jF4iIGRZtBE49EtEOLNOf5skpJWG4G1ke0RiFlvxIWkt4eQnUUx9LXOE/GiDqMEJfa+K4WDUdmAHWeUd4d02bKDJI3qafKd0GwAskqR4YH+JPSXPsVXCzz9VH8aQZeSXDZKE9+ojDNjMmZrBnYfWaTP7RLDBHtAUWHGwJyryG7sF6MMF9oMNDaf/5PffiwBloZyD2PsQ+Fk2mp6lvXOxQRWw8h0mOimNz2cFQ5MxYfw+lsArulm1EWt0Wz448OUDKl8tnH7UPhwbU99ZBRpSIiNhpEe7bBiG10LrZNqxTBU/PvlaNhip6fKuvJ52OuzjWh8sI8qIbvD8QilFwQRIiRibdncw9Ngn6y4mjsfU+36O8MUshjR6fVIc0TP9mCBVApJmzv8B8xNVeDqIcNjzjE2HsHgJ7Qh4rZa1bQUMAVtfxmlnZWsS1ux/beCwWFBDXB8EyPWXgFZoezYSXmvz4UQNJQCKyszu/wNcXdurxNu//ZKReOIXquG5TaworyJy+Z2cQ4pOhcnK1xMlSWyShnIjlxQ+EWgdhYt6WwEZtSCDdc2FMetxLW4EQNOWqfxynNqwKMdpriG/sN45eJOesOD12vIcgoE0w5bquouwebLLg9shh0saGqPKhAzIrzZoiZ9ni/IRHT+L6i40xSzUPG4ffrGjYr2Acjsn+XsITyaSd3Q96uQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: d56cdda8-1162-4d08-7ad1-08da63573989 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:50.7462 (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: Wjn3PmR/Ff+VsbXN5cXsyQiRvbUO0Do8xpCQZUrMkNYlJvkuOhkCW48vGwJfpWfCjnIw2VND4knB45dPcZ0a3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5113 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC There is a common flow in several drivers where a lynx PCS is created without a corresponding firmware node. Consolidate these into one helper function. Because we control when the mdiodev is registered, we can add a custom match function which will automatically bind our driver (instead of using device_driver_attach). Signed-off-by: Sean Anderson Signed-off-by: Vladimir Oltean --- drivers/net/dsa/ocelot/felix_vsc9959.c | 25 ++++--------------- drivers/net/dsa/ocelot/seville_vsc9953.c | 25 ++++--------------- .../net/ethernet/freescale/enetc/enetc_pf.c | 21 +++------------- drivers/net/pcs/pcs-lynx.c | 24 ++++++++++++++++++ include/linux/pcs-lynx.h | 1 + 5 files changed, 39 insertions(+), 57 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 57634e2296c0..0a756c25d5e8 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 @@ -1089,16 +1090,9 @@ 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(felix->imdio, port); + if (IS_ERR(phylink_pcs)) continue; - - phylink_pcs = lynx_pcs_create(mdio_device); - if (IS_ERR(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); @@ -1112,17 +1106,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(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 8c52de5d0b02..9006dec85ef0 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 @@ -1044,16 +1045,9 @@ 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(felix->imdio, addr); + if (IS_ERR(phylink_pcs)) continue; - - phylink_pcs = lynx_pcs_create(mdio_device); - if (IS_ERR(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); @@ -1067,17 +1061,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(felix->pcs[port]); /* mdiobus_unregister and mdiobus_free handled by devres */ } diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c index 8c923a93da88..8da7c8644e44 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" @@ -827,7 +828,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; @@ -851,16 +851,8 @@ 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); + phylink_pcs = lynx_pcs_create_on_bus(bus, 0); if (IS_ERR(phylink_pcs)) { - mdio_device_free(mdio_device); err = PTR_ERR(phylink_pcs); dev_err(dev, "cannot create lynx pcs (%d)\n", err); goto unregister_mdiobus; @@ -880,13 +872,8 @@ 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->pcs) + pcs_put(pf->pcs); if (pf->imdio) { mdiobus_unregister(pf->imdio); mdiobus_free(pf->imdio); diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index 8272072698e4..adb9fd5ce72e 100644 --- a/drivers/net/pcs/pcs-lynx.c +++ b/drivers/net/pcs/pcs-lynx.c @@ -403,6 +403,30 @@ struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) } EXPORT_SYMBOL(lynx_pcs_create); +struct phylink_pcs *lynx_pcs_create_on_bus(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_provider(&mdio->dev); + mdio_device_free(mdio); + return pcs; +} +EXPORT_SYMBOL(lynx_pcs_create_on_bus); + void lynx_pcs_destroy(struct phylink_pcs *pcs) { pcs_put(pcs); diff --git a/include/linux/pcs-lynx.h b/include/linux/pcs-lynx.h index 5712cc2ce775..1c14342bb8c4 100644 --- a/include/linux/pcs-lynx.h +++ b/include/linux/pcs-lynx.h @@ -12,6 +12,7 @@ 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 mii_bus *bus, int addr); void lynx_pcs_destroy(struct phylink_pcs *pcs); From patchwork Mon Jul 11 16:05:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12914000 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ACDFC43334 for ; Mon, 11 Jul 2022 16:06:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231770AbiGKQGj (ORCPT ); Mon, 11 Jul 2022 12:06:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231405AbiGKQGT (ORCPT ); Mon, 11 Jul 2022 12:06:19 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2059.outbound.protection.outlook.com [40.107.22.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79A9E6B263; Mon, 11 Jul 2022 09:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k0wxfqYhhJLuUE2xZLwfZffb254i3cuuo5y811fXEKlxS7fzL4DDlZR4Izr9GBvBm4fsuRdeUFOoKvZI//fCoYo/b/fWvE5IBK93y7q4F7ka0A6Q7n0UjdmojCyJdcMzlDEgQguQLsZ2b92ZUmhw7faD5a+75rE264+z8x0wBEnZ8Rf3XIxt4x55lU8LSXb3IDBi7klnxpcTiGTM54oFR2FIT+F1j+tqE/vf8q7mSFSG7S+yOvG9plohD0TGyExj65aBe83nRG+GYIPiMJ7AuM1nnNWZv3DYYrFoNXCcmLB86UAlZMbq59cMFgUh/tUpkEWn5Sx/2nCEXEB58fCeAg== 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=Hjc9RLGREP3Z5WJkyMST6CSowlBSuOnnDs9Ai7CFZkk=; b=e9Oa2h1GCdU80jdOMLiw03mp/BauQWvYYYJgQkFNlHcSZTzvmHvjN7FWM4DTJ9xbZ6Qk15PdoXot456kRYK+/zIEmhcRmu1mdy9tc60DEjXyWAbp9g+FBJy97VM9dklZgL9dPgckOprTl9IyEMyqLxUvAU43e1XMAWsbOnMJdycCRDCgQTRbYdEprsxHXqixvfAybGZovEH281c8BqsUmKqK5LFoER2EiLNFg22cbaUeBHc396uN3BGPW4Izp/7+rydF7awqObt+2Wnqvk3YNTWUPUY4IbnETomn42/x/b0DX7W37ts6scDc93kwuOTnmhxiJyZTGNr2etxdi+uKVw== 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=Hjc9RLGREP3Z5WJkyMST6CSowlBSuOnnDs9Ai7CFZkk=; b=VQYIx380w46jSdBsSWAWVdwgivbSy23x2OU1vRDsajF/iVBIqYi/lgUr7cMJ5VRN+S2y6ikGm0PccPkRCNmy7mGc//6gj42Ec0porqNgCqtF4zBFReTEe4gUGqvwLoKe5+bGVGtMvGG48kho/z6VLG8aU0P3sfALJG5fNfIyrJHMhbcjNq8ky65yC2ssm3aaSoDtEEBhSy06EG3CvyKsOfMSRtz19d28ZS03F4rfrw3eZ+NsmUp0nA3C22KMDLnYGtrI3gG8fM2AJgDkDDutfhIgbN3rc6BnIUkYkt27BmqSh7Y2SKEqXHTXWb4hUR691wpN1236P55ozmNvpqo/bA== 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:52 +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:52 +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 , Claudiu Manoil , Florian Fainelli , UNGLinuxDriver@microchip.com, Vivien Didelot , Vladimir Oltean Subject: [RFC PATCH net-next 6/9] net: pcs: lynx: Remove lynx_get_mdio_device and lynx_pcs_destroy Date: Mon, 11 Jul 2022 12:05:16 -0400 Message-Id: <20220711160519.741990-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220711160519.741990-1-sean.anderson@seco.com> References: <20220711160519.741990-1-sean.anderson@seco.com> 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: 1c86d629-41ab-45ea-79d1-08da63573ad2 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: SruOoDBENiQknJRFUYN1EeuamFHcHtJC8WEjCMyix5clekdUF7xXvj/jGvaBavWOFOPHeWewXjBxaoKNGTJmS0Woksdcc8XNRZlgzIa6eEz9sCreblJXheirZId+y9eQmz5T/nkSzwbpCwnHmOV1rh1NJsPQtbCXBBI05KYy+QTJWA3qbDOi72qXzQJMwgSGPMiOX+bYuLGLPii4nuBA14oaoohemSxTUqdZVxvSWRyx0nmPtMpoCiUHRBdKLaYaPm7v2Qu+Fj3ljLNimblvF1hscdyMuJ5dTwfIUCs0DsVGEIkYHLRI4odW/I+BXvV9Oa/tghzRC7SbORZsxwp+suN1xE8/gChUcpPzjCGPidGuFe+1qF6JpN7xsIg9Qs/3T2TO4U3NKTqKKFiIslt8dK5/jMmvcAp0vEHzuarIDyDHCeZydhbR8/RSBHxiVt9/HbGAmQo3rkjmo5XIvCkLJJ+bjKmmALObqtNNTdAyDsVDmajlGviLvEVaftARuStLGa9zT+NaSIu0PvlaJ1eA17Y6jiCAKP91xXaaH3q0ub+Z5+X+x2qXVHtVjxG1YrgDQ9hq6LGrvvC22CtMmgDrthUoGZFtAJIOz6jHAEHZSGuhuClNc8V8wghgwTdJ89SU/7V7AxMWyuuOjEPIoMkUZx/C98hNdj/9rz2JRwLwRehUmduelHTfb4WSDhajLQiCrGGwct7jU65Xk58wi7a+DE09C3PiSZ3pz/OK8yX2qx0o6vzlIIl6KxWfa2szywdu4p2ZA4NyPbhFpcVzyMQkg/9HoFAtzW0GZ5d/lhtdtrJT8yLuPTDHBFESpbU6LI3L 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: KrL3reZPq0vi/4FpMqYz7hX2ZJrewvEpaEtaT/b30D4Mw2GnS+ihalwTX8xbFTWoEwx6xKLXUz+ylGtjv1z9ALXO0hDWnfXYUEQBx5d7RjZnKmrlOTWPLWc/RjBSJctGfZelPWtpTcB3IIWuPweDNFnwUj6Sb2BlEnBZz8LvOufK88bU1IE1KEUlZr75U86w6p7eyQGGgfQb1dPA08V2pHE++N+lKUg82xe5prlTfaAO1iGNPlImYdaxsKBU2FW9eJwdsE+iAbo5eSSN/PWZGGvy2l8T5NTg23MfcgxSqDWpIwp4DTIdIjfpdutn1fO8X++zsfoaC+FQlrl1OoSHSVHfR1a8ECTHzIIQKoEgkVCax3cYDyAW0xRbaQOZgNK00auaZwFU9aIymsrxtlVqzeBVQ6ukGxGPffCOMj1/O6bLBdmdoSIBHhdHE5t14QWxkML1x0FYb7usGhDUeUG9xmAvJ0iuGpHKeY3uJXU3eLqI1/BE863pqWfjoIGv46v6ggFElYAOA7tCosqbsokcMYujkXr7N5b/swlvnRBc6GkjgHlj06AW1W8SVXXp6L88PjMUQ/khsm+hjSgANVUZl3vXHAebOX9Jo3Qrl5wsYyHFaZswMA9pJeL1zcQoV9GgBzEjSwiATrOgD/01a0pPWuUWa9rRNGXfgzsMQjHH57p/yzyMIWdWEXBUVFAZqi/eWJCcu7tX038C2NqDwhDUjD8FYs3iWhOhiBbdy/Hg37GRcURv4K9gyjI4xBo5w57nykhU5XptBUyyWB71jy5colnpYB2QhVoDCmhbyf+qXT7kirQtKrMICCVmvwJHORSzeGj/wAEqAYhVWvmYEROda3jqAIciz1KjmNoo1Oq4T5cUkItpy9Xc1PAL8ggW8zsYeRE7YmQu8mwUuqpV5R2d5GfpW19MOLefTBsMNJDU1C4jh0GbJSxYTdsQ3mRFvUL5WOGNk5aXcZrSNMt/DCeYlKAfM7Ev+91sQ5NS6S0PmqqEbtyNESVHLSBjiOrzASUQUxTSslGy1q6k+cWSrvJYV0IeT/lKTsqnSoVHaofycrXKblZCWZ2/HsLEYG8zEBnhgGP2nJsHnD1qyE00sAINRApOPZPQgDjmjnxIs42pI1VViuhFBFOaIcZUl4Crp8gLYWhnGl8slrcighH02yg/ggXIEfEFsLl873MO7WdvrzP17rMrmzORSI0v5YW8zh08FaJDwernA7wBvVrZt4HaAVajKv45vulkFrnSEo7EMYuQe6ALqVUUkNz69rmlHymriexPiU153YnN1A+iiUqE6soLg7ENtcObbBgjyecqBON7m1rCIousuQo1d5L902MJzd9qNcPEBmqH79Wg1RlvSwwlvC6mdV2BHF7erhNmGa1PUu34TETjEXp8KiHrFG0qaqnB5erSwwI3CJBT36uUNHJXYzCU5Z7uDQVrW/kj946agxYSHY9QsDnQ6kOJ/iBCAazNLzXqcHz8PJPh3wEhacF8WQyeHh39vmpNdOPOyjTBw5EDdg+NTBQVAz9q7JxFV0bh/sxjQzLA62C/A/VJplwUKMIrJuUysQeeTQboXsp+LaIrKeguukO9FJsaGzGbgu2+IKOgCbr5zOijw1BnEw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c86d629-41ab-45ea-79d1-08da63573ad2 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:52.8554 (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: x1ymC9tGS14nWwuJMOdUHlpD2spQFFIBvg6hyq53XeE4YhJbvI7N8amcT7EenxneAMn0Ct3dHks9edH+DVT0xA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5113 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The PCS subsystem now manages getting/putting the PCS device. We can convert our manual cleanup with a call to pcs_put. This removes the last users of lynx_get_mdio_device lynx_pcs_destroy, so they can be removed. Signed-off-by: Sean Anderson --- drivers/net/dsa/ocelot/felix_vsc9959.c | 1 - drivers/net/dsa/ocelot/seville_vsc9953.c | 1 - drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 14 ++++---------- drivers/net/pcs/pcs-lynx.c | 14 -------------- include/linux/pcs-lynx.h | 4 ---- 5 files changed, 4 insertions(+), 30 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 0a756c25d5e8..16ff0052a8bf 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -1082,7 +1082,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; diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c index 9006dec85ef0..669af83c9611 100644 --- a/drivers/net/dsa/ocelot/seville_vsc9953.c +++ b/drivers/net/dsa/ocelot/seville_vsc9953.c @@ -1036,7 +1036,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)) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c index e82c0d23eeb5..d8b491ffa4db 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 @@ -268,6 +269,7 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac, return -EPROBE_DEFER; mac->pcs = lynx_pcs_create(mdiodev); + mdio_device_free(mdiodev); if (IS_ERR(mac->pcs)) { netdev_err(mac->net_dev, "lynx_pcs_create() failed\n"); put_device(&mdiodev->dev); @@ -279,16 +281,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->pcs); + mac->pcs = NULL; } static void dpaa2_mac_set_supported_interfaces(struct dpaa2_mac *mac) diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index adb9fd5ce72e..bfa72d9cbcf9 100644 --- a/drivers/net/pcs/pcs-lynx.c +++ b/drivers/net/pcs/pcs-lynx.c @@ -40,14 +40,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) { @@ -427,11 +419,5 @@ struct phylink_pcs *lynx_pcs_create_on_bus(struct mii_bus *bus, int addr) } EXPORT_SYMBOL(lynx_pcs_create_on_bus); -void lynx_pcs_destroy(struct phylink_pcs *pcs) -{ - pcs_put(pcs); -} -EXPORT_SYMBOL(lynx_pcs_destroy); - 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 1c14342bb8c4..61caa59a069c 100644 --- a/include/linux/pcs-lynx.h +++ b/include/linux/pcs-lynx.h @@ -9,11 +9,7 @@ #include #include -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 mii_bus *bus, int addr); -void lynx_pcs_destroy(struct phylink_pcs *pcs); - #endif /* __LINUX_PCS_LYNX_H */ From patchwork Mon Jul 11 16:05:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12914001 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39477CCA480 for ; Mon, 11 Jul 2022 16:06:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231682AbiGKQGn (ORCPT ); Mon, 11 Jul 2022 12:06:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231620AbiGKQGU (ORCPT ); Mon, 11 Jul 2022 12:06:20 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2059.outbound.protection.outlook.com [40.107.22.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515D76E883; Mon, 11 Jul 2022 09:05:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DbrexflZns6XiD1fTsrdBrvR+x8EDHizlKh1z69hN0gEDgNxRbz2phi20TQFS3H9HhNbIf1ETxk9M1wnZj/peZvCIPfAY804WlX210/x9SJ3C9DTJawlgCwIKSigQmYqytUMV76U3SH/bIwZxi40tDbiyUpWA2WC5XXk26b7RkqjqhdLFpPayhkIPcHnNL7GqvDlKygGJRRs+n9iAYgkOlupM2Y6xGzVpYfxJBks8dc+l+6DW5hgB9BntAOZVKyhIvFYDVnxEjmR+uH3+mmh1I60B7nBeHZOGuWmoS2RzdJ3wzyM/SvnT/NPqV314oOWN67+3B+n/pvW5GDh+2VkHg== 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=nXL9uU0jmBAUWk0tRM+f5NoyfnScEQTJlO7VAKcTK3E=; b=nTYgQwF2+cVwg3i4l4zcwZX+Gyf536xuUe8y/B69LblNtBXyA48mmEj0nuIcHvQh7yIWCGt0uhdR6HVDXSBJqIsbJrX5ZxILeCCVdBpz1AvIlkKyRtNuLq94z2EUdvhp3X4ZFtElVe0/b44xx9bgN/S4aYLDlt3/MF5G33Yw+8bWKQNuC4O6dmEZVuepViam3IAvDryR07jbUk+RO3Y3ruVoau92D+jTgIoeNNxB7S+D7tBwunQqrmZlYFW+UsY431u2JVa7HzdgrU8/ccZIN806DoGBQs7nfkl4WWcI64AVv3J+E2D0VbXM9bkV7UOMhSHM9L6S5PEz0+ViODgjcg== 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=nXL9uU0jmBAUWk0tRM+f5NoyfnScEQTJlO7VAKcTK3E=; b=hbGLx1aYDRqp1EHx2kk3SHu/AZuHmbSov7RknSv8GC5CIywAfwR6ZitgKo79uNAXKNhen7B5kyewKE4T/Bd+v58zIDm/+XDsDliHnUE2f3wNxH0x/P2OFgt6e3p/xoP9Ao+TWGOWoDJFUDjSYYHX0VrzlaDOFXdnnvrSVuc00k49MO3R2YI+apSwhNeS+CiMY+fI6ot7rb4oOY5pap4cGqn+wPgYZG3Dcf3BNCfvnSVh99vVOIrILlpftlWTUMeI6i0/T/TjBoh0xEpPQVIVVDOUyg4l2pRTmfHmV4FSJErO5E/aDyodGT5dv6a3ZKvhDDRD2Ds6BJ9fEVeDoUHxKg== 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:55 +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:54 +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 , Krzysztof Kozlowski , Li Yang , Rob Herring , Shawn Guo , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH net-next 7/9] arm64: dts: Add compatible strings for Lynx PCSs Date: Mon, 11 Jul 2022 12:05:17 -0400 Message-Id: <20220711160519.741990-8-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220711160519.741990-1-sean.anderson@seco.com> References: <20220711160519.741990-1-sean.anderson@seco.com> 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: a60f6f2d-6a13-4563-ef83-08da63573c11 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: mHM2Lkl61Agt2nDZ3Zh5P3K61cJi+Wg/E+NobOwzElHE6RIMqLeR+qEzLGfiydjavhHMpbvbbhRlrUj56Wuz2sQ9XLeffJ13mklz6t+QwHD588C4p0YJ6VP/hYrbcPlzhSbVO7w7JwD73+vfWAVEGwdGXIcXt+ahqzRyGy3YzO+kEpZBbftTlwsCeuYkyRPuAZ34KFSRO9vE5zuzOei03nj0N7f8mi9CUWIuLPa7SwQfRQKV6bEFPufJdJoaRMgQp+48Bhu6pKasmoHlgpmKiZDgl84EbSv9iwMDpX+wkDEcEqciYqJmSWG5UdMojFuX2V2khnb1T2Cp8y6pzGi99bAvKtnS2YVdji1j2yV7TxeedSRchbqqW+yto0KtH1gyEPMbHlC4Zqx3NFc5h2+xzkECptbwdIc3CGAB8TPzc9G+Z0N05It3K8EhgCsjJQ/fWYvldG0pdR30i8JZ17SCpOPPVwjvMT9/wMsAN5XDDQtm0VUSDjCsScWxEC4zV4bQbsj+gClK94CB0WBM6jTPZlVRYcAZ0IkT/YvP7LEVKM4fw7moqYNLGHcS6L5PyiTjX3BICdasyZmV7gRhT/f6nHlD0I5yZ0pKr1+z84Rpvf4RvM/12tyKc3iU3jyeF+w4YAZcJElt5uBkh74VE/xjoC/UzVavWlsrWZ/OzGsd3RZogUlQXD8/PeH7rtP8qDfn0wnu+MY3gy4z6+VfCjy/qKtrNu76/YrdyDFsD8lMwGOKb9D6BDEuZYw8jfGnN2K0T4XrhddfpL+Axx77JKErbm9nmLycEYWhvAAXUhaELKKzG14KhFZQe7UsLfqTwUFK48TYzad+GVFguUyu8mouNw== 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)(30864003)(5660300002)(44832011)(6666004)(7416002)(2906002)(6506007)(41300700001)(26005)(6486002)(966005)(52116002)(478600001)(110136005)(186003)(1076003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: c1tNPR6JmHP2bUJXyMaGFrPeGiAzVqlKfB+33PM/ps8lNsvlseSx//LYu4q3BjjCWvno0Sh8Ya+rDHWSN8O7r1GDfSvu5+uV8g15x1WrfG0TzQFeWtT3vW+So7ngqB9vcdZ7Bi+oQ9sDGW9tOwjwEkwQbF8AmLe6v9E0043G/faCoIQ+9Zm4EbAOTUleH3y6OJBIGbi8czJL6+KH9NSbMcjMJ1cqy0PkbyEvISp8nuaJqJQwrqnA+n2oIoYEqOlBJ9iQhI38KQgfHdQcjxJq3APVc4ey59kWqSqF6ttQ33U+EnAyemHMQ7WAgiWq1TvVqvoZR8OSIi1/QvPLoNN7W27I5KuBioVOdJX8XM1mGM9e23EUEVI1SCcxKZMESWUwWTwok9NCLJR7I24EqYat8nMu7Bk42+QYwbABIHX74cj7Zrh2LshflgK20lbpBr5uVl2h5eG/VxlUVc0XvjvCX09j1xc1YhXShj6u6qP8+i3UXfp6dFAtht1r8W8ABq3IdEeqx51aQ4PCwYaEM9cfp8n5HK6FoH0x395Lrca9OtG6kvT7zHA37EGzKQfZJX5kDL+GgsyzHZ9GiCPWnnG7MJTmFPIh4fG1a3vb2ImMe8lGYrsgcQtcLnwuEljDT7DdUf+7Qs34Gn9KfoI1hsWV8mFOIJelx5R1QoflwSSDFrCFYfM+Jug+vPrP+HRJAtGs4yO2/wVEfLmfPHtey2dA+sbvfkEinhN4JfzFwl2B50FPmyznJ/Dk0witIfEJmx77ssGM+jmb9QpflhF8KUJtQGczDKCk0cvMSiexQ1/FnJFrCZ1c17QL+sRkyzE+QZ1rqUoJt2rWGH2OmuqVpDz1lXF0UYvdojb+Ch9AQxBw+e9BsOtGSAoqVaDueERwt8yfPMQ2bxa+rVajq4JQkFtbGB4vZZpbVL9Ri0Rjst9TMxxQWTUzAWe3W/nfeM4GG5Cws/AP+BehUW2IHWKAZIU4Kkkuhn/Xxx87n5ZKMRJd4nCWVaCUJBfot2T8x80uwddsuP+YsrmY8MmslhR3DF4VCf1PueTjB72ecUtqUVqCiFUXTnxgzT8Iyx/SuLAxIk7yqMeLSLjLHlPPGm/ZG71MoGP+9U5sytTMmqHqqICF+RHszPVS4lFNofRFbLc2ubQopyGwzUs3wEUAsh280v+pR999rSyWlYB2RgCLr2SKHCvbzFbyW/+Bl1GIyBsjBy0JEe6mO6KVt3xs87wz+faC7FqrGxgFgMZuxhahbFXnUcdKFJ7zR7uy1HzrI4Iu8ordAEZPOGzR2yvq9fHJtV2dStQxKcub/9/ZQ3nfPvRnNLlJueFxyL4NTb3a0qYty6oU+pEBQ4pvxkks3MKIbG/L4O7/l793eUG0gSzLxq9gbQnjueB42T++zaqCwZ7BTgp4RrHuDWCLsgwSsHYw7FznY13PiaKMeCNeF/gR1vvCllzzQGLnauCsMtj/wk9WpWsUGFlW0fiR8APeTzMar1uuMFM0Vk/9sTt1qxQqAwIZyUzv79M1sltu1wXvfzitGAnPatq5L/aXo1YKvJh7+w48N1QvNUYa+mB0DVquKuDevBSBRdbeGA7aDJ5w90vEhurSbHyBGAHXtFuhSD/IFkGTDQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: a60f6f2d-6a13-4563-ef83-08da63573c11 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:54.9178 (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: 5lsCSXXbcUV0c82qmBeiS/g1lOak9rnlw7Xme4vOEYUISnqo5ieN8HUkagEoJJF/mTNIR9PswBnygccQv6D+fw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5113 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 --- This will break mEMACs. The DPAA driver needs at least something like [1] before this is applied. This is because adding a non-phy compatible string to something on an MDIO bus makes it a regular MDIO device and not a phy. This will break the existing code, which expects a phy and not an MDIO device. [1] https://lore.kernel.org/netdev/20220628221404.1444200-1-sean.anderson@seco.com/T/#md2dee008cbb0962bc9e943426b2c02d2e64b6e3b .../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 +- 11 files changed, 104 insertions(+), 52 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi index f476b7d8b056..259ca8f3f44d 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi @@ -791,7 +791,8 @@ pcs_mdio1: mdio@8c07000 { #size-cells = <0>; status = "disabled"; - pcs1: ethernet-phy@0 { + pcs1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -804,7 +805,8 @@ pcs_mdio2: mdio@8c0b000 { #size-cells = <0>; status = "disabled"; - pcs2: ethernet-phy@0 { + pcs2: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -817,19 +819,23 @@ pcs_mdio3: mdio@8c0f000 { #size-cells = <0>; status = "disabled"; - pcs3_0: ethernet-phy@0 { + pcs3_0: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; - pcs3_1: ethernet-phy@1 { + pcs3_1: ethernet-pcs@1 { + compatible = "fsl,lynx-pcs"; reg = <1>; }; - pcs3_2: ethernet-phy@2 { + pcs3_2: ethernet-pcs@2 { + compatible = "fsl,lynx-pcs"; reg = <2>; }; - pcs3_3: ethernet-phy@3 { + pcs3_3: ethernet-pcs@3 { + compatible = "fsl,lynx-pcs"; reg = <3>; }; }; @@ -842,19 +848,23 @@ pcs_mdio7: mdio@8c1f000 { #size-cells = <0>; status = "disabled"; - pcs7_0: ethernet-phy@0 { + pcs7_0: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; - pcs7_1: ethernet-phy@1 { + pcs7_1: ethernet-pcs@1 { + compatible = "fsl,lynx-pcs"; reg = <1>; }; - pcs7_2: ethernet-phy@2 { + pcs7_2: ethernet-pcs@2 { + compatible = "fsl,lynx-pcs"; reg = <2>; }; - pcs7_3: ethernet-phy@3 { + pcs7_3: ethernet-pcs@3 { + compatible = "fsl,lynx-pcs"; reg = <3>; }; }; diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi index 4ba1e0499dfd..130a96054ff9 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi @@ -545,7 +545,8 @@ pcs_mdio1: mdio@8c07000 { #size-cells = <0>; status = "disabled"; - pcs1: ethernet-phy@0 { + pcs1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -558,7 +559,8 @@ pcs_mdio2: mdio@8c0b000 { #size-cells = <0>; status = "disabled"; - pcs2: ethernet-phy@0 { + pcs2: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -571,7 +573,8 @@ pcs_mdio3: mdio@8c0f000 { #size-cells = <0>; status = "disabled"; - pcs3: ethernet-phy@0 { + pcs3: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -584,7 +587,8 @@ pcs_mdio4: mdio@8c13000 { #size-cells = <0>; status = "disabled"; - pcs4: ethernet-phy@0 { + pcs4: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -597,7 +601,8 @@ pcs_mdio5: mdio@8c17000 { #size-cells = <0>; status = "disabled"; - pcs5: ethernet-phy@0 { + pcs5: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -610,7 +615,8 @@ pcs_mdio6: mdio@8c1b000 { #size-cells = <0>; status = "disabled"; - pcs6: ethernet-phy@0 { + pcs6: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -623,7 +629,8 @@ pcs_mdio7: mdio@8c1f000 { #size-cells = <0>; status = "disabled"; - pcs7: ethernet-phy@0 { + pcs7: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -636,7 +643,8 @@ pcs_mdio8: mdio@8c23000 { #size-cells = <0>; status = "disabled"; - pcs8: ethernet-phy@0 { + pcs8: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -649,7 +657,8 @@ pcs_mdio9: mdio@8c27000 { #size-cells = <0>; status = "disabled"; - pcs9: ethernet-phy@0 { + pcs9: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -662,7 +671,8 @@ pcs_mdio10: mdio@8c2b000 { #size-cells = <0>; status = "disabled"; - pcs10: ethernet-phy@0 { + pcs10: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -675,7 +685,8 @@ pcs_mdio11: mdio@8c2f000 { #size-cells = <0>; status = "disabled"; - pcs11: ethernet-phy@0 { + pcs11: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -688,7 +699,8 @@ pcs_mdio12: mdio@8c33000 { #size-cells = <0>; status = "disabled"; - pcs12: ethernet-phy@0 { + pcs12: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -701,7 +713,8 @@ pcs_mdio13: mdio@8c37000 { #size-cells = <0>; status = "disabled"; - pcs13: ethernet-phy@0 { + pcs13: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -714,7 +727,8 @@ pcs_mdio14: mdio@8c3b000 { #size-cells = <0>; status = "disabled"; - pcs14: ethernet-phy@0 { + pcs14: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -727,7 +741,8 @@ pcs_mdio15: mdio@8c3f000 { #size-cells = <0>; status = "disabled"; - pcs15: ethernet-phy@0 { + pcs15: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -740,7 +755,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 47ea854720ce..b48b2d6acd3d 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi @@ -1398,7 +1398,8 @@ pcs_mdio1: mdio@8c07000 { #size-cells = <0>; status = "disabled"; - pcs1: ethernet-phy@0 { + pcs1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1411,7 +1412,8 @@ pcs_mdio2: mdio@8c0b000 { #size-cells = <0>; status = "disabled"; - pcs2: ethernet-phy@0 { + pcs2: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1424,7 +1426,8 @@ pcs_mdio3: mdio@8c0f000 { #size-cells = <0>; status = "disabled"; - pcs3: ethernet-phy@0 { + pcs3: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1437,7 +1440,8 @@ pcs_mdio4: mdio@8c13000 { #size-cells = <0>; status = "disabled"; - pcs4: ethernet-phy@0 { + pcs4: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1450,7 +1454,8 @@ pcs_mdio5: mdio@8c17000 { #size-cells = <0>; status = "disabled"; - pcs5: ethernet-phy@0 { + pcs5: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1463,7 +1468,8 @@ pcs_mdio6: mdio@8c1b000 { #size-cells = <0>; status = "disabled"; - pcs6: ethernet-phy@0 { + pcs6: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1476,7 +1482,8 @@ pcs_mdio7: mdio@8c1f000 { #size-cells = <0>; status = "disabled"; - pcs7: ethernet-phy@0 { + pcs7: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1489,7 +1496,8 @@ pcs_mdio8: mdio@8c23000 { #size-cells = <0>; status = "disabled"; - pcs8: ethernet-phy@0 { + pcs8: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1502,7 +1510,8 @@ pcs_mdio9: mdio@8c27000 { #size-cells = <0>; status = "disabled"; - pcs9: ethernet-phy@0 { + pcs9: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1515,7 +1524,8 @@ pcs_mdio10: mdio@8c2b000 { #size-cells = <0>; status = "disabled"; - pcs10: ethernet-phy@0 { + pcs10: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1528,7 +1538,8 @@ pcs_mdio11: mdio@8c2f000 { #size-cells = <0>; status = "disabled"; - pcs11: ethernet-phy@0 { + pcs11: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1541,7 +1552,8 @@ pcs_mdio12: mdio@8c33000 { #size-cells = <0>; status = "disabled"; - pcs12: ethernet-phy@0 { + pcs12: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1554,7 +1566,8 @@ pcs_mdio13: mdio@8c37000 { #size-cells = <0>; status = "disabled"; - pcs13: ethernet-phy@0 { + pcs13: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1567,7 +1580,8 @@ pcs_mdio14: mdio@8c3b000 { #size-cells = <0>; status = "disabled"; - pcs14: ethernet-phy@0 { + pcs14: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1580,7 +1594,8 @@ pcs_mdio15: mdio@8c3f000 { #size-cells = <0>; status = "disabled"; - pcs15: ethernet-phy@0 { + pcs15: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1593,7 +1608,8 @@ pcs_mdio16: mdio@8c43000 { #size-cells = <0>; status = "disabled"; - pcs16: ethernet-phy@0 { + pcs16: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1606,7 +1622,8 @@ pcs_mdio17: mdio@8c47000 { #size-cells = <0>; status = "disabled"; - pcs17: ethernet-phy@0 { + pcs17: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -1619,7 +1636,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 Mon Jul 11 16:05:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12914002 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8ADE5C43334 for ; Mon, 11 Jul 2022 16:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231907AbiGKQG6 (ORCPT ); Mon, 11 Jul 2022 12:06:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbiGKQGj (ORCPT ); Mon, 11 Jul 2022 12:06:39 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2059.outbound.protection.outlook.com [40.107.22.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 041B670E67; Mon, 11 Jul 2022 09:06:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KEwhWuZDy6gjvPnMsEYHNQT5fcFG4V06fidvuDlLYWrRtImZJQN13nHeBSxUHZqdgxpKEVUVOlPD3KG3Ximc9W1z2hxVMdSr+z21QGimFEUWrWjTyn1VnhFCM3ga7skrjZ9N/YpOegBGXbjbknzsEBFdJQVVW2SxtzeOQ/cuSAxfJTOalZQiv4VtgixgE2Q7Le4y0/euPtG16GUGYsCwA+y99wG53Z75WZNjkEx3dLYInAb2j6yr72GtyocMjXh64NSAZdJp3Wfr7o6t8p/j3/FqxJnVXdCTEJ3ozbqhVMrQoTBcQzP+w3vwUxoA4NGSfjHZX5gGTmzmZ2HkxPmMsw== 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=37YWCy9jRz6TqCG7bmXi+Z4wefx1d4OKtFt1N83LAtw=; b=fOY7JBfxyj+saEwyTFRk6bhH7LLflEFuzCv4avVcJpX/lVI0wt1OaJFTQMW3BgZN7EEffbB/2ngF+xDly729UtYQa0bKGaOtKdExceIpsTuSEnnEWlPMWJiCX1wAdwP/lQ6iYU4LQqg4F+4QIJIfyxbvwmzn0nj3pmwgjju9feoOf6036c7IpHmZfae4pcDwzvpxcHGOAlAF8aJI/EyLhjzXjKTu2uzdjpxPZWFHxKAzPjFMO7JVtOV2L229ZrSHZLUZulQrvR4jtgS2F5SMDYjxVhCEohG73VpyG5EbBsNdsSonvQbZF/vZuA7uL9Y3BsCrdYUfGxXyhFDuzTxlmg== 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=37YWCy9jRz6TqCG7bmXi+Z4wefx1d4OKtFt1N83LAtw=; b=IOkTp+6rE1C1uvbf0zZSbE3kwrYKz9HjqHsivjWnBLHoUUixfMf5Tku1Han47G5qweazI+nSDRnBlCpkm4/mLH8AUItjN2xf+DIkOmjIKpO2UkAX04qSgl7FXhBnSBDBLiGVI4nmyfhSwq++F01xjgILOPHV2rgbecdiCK2joKEQpHDR60F6NoNUjRBeutnBlUZTK7PH3BG6+Sih1fe2p7NNY+lR1WYNlck5UNLIQBUrbkERCslcF8Jx/h8dpY5iGv/7nfIn9E1upht3/WTiJkPQmGcdsGNZaE7wZNYq4okTGF5wAxSfgSs+TA9s6XV0OYxxYI9U061y5WVUcPaZ4A== 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:57 +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:57 +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 , Benjamin Herrenschmidt , Krzysztof Kozlowski , Michael Ellerman , Paul Mackerras , Rob Herring , devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH net-next 8/9] powerpc: dts: Add compatible strings for Lynx PCSs Date: Mon, 11 Jul 2022 12:05:18 -0400 Message-Id: <20220711160519.741990-9-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220711160519.741990-1-sean.anderson@seco.com> References: <20220711160519.741990-1-sean.anderson@seco.com> 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: 2fd540a4-2e76-4156-da14-08da63573d66 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: azXGz15jR1qmKnoAoA52nufStXxQtE+IHbZ/sJbosAZGIMqEhS0vrU/xLYNZYQTq7IgK6lo4dMC2HOLA6gqePI1w8I7GJSrJ6jBTGbJx3rxgHbHfl71nQvlq4x/s9geb5kkCFcno2R+iqJV6RvS3XxMNQA/ua1vYkAjEkGGTZ7zQeZkeZLT3AZrn5pdbUQ69oz5md2kwKDtdqFzaBrYvjihB0A/ueLzjGakm8qXtpLlC/SarNZ+UvPsSBI2pQ02bsh8QYYCRP5OEWCKSzsS9ZloetqmUn5sNc3JBYDGJJxF/rX3EihQ80963tnwjZX0uuGjvIC5rwJE4Wwwwa/+SxW9ozjwrjb0vONh917BnZJrihc+0XiZbJDYOt+sZI6wU7aiABKUxzgfBT/VGvso++sH6UcppH3uO/n+NUswF8TZDa5tCST4IG3f/Pwui/1pCrY2vvO515siPqcZ6UomxNPZurr66nCJg5iRuqRWZ9953VFCPE2VY4gR1IC6dLLV4o50wYIBZIOl6+OaIud99JuL/1WnYfwfVXe+hWgksiP062ZOa9iSCfTp3VPAdmb8rsjqW8MbEsvmX8MxTEmc0j8GEZx0F8i9GRtqOVgey8rMaNM5DockucpbNkNfOMU1I35be2LoADfXbEEby/je8Gn8o7vLH5HUZAn5OntFmF480Dfd0CTg0IZ2XBJBfdlYBjyYdjhYo6BDGwZoVnRNmME3u5E+FWv6Bs0CxCWFbB7LHfW87mCuIiAYVCILbTG8qt5Acn3bSJDwcavyTT422oRPOE6CFzWIhcLzO9ucbqN8RM6lDugBScVGBdrXb/Afu 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)(30864003)(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: tgEVHvCgATT06zsLf1qbIS1iUo6JNzv5SAtCwLxxrt/9ZQN7FrhOjcqOXPWwk/Sp85+6OVp5cgShmTv69UXycvR+MOeXxoCEbOUm4/1wWzTp9aiB27xlH0JErKebq4kZk0IvtP0AXe0mvCNY9Dk+fWD4VCgdEQ0DKn6kjx0JkK0gFcUJvBHPCI8jhojnsk92IHpdReYOhse2KlOpM0BbFZSItnQGmrpTkEYtwODtpB30WFf7aGvx2V39PxxVXcw6OgUGELg4UPbL4+hTk8RbnAWiZjVzzyndQok6oj1NLgM/J04OcV3aHA8U3p7kXdmTw+msH5bZjYGjF7pIuH0NhNYFoiDFDpRcoQ/7bHLwm2tEiDSkLjfBisnmToK+Qx5rbpFKUguyBuAIMmyc8rhSMV7RRnaCo1dUk6OIHa8myjgu0lqBaHRYocOh4sfv0Si/Fa471kCqvn8X6ox32vzfoIUkyBA1SGe7IVhCZGIdOCcUoJ4kWJM97O63O1KeLg93ZiVM0JNuGTaimgGHqhZzQYZbgt1fH6C+xgH7yDkRtefiJ+4uJxAhdkT/YYg730tMe7YhU7J+qqwBb5jtqvgneJGBE/uWZrGX0Ti9CmNu4fiDvDkowgOJjCrRYkoAKkgKv0za1vWA9Usy0WMVNR9f64JmWAYZpfD7xctBNDD//nDrkY4WH037I/z/k+8hLm5AyeSTRsQiQfmY5D9dw1goZW8L5aGExhd++cGLOY/1RqxuZ+SqfpiXkx6aOuWw+PGrA+6HcxuQv89GkxmzvgAICbshYh1DPVSN1mKmJ7MTprGgxH630/NrLaCY9uWLaUAEtyCnBuZGEvHzrNoXVYIoYd2G8wa9wFzPsLlvQapRh4ztq/FxjWmWUDiq+jaX3VNyGniqg0iEc3kzP+unzdKeOy7dgtXufdwpNA/Piy+YfrGU8+52iLNLlixCdmaVRsx/kg0/2pXqMWX/e/WxOPs7bron37WgYAGlywd2mIM906NEtNrha8buy8pMT1nfKO4n81IyIJBeHqNsbqrLSiuKaPLUdfYlQjtCLWzS2nNQ+LyhgYSaHfnJ8cdxOmHqJ+Mnz+vZD5OY3wWc9/ajyOKtH6wn255mBdHqvxaw7+c6z/jbgh9qSr40Z79ZM4pejd0lNnB3xI1P6I2HaEGZymexpoLzxDqVojNCmJ4t9rrlbkYR3DrwruhXhj8WvWa45fz3AHkAGMQvfsbsCVgYNTkXwXks2VMWNaZADSYgQBxZNQsS83mGo34uBEoJGVvu/5tyLIHwuU8YA1fRQZLpumNp401EKF4CjNJq1EIGTr7QlPcY+BuYYz4CfJ4lLcbzVQkRczHCAsvxbNdlMXlUuytJyrwVy10H6cH8N4y5TmJbWKQICeXV/1py2pyCe0BQhlMAdbxBH+YBLMk8aKI23njeiPrltd+EBgochdfP6qDowDsELMe6p51ag0vnulyB2NwKc5VqpiL26UI8axKtHodjWv1jqgKOua+E5/uOe7rAJ4bKs3dnsNbBJZMrBSJgaN8lhk4rl5wwzvBxcFNNjhVswOhuusDUBx8QA2/LbyPoLi2O9Zvajzt4BI0YWkrZGzRkG8VXWiPwM5qk0Tpce6uaYw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fd540a4-2e76-4156-da14-08da63573d66 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:57.1364 (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: kurvTXOqib125dMSagdWi4qRyZZfhTf+kcd9qihqFoZ/X9RH/EbnfxRPZwcc0HjPdG0yeEg6EXgAYlymZkcQ+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5113 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 --- 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-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 ++- 18 files changed, 36 insertions(+), 18 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 baa0c503e741..b0bb58121440 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 @@ -65,7 +65,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 93095600e808..67765c49c6dd 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 @@ -62,7 +62,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 ff4bd38f0645..5b5f1768507f 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 @@ -65,7 +65,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 1fa38ed6f59e..c1b4a9cf8435 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 @@ -62,7 +62,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-1g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi index a8cc9780c0c4..f4f7445a261c 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 @@ -61,7 +61,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 8b8bd70c9382..78bf1c1e09c2 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 @@ -61,7 +61,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 619c880b54d8..432e3da63584 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 @@ -61,7 +61,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 d7ebb73a400d..a92d88685b91 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 @@ -61,7 +61,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 b151d696a069..af70c159d030 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 @@ -61,7 +61,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 adc0ae0013a3..da46fd9aab2e 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 @@ -61,7 +61,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 435047e0e250..50c1b75c073f 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 @@ -62,7 +62,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 c098657cca0a..03ed8d83adde 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 @@ -62,7 +62,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 9d06824815f3..ced05a914e36 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 @@ -61,7 +61,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 70e947730c4b..de6be3e6db36 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 @@ -61,7 +61,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 ad96e6529595..053cb568529e 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 @@ -61,7 +61,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 034bc4b71f7a..448a73c24d1c 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 @@ -61,7 +61,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 93ca23d82b39..5d388ab4268b 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 @@ -61,7 +61,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 23b3117a2fd2..fb262d9e0c01 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 @@ -61,7 +61,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 Mon Jul 11 16:05:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12914003 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2E82C43334 for ; Mon, 11 Jul 2022 16:07:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230150AbiGKQHB (ORCPT ); Mon, 11 Jul 2022 12:07:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231829AbiGKQGl (ORCPT ); Mon, 11 Jul 2022 12:06:41 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2059.outbound.protection.outlook.com [40.107.22.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C427C77A53; Mon, 11 Jul 2022 09:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ayShGProG0OxqeiVBuD4GPYjttDo9XL2nMPndo9GykZCTQ9msSDKhDv+iSVR8TOLCsyAgL/6dbYzsJDwNm5KgJlJ5p3WHCcXpcyfxJ7bdA+K3rJHYIPJo8NZX+Y4j2/4yOA/3S/cCsiixIUdAdp8aqEhYoUbLTx9zNxp8alnYk8EuUWJOJ8PQslaWp/xaqS6axw1nTkPj8wGgHgP5lHQfGdQ4qy0w/fgtnBw3WK5ZUnsGb/pZGQ/VQA5XnVF7ZsSGGlLlKTv1QIfXFbQcVa6JEk3xfEdPHG+wQnkYCeQnBuFnFcffkhLVRDalA5PSQVP1u5gqgpULstP/QbYD/Cq6w== 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=QsnF6KwrnOBQj3Vyo4Ii1tIjjSDkIAsMrXwa5Ec/fSs=; b=juYAJmHKC1THICnMakvKJnks3NfqIjMbM2LFS/x0a5h7nU2/hqLwqY5HxlyHyaOVdAmS/Qercoi8vWTucfqedrp+I8yOYt7wbN+0M5wKATpOXCindKyYPaQA3hSSp8pgIBYmRm/MrWbRmrDV+0BmHEOcQmXscY7dZm9gbRhD14CVg+Qev+oF0wgLeYIPriuLcWc2Es57UfvkHf1UZLYa/7tAWGH6ThQjCQuO8+3VV5NtbS+7WQMrslnOmWcDn+aiFiWLGEY5MmheeS1pa5CgmIUgF2S6bNWe4NuiTog4pLVsUtFzutHCAqnvnS0aElhHDDib3o2lWJP5h2wr8SYU3A== 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=QsnF6KwrnOBQj3Vyo4Ii1tIjjSDkIAsMrXwa5Ec/fSs=; b=iKkVQjrCP/Swuyg39NpV+TLduKUOO2W7pF2t10itlQia3X4HYLpodPwrEXNspid2C4cPaUNcPDV7QklWDU8qxccwnvVFmAq7xYIPk6todN53z3Lc6Trq3ZMbX4wHG7/p0E/sI+nKusIitGX6CDNkegZSEvXKXcSt6hnt4uSLFgCg1cH2fdlntI9PPv0oINvGraEtAvf9mHPiTYBglxIQLPBb1ZtVRbxZpbGtZ6hs7gxTZelPMqQ6c+XLBVEbDzUpEqvOQ4hZX4J2YVtIz3rd+zJBo23HgV2eiygYVht65XaqD/Q3zV4VlgwCGTkJI2eOiZbcTHwf3d6+5A0fVaLvNg== 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:58 +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:58 +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 Subject: [RFC PATCH net-next 9/9] net: pcs: lynx: Remove remaining users of lynx_pcs_create Date: Mon, 11 Jul 2022 12:05:19 -0400 Message-Id: <20220711160519.741990-10-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220711160519.741990-1-sean.anderson@seco.com> References: <20220711160519.741990-1-sean.anderson@seco.com> 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: d362e91c-b6e4-4b78-4130-08da63573e55 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: y+DZYecDp6h3zLny8JuVdaZGd3sjyXJP2gUU4w26QxPPv/AzHoGlP+BBsyloizvilg7Xwg/1KS4ug+pORKRkEJpfesB0G78F+xyep39aHz0ctXtImgOOdGyCiKaQ3nXEWiEuTChyHy6vq0vUAFQAjymSs+DA7MoiSnS7L6wDrvwWiBiOPuTp9R+ZDKFUK7GsyxpLLwN/3s2GdRjqP+kNrnIaHW2cAj4eDELVCsdqfqCH/lImocXnETaI/xMuuAnASj21XTOVoBWxvmC3M+Dh4uEerWYSe+doINXMd5S6J+4YcNw61BsLXu5+ueX1yVM/HNjUazc/rWdLpCph4eFT7LSrOEz1qK6yBaz2STFY8ZMC4ynOu149B2MF5o6fx7r1NbelQywZMP9TnLWD6BCRTucrukFE0rw8HNI4SmtoA3294PMIIm+/kWFyBIcQJVr3YkocN4RNdCqr9zePI4T0Oycbahw/6U1+xzB3vuxwpxPryKTtTBY/gaJH4epiVQwSw1lapghPZcUnYc21PLrtydiKyhG04f1wD+Pc/xr0O4+w3l/7p1MWmzmxpOd6p5L+y3ICbnChD98aXUHc/i61kDr7qfxPSqZ1U9QXZsmIOBT/34fyD7sI6//JrtkrFplTLyL5m8mMWsY9+xx7r0XmgpYobnrbgzmBTyr5+W9kQNOzxk6o+8FahvvbMNdnMSI/v08ebIG7xpUKaFSK06m/dJadhQB6zK22F7gbKLqDIS8itWWkb8yMlzD7Kcu6wlodShsEi40hOqbgHHroeddL126naPiHOddZCqbZU0TwigHzwecbsnwD7mgRON4y+Vdn 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)(107886003)(186003)(1076003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iU0KyZ+o7gDACzP8i04Dy1KujA5OYURdic7C2zC3P9rO3eM9Bp/d09UKUUltNcH0EGuTY7nnhb6XfmNbSdy7Quc33noE6gPngmUK3hFMZsiEtwU7G3hlkL48jrC60/F7We6W8AlRRDg/9cu/zyKyZ3u/UUWHBO76U3Suoh9Qv6On/SUrftrI72KYAZJPSViRaLJi3AwKQsTmxqtr70AsXCc4Zhe302Ts1XvrCpJzIhPmkTIuWEqgTqT330k7ny+EDNDTxnyTrx5DjQPHEEHNABQD2eUwsmQJdpo9/Gj7MVchs8AwishRTeCrByEUcglPCD1LkA91/Nl+7JEIhrl9H8JD9F73nukjkDPN5Ud73fYl2nf/4pr2MmlQ4pd74p1gwpUjU5odZ9OYBOqOnuJIGKeHBKHoTC6715PZp8rInL233DqN8yz8nSpf1Nd7gASwEb7sLbrDYx5/XIXhtLJHC4TiejMqT3qGZ5EWOEW99ggre6LG8e3224ITNogayi1e7lc13zMjgtYiRW5q2dWPFylbC5y68sYgMbp+YP0D62XbpwzmspPjo58egHgALYvQL8TLlbFkQVpYfkXHKI8Jb4RyifJuq3pX1rCjRt0L3XGyXOx+CF63wxgt15hMDy26RfRR8jFy5yFYO3TiOUCsHDVbPIcJ+YTc8gTJWAJOXwiXT+iryOSZ4Ssex8mcUA2QFTpRTvciDzuhe8qGDh6GF5arar29VSVF4qsFmmA5JdvaeSAsHQiOxfyqpJ+fcQTBtQ0P47fzvCgF5I2DzGgEnyM4o1PT6eInVfnY0PlmhjAC+HI4U2DZvLcJsMtG7MATbujhdAGiNOC+dAo7RBVge0EcvqvXFovCdTOz68Z3zbhZ9P75WHpsiWvGlqCz9EzmGY3NZ9G2XaUeQNqGp6jZOCBzInxoOlB89PhcbKMNTKQy4ruGn84nzQvydmUQXc9xUDzV1VFGIB+g2mfM7fYwLgbW6s9umfYOSRPWlhFkRwPQRKTujTZPBZYYSluo0z7CMcL4IFVAXvAMfff76YNvX2okV6xWf2S4Lv0Nb5mLam5D+Pxq9Jp7ZJfucQ+FR6dOWnbnCjEAfbf9NOl0vYdtzCAde1IqZx2zrxvyQZvbLaAUR/75dZlWYalhAKz+FRKZ0BlfQvkfS12AvR5+DU6w1DCxEV4DP7SimtMRonNwtP/EPv1+S5FDjWK4aDDZtp/bGRl66qs6KMvdPKSL2j5JAfdDTWHWb2Sy9fgAr2skDFZQco0UGLT4j3FxpUV+egMOsQa9WJ3yxfPONfiGhlFuDIazRdwsuY1fLnh/vyPGdctTolIMPmEfrHudKagidP0p93mBbydLABLx76AgSzzgYq7HOHMAfVwd1CcKfbtEP7+RRgRVUQ1tgO0upo2ZxJbv3GQmgKzCg8aF8QDoqot+udzjMPJAwiHarR4lE0Na6ZPljAPx0gox+2yGuccYdXaJvN+S50FTyNcF9ttFi2XxiCRlExVeiqggAJPQFWZcyFSAMb+MLJkOyle2F+M0sy22Jgona9RN21gYDwNTU0K7GvGugzX2x4eSWoDyh/c/EG2ZOcVLSAI3j8YXHTkrrqT4rpsuB3HFlOW+9an+fkk9Zg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: d362e91c-b6e4-4b78-4130-08da63573e55 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:58.8706 (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: v9belI9yBAh7ol7UZ1jO4Lm2seG/6J3Jn9juLC/zofgsRSy+X2oynGAaf8lETRgaB4M1nWyTfHL3ZqvEMFEf8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5113 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Now that PCS devices have a compatible string, we no longer have to bind the driver manually in lynx_pcs_create. Remove it, and convert the remaining users to pcs_get_by_fwnode. Signed-off-by: Sean Anderson --- This requires that all PCSs have a compatible string. For a reasonable window of compatibility, this should be applied one major release after all compatible strings are added. .../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 27 ++----------------- drivers/net/pcs/pcs-lynx.c | 19 ------------- include/linux/pcs-lynx.h | 1 - 3 files changed, 2 insertions(+), 45 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c index d8b491ffa4db..1c1cd935ec1d 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c @@ -247,32 +247,9 @@ 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); - mdio_device_free(mdiodev); + mac->pcs = pcs_get_by_fwnode(dpmac_node, NULL); if (IS_ERR(mac->pcs)) { - netdev_err(mac->net_dev, "lynx_pcs_create() failed\n"); - put_device(&mdiodev->dev); + netdev_err(mac->net_dev, "pcs_get_by_fwnode() failed\n"); return PTR_ERR(mac->pcs); } diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index bfa72d9cbcf9..f4a70a1a73fe 100644 --- a/drivers/net/pcs/pcs-lynx.c +++ b/drivers/net/pcs/pcs-lynx.c @@ -376,25 +376,6 @@ static struct mdio_driver lynx_pcs_driver = { }; mdio_module_driver(lynx_pcs_driver); -struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) -{ - struct device *dev = &mdio->dev; - int err; - - /* For compatibility with device trees lacking compatible strings, we - * bind the device manually here. - */ - err = device_driver_attach(&lynx_pcs_driver.mdiodrv.driver, dev); - if (err && err != -EBUSY) { - if (err == -EAGAIN) - err = -EPROBE_DEFER; - return ERR_PTR(err); - } - - return pcs_get_by_provider(&mdio->dev); -} -EXPORT_SYMBOL(lynx_pcs_create); - struct phylink_pcs *lynx_pcs_create_on_bus(struct mii_bus *bus, int addr) { struct mdio_device *mdio; diff --git a/include/linux/pcs-lynx.h b/include/linux/pcs-lynx.h index 61caa59a069c..54dacabc0884 100644 --- a/include/linux/pcs-lynx.h +++ b/include/linux/pcs-lynx.h @@ -9,7 +9,6 @@ #include #include -struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio); struct phylink_pcs *lynx_pcs_create_on_bus(struct mii_bus *bus, int addr); #endif /* __LINUX_PCS_LYNX_H */