public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted
@ 2025-12-03 21:08 Marek Vasut
  2025-12-03 21:08 ` [net-next,PATCH v2 2/3] dt-bindings: net: realtek,rtl82xx: Document realtek,ssc-enable property Marek Vasut
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Marek Vasut @ 2025-12-03 21:08 UTC (permalink / raw)
  To: netdev
  Cc: Marek Vasut, David S. Miller, Aleksander Jan Bajkowski,
	Andrew Lunn, Conor Dooley, Eric Dumazet, Florian Fainelli,
	Heiner Kallweit, Ivan Galkin, Jakub Kicinski, Krzysztof Kozlowski,
	Michael Klein, Paolo Abeni, Rob Herring, Russell King,
	Vladimir Oltean, devicetree

Sort the documented properties alphabetically, no functional change.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
---
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Aleksander Jan Bajkowski <olek2@wp.pl>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Ivan Galkin <ivan.galkin@axis.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Michael Klein <michael@fossekall.de>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: devicetree@vger.kernel.org
Cc: netdev@vger.kernel.org
---
V2: No change
---
 .../devicetree/bindings/net/realtek,rtl82xx.yaml          | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml b/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml
index 2b5697bd7c5df..eafcc2f3e3d66 100644
--- a/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml
+++ b/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml
@@ -40,15 +40,15 @@ properties:
 
   leds: true
 
-  realtek,clkout-disable:
+  realtek,aldps-enable:
     type: boolean
     description:
-      Disable CLKOUT clock, CLKOUT clock default is enabled after hardware reset.
+      Enable ALDPS mode, ALDPS mode default is disabled after hardware reset.
 
-  realtek,aldps-enable:
+  realtek,clkout-disable:
     type: boolean
     description:
-      Enable ALDPS mode, ALDPS mode default is disabled after hardware reset.
+      Disable CLKOUT clock, CLKOUT clock default is enabled after hardware reset.
 
   wakeup-source:
     type: boolean
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [net-next,PATCH v2 2/3] dt-bindings: net: realtek,rtl82xx: Document realtek,ssc-enable property
  2025-12-03 21:08 [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted Marek Vasut
@ 2025-12-03 21:08 ` Marek Vasut
  2025-12-05  9:04   ` Krzysztof Kozlowski
  2025-12-03 21:08 ` [net-next,PATCH v2 3/3] net: phy: realtek: Add property to enable SSC Marek Vasut
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Marek Vasut @ 2025-12-03 21:08 UTC (permalink / raw)
  To: netdev
  Cc: Marek Vasut, David S. Miller, Aleksander Jan Bajkowski,
	Andrew Lunn, Conor Dooley, Eric Dumazet, Florian Fainelli,
	Heiner Kallweit, Ivan Galkin, Jakub Kicinski, Krzysztof Kozlowski,
	Michael Klein, Paolo Abeni, Rob Herring, Russell King,
	Vladimir Oltean, devicetree

Document support for spread spectrum clocking (SSC) on RTL8211F(D)(I)-CG,
RTL8211FS(I)(-VS)-CG, RTL8211FG(I)(-VS)-CG PHYs. Introduce DT properties
'realtek,clkout-ssc-enable', 'realtek,rxc-ssc-enable' and
'realtek,sysclk-ssc-enable' which control CLKOUT, RXC and SYSCLK
SSC spread spectrum clocking enablement on these signals. These
clock are not exposed via the clock API, therefore assigned-clock-sscs
property does not apply.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
---
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Aleksander Jan Bajkowski <olek2@wp.pl>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Ivan Galkin <ivan.galkin@axis.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Michael Klein <michael@fossekall.de>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: devicetree@vger.kernel.org
Cc: netdev@vger.kernel.org
---
V2: Split SSC clock control for each CLKOUT, RXC, SYSCLK signal
---
 .../devicetree/bindings/net/realtek,rtl82xx.yaml  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml b/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml
index eafcc2f3e3d66..45033c31a2d51 100644
--- a/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml
+++ b/Documentation/devicetree/bindings/net/realtek,rtl82xx.yaml
@@ -50,6 +50,21 @@ properties:
     description:
       Disable CLKOUT clock, CLKOUT clock default is enabled after hardware reset.
 
