Devicetree
 help / color / mirror / Atom feed
* [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply
@ 2026-10-16 11:19 Robert Marko
  2026-10-16 11:19 ` [PATCH net-next v2 2/5] net: phy: mxl-gpy: " Robert Marko
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Robert Marko @ 2026-10-16 11:19 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, lxu, hkallweit1, linux, michael, netdev, devicetree,
	linux-kernel
  Cc: lrosu, luka.perkov, Robert Marko

Describe the VDDP supply used by the MxL86211C PHY. Its voltage
determines whether the MDIO, MDC, and MDINT pads use 1.8 V or 3.3 V.

Select this binding for the MxL86211C PHY ID so the supply requirement
is validated.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
Changes in v2:
- Model VDDP as a supply instead of a regulator provider.
- Select the schema for the MxL86211C PHY ID.

 .../bindings/net/maxlinear,gpy2xx.yaml        | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml b/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
index 8a3713abd1ca9..a0dfb6192d81b 100644
--- a/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
+++ b/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
@@ -10,10 +10,38 @@ maintainers:
   - Andrew Lunn <andrew@lunn.ch>
   - Michael Walle <michael@walle.cc>
 
+select:
+  properties:
+    compatible:
+      contains:
+        const: ethernet-phy-idc133.5400
+  required:
+    - compatible
+
 allOf:
   - $ref: ethernet-phy.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: ethernet-phy-idc133.5400
+      required:
+        - compatible
+
+    then:
+      required:
+        - vddp-supply
+
+    else:
+      properties:
+        vddp-supply: false
 
 properties:
+  vddp-supply:
+    description: |
+      Regulator supplying the VDDP pin. Its voltage configures the MDIO,
+      MDC, and MDINT pad voltage and must be either 1.8 V or 3.3 V.
+
   maxlinear,use-broken-interrupts:
     description: |
       Interrupts are broken on some GPY2xx PHYs in that they keep the
@@ -45,4 +73,25 @@ examples:
         };
     };
 
+  - |
+    vddp: regulator-vddp {
+        compatible = "regulator-fixed";
+        regulator-name = "vddp";
+        regulator-min-microvolt = <1800000>;
+        regulator-max-microvolt = <1800000>;
+    };
+
+    ethernet {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ethernet-phy@0 {
+            compatible = "ethernet-phy-idc133.5400",
+                         "ethernet-phy-ieee802.3-c45";
+            reg = <0>;
+            vddp-supply = <&vddp>;
+
+        };
+    };
+
 ...
-- 
2.56.0


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

* [PATCH net-next v2 2/5] net: phy: mxl-gpy: add MxL86211C VDDP supply
  2026-10-16 11:19 [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply Robert Marko
@ 2026-10-16 11:19 ` Robert Marko
  2026-10-16 21:12   ` Andrew Lunn
  2026-10-17 11:20   ` sashiko-bot
  2026-10-16 11:19 ` [PATCH net-next v2 3/5] net: phy: mxl-gpy: release MxL86211C Super Isolate Robert Marko
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 11+ messages in thread
From: Robert Marko @ 2026-10-16 11:19 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, lxu, hkallweit1, linux, michael, netdev, devicetree,
	linux-kernel
  Cc: lrosu, luka.perkov, Robert Marko

Read the VDDP supply voltage and configure the MxL86211C MDIO, MDC,
and MDINT pads for the matching 1.8 V or 3.3 V level.

Keep the shared GPY driver buildable without regulator support; only
the MxL86211C probe requires the supply.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
Changes in v2:
- Replace the MDIO regulator provider with a VDDP supply consumer.
- Set the pad voltage from the supply's reported voltage.
- Keep the shared driver buildable with CONFIG_REGULATOR=n.

 drivers/net/phy/mxl-gpy.c | 63 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 62 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c
index 089a1a9e5bc61..fbac7c49b4759 100644
--- a/drivers/net/phy/mxl-gpy.c
+++ b/drivers/net/phy/mxl-gpy.c
@@ -14,6 +14,7 @@
 #include <linux/polynomial.h>
 #include <linux/property.h>
 #include <linux/netdevice.h>
+#include <linux/regulator/consumer.h>
 
 /* PHY ID */
 #define PHY_ID_GPYx15B_MASK	0xFFFFFFFC
@@ -110,6 +111,10 @@
 #define VSPEC1_SGMII_ANEN_ANRS	(VSPEC1_SGMII_CTRL_ANEN | \
 				 VSPEC1_SGMII_CTRL_ANRS)
 
+/* Packet Manager Control */
+#define VSPEC1_PM_CTRL		0x0c
+#define VSPEC1_PM_CTRL_MDIO_VOL	BIT(14)
+
 /* Temperature sensor */
 #define VSPEC1_TEMP_STA	0x0E
 #define VSPEC1_TEMP_STA_DATA	GENMASK(9, 0)
@@ -140,6 +145,7 @@ struct gpy_priv {
 	u8 fw_minor;
 	u32 wolopts;
 	u64 rx_errors;
+	struct regulator *vddp;
 
 	/* It takes 3 seconds to fully switch out of loopback mode before
 	 * it can safely re-enter loopback mode. Record the time when
@@ -390,6 +396,61 @@ static int gpy_probe(struct phy_device *phydev)
 	return 0;
 }
 
+static int mxl86211c_configure_mdio_voltage(struct phy_device *phydev,
+					    struct regulator *vddp)
+{
+	int voltage;
+	int val;
+
+	voltage = regulator_get_voltage(vddp);
+	if (voltage < 0)
+		return voltage;
+
+	switch (voltage) {
+	case 1800000:
+		val = VSPEC1_PM_CTRL_MDIO_VOL;
+		break;
+	case 3300000:
+		val = 0;
+		break;
+	default:
+		phydev_err(phydev, "unsupported VDDP voltage: %d\n", voltage);
+		return -EINVAL;
+	}
+
+	return phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_PM_CTRL,
+			      VSPEC1_PM_CTRL_MDIO_VOL, val);
+}
+
+static int mxl86211c_probe(struct phy_device *phydev)
+{
+	struct device *dev = &phydev->mdio.dev;
+	struct gpy_priv *priv;
+	struct regulator *vddp;
+	int ret;
+
+	vddp = devm_regulator_get(dev, "vddp");
+	if (IS_ERR(vddp))
+		return dev_err_probe(dev, PTR_ERR(vddp),
+				     "failed to get VDDP supply\n");
+	if (!vddp)
+		return dev_err_probe(dev, -EOPNOTSUPP,
+				     "VDDP supply requires regulator support\n");
+
+	ret = mxl86211c_configure_mdio_voltage(phydev, vddp);
+	if (ret)
+		return ret;
+
+	ret = gpy_probe(phydev);
+	if (ret)
+		return ret;
+
+	priv = phydev->priv;
+	priv->vddp = vddp;
+
+	return 0;
+}
+
 static bool gpy_sgmii_need_reaneg(struct phy_device *phydev)
 {
 	struct gpy_priv *priv = phydev->priv;
@@ -1406,7 +1467,7 @@ static struct phy_driver gpy_drivers[] = {
 		.name		= "Maxlinear Ethernet MxL86211C",
 		.get_features	= genphy_c45_pma_read_abilities,
 		.config_init	= gpy21x_config_init,
-		.probe		= gpy_probe,
+		.probe		= mxl86211c_probe,
 		.inband_caps	= gpy_inband_caps,
 		.config_inband	= gpy_config_inband,
 		.suspend	= genphy_suspend,
-- 
2.56.0


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

* [PATCH net-next v2 3/5] net: phy: mxl-gpy: release MxL86211C Super Isolate
  2026-10-16 11:19 [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply Robert Marko
  2026-10-16 11:19 ` [PATCH net-next v2 2/5] net: phy: mxl-gpy: " Robert Marko
@ 2026-10-16 11:19 ` Robert Marko
  2026-10-17 11:20   ` sashiko-bot
  2026-10-16 11:19 ` [PATCH net-next v2 4/5] dt-bindings: net: maxlinear: add MxL86211C lane mapping support Robert Marko
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Robert Marko @ 2026-10-16 11:19 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, lxu, hkallweit1, linux, michael, netdev, devicetree,
	linux-kernel
  Cc: lrosu, luka.perkov, Robert Marko

The MxL86211C can be strapped into Super Isolate mode, leaving the PHY
halted after reset until software releases it.

Reapply the MDIO pad voltage and release Super Isolate in config_init,
so both settings are restored after each hardware reset.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
Changes in v2:
- Move Super Isolate release from probe to config_init for resets.
- Reapply the MDIO pad voltage before releasing Super Isolate.

 drivers/net/phy/mxl-gpy.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c
index fbac7c49b4759..8bc119655f104 100644
--- a/drivers/net/phy/mxl-gpy.c
+++ b/drivers/net/phy/mxl-gpy.c
@@ -114,6 +114,7 @@
 /* Packet Manager Control */
 #define VSPEC1_PM_CTRL		0x0c
 #define VSPEC1_PM_CTRL_MDIO_VOL	BIT(14)
+#define VSPEC1_PM_CTRL_SI	BIT(12)		/* Super Isolate */
 
 /* Temperature sensor */
 #define VSPEC1_TEMP_STA	0x0E
@@ -422,6 +423,23 @@ static int mxl86211c_configure_mdio_voltage(struct phy_device *phydev,
 			      VSPEC1_PM_CTRL_MDIO_VOL, val);
 }
 
+static int mxl86211c_config_init(struct phy_device *phydev)
+{
+	struct gpy_priv *priv = phydev->priv;
+	int ret;
+
+	ret = mxl86211c_configure_mdio_voltage(phydev, priv->vddp);
+	if (ret)
+		return ret;
+
+	ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_PM_CTRL,
+			     VSPEC1_PM_CTRL_SI, 0);
+	if (ret)
+		return ret;
+
+	return gpy21x_config_init(phydev);
+}
+
 static int mxl86211c_probe(struct phy_device *phydev)
 {
 	struct device *dev = &phydev->mdio.dev;
@@ -1466,7 +1484,7 @@ static struct phy_driver gpy_drivers[] = {
 		PHY_ID_MATCH_MODEL(PHY_ID_MXL86211C),
 		.name		= "Maxlinear Ethernet MxL86211C",
 		.get_features	= genphy_c45_pma_read_abilities,
-		.config_init	= gpy21x_config_init,
+		.config_init	= mxl86211c_config_init,
 		.probe		= mxl86211c_probe,
 		.inband_caps	= gpy_inband_caps,
 		.config_inband	= gpy_config_inband,
-- 
2.56.0


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

* [PATCH net-next v2 4/5] dt-bindings: net: maxlinear: add MxL86211C lane mapping support
  2026-10-16 11:19 [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply Robert Marko
  2026-10-16 11:19 ` [PATCH net-next v2 2/5] net: phy: mxl-gpy: " Robert Marko
  2026-10-16 11:19 ` [PATCH net-next v2 3/5] net: phy: mxl-gpy: release MxL86211C Super Isolate Robert Marko
@ 2026-10-16 11:19 ` Robert Marko
  2026-10-17 11:20   ` sashiko-bot
  2026-10-16 11:19 ` [PATCH net-next v2 5/5] net: phy: mxl-gpy: support MxL86211C lane mapping Robert Marko
  2026-10-17 11:20 ` [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply sashiko-bot
  4 siblings, 1 reply; 11+ messages in thread
From: Robert Marko @ 2026-10-16 11:19 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, lxu, hkallweit1, linux, michael, netdev, devicetree,
	linux-kernel
  Cc: lrosu, luka.perkov, Robert Marko

Describe the optional board-level mapping from physical TPI lanes to the
MxL86211C analog front ends (ASPs). This allows DTS to describe wiring
that differs from the hardware reset mapping.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
Changes in v2:
- Define the lane-map property at the top level for type checking.
- Describe ASPs as analog front ends.

 .../bindings/net/maxlinear,gpy2xx.yaml        | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml b/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
index a0dfb6192d81b..4323be300c721 100644
--- a/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
+++ b/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
@@ -35,6 +35,7 @@ allOf:
     else:
       properties:
         vddp-supply: false
+        maxlinear,lane-asp-map: false
 
 properties:
   vddp-supply:
@@ -42,6 +43,21 @@ properties:
       Regulator supplying the VDDP pin. Its voltage configures the MDIO,
       MDC, and MDINT pad voltage and must be either 1.8 V or 3.3 V.
 
+  maxlinear,lane-asp-map:
+    description: |
+      Mapping of physical TPI lanes A through D to analog front ends (ASPs)
+      A through D. The array index identifies the physical TPI lane, while
+      its value identifies the analog front end, encoded as 0 through 3.
+      Each analog front end must be mapped exactly once. Omit the property to
+      retain the hardware reset mapping.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    minItems: 4
+    maxItems: 4
+    uniqueItems: true
+    items:
+      minimum: 0
+      maximum: 3
+
   maxlinear,use-broken-interrupts:
     description: |
       Interrupts are broken on some GPY2xx PHYs in that they keep the
@@ -91,6 +107,9 @@ examples:
             reg = <0>;
             vddp-supply = <&vddp>;
 
+            /* Swap physical TPI lanes C and D. */
+            maxlinear,lane-asp-map = <0 1 3 2>;
+
         };
     };
 
-- 
2.56.0


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

* [PATCH net-next v2 5/5] net: phy: mxl-gpy: support MxL86211C lane mapping
  2026-10-16 11:19 [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply Robert Marko
                   ` (2 preceding siblings ...)
  2026-10-16 11:19 ` [PATCH net-next v2 4/5] dt-bindings: net: maxlinear: add MxL86211C lane mapping support Robert Marko
@ 2026-10-16 11:19 ` Robert Marko
  2026-10-16 21:15   ` Andrew Lunn
  2026-10-17 11:20 ` [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply sashiko-bot
  4 siblings, 1 reply; 11+ messages in thread
From: Robert Marko @ 2026-10-16 11:19 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, lxu, hkallweit1, linux, michael, netdev, devicetree,
	linux-kernel
  Cc: lrosu, luka.perkov, Robert Marko

Configure the MxL86211C mapping from physical TPI lanes to analog
front ends (ASPs) when specified in DTS.

Leave the hardware reset mapping untouched when the optional property
is absent.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
Changes in v2:
- Preserve unrelated register bits when updating the lane map.

 drivers/net/phy/mxl-gpy.c | 47 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c
index 8bc119655f104..acd5ad01a285d 100644
--- a/drivers/net/phy/mxl-gpy.c
+++ b/drivers/net/phy/mxl-gpy.c
@@ -116,6 +116,13 @@
 #define VSPEC1_PM_CTRL_MDIO_VOL	BIT(14)
 #define VSPEC1_PM_CTRL_SI	BIT(12)		/* Super Isolate */
 
+/* TPI lane to ASP map */
+#define VSPEC1_LANE_ASP_MAP	0x14
+#define VSPEC1_LANE_ASP_MAP_A	GENMASK(1, 0)
+#define VSPEC1_LANE_ASP_MAP_B	GENMASK(3, 2)
+#define VSPEC1_LANE_ASP_MAP_C	GENMASK(5, 4)
+#define VSPEC1_LANE_ASP_MAP_D	GENMASK(7, 6)
+
 /* Temperature sensor */
 #define VSPEC1_TEMP_STA	0x0E
 #define VSPEC1_TEMP_STA_DATA	GENMASK(9, 0)
@@ -423,6 +430,42 @@ static int mxl86211c_configure_mdio_voltage(struct phy_device *phydev,
 			      VSPEC1_PM_CTRL_MDIO_VOL, val);
 }
 
+static int mxl86211c_configure_lane_asp_map(struct phy_device *phydev)
+{
+	struct device *dev = &phydev->mdio.dev;
+	u32 lane_asp_map[4];
+	u16 val;
+	unsigned int seen = 0;
+	int i, ret;
+
+	if (!device_property_present(dev, "maxlinear,lane-asp-map"))
+		return 0;
+
+	ret = device_property_read_u32_array(dev, "maxlinear,lane-asp-map",
+					     lane_asp_map,
+					     ARRAY_SIZE(lane_asp_map));
+	if (ret)
+		return ret;
+
+	for (i = 0; i < ARRAY_SIZE(lane_asp_map); i++) {
+		if (lane_asp_map[i] > 3 || seen & BIT(lane_asp_map[i]))
+			return -EINVAL;
+
+		seen |= BIT(lane_asp_map[i]);
+	}
+
+	val = FIELD_PREP(VSPEC1_LANE_ASP_MAP_A, lane_asp_map[0]) |
+	      FIELD_PREP(VSPEC1_LANE_ASP_MAP_B, lane_asp_map[1]) |
+	      FIELD_PREP(VSPEC1_LANE_ASP_MAP_C, lane_asp_map[2]) |
+	      FIELD_PREP(VSPEC1_LANE_ASP_MAP_D, lane_asp_map[3]);
+
+	return phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_LANE_ASP_MAP,
+			      VSPEC1_LANE_ASP_MAP_A |
+			      VSPEC1_LANE_ASP_MAP_B |
+			      VSPEC1_LANE_ASP_MAP_C |
+			      VSPEC1_LANE_ASP_MAP_D, val);
+}
+
 static int mxl86211c_config_init(struct phy_device *phydev)
 {
 	struct gpy_priv *priv = phydev->priv;
@@ -432,6 +475,10 @@ static int mxl86211c_config_init(struct phy_device *phydev)
 	if (ret)
 		return ret;
 
+	ret = mxl86211c_configure_lane_asp_map(phydev);
+	if (ret)
+		return ret;
+
 	ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_PM_CTRL,
 			     VSPEC1_PM_CTRL_SI, 0);
 	if (ret)
