Re: [PATCH v4 1/3] net: dsa: microchip: implement KSZ87xx Module 3 low-loss cable errata

From: Fidelio LAWSON

Date: Fri Apr 17 2026 - 11:23:39 EST


On 4/17/26 16:35, Marek Vasut wrote:
On 4/17/26 2:44 PM, Fidelio Lawson wrote:

[...]

@@ -1271,6 +1287,29 @@ int ksz8_w_phy(struct ksz_device *dev, u16 phy, u16 reg, u16 val)
          if (ret)
              return ret;
          break;
+    case PHY_REG_KSZ87XX_SHORT_CABLE:
+        if (!ksz_is_ksz87xx(dev))
+            return -EOPNOTSUPP;
+        ret = ksz87xx_apply_low_loss_preset(dev, !!val);
+        if (ret)
+            return ret;
+        break;
+    case PHY_REG_KSZ87XX_LPF_BW:
+        if (!ksz_is_ksz87xx(dev))
+            return -EOPNOTSUPP;
+        ret = ksz8_ind_write8(dev, TABLE_LINK_MD, KSZ87XX_REG_PHY_LPF, (u8)val);
+        if (ret)
+            return ret;
+        dev->lpf_bw = val;
+        break;
+    case PHY_REG_KSZ87XX_EQ_INIT:
+        if (!ksz_is_ksz87xx(dev))
+            return -EOPNOTSUPP;
+        ret = ksz8_ind_write8(dev, TABLE_LINK_MD, KSZ87XX_REG_DSP_EQ, (u8)val);
Do these values need some check, so they would be in the correct range(s) / in the correct bitfields before being written into those registers ?

Yes, I can add validation to ensure that only the documented bitfields are accepted before writing the registers, (bits [7:6] for the LPF bandwidth and bits [5:0] for the DSP EQ initial value).