+  realtek,clkout-ssc-enable:
+    type: boolean
+    description:
+      Enable CLKOUT SSC mode, CLKOUT SSC mode default is disabled after hardware reset.
+
+  realtek,rxc-ssc-enable:
+    type: boolean
+    description:
+      Enable RXC SSC mode, RXC SSC mode default is disabled after hardware reset.
+
+  realtek,sysclk-ssc-enable:
+    type: boolean
+    description:
+      Enable SYSCLK SSC mode, SYSCLK SSC mode default is disabled after hardware reset.
+
   wakeup-source:
     type: boolean
     description:
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [net-next,PATCH v2 3/3] net: phy: realtek: Add property to enable SSC
  2025-12-03 21:08 [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted Marek Vasut
  2025-12-03 21:08 ` [net-next,PATCH v2 2/3] dt-bindings: net: realtek,rtl82xx: Document realtek,ssc-enable property Marek Vasut
@ 2025-12-03 21:08 ` Marek Vasut
  2025-12-04 14:27   ` Ivan Galkin
  2025-12-11 18:39   ` Sai Krishna Gajula
  2025-12-04 11:04 ` [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted Paolo Abeni
  2025-12-05  9:03 ` Krzysztof Kozlowski
  3 siblings, 2 replies; 11+ messages in thread
From: Marek Vasut @ 2025-12-03 21:08 UTC (permalink / raw)
  To: netdev
  Cc: Marek Vasut, David S. Miller, Aleksander Jan Bajkowski,
	Andrew Lunn, Conor Dooley, Eric Dumazet, Florian Fainelli,
	Heiner Kallweit, Ivan Galkin, Jakub Kicinski, Krzysztof Kozlowski,
	Michael Klein, Paolo Abeni, Rob Herring, Russell King,
	Vladimir Oltean, devicetree

Add support for spread spectrum clocking (SSC) on RTL8211F(D)(I)-CG,
RTL8211FS(I)(-VS)-CG, RTL8211FG(I)(-VS)-CG PHYs. The implementation
follows EMI improvement application note Rev. 1.2 for these PHYs.

The current implementation enables SSC for both RXC and SYSCLK clock
signals. Introduce DT properties 'realtek,clkout-ssc-enable',
'realtek,rxc-ssc-enable' and 'realtek,sysclk-ssc-enable' which control
CLKOUT, RXC and SYSCLK SSC spread spectrum clocking enablement on these
signals.

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
---
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Aleksander Jan Bajkowski <olek2@wp.pl>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Ivan Galkin <ivan.galkin@axis.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Michael Klein <michael@fossekall.de>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: devicetree@vger.kernel.org
Cc: netdev@vger.kernel.org
---
V2: Split SSC clock control for each CLKOUT, RXC, SYSCLK signal
---
 drivers/net/phy/realtek/realtek_main.c | 124 +++++++++++++++++++++++++
 1 file changed, 124 insertions(+)

diff --git a/drivers/net/phy/realtek/realtek_main.c b/drivers/net/phy/realtek/realtek_main.c
index 67ecf3d4af2b1..ac80653cdbe28 100644
--- a/drivers/net/phy/realtek/realtek_main.c
+++ b/drivers/net/phy/realtek/realtek_main.c
@@ -74,11 +74,19 @@
 
 #define RTL8211F_PHYCR2				0x19
 #define RTL8211F_CLKOUT_EN			BIT(0)
+#define RTL8211F_SYSCLK_SSC_EN			BIT(3)
 #define RTL8211F_PHYCR2_PHY_EEE_ENABLE		BIT(5)
+#define RTL8211F_CLKOUT_SSC_EN			BIT(7)
 
 #define RTL8211F_INSR_PAGE			0xa43
 #define RTL8211F_INSR				0x1d
 
+/* RTL8211F SSC settings */
+#define RTL8211F_SSC_PAGE			0xc44
+#define RTL8211F_SSC_RXC			0x13
+#define RTL8211F_SSC_SYSCLK			0x17
+#define RTL8211F_SSC_CLKOUT			0x19
+
 /* RTL8211F LED configuration */
 #define RTL8211F_LEDCR_PAGE			0xd04
 #define RTL8211F_LEDCR				0x10
@@ -203,6 +211,9 @@ MODULE_LICENSE("GPL");
 struct rtl821x_priv {
 	bool enable_aldps;
 	bool disable_clk_out;
+	bool enable_clkout_ssc;
+	bool enable_rxc_ssc;
+	bool enable_sysclk_ssc;
 	struct clk *clk;
 	/* rtl8211f */
 	u16 iner;
@@ -266,6 +277,12 @@ static int rtl821x_probe(struct phy_device *phydev)
 						   "realtek,aldps-enable");
 	priv->disable_clk_out = of_property_read_bool(dev->of_node,
 						      "realtek,clkout-disable");
+	priv->enable_clkout_ssc = of_property_read_bool(dev->of_node,
+							"realtek,clkout-ssc-enable");
+	priv->enable_rxc_ssc = of_property_read_bool(dev->of_node,
+						     "realtek,rxc-ssc-enable");
+	priv->enable_sysclk_ssc = of_property_read_bool(dev->of_node,
+							"realtek,sysclk-ssc-enable");
 
 	phydev->priv = priv;
 
@@ -700,6 +717,101 @@ static int rtl8211f_config_phy_eee(struct phy_device *phydev)
 				RTL8211F_PHYCR2_PHY_EEE_ENABLE, 0);
 }
 