-- 
2.56.0


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

* Re: [PATCH net-next v2 2/5] net: phy: mxl-gpy: add MxL86211C VDDP supply
  2026-10-16 11:19 ` [PATCH net-next v2 2/5] net: phy: mxl-gpy: " Robert Marko
@ 2026-10-16 21:12   ` Andrew Lunn
  2026-10-17 11:20   ` sashiko-bot
  1 sibling, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2026-10-16 21:12 UTC (permalink / raw)
  To: Robert Marko
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, lxu, hkallweit1, linux, michael, netdev, devicetree,
	linux-kernel, lrosu, luka.perkov

> +static int mxl86211c_probe(struct phy_device *phydev)
> +{
> +	struct device *dev = &phydev->mdio.dev;
> +	struct gpy_priv *priv;
> +	struct regulator *vddp;
> +	int ret;
> +
> +	vddp = devm_regulator_get(dev, "vddp");
> +	if (IS_ERR(vddp))
> +		return dev_err_probe(dev, PTR_ERR(vddp),
> +				     "failed to get VDDP supply\n");
> +	if (!vddp)
> +		return dev_err_probe(dev, -EOPNOTSUPP,
> +				     "VDDP supply requires regulator support\n");
> +

>  static bool gpy_sgmii_need_reaneg(struct phy_device *phydev)
>  {
>  	struct gpy_priv *priv = phydev->priv;
> @@ -1406,7 +1467,7 @@ static struct phy_driver gpy_drivers[] = {
>  		.name		= "Maxlinear Ethernet MxL86211C",
>  		.get_features	= genphy_c45_pma_read_abilities,
>  		.config_init	= gpy21x_config_init,
> -		.probe		= gpy_probe,
> +		.probe		= mxl86211c_probe,

This is an existing device. You cannot add required new DT parameters,
that would break backwards compatibility. Anything you add news to be
optional.

    Andrew

---
pw-bot: cr

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

* Re: [PATCH net-next v2 5/5] net: phy: mxl-gpy: support MxL86211C lane mapping
  2026-10-16 11:19 ` [PATCH net-next v2 5/5] net: phy: mxl-gpy: support MxL86211C lane mapping Robert Marko
