From patchwork Wed Mar 9 14:37:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 12775189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B3C9C433EF for ; Wed, 9 Mar 2022 14:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=oiAfy6K9RSnrka8F0N8H+vhYmikKlHQEasNYZTS949g=; b=DDabqRBP3GMZip fFADlQDKn6wuh/rNUbYCUB/LdCQcY4n9RLM7C+1Yh/5HIiAQEbFeuBQRUfs4qdXwwxbQWoqUIir+O 4yMCDNHmKpgy0NVEp4aZ3hpjWU6dUyl43kat+kmMCFMBh6wTivopj94bnix1oXGM14Y8n4cxDQXDV eK1pe0eWGZfddFYm+QaOasPzNrQa0AqZ9YSrKWR8acrSDu9PiFhk/jG+jXmhbaa5KvUnqAJP3yYpn HTFM3dm5KSdMBmXg3PdGUjCiWlAk1DWEDbWaJ/A5vEkJC/25sPkmVNDn2743SjhIPOTBhG74S7zsR firIsqh95t4l2tBhD7pA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRxg7-0095GY-BY; Wed, 09 Mar 2022 14:52:39 +0000 Received: from mail-db5eur03on0600.outbound.protection.outlook.com ([2a01:111:f400:fe0a::600] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRxg4-0095FL-5I for linux-phy@lists.infradead.org; Wed, 09 Mar 2022 14:52:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RChnBvB3+0+6ft38gpc+9NPv9ZePISCTAYTdBKiFqGZ5PVgbErPJ9x0o94lAWCX6cJNvgrRJU7Ol9M7lk7R+XVoPcw21chb72S93GxpHNgXZoN4QwSfuPceFot3cugR6uO4lv5C4M92Ea6+DUFBs8r08OTBfrrmIJaQ5NO0otHa5hS2JZvfnSVPJPbSLA7lGGCvRnlrNzzhQG5K6dnO3v/o6MeQ4ORggC4CbGYfeVl4PzR2eYRXdMpANpLpMXsL8khEo2FBsivf8XtmQGpr1BO95iEDDbNbt3PbKBIoKX+aI2L2QaJbYNEf/ylt1kZQXiivtFsqeDyEJsDXG9OOMIg== 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=0VCasTUXaeikggrAN81JeYfa2grSxUwVk1CW6TATm0I=; b=VsVZM4BbQ0rBUqlsPR8Xyu3oHhfuX4tskloeE3V6xRmbrMX/3WtzeHl7DlDvJ5d2tJwOcBkdhtPXR3CZMRhHFfvKd9iNpuOl2O4JqF314U0gP1791Vo5AJH/PzODvq4YKKwOZr3geM0u64ZB+QGSfWDnLxi0Yl+37hkMM/t2R0d/AaBYyTBt5fKgTyP/+qriuBlndeP5pCorsgpHdsKaH5e+em6Y2UpizHlYktjvDOEn6duNC4eiBqrnLDO2V+NgEc06nFEOjYyV63OVHrgdzj8z49PWzcGNCTD9Eyi6VdITWjM/yljyBMwhrjIFq0hckdWxOgAxaMSZOZd/WdVkmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0VCasTUXaeikggrAN81JeYfa2grSxUwVk1CW6TATm0I=; b=C19uuXhbg0E81fO8/79ACaJak4q1D3s6DeWcuquit4xDNJmITrO2CQAwD6LRbujlaUmqaqeetCDx2keVzae0+ks5qW4dM4YHvGfoW0H77TE2klti0dzlURk8kevb2mP9OXKTa5KLH1hYmdXAXXcXSeyMAN1MIjKIJpOkC+XQ/20= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM9PR04MB8555.eurprd04.prod.outlook.com (2603:10a6:20b:436::16) by VI1PR04MB6223.eurprd04.prod.outlook.com (2603:10a6:803:fa::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 9 Mar 2022 14:38:17 +0000 Received: from AM9PR04MB8555.eurprd04.prod.outlook.com ([fe80::c58c:4cac:5bf9:5579]) by AM9PR04MB8555.eurprd04.prod.outlook.com ([fe80::c58c:4cac:5bf9:5579%7]) with mapi id 15.20.5038.027; Wed, 9 Mar 2022 14:38:17 +0000 From: Ioana Ciornei To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: kishon@ti.com, vkoul@kernel.org, robh+dt@kernel.org, leoyang.li@nxp.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, Ioana Ciornei Subject: [PATCH net-next 0/8] dpaa2-mac: add support for changing the protocol at runtime Date: Wed, 9 Mar 2022 16:37:43 +0200 Message-Id: <20220309143751.3362678-1-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.33.1 X-ClientProxiedBy: AM0PR02CA0187.eurprd02.prod.outlook.com (2603:10a6:20b:28e::24) To AM9PR04MB8555.eurprd04.prod.outlook.com (2603:10a6:20b:436::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3dc4170c-3462-4fcd-56b1-08da01da72f6 X-MS-TrafficTypeDiagnostic: VI1PR04MB6223:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rnnrRrRNpNMjLTa8egYJS6iYtEPvliQn/xT3VEkA+Lb65PjdjhUXD3CiFXGKDYp1UEPr24/vAZMxJhv4uQoq9NFp3ArszJPGCsDBQSqFPEQI8zlM0dIFoidzWEuYT4DfaDVnHaC4x8P1/s7yzEx3Dt/gnq10Q0+LJAqw4sUgXP6RgGbqy7pX4lzoJuPkkH0Dw7TkiRMhhyu7bR8OnLa5dAYZd99QIOAHJdDI2yQl1ixKo/rBxTZvrbgJxoa9Ax2qbFNMkh3nFO0XAJep21s3X2iTqNBxMdT+1gUJ7wYRJfbZ58fVjZbxHmo0ZrZHDzZVVyY9eO1xq8YE9M6oP1ip31nJABZ2n9EBy6avTt6xAxKZbhaSWmmQSP0pokwhi9yUOfRCaQvGqrzW3Auem0jPuL7nvUDSiMYz5/kMNYREpAJuW4t6g1dyQIBCzhtq15O+o/7fjjVw86nI4jo88GBWSh0S0HUk8Z7AsfdBlSxCf1g4yz7/VMiQ8JfpXbNlJcMkoEqn+072tEag9/2/NxTkx3sHunM/SMW/e+ZshAFy20CLSa92WinfsM1QP6a+H+qiMPlx7fEkIulubvVCXw1wPqDdBf9O9Nb1c3sW81FdKmwJsjXzzY5d//18nrAqDczy5GC6Se4iRu9PEbt7g7ZUtvI3jy/RjoncqIubF4hVND+oec1gYBcumxquLbBW17O8vZVXY4gNlQDTNSQ/LE+pRA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR04MB8555.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6506007)(6512007)(86362001)(44832011)(52116002)(36756003)(66476007)(66556008)(8936002)(66946007)(8676002)(26005)(5660300002)(498600001)(2906002)(4326008)(6666004)(83380400001)(38350700002)(38100700002)(6486002)(2616005)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: s0wkzB3d4xr4kw/jHQPkW8FKXT5k/Ige0HeXpcKLnqxMh3Cr59NLCfs5hr8UL9Re5re9ucUq72xrW20Ur+7Umj1FNQpz6ppv4aZHCFmzyPwvXllqIAIKzneYQOLZpolp520jPd4PsSrIxSCpbSSRbMOSyky/5wBueqK5uAVkz3u4JljHLr9sjYACgXWVvS8TKksSUUDq8+yPwdpgn1JZ/NDgsl25mZ1OqgzHYagoEPegyDhEGmul5TSexCxQOCZSFeP3yef9Uko32z1V0VXjPIvCz/cg9+IR7CnsWDKqlXrIjdWtwCv2D5ddzDutFzCLYNfuKiIjemhoGj8LLzXDekqxqzkSCVyrfq4PVK1EyTKNd3WEdXC52FHFaLEcfHxgmrNXJRqk45P8XjUIS+7mo9sQNB8pFyEThwGqjckxlfD6ShRYn2qXUZe+MwVdg9vQ1BMbR3WQbhtXj1GCGr+avaOiYhMkosk1LLNeRrPNQAsTiJDP9haIA2UBbX3l6H3LaSsL4MBwh+5BqdElHLpKbwvWwmvH7cfk5e6VhsyZJXHvGobuuqG5DPGoMaFjMCI3X2v3C8/f+LhlqLiPuEWGm40msbxhOrKJ/gwyYWpEGRRQACgXClkckTbrk1eXx2uMJaNpbI2El5KaW3F+MjJwtjS7cBxucATpU+1gHcRtnfFg1TUn61najH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od.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2022 14:38:17.0997 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f6dC57Dxxee1deflqqEq1Bu3NGQBWYHJNu8/v3MlGH6vskGr/WtvBuc+7bNUmZqsUyhE/sjLyegV0Wo8tVXJ0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6223 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220309_065236_237973_ACA52BE7 X-CRM114-Status: GOOD ( 18.62 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org This patch set adds support for changing the Ethernet protocol at runtime on Layerscape SoCs which have the Lynx 28G SerDes block. The first two patches add a new generic PHY driver for the Lynx 28G and the bindings file associated. The driver reads the PLL configuration at probe time (the frequency provided to the lanes) and determines what protocols can be supported. Based on this the driver can deny or approve a request from the dpaa2-mac to setup a new protocol. The next 2 patches add some MC APIs for inquiring what is the running version of firmware and setting up a new protocol on the MAC. Moving along, we extract the code for setting up the supported interfaces on a MAC on a different function since in the next patches will update the logic. In the next patch, the dpaa2-mac is updated so that it retrieves the SerDes PHY based on the OF node and in case of a major reconfig, call the PHY driver to set up the new protocol on the associated lane and the MC firmware to reconfigure the MAC side of things. Finally, the LX2160A dtsi is annotated with the SerDes PHY nodes for the 1st SerDes block. Beside this, the LX2160A Clearfog dtsi is annotated with the 'phys' property for the exposed SFP cages. Ioana Ciornei (8): phy: add support for the Layerscape SerDes 28G dt-bindings: phy: add the "fsl,lynx-28g" compatible dpaa2-mac: add the MC API for retrieving the version dpaa2-mac: add the MC API for reconfiguring the protocol dpaa2-mac: retrieve API version and detect features dpaa2-mac: move setting up supported_interfaces into a function dpaa2-mac: configure the SerDes phy on a protocol change arch: arm64: dts: lx2160a: describe the SerDes block #1 .../devicetree/bindings/phy/fsl,lynx-28g.yaml | 71 ++ MAINTAINERS | 7 + .../freescale/fsl-lx2160a-clearfog-itx.dtsi | 4 + .../arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 41 ++ .../net/ethernet/freescale/dpaa2/dpaa2-eth.c | 5 +- .../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 164 ++++- .../net/ethernet/freescale/dpaa2/dpaa2-mac.h | 8 + .../ethernet/freescale/dpaa2/dpaa2-switch.c | 5 +- .../net/ethernet/freescale/dpaa2/dpmac-cmd.h | 12 + drivers/net/ethernet/freescale/dpaa2/dpmac.c | 54 ++ drivers/net/ethernet/freescale/dpaa2/dpmac.h | 5 + drivers/phy/freescale/Kconfig | 10 + drivers/phy/freescale/Makefile | 1 + drivers/phy/freescale/phy-fsl-lynx-28g.c | 629 ++++++++++++++++++ 14 files changed, 995 insertions(+), 21 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/fsl,lynx-28g.yaml create mode 100644 drivers/phy/freescale/phy-fsl-lynx-28g.c