+static int rtl8211f_config_clkout_ssc(struct phy_device *phydev)
+{
+	struct rtl821x_priv *priv = phydev->priv;
+	struct device *dev = &phydev->mdio.dev;
+	int ret;
+
+	/* The value is preserved if the device tree property is absent */
+	if (!priv->enable_clkout_ssc)
+		return 0;
+
+	/* RTL8211FVD has no PHYCR2 register */
+	if (phydev->drv->phy_id == RTL_8211FVD_PHYID)
+		return 0;
+
+	/* Unnamed registers from EMI improvement parameters application note 1.2 */
+	ret = phy_write_paged(phydev, 0xd09, 0x10, 0xcf00);
+	if (ret < 0) {
+		dev_err(dev, "CLKOUT SCC initialization failed: %pe\n", ERR_PTR(ret));
+		return ret;
+	}
+
+	ret = phy_write_paged(phydev, RTL8211F_SSC_PAGE, RTL8211F_SSC_CLKOUT, 0x38c3);
+	if (ret < 0) {
+		dev_err(dev, "CLKOUT SCC configuration failed: %pe\n", ERR_PTR(ret));
+		return ret;
+	}
+
+	/*
+	 * Enable CLKOUT SSC using PHYCR2 bit 7 , this step is missing from the
+	 * EMI improvement parameters application note 1.2 section 2.3
+	 */
+	ret = phy_modify_paged(phydev, RTL8211F_PHYCR_PAGE, RTL8211F_PHYCR2,
+			       RTL8211F_CLKOUT_SSC_EN, RTL8211F_CLKOUT_SSC_EN);
+	if (ret < 0) {
+		dev_err(dev, "CLKOUT SCC enable failed: %pe\n", ERR_PTR(ret));
+		return ret;
+	}
+
+	return 0;
+}
+
+static int rtl8211f_config_rxc_ssc(struct phy_device *phydev)
+{
+	struct rtl821x_priv *priv = phydev->priv;
+	struct device *dev = &phydev->mdio.dev;
+	int ret;
+
+	/* The value is preserved if the device tree property is absent */
+	if (!priv->enable_rxc_ssc)
+		return 0;
+
+	/* RTL8211FVD has no PHYCR2 register */
+	if (phydev->drv->phy_id == RTL_8211FVD_PHYID)
+		return 0;
+
+	ret = phy_write_paged(phydev, RTL8211F_SSC_PAGE, RTL8211F_SSC_RXC, 0x5f00);
+	if (ret < 0) {
+		dev_err(dev, "RXC SCC configuration failed: %pe\n", ERR_PTR(ret));
+		return ret;
+	}
+
+	return 0;
+}
+
+static int rtl8211f_config_sysclk_ssc(struct phy_device *phydev)
+{
+	struct rtl821x_priv *priv = phydev->priv;
+	struct device *dev = &phydev->mdio.dev;
+	int ret;
+
+	/* The value is preserved if the device tree property is absent */
+	if (!priv->enable_sysclk_ssc)
+		return 0;
+
+	/* RTL8211FVD has no PHYCR2 register */
+	if (phydev->drv->phy_id == RTL_8211FVD_PHYID)
+		return 0;
+
+	ret = phy_write_paged(phydev, RTL8211F_SSC_PAGE, RTL8211F_SSC_SYSCLK, 0x4f00);
+	if (ret < 0) {
+		dev_err(dev, "SYSCLK SCC configuration failed: %pe\n", ERR_PTR(ret));
+		return ret;
+	}
+
+	/* Enable SSC */
+	ret = phy_modify_paged(phydev, RTL8211F_PHYCR_PAGE, RTL8211F_PHYCR2,
+			       RTL8211F_SYSCLK_SSC_EN, RTL8211F_SYSCLK_SSC_EN);
+	if (ret < 0) {
+		dev_err(dev, "SYSCLK SCC enable failed: %pe\n", ERR_PTR(ret));
+		return ret;
+	}
+
+	return 0;
+}
+
 static int rtl8211f_config_init(struct phy_device *phydev)
 {
 	struct device *dev = &phydev->mdio.dev;
@@ -723,6 +835,18 @@ static int rtl8211f_config_init(struct phy_device *phydev)
 		return ret;
 	}
 