@ 2026-10-16 21:15   ` Andrew Lunn
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2026-10-16 21:15 UTC (permalink / raw)
  To: Robert Marko
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, lxu, hkallweit1, linux, michael, netdev, devicetree,
	linux-kernel, lrosu, luka.perkov

On Fri, Oct 16, 2026 at 01:19:36PM +0200, Robert Marko wrote:
> Configure the MxL86211C mapping from physical TPI lanes to analog
> front ends (ASPs) when specified in DTS.
> 
> Leave the hardware reset mapping untouched when the optional property
> is absent.
> 
> Signed-off-by: Robert Marko <robert.marko@sartura.hr>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply
  2026-10-16 11:19 [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply Robert Marko
                   ` (3 preceding siblings ...)
  2026-10-16 11:19 ` [PATCH net-next v2 5/5] net: phy: mxl-gpy: support MxL86211C lane mapping Robert Marko
@ 2026-10-17 11:20 ` sashiko-bot
  4 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-10-17 11:20 UTC (permalink / raw)
  To: Robert Marko, devicetree; +Cc: robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dt-bindings: overly restrictive select block breaks validation for other PHYs
--

commit 695546f38e461889fde9ccbc3738543cebc3766c
Author: Robert Marko <robert.marko@sartura.hr>

