From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF31E404BDA for ; Thu, 9 Jul 2026 09:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783591060; cv=none; b=h/YaDAOS0NjtHWUEYK5oAm3a0w2vhptTr/VVcabCSOiz6SQRuAoxPlcBNbaCoweaWbYoHLHy/ltpmzzhMO9/AmMRqoQJkhHtRlXLsVdGg3Fw3BdeSbr6G/XaMtFIgm6QKLBg3MLZEsAEJvszEL8yc8VZUI2PTc8dHBCY3uhk86o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783591060; c=relaxed/simple; bh=Pzovs7+ceuL9Gbq7CF1bSTvbNZrIKxrZaUVNj+KFrLU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jAqB6lAyBaM+fQG4n/WNN5QSI8JGy5SlDLxwGSqF/hf2VAGYWrW6WLGYkys/uV7g7Zw9q01AjQ7oQDdJbk0b+JrQNYlp3rAIaNoEp6J5NY7aAOq+pMNk45tlO4eenBQ7yXKzcMQuVWxkTXbUrzxxcodPqOWGfVk5joZqcjud/Ks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=RnpOXyE1; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="RnpOXyE1" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 2B5834E40D13; Thu, 9 Jul 2026 09:57:35 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id EB2A35FF03; Thu, 9 Jul 2026 09:57:34 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 04C9311BC372F; Thu, 9 Jul 2026 11:57:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1783591054; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=/gkI1MXnCEYH3Di825+Sh3B3L9iCOKimmTxO6EW759A=; b=RnpOXyE16ndyZJ/dMZSZ7JBLpKIqyfsthPU6taRnVRv7UodYqcjYd6Q9uCpZHoD/xQ2bQl a9YLpVXww/on8k8TZIut0aEvyMo2D+YGgbmxq8ikCx34FQcROgiEqgiJ0WGV5Kr3xKKSeg Mk3ah6yzyZjaR2O4aGsrZAEfQao2P3VcIPck2WOSjIXgHFCuItRqK3H2+RNwzpNiwbflG1 OLatsWGIC/HCthDIGz1vFrqB3LzTluYTUYpTBaV+tYx5Gq0gTOkc48RaMgrz81utbI959i Rs1mcFIdJpW9tyv2ySb/Hhts4rS0zFllMtLoiW5a2nnVYbby8e0TAbIjTBq9zQ== Message-ID: <9d4bab68-6383-4b8d-a9d0-144b348e937c@bootlin.com> Date: Thu, 9 Jul 2026 11:57:28 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Question: net: phy: realtek: RTL8211FS SGMII bridge mode support To: Jacky Huang , Andrew Lunn , Heiner Kallweit Cc: Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Daniel Golle , Vladimir Oltean , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260709035244.3008436-1-jackyhuang@nvidia.com> From: Maxime Chevallier Content-Language: en-US In-Reply-To: <20260709035244.3008436-1-jackyhuang@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 Hi, On 7/9/26 05:52, Jacky Huang wrote: > Hi, > > RTL8211FS is the SGMII-capable variant of RTL8211F. Besides the standard > copper/RGMII mode, it supports hardware-strapped RGMII-to-SGMII bridge mode, > where the MAC side uses RGMII and the line side uses SGMII. > > The in-tree realtek driver currently does not handle this mode. RTL8211FS > shares the same PHY ID as RTL8211F (0x001cc916), so the driver binds it > as a standard RTL8211F and follows the existing copper/RGMII path. In > RGMII-to-SGMII bridge mode, this means read_status() does not observe the > SGMII-side link and the link stays down. > > We have discussed this with Realtek. They confirmed that the current mode > can be detected from a vendor mode-selection register shared by RTL8211F > variants, and that this case is application-dependent rather than generic > copper PHY behavior. > > Our plan is to add RTL8211FS bridge mode support inside the realtek > driver, gated on the detected mode. The driver would only read this > register for detection and would not use it to override the hardware > strapping. For that mode, config_init() would program the SGMII side as > needed, and read_status() would read the SGMII-side link status instead > of relying on the copper path. The existing RTL8211F copper/RGMII behavior > would be left unchanged. > > Does this approach sound acceptable for upstream? If you prefer a > different model, or if there is already related work that we should build > on, please let me know. If you can tell the mode based on the straps, that's OK :) There are other drivers that do the same, for example the TI dp83869 (it's not based on a strap value, but rather a custom DT property, but it's the same idea), or some broadcom drivers that read strap state from registers and switch to fiber mode. What's missing is proper support for what comes after the SGMII bridge, if you have an SFP after for example, there's all the plumbing to support handling that SFP module, however there's no way (yet) to handle the PHY within that module, as you'll have : MAC - RGMII - PHY - SGMII - PHY ^ | nothing handles the state machine of that one PHY If you have a DSA switch on that SGMII link though, it may "just work" as long as you correctly read the status and configure inband aned on the SGMII side. Maxime