From: Klaus Kudielka Subject: Re: [RFC] phylink: support for devices with MAC sharing SFP cage & PHY (e.g. Turris Omnia) Date: Mon, 31 Dec 2018 12:24:18 +0100 Message-ID: <62ef7a14-69ad-d517-b10b-dacabf9188d9@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; format=flowed Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, Florian Fainelli , Heiner Kallweit , Russell King , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Tomas Hlavacek To: Andrew Lunn Return-path: Received: from mail-ed1-f46.google.com ([209.85.208.46]:37072 "EHLO mail-ed1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727078AbeLaL0b (ORCPT ); Mon, 31 Dec 2018 06:26:31 -0500 Received: by mail-ed1-f46.google.com with SMTP id h15so22354307edb.4 for ; Mon, 31 Dec 2018 03:26:30 -0800 (PST) In-Reply-To: <20181230095105.GA24825@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 30.12.18 10:51, Andrew Lunn wrote: > 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. This decision is taken by hardware? I am just wondering how the outcome would be detected unambiguously by software. (Any documentation?) > 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. Okay, here the decision for the MUX would be taken by software. > 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. That would be the ideal solution for the Omnia. > 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. Such a "generic" solution would be restricted (per MAC) to a maximum of one SFP (fiber or copper), and one separate PHY, right? The main difference between boards would be the switching logic. Klaus