dt-bindings: net: maxlinear: add MxL86211C VDDP supply

This commit describes the VDDP supply used by the MxL86211C PHY.
It adds a new schema section to validate that the supply requirement is met
when the MxL86211C PHY ID is present.

> diff --git a/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml b/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
> index 8a3713abd1ca9..a0dfb6192d81b 100644
> --- a/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
> +++ b/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
> @@ -10,10 +10,38 @@ maintainers:
>    - Andrew Lunn <andrew@lunn.ch>
>    - Michael Walle <michael@walle.cc>
>  
> +select:
> +  properties:
> +    compatible:
> +      contains:
> +        const: ethernet-phy-idc133.5400
> +  required:
> +    - compatible

[Severity: Medium]
Does this top-level select block restrict the entire schema to only match this
single PHY ID? By acting as a gatekeeper for the whole schema, it appears this
breaks validation for all other supported GPY2xx PHYs.

For example, the maxlinear,use-broken-interrupts property intended for
GPY215B/C might no longer be validated, and even pre-existing examples in the
schema might fail to match.

> +
>  allOf:
>    - $ref: ethernet-phy.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: ethernet-phy-idc133.5400
> +      required:
> +        - compatible
> +
> +    then:
> +      required:
> +        - vddp-supply
> +
> +    else:
> +      properties:
> +        vddp-supply: false