+	ret = rtl8211f_config_clkout_ssc(phydev);
+	if (ret)
+		return ret;
+
+	ret = rtl8211f_config_rxc_ssc(phydev);
+	if (ret)
+		return ret;
+
+	ret = rtl8211f_config_sysclk_ssc(phydev);
+	if (ret)
+		return ret;
+
 	return rtl8211f_config_phy_eee(phydev);
 }
 
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted
  2025-12-03 21:08 [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted Marek Vasut
  2025-12-03 21:08 ` [net-next,PATCH v2 2/3] dt-bindings: net: realtek,rtl82xx: Document realtek,ssc-enable property Marek Vasut
  2025-12-03 21:08 ` [net-next,PATCH v2 3/3] net: phy: realtek: Add property to enable SSC Marek Vasut
@ 2025-12-04 11:04 ` Paolo Abeni
  2025-12-05  9:03 ` Krzysztof Kozlowski
  3 siblings, 0 replies; 11+ messages in thread
From: Paolo Abeni @ 2025-12-04 11:04 UTC (permalink / raw)
  To: Marek Vasut, netdev
  Cc: David S. Miller, Aleksander Jan Bajkowski, Andrew Lunn,
	Conor Dooley, Eric Dumazet, Florian Fainelli, Heiner Kallweit,
	Ivan Galkin, Jakub Kicinski, Krzysztof Kozlowski, Michael Klein,
	Rob Herring, Russell King, Vladimir Oltean, devicetree

On 12/3/25 10:08 PM, Marek Vasut wrote:
> Sort the documented properties alphabetically, no functional change.
> 
> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Linux tagged 6.18 final, so net-next is closed for new code submissions
per the announcement at
https://lore.kernel.org/20251130174502.3908e3ee@kernel.org


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [net-next,PATCH v2 3/3] net: phy: realtek: Add property to enable SSC
  2025-12-03 21:08 ` [net-next,PATCH v2 3/3] net: phy: realtek: Add property to enable SSC Marek Vasut
@ 2025-12-04 14:27   ` Ivan Galkin
  2025-12-11 18:39   ` Sai Krishna Gajula
  1 sibling, 0 replies; 11+ messages in thread
From: Ivan Galkin @ 2025-12-04 14:27 UTC (permalink / raw)
  To: marek.vasut@mailbox.org, netdev@vger.kernel.org
  Cc: devicetree@vger.kernel.org, andrew@lunn.ch, davem@davemloft.net,
	hkallweit1@gmail.com, michael@fossekall.de, linux@armlinux.org.uk,
	robh@kernel.org, vladimir.oltean@nxp.com, olek2@wp.pl,
	kuba@kernel.org, f.fainelli@gmail.com, edumazet@google.com,
	conor+dt@kernel.org, krzk+dt@kernel.org, pabeni@redhat.com

On Wed, 2025-12-03 at 22:08 +0100, Marek Vasut wrote:
> Add support for spread spectrum clocking (SSC) on RTL8211F(D)(I)-CG,
> RTL8211FS(I)(-VS)-CG, RTL8211FG(I)(-VS)-CG PHYs. The implementation
> follows EMI improvement application note Rev. 1.2 for these PHYs.
> 
> The current implementation enables SSC for both RXC and SYSCLK clock
> signals. Introduce DT properties 'realtek,clkout-ssc-enable',
> 'realtek,rxc-ssc-enable' and 'realtek,sysclk-ssc-enable' which
> control
> CLKOUT, RXC and SYSCLK SSC spread spectrum clocking enablement on
> these
> signals.
> 
> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
> ---
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Aleksander Jan Bajkowski <olek2@wp.pl>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Conor Dooley <conor+dt@kernel.org>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Heiner Kallweit <hkallweit1@gmail.com>
> Cc: Ivan Galkin <ivan.galkin@axis.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
> Cc: Michael Klein <michael@fossekall.de>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
> Cc: devicetree@vger.kernel.org
> Cc: netdev@vger.kernel.org
> ---
> V2: Split SSC clock control for each CLKOUT, RXC, SYSCLK signal
> ---
>  drivers/net/phy/realtek/realtek_main.c | 124
> +++++++++++++++++++++++++
>  1 file changed, 124 insertions(+)
> 
> diff --git a/drivers/net/phy/realtek/realtek_main.c
> b/drivers/net/phy/realtek/realtek_main.c
> index 67ecf3d4af2b1..ac80653cdbe28 100644
> --- a/drivers/net/phy/realtek/realtek_main.c
> +++ b/drivers/net/phy/realtek/realtek_main.c
> @@ -74,11 +74,19 @@
>  
>  #define RTL8211F_PHYCR2                                0x19
>  #define RTL8211F_CLKOUT_EN                     BIT(0)
> +#define RTL8211F_SYSCLK_SSC_EN                 BIT(3)
>  #define RTL8211F_PHYCR2_PHY_EEE_ENABLE         BIT(5)
> +#define RTL8211F_CLKOUT_SSC_EN                 BIT(7)
>  
>  #define RTL8211F_INSR_PAGE                     0xa43
>  #define RTL8211F_INSR                          0x1d
>  
> +/* RTL8211F SSC settings */
> +#define RTL8211F_SSC_PAGE                      0xc44
> +#define RTL8211F_SSC_RXC                       0x13
> +#define RTL8211F_SSC_SYSCLK                    0x17
> +#define RTL8211F_SSC_CLKOUT                    0x19
> +
>  /* RTL8211F LED configuration */
>  #define RTL8211F_LEDCR_PAGE                    0xd04
>  #define RTL8211F_LEDCR                         0x10
> @@ -203,6 +211,9 @@ MODULE_LICENSE("GPL");
>  struct rtl821x_priv {
>         bool enable_aldps;
>         bool disable_clk_out;
> +       bool enable_clkout_ssc;
> +       bool enable_rxc_ssc;
> +       bool enable_sysclk_ssc;
>         struct clk *clk;
>         /* rtl8211f */
>         u16 iner;
> @@ -266,6 +277,12 @@ static int rtl821x_probe(struct phy_device
> *phydev)
>                                                    "realtek,aldps-
> enable");
>         priv->disable_clk_out = of_property_read_bool(dev->of_node,
>                                                      
> "realtek,clkout-disable");
> +       priv->enable_clkout_ssc = of_property_read_bool(dev->of_node,
> +                                                       "realtek,clko
> ut-ssc-enable");
> +       priv->enable_rxc_ssc = of_property_read_bool(dev->of_node,
> +                                                    "realtek,rxc-
> ssc-enable");
> +       priv->enable_sysclk_ssc = of_property_read_bool(dev->of_node,
> +                                                       "realtek,sysc
> lk-ssc-enable");
>  
>         phydev->priv = priv;
>  
> @@ -700,6 +717,101 @@ static int rtl8211f_config_phy_eee(struct
> phy_device *phydev)
>                                 RTL8211F_PHYCR2_PHY_EEE_ENABLE, 0);
>  }
>  
> +static int rtl8211f_config_clkout_ssc(struct phy_device *phydev)
> +{
> +       struct rtl821x_priv *priv = phydev->priv;
> +       struct device *dev = &phydev->mdio.dev;
> +       int ret;
> +
> +       /* The value is preserved if the device tree property is
> absent */
> +       if (!priv->enable_clkout_ssc)
> +               return 0;
> +
> +       /* RTL8211FVD has no PHYCR2 register */
> +       if (phydev->drv->phy_id == RTL_8211FVD_PHYID)
> +               return 0;

I recommend rewording this comment, otherwise any manipulation of
PHYCR2 on RTL8211FVD will be considered an error. For example, PHY-mode
EEE on this PHY is still set via PHYCR2.

IMHO the technically correct comment should state that the
configuration of CLKOUT SSC is not currently supported by this driver.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted
  2025-12-03 21:08 [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted Marek Vasut
                   ` (2 preceding siblings ...)
  2025-12-04 11:04 ` [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted Paolo Abeni
@ 2025-12-05  9:03 ` Krzysztof Kozlowski
  2025-12-18 17:11   ` Marek Vasut
  3 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-05  9:03 UTC (permalink / raw)
  To: Marek Vasut
  Cc: netdev, David S. Miller, Aleksander Jan Bajkowski, Andrew Lunn,
	Conor Dooley, Eric Dumazet, Florian Fainelli, Heiner Kallweit,
	Ivan Galkin, Jakub Kicinski, Krzysztof Kozlowski, Michael Klein,
	Paolo Abeni, Rob Herring, Russell King, Vladimir Oltean,
	devicetree

On Wed, Dec 03, 2025 at 10:08:04PM +0100, Marek Vasut wrote:
> Sort the documented properties alphabetically, no functional change.

That's just churn, we don't do this for bindings.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [net-next,PATCH v2 2/3] dt-bindings: net: realtek,rtl82xx: Document realtek,ssc-enable property
  2025-12-03 21:08 ` [net-next,PATCH v2 2/3] dt-bindings: net: realtek,rtl82xx: Document realtek,ssc-enable property Marek Vasut
@ 2025-12-05  9:04   ` Krzysztof Kozlowski
  2025-12-18 17:20     ` Marek Vasut
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-05  9:04 UTC (permalink / raw)
  To: Marek Vasut
  Cc: netdev, David S. Miller, Aleksander Jan Bajkowski, Andrew Lunn,
	Conor Dooley, Eric Dumazet, Florian Fainelli, Heiner Kallweit,
	Ivan Galkin, Jakub Kicinski, Krzysztof Kozlowski, Michael Klein,
	Paolo Abeni, Rob Herring, Russell King, Vladimir Oltean,
	devicetree

On Wed, Dec 03, 2025 at 10:08:05PM +0100, Marek Vasut wrote:
> Document support for spread spectrum clocking (SSC) on RTL8211F(D)(I)-CG,
> RTL8211FS(I)(-VS)-CG, RTL8211FG(I)(-VS)-CG PHYs. Introduce DT properties
> 'realtek,clkout-ssc-enable', 'realtek,rxc-ssc-enable' and
> 'realtek,sysclk-ssc-enable' which control CLKOUT, RXC and SYSCLK
> SSC spread spectrum clocking enablement on these signals. These
> clock are not exposed via the clock API, therefore assigned-clock-sscs
> property does not apply.
> 
> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [net-next,PATCH v2 3/3] net: phy: realtek: Add property to enable SSC
  2025-12-03 21:08 ` [net-next,PATCH v2 3/3] net: phy: realtek: Add property to enable SSC Marek Vasut
  2025-12-04 14:27   ` Ivan Galkin
@ 2025-12-11 18:39   ` Sai Krishna Gajula
  2025-12-18 17:33     ` Marek Vasut
  1 sibling, 1 reply; 11+ messages in thread
From: Sai Krishna Gajula @ 2025-12-11 18:39 UTC (permalink / raw)
  To: Marek Vasut, netdev@vger.kernel.org
  Cc: David S. Miller, Aleksander Jan Bajkowski, Andrew Lunn,
	Conor Dooley, Eric Dumazet, Florian Fainelli, Heiner Kallweit,
	Ivan Galkin, Jakub Kicinski, Krzysztof Kozlowski, Michael Klein,
	Paolo Abeni, Rob Herring, Russell King, Vladimir Oltean,
	devicetree@vger.kernel.org



> -----Original Message-----
> From: Marek Vasut <marek.vasut@mailbox.org>
> Sent: Thursday, December 4, 2025 2:38 AM
> To: netdev@vger.kernel.org
> Cc: Marek Vasut <marek.vasut@mailbox.org>; David S. Miller
> <davem@davemloft.net>; Aleksander Jan Bajkowski <olek2@wp.pl>; Andrew
> Lunn <andrew@lunn.ch>; Conor Dooley <conor+dt@kernel.org>; Eric
> Dumazet <edumazet@google.com>; Florian Fainelli <f.fainelli@gmail.com>;
> Heiner Kallweit <hkallweit1@gmail.com>; Ivan Galkin
> <ivan.galkin@axis.com>; Jakub Kicinski <kuba@kernel.org>; Krzysztof
> Kozlowski <krzk+dt@kernel.org>; Michael Klein <michael@fossekall.de>;
> Paolo Abeni <pabeni@redhat.com>; Rob Herring <robh@kernel.org>; Russell
> King <linux@armlinux.org.uk>; Vladimir Oltean <vladimir.oltean@nxp.com>;
> devicetree@vger.kernel.org
> Subject: [net-next,PATCH v2 3/3] net: phy: realtek: Add property
> to enable SSC
> 
> Add support for spread spectrum clocking (SSC) on RTL8211F(D)(I)-CG,
> RTL8211FS(I)(-VS)-CG, RTL8211FG(I)(-VS)-CG PHYs. The implementation
> follows EMI improvement application note Rev. 1. 2 for these PHYs. The
> current implementation enables SSC 
> Add support for spread spectrum clocking (SSC) on RTL8211F(D)(I)-CG,
> RTL8211FS(I)(-VS)-CG, RTL8211FG(I)(-VS)-CG PHYs. The implementation
> follows EMI improvement application note Rev. 1.2 for these PHYs.
> 
> The current implementation enables SSC for both RXC and SYSCLK clock
> signals. Introduce DT properties 'realtek,clkout-ssc-enable', 'realtek,rxc-ssc-
> enable' and 'realtek,sysclk-ssc-enable' which control CLKOUT, RXC and SYSCLK
> SSC spread spectrum clocking enablement on these signals.
> 
> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
> ---
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Aleksander Jan Bajkowski <olek2@wp.pl>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Conor Dooley <conor+dt@kernel.org>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Heiner Kallweit <hkallweit1@gmail.com>
> Cc: Ivan Galkin <ivan.galkin@axis.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
> Cc: Michael Klein <michael@fossekall.de>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
> Cc: devicetree@vger.kernel.org
> Cc: netdev@vger.kernel.org
> ---
> V2: Split SSC clock control for each CLKOUT, RXC, SYSCLK signal
> ---
>  drivers/net/phy/realtek/realtek_main.c | 124 +++++++++++++++++++++++++
>  1 file changed, 124 insertions(+)
> 
> diff --git a/drivers/net/phy/realtek/realtek_main.c
> b/drivers/net/phy/realtek/realtek_main.c
> index 67ecf3d4af2b1..ac80653cdbe28 100644
> --- a/drivers/net/phy/realtek/realtek_main.c
> +++ b/drivers/net/phy/realtek/realtek_main.c
> @@ -74,11 +74,19 @@
> 
>  #define RTL8211F_PHYCR2				0x19
>  #define RTL8211F_CLKOUT_EN			BIT(0)
> +#define RTL8211F_SYSCLK_SSC_EN			BIT(3)
>  #define RTL8211F_PHYCR2_PHY_EEE_ENABLE		BIT(5)
> +#define RTL8211F_CLKOUT_SSC_EN			BIT(7)
> 
>  #define RTL8211F_INSR_PAGE			0xa43
>  #define RTL8211F_INSR				0x1d
> 
> +/* RTL8211F SSC settings */
> +#define RTL8211F_SSC_PAGE			0xc44
> +#define RTL8211F_SSC_RXC			0x13
> +#define RTL8211F_SSC_SYSCLK			0x17
> +#define RTL8211F_SSC_CLKOUT			0x19
> +
>  /* RTL8211F LED configuration */
>  #define RTL8211F_LEDCR_PAGE			0xd04
>  #define RTL8211F_LEDCR				0x10
> @@ -203,6 +211,9 @@ MODULE_LICENSE("GPL");  struct rtl821x_priv {
>  	bool enable_aldps;
>  	bool disable_clk_out;
> +	bool enable_clkout_ssc;
> +	bool enable_rxc_ssc;
> +	bool enable_sysclk_ssc;
>  	struct clk *clk;
>  	/* rtl8211f */
>  	u16 iner;
> @@ -266,6 +277,12 @@ static int rtl821x_probe(struct phy_device *phydev)
>  						   "realtek,aldps-enable");
>  	priv->disable_clk_out = of_property_read_bool(dev->of_node,
>  						      "realtek,clkout-disable");
> +	priv->enable_clkout_ssc = of_property_read_bool(dev->of_node,
> +							"realtek,clkout-ssc-
> enable");
> +	priv->enable_rxc_ssc = of_property_read_bool(dev->of_node,
> +						     "realtek,rxc-ssc-enable");
> +	priv->enable_sysclk_ssc = of_property_read_bool(dev->of_node,
> +							"realtek,sysclk-ssc-
> enable");
> 
>  	phydev->priv = priv;
> 
> @@ -700,6 +717,101 @@ static int rtl8211f_config_phy_eee(struct
> phy_device *phydev)
>  				RTL8211F_PHYCR2_PHY_EEE_ENABLE, 0);  }
> 
> +static int rtl8211f_config_clkout_ssc(struct phy_device *phydev) {
> +	struct rtl821x_priv *priv = phydev->priv;
> +	struct device *dev = &phydev->mdio.dev;
> +	int ret;
> +
> +	/* The value is preserved if the device tree property is absent */
> +	if (!priv->enable_clkout_ssc)
> +		return 0;
> +
> +	/* RTL8211FVD has no PHYCR2 register */
> +	if (phydev->drv->phy_id == RTL_8211FVD_PHYID)
> +		return 0;
> +
> +	/* Unnamed registers from EMI improvement parameters application
> note 1.2 */
> +	ret = phy_write_paged(phydev, 0xd09, 0x10, 0xcf00);
> +	if (ret < 0) {
> +		dev_err(dev, "CLKOUT SCC initialization failed: %pe\n",
> ERR_PTR(ret));
> +		return ret;
> +	}
> +
> +	ret = phy_write_paged(phydev, RTL8211F_SSC_PAGE,
> RTL8211F_SSC_CLKOUT, 0x38c3);
> +	if (ret < 0) {
> +		dev_err(dev, "CLKOUT SCC configuration failed: %pe\n",
> ERR_PTR(ret));
> +		return ret;
> +	}
> +
> +	/*
> +	 * Enable CLKOUT SSC using PHYCR2 bit 7 , this step is missing from
> the
> +	 * EMI improvement parameters application note 1.2 section 2.3
> +	 */
> +	ret = phy_modify_paged(phydev, RTL8211F_PHYCR_PAGE,
> RTL8211F_PHYCR2,
> +			       RTL8211F_CLKOUT_SSC_EN,
> RTL8211F_CLKOUT_SSC_EN);
> +	if (ret < 0) {
> +		dev_err(dev, "CLKOUT SCC enable failed: %pe\n",
> ERR_PTR(ret));
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +
> +static int rtl8211f_config_rxc_ssc(struct phy_device *phydev) {
> +	struct rtl821x_priv *priv = phydev->priv;
> +	struct device *dev = &phydev->mdio.dev;
> +	int ret;
> +
> +	/* The value is preserved if the device tree property is absent */
> +	if (!priv->enable_rxc_ssc)
> +		return 0;
> +
> +	/* RTL8211FVD has no PHYCR2 register */
> +	if (phydev->drv->phy_id == RTL_8211FVD_PHYID)
> +		return 0;
> +
> +	ret = phy_write_paged(phydev, RTL8211F_SSC_PAGE,
> RTL8211F_SSC_RXC, 0x5f00);
> +	if (ret < 0) {
> +		dev_err(dev, "RXC SCC configuration failed: %pe\n",
> ERR_PTR(ret));
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +
> +static int rtl8211f_config_sysclk_ssc(struct phy_device *phydev) {

Minor nit:   Kernel style requires the opening brace on the next line, also in other places.
static int rtl8211f_config_sysclk_ssc(struct phy_device *phydev) 
{

> +	struct rtl821x_priv *priv = phydev->priv;
> +	struct device *dev = &phydev->mdio.dev;
> +	int ret;
> +
> +	/* The value is preserved if the device tree property is absent */
> +	if (!priv->enable_sysclk_ssc)
> +		return 0;
> +
> +	/* RTL8211FVD has no PHYCR2 register */
> +	if (phydev->drv->phy_id == RTL_8211FVD_PHYID)
> +		return 0;
> +
> +	ret = phy_write_paged(phydev, RTL8211F_SSC_PAGE,
> RTL8211F_SSC_SYSCLK, 0x4f00);
> +	if (ret < 0) {
> +		dev_err(dev, "SYSCLK SCC configuration failed: %pe\n",
> ERR_PTR(ret));
> +		return ret;
> +	}
> +
> +	/* Enable SSC */
> +	ret = phy_modify_paged(phydev, RTL8211F_PHYCR_PAGE,
> RTL8211F_PHYCR2,
> +			       RTL8211F_SYSCLK_SSC_EN,
> RTL8211F_SYSCLK_SSC_EN);
> +	if (ret < 0) {
> +		dev_err(dev, "SYSCLK SCC enable failed: %pe\n",
> ERR_PTR(ret));
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +
>  static int rtl8211f_config_init(struct phy_device *phydev)  {
>  	struct device *dev = &phydev->mdio.dev; @@ -723,6 +835,18 @@
> static int rtl8211f_config_init(struct phy_device *phydev)
>  		return ret;
>  	}
> 
> +	ret = rtl8211f_config_clkout_ssc(phydev);
> +	if (ret)
> +		return ret;
> +
> +	ret = rtl8211f_config_rxc_ssc(phydev);
> +	if (ret)
> +		return ret;
> +
> +	ret = rtl8211f_config_sysclk_ssc(phydev);
> +	if (ret)
> +		return ret;
> +
>  	return rtl8211f_config_phy_eee(phydev);  }
> 
> --
> 2.51.0
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted
  2025-12-05  9:03 ` Krzysztof Kozlowski
@ 2025-12-18 17:11   ` Marek Vasut
  0 siblings, 0 replies; 11+ messages in thread
From: Marek Vasut @ 2025-12-18 17:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: netdev, David S. Miller, Aleksander Jan Bajkowski, Andrew Lunn,
	Conor Dooley, Eric Dumazet, Florian Fainelli, Heiner Kallweit,
	Ivan Galkin, Jakub Kicinski, Krzysztof Kozlowski, Michael Klein,
	Paolo Abeni, Rob Herring, Russell King, Vladimir Oltean,
	devicetree

On 12/5/25 10:03 AM, Krzysztof Kozlowski wrote:
> On Wed, Dec 03, 2025 at 10:08:04PM +0100, Marek Vasut wrote:
>> Sort the documented properties alphabetically, no functional change.
> 
> That's just churn, we don't do this for bindings.
It hopefully helps when searching for the right property.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [net-next,PATCH v2 2/3] dt-bindings: net: realtek,rtl82xx: Document realtek,ssc-enable property
  2025-12-05  9:04   ` Krzysztof Kozlowski
@ 2025-12-18 17:20     ` Marek Vasut
  0 siblings, 0 replies; 11+ messages in thread
From: Marek Vasut @ 2025-12-18 17:20 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: netdev, David S. Miller, Aleksander Jan Bajkowski, Andrew Lunn,
	Conor Dooley, Eric Dumazet, Florian Fainelli, Heiner Kallweit,
	Ivan Galkin, Jakub Kicinski, Krzysztof Kozlowski, Michael Klein,
	Paolo Abeni, Rob Herring, Russell King, Vladimir Oltean,
	devicetree

On 12/5/25 10:04 AM, Krzysztof Kozlowski wrote:
> On Wed, Dec 03, 2025 at 10:08:05PM +0100, Marek Vasut wrote:
>> Document support for spread spectrum clocking (SSC) on RTL8211F(D)(I)-CG,
>> RTL8211FS(I)(-VS)-CG, RTL8211FG(I)(-VS)-CG PHYs. Introduce DT properties
>> 'realtek,clkout-ssc-enable', 'realtek,rxc-ssc-enable' and
>> 'realtek,sysclk-ssc-enable' which control CLKOUT, RXC and SYSCLK
>> SSC spread spectrum clocking enablement on these signals. These
>> clock are not exposed via the clock API, therefore assigned-clock-sscs
>> property does not apply.
>>
>> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
I'll pick the RB , but will update the subject as follows to reflect the 
adjustment to this commit, I hope that's OK ?

-dt-bindings: net: realtek,rtl82xx: Document realtek,ssc-enable property
+dt-bindings: net: realtek,rtl82xx: Document realtek,*-ssc-enable property

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [net-next,PATCH v2 3/3] net: phy: realtek: Add property to enable SSC
  2025-12-11 18:39   ` Sai Krishna Gajula
@ 2025-12-18 17:33     ` Marek Vasut
  0 siblings, 0 replies; 11+ messages in thread
From: Marek Vasut @ 2025-12-18 17:33 UTC (permalink / raw)
  To: Sai Krishna Gajula, netdev@vger.kernel.org
  Cc: David S. Miller, Aleksander Jan Bajkowski, Andrew Lunn,
	Conor Dooley, Eric Dumazet, Florian Fainelli, Heiner Kallweit,
	Ivan Galkin, Jakub Kicinski, Krzysztof Kozlowski, Michael Klein,
	Paolo Abeni, Rob Herring, Russell King, Vladimir Oltean,
	devicetree@vger.kernel.org

On 12/11/25 7:39 PM, Sai Krishna Gajula wrote:

[...]

>> +	ret = phy_write_paged(phydev, RTL8211F_SSC_PAGE,
>> RTL8211F_SSC_RXC, 0x5f00);
>> +	if (ret < 0) {
>> +		dev_err(dev, "RXC SCC configuration failed: %pe\n",
>> ERR_PTR(ret));
>> +		return ret;
>> +	}
>> +
>> +	return 0;
>> +}
>> +
>> +static int rtl8211f_config_sysclk_ssc(struct phy_device *phydev) {
> 
> Minor nit:   Kernel style requires the opening brace on the next line, also in other places.
> static int rtl8211f_config_sysclk_ssc(struct phy_device *phydev)
> {
The patch looks correctly in lore archive, see:

https://lore.kernel.org/all/20251203210857.113328-3-marek.vasut@mailbox.org/

The patch also looks correctly in my mailer, it is only the 
aforementioned quoted text that seems mangled. Maybe your mailer did 
something odd with the patch ?

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-12-18 17:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-03 21:08 [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted Marek Vasut
2025-12-03 21:08 ` [net-next,PATCH v2 2/3] dt-bindings: net: realtek,rtl82xx: Document realtek,ssc-enable property Marek Vasut
2025-12-05  9:04   ` Krzysztof Kozlowski
2025-12-18 17:20     ` Marek Vasut
2025-12-03 21:08 ` [net-next,PATCH v2 3/3] net: phy: realtek: Add property to enable SSC Marek Vasut
2025-12-04 14:27   ` Ivan Galkin
2025-12-11 18:39   ` Sai Krishna Gajula
2025-12-18 17:33     ` Marek Vasut
2025-12-04 11:04 ` [net-next,PATCH v2 1/3] dt-bindings: net: realtek,rtl82xx: Keep property list sorted Paolo Abeni
2025-12-05  9:03 ` Krzysztof Kozlowski
2025-12-18 17:11   ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox