From: Florian Fainelli Subject: Re: [RFC] phylink: support for devices with MAC sharing SFP cage & PHY (e.g. Turris Omnia) Date: Sun, 30 Dec 2018 14:35:32 -0800 Message-ID: <3c9d3f80-f42e-fd6d-693f-cd190b444398@gmail.com> References: <97244846-c507-113b-3353-dddc6a50d72b@gmail.com> <20181230095105.GA24825@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, Heiner Kallweit , Russell King , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Tomas Hlavacek To: Andrew Lunn , Klaus Kudielka Return-path: Received: from mail-ot1-f47.google.com ([209.85.210.47]:44752 "EHLO mail-ot1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726727AbeL3Wfg (ORCPT ); Sun, 30 Dec 2018 17:35:36 -0500 Received: by mail-ot1-f47.google.com with SMTP id f18so22474359otl.11 for ; Sun, 30 Dec 2018 14:35:35 -0800 (PST) In-Reply-To: <20181230095105.GA24825@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Le 12/30/18 à 1:51 AM, Andrew Lunn a écrit : > On Sun, Dec 30, 2018 at 09:25:53AM +0100, Klaus Kudielka wrote: >> Hello, > > Hi Klaus > > Thanks for reposting on the correct list. > >> Apart from the 88E1514 PHY specified for eth2, the device also >> features an SFP cage, which uses the same SGMII of the Armada >> 385 SoC (a 2:1 multiplexer is driven by the MOD_DEF0 signal). > > Some of the Marvell Ethernet switches have a similar setup. Some ports > have both an internal PHY and a SERDES port which can be connected to > an SFP cage. Whichever gets link first is connected to the MAC. I can > also imagine a slightly different setup to what you have, the MUX is > controlled via a GPIO, not MOD_DEF0, so again, you want both active > until one gets link, although SFP LOS is not very reliable for this. > > So we need a generic solution to this. In your case, the PHY should be > configured down when the SFP is present, but then made active when the > SFP is unplugged. For the Marvell switch, we need both SFP and PHY > active until one gets a link, and then the other configured down. So > it sounds like we need some board specific code involved to implement > the board specific parts. There are at least two user space configuration knobs that we could extend to support dynamically switching between copper and fiber interface: ethtool -s port tp|mii|fiber.. or devlink port type eth media copper|sfp Would that work here? -- Florian