[Severity: Medium]
Since the top-level select block already guarantees that the compatible string
contains ethernet-phy-idc133.5400, does this else branch become dead code? 

The if condition will always evaluate to true when this file is applied, so
this branch won't be able to enforce the vddp-supply restriction on other
PHYs.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016112033.949026-1-robert.marko@sartura.hr?part=1

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

* Re: [PATCH net-next v2 2/5] net: phy: mxl-gpy: add MxL86211C VDDP supply
  2026-10-16 11:19 ` [PATCH net-next v2 2/5] net: phy: mxl-gpy: " Robert Marko
  2026-10-16 21:12   ` Andrew Lunn
@ 2026-10-17 11:20   ` sashiko-bot
  1 sibling, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-10-17 11:20 UTC (permalink / raw)
  To: Robert Marko, devicetree; +Cc: robh, conor+dt

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] mxl-gpy: missing regulator_enable() for VDDP supply
- [High] phy: mxl-gpy: probe regression on missing vddp-supply
--

commit a90a687bf14a0ab1f83d612c5413b01b74244ef5
Author: Robert Marko <robert.marko@sartura.hr>

net: phy: mxl-gpy: add MxL86211C VDDP supply

This commit introduces VDDP supply handling for the MxL86211C PHY. It
fetches the supply voltage to properly configure the MDIO, MDC, and MDINT
pads for 1.8V or 3.3V operation.

> diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c
> index 089a1a9e5bc61..fbac7c49b4759 100644
> --- a/drivers/net/phy/mxl-gpy.c
> +++ b/drivers/net/phy/mxl-gpy.c
[ ... ]
> @@ -390,6 +396,61 @@ static int gpy_probe(struct phy_device *phydev)
>  	return 0;
>  }
>  
> +static int mxl86211c_configure_mdio_voltage(struct phy_device *phydev,
> +					    struct regulator *vddp)
> +{
> +	int voltage;
> +	int val;
> +
> +	voltage = regulator_get_voltage(vddp);
> +	if (voltage < 0)
> +		return voltage;

[Severity: High]
If the device tree does not provide a vddp-supply, devm_regulator_get()
will return a dummy regulator. Calling regulator_get_voltage() on this dummy
regulator returns -EINVAL, which propagates up and aborts the probe. Will
this break backward compatibility on existing boards that do not define a
vddp-supply?

> +
> +	switch (voltage) {
> +	case 1800000:
> +		val = VSPEC1_PM_CTRL_MDIO_VOL;
> +		break;
> +	case 3300000:
> +		val = 0;
> +		break;
> +	default:
> +		phydev_err(phydev, "unsupported VDDP voltage: %d\n", voltage);
> +		return -EINVAL;
> +	}
> +
> +	return phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_PM_CTRL,
> +			      VSPEC1_PM_CTRL_MDIO_VOL, val);
> +}
> +
> +static int mxl86211c_probe(struct phy_device *phydev)
> +{
> +	struct device *dev = &phydev->mdio.dev;
> +	struct gpy_priv *priv;
> +	struct regulator *vddp;
> +	int ret;
> +
> +	vddp = devm_regulator_get(dev, "vddp");
> +	if (IS_ERR(vddp))
> +		return dev_err_probe(dev, PTR_ERR(vddp),
> +				     "failed to get VDDP supply\n");

[Severity: High]
The VDDP supply is acquired here, but it appears regulator_enable() is never
called. Because the regulator's use-count remains at zero, won't the
regulator core disable the VDDP supply during late init (via
regulator_disable_unused()) unless it is marked as regulator-always-on? 

Disabling this supply would cut power to the PHY's MDIO pads and render the
network interface unusable.

> +	if (!vddp)
> +		return dev_err_probe(dev, -EOPNOTSUPP,
> +				     "VDDP supply requires regulator support\n");
> +
> +	ret = mxl86211c_configure_mdio_voltage(phydev, vddp);
> +	if (ret)
> +		return ret;
> +
> +	ret = gpy_probe(phydev);
> +	if (ret)
> +		return ret;
> +
> +	priv = phydev->priv;
> +	priv->vddp = vddp;
> +
> +	return 0;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016112033.949026-1-robert.marko@sartura.hr?part=2

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

* Re: [PATCH net-next v2 3/5] net: phy: mxl-gpy: release MxL86211C Super Isolate
  2026-10-16 11:19 ` [PATCH net-next v2 3/5] net: phy: mxl-gpy: release MxL86211C Super Isolate Robert Marko
@ 2026-10-17 11:20   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-10-17 11:20 UTC (permalink / raw)
  To: Robert Marko, devicetree; +Cc: robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] net: phy: mxl-gpy: firmware version read while PHY is halted
--

commit 2628bcaa4964186af3313096275fe989a084332d
Author: Robert Marko <robert.marko@sartura.hr>

net: phy: mxl-gpy: release MxL86211C Super Isolate

This commit modifies the driver to release the MxL86211C Super Isolate
mode in config_init rather than probe. This ensures both MDIO pad voltage
and Super Isolate settings are restored after each hardware reset.

> diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c
> index fbac7c49b4759..8bc119655f104 100644
> --- a/drivers/net/phy/mxl-gpy.c
> +++ b/drivers/net/phy/mxl-gpy.c
[ ... ]
> @@ -422,6 +423,23 @@ static int mxl86211c_configure_mdio_voltage(struct phy_device *phydev,
>  			      VSPEC1_PM_CTRL_MDIO_VOL, val);
>  }
>  
> +static int mxl86211c_config_init(struct phy_device *phydev)
> +{
> +	struct gpy_priv *priv = phydev->priv;
> +	int ret;
> +
> +	ret = mxl86211c_configure_mdio_voltage(phydev, priv->vddp);
> +	if (ret)
> +		return ret;
> +
> +	ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_PM_CTRL,
> +			     VSPEC1_PM_CTRL_SI, 0);

[Severity: Medium]
Will this delay in releasing Super Isolate cause gpy_probe() to read an
incorrect firmware version?

If the MxL86211C PHY is strapped into Super Isolate mode, it remains halted
after reset. During device registration, mxl86211c_probe() executes and
invokes gpy_probe() which attempts to read the firmware version:

drivers/net/phy/mxl-gpy.c:gpy_probe() {
    ...
    fw_version = phy_read(phydev, PHY_FWV);
    if (fw_version < 0)
        return fw_version;
    priv->fw_major = FIELD_GET(PHY_FWV_MAJOR_MASK, fw_version);
    priv->fw_minor = FIELD_GET(PHY_FWV_MINOR_MASK, fw_version);
    ...
}

Because the release of the Super Isolate bit (VSPEC1_PM_CTRL_SI) is
deferred here to mxl86211c_config_init(), the PHY microcontroller is
still halted during the probe path.

Could this cause the driver to cache an incorrect firmware version
(likely 0.0), potentially breaking firmware-specific logic like the
workarounds in gpy_sgmii_need_reaneg() and gpy115_loopback()?

> +	if (ret)
> +		return ret;
> +
> +	return gpy21x_config_init(phydev);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016112033.949026-1-robert.marko@sartura.hr?part=3

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

* Re: [PATCH net-next v2 4/5] dt-bindings: net: maxlinear: add MxL86211C lane mapping support
  2026-10-16 11:19 ` [PATCH net-next v2 4/5] dt-bindings: net: maxlinear: add MxL86211C lane mapping support Robert Marko
@ 2026-10-17 11:20   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-10-17 11:20 UTC (permalink / raw)
  To: Robert Marko, devicetree; +Cc: robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dt-bindings: net: maxlinear: dead code in else block due to strict select
--

commit 414c3b989bc8453c4971568d53b96638314826bb
Author: Robert Marko <robert.marko@sartura.hr>

dt-bindings: net: maxlinear: add MxL86211C lane mapping support

Describe the optional board-level mapping from physical TPI lanes to the
MxL86211C analog front ends (ASPs). This allows DTS to describe wiring
that differs from the hardware reset mapping.

> diff --git a/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml b/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
> index a0dfb6192d81b..4323be300c721 100644
> --- a/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
> +++ b/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
> @@ -35,6 +35,7 @@ allOf:
>      else:
>        properties:
>          vddp-supply: false
> +        maxlinear,lane-asp-map: false

[Severity: Medium]
Will this else block ever be reached?

In Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml, the schema
contains a restricted select block:

select:
  properties:
    compatible:
      contains:
        const: ethernet-phy-idc133.5400

Since the allOf / if block checks for the exact same condition, it appears
guaranteed to always evaluate to true, as the schema only evaluates nodes
that already passed the select filter.

This seems to make the else block dead code, meaning maxlinear,lane-asp-map: false
is never actually enforced for non-idc133.5400 nodes.

Additionally, does this strict select block prevent the schema from
evaluating older PHYs like GPY215B/C? If the schema restricts evaluation
exclusively to ethernet-phy-idc133.5400, properties like
maxlinear,use-broken-interrupts might skip validation on older PHYs and be
flagged as undocumented during dtbs_check validations.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016112033.949026-1-robert.marko@sartura.hr?part=4

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

end of thread, other threads:[~2026-10-17 11:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 11:19 [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply Robert Marko
2026-10-16 11:19 ` [PATCH net-next v2 2/5] net: phy: mxl-gpy: " Robert Marko
2026-10-16 21:12   ` Andrew Lunn
2026-10-17 11:20   ` sashiko-bot
2026-10-16 11:19 ` [PATCH net-next v2 3/5] net: phy: mxl-gpy: release MxL86211C Super Isolate Robert Marko
2026-10-17 11:20   ` sashiko-bot
2026-10-16 11:19 ` [PATCH net-next v2 4/5] dt-bindings: net: maxlinear: add MxL86211C lane mapping support Robert Marko
2026-10-17 11:20   ` sashiko-bot
2026-10-16 11:19 ` [PATCH net-next v2 5/5] net: phy: mxl-gpy: support MxL86211C lane mapping Robert Marko
2026-10-16 21:15   ` Andrew Lunn
2026-10-17 11:20 ` [PATCH net-next v2 1/5] dt-bindings: net: maxlinear: add MxL86211C VDDP supply sashiko-bot

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