From patchwork Mon Nov 12 12:29:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10678587 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D3F114DB for ; Mon, 12 Nov 2018 12:30:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A5F429CED for ; Mon, 12 Nov 2018 12:30:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D50329CF2; Mon, 12 Nov 2018 12:30:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7BD7229CED for ; Mon, 12 Nov 2018 12:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date: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=Tb8jDYb/gjz5NMS7xOBzi53DHvh0ltHmCmltLgAHMdY=; b=Ub1HnBTe4MLuq6 Tn2cmuTF5JPk63nSZ37YLBxOkAfLM22RTleWPoikAi0UbwOesfdYBVzaucICCQIo9Ab8ZETlSWdj+ W7NuGK44Z3M7i4Xf5LWCHGaAQ+5aM601xkMnyqWF6uABA+4cdfwQryYTyBv+wz2PhTAm50y37Rq53 AmbkZ1OMZXx2K0ZpggQ/vUo8wZPGWwMtK2ZzYROq94GoBI6oQpYKyM+moO4Z7vRP+bw0ci/mBAK1l vtHkqfbOMN5QfxIxQ5ZupdzAJWOOWprjT3/Y5VCPDMLHbn9X4za4STDwJFRRBaJBjoMHZFs0/9dBi WHOfzkcjbEPxoBqukEfg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMBM4-00054O-DO; Mon, 12 Nov 2018 12:30:12 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMBLx-0003pM-Oe for linux-arm-kernel@lists.infradead.org; Mon, 12 Nov 2018 12:30:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wOk1zDBh5XI1vWo40NSfj915rkE1AamsxyF4yOavUj0=; b=OStf5TInc9q3rCgM6+1rznmzb v40GhJJMhkJGYDfuDcSRMlqph0ZyoJmhz9WAShx58OotuMVPc+G9ttB/ustpFkbckWaZcwTeha8Zj WiDTn1u40AwUTLguSXF/4rPXM3vJpTokqq6rI62zgmvUhmvgAsd8CAX1uZO8hLmLPGpjQ=; Received: from n2100.armlinux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:40411) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1gMBLW-00027d-Pc; Mon, 12 Nov 2018 12:29:38 +0000 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1gMBLT-0003j8-Me; Mon, 12 Nov 2018 12:29:35 +0000 Date: Mon, 12 Nov 2018 12:29:33 +0000 From: Russell King - ARM Linux To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Subject: [RFC PATCH 0/6] Armada 38x comphy driver to support 2.5Gbps networking Message-ID: <20181112122933.GD30658@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181112_043005_813662_2355A72E X-CRM114-Status: GOOD ( 17.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Andrew Lunn , Jason Cooper , Gregory Clement , Kishon Vijay Abraham I , Rob Herring , Maxime Chevallier , Thomas Petazzoni , Sebastian Hesselbarth Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This series adds support for dynamically switching between 1Gbps and 2.5Gbps networking for the Marvell Armada 38x SoCs, tested on Armada 388 on the Clearfog platform. This is necessary to be able to connect (eg) a Clearfog platform with a Macchiatobin platform via the SFP sockets, as Clearfog currently only supports 1Gbps networking via the SFP socket and Macchiatobin defaults to 2.5Gbps when using Fiberchannel SFPs. In order to allow dynamic switching, we need to implement a common phy driver to switch the ethernet serdes lane speed - 2.5Gbps is just 1Gbps up-clocked by 2.5x. We implement a simple comphy driver to achieve this, which only supports networking. With this, we are able to support both Fiberchannel SFPs operating at 2.5Gbps or 1Gbps, and 1G ethernet SFPs plugged into the Clearfog platform, dynamically selecting according to the SFPs abilities. I'm aware of the proposed changes to the PHY layer, changing phy_set_mode() to take the ethernet phy interface type, hence why this is RFC - there's also the question about how this will be merged. This series is currently based on 4.20-rc1, but will likely need to be rebased when the PHY layer changes hit. .../bindings/net/marvell-armada-370-neta.txt | 2 +- .../bindings/phy/phy-armada38x-comphy.txt | 40 ++++ arch/arm/boot/dts/armada-388-clearfog.dtsi | 2 + arch/arm/boot/dts/armada-38x.dtsi | 37 ++++ drivers/net/ethernet/marvell/mvneta.c | 58 ++++- drivers/phy/marvell/Kconfig | 10 + drivers/phy/marvell/Makefile | 1 + drivers/phy/marvell/phy-armada38x-comphy.c | 236 +++++++++++++++++++++ 8 files changed, 378 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/phy-armada38x-comphy.txt create mode 100644 drivers/phy/marvell/phy-armada38x-comphy.c