2024-03-04 09:17:13

by Horatiu Vultur

[permalink] [raw]
Subject: [PATCH net-next v3 0/2] net: phy: micrel: lan8814 erratas

Add two erratas for lan8814. First one fix the led which might
stay on even that there is no link. The second one improves increases
length of the cable that can be used when used in 1000Base-T.

v2->v3:
- drop trailing underscore from register definitions

v1->v2:
- separate errates such that each errate has it's own function.

Horatiu Vultur (2):
net: phy: micrel: lan8814 led errata
net: phy: micrel: lan8814 cable improvement errata

drivers/net/phy/micrel.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

--
2.34.1



2024-03-04 09:17:55

by Horatiu Vultur

[permalink] [raw]
Subject: [PATCH net-next v3 2/2] net: phy: micrel: lan8814 cable improvement errata

When the length of the cable is more than 100m and the lan8814 is
configured to run in 1000Base-T Slave then the register of the device
needs to be optimized.

Workaround this by setting the measure time to a value of 0xb. This
value can be set regardless of the configuration.

This issue is described in 'LAN8814 Silicon Errata and Data Sheet
Clarification' and according to that, this will not be corrected in a
future silicon revision.

Reviewed-by: Wojciech Drewek <[email protected]>
Signed-off-by: Horatiu Vultur <[email protected]>
---
drivers/net/phy/micrel.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 88cc03982bb78..8b8634600c519 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -117,6 +117,10 @@
#define LAN8814_EEE_STATE 0x38
#define LAN8814_EEE_STATE_MASK2P5P BIT(10)

+#define LAN8814_PD_CONTROLS 0x9d
+#define LAN8814_PD_CONTROLS_PD_MEAS_TIME_MASK GENMASK(3, 0)
+#define LAN8814_PD_CONTROLS_PD_MEAS_TIME_VAL 0xb
+
/* Represents 1ppm adjustment in 2^32 format with
* each nsec contains 4 clock cycles.
* The value is calculated as following: (1/1000000)/((2^-32)/4)
@@ -3304,6 +3308,20 @@ static void lan8814_clear_2psp_bit(struct phy_device *phydev)
lanphy_write_page_reg(phydev, 2, LAN8814_EEE_STATE, val);
}

+static void lan8814_update_meas_time(struct phy_device *phydev)
+{
+ u16 val;
+
+ /* By setting the measure time to a value of 0xb this will allow cables
+ * longer than 100m to be used. This configuration can be used
+ * regardless of the mode of operation of the PHY
+ */
+ val = lanphy_read_page_reg(phydev, 1, LAN8814_PD_CONTROLS);
+ val &= ~LAN8814_PD_CONTROLS_PD_MEAS_TIME_MASK;
+ val |= LAN8814_PD_CONTROLS_PD_MEAS_TIME_VAL;
+ lanphy_write_page_reg(phydev, 1, LAN8814_PD_CONTROLS, val);
+}
+
static int lan8814_probe(struct phy_device *phydev)
{
const struct kszphy_type *type = phydev->drv->driver_data;
@@ -3342,6 +3360,7 @@ static int lan8814_probe(struct phy_device *phydev)

/* Errata workarounds */
lan8814_clear_2psp_bit(phydev);
+ lan8814_update_meas_time(phydev);

return 0;
}
--
2.34.1


2024-03-04 13:25:06

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH net-next v3 2/2] net: phy: micrel: lan8814 cable improvement errata

On Mon, Mar 04, 2024 at 10:15:48AM +0100, Horatiu Vultur wrote:
> When the length of the cable is more than 100m and the lan8814 is
> configured to run in 1000Base-T Slave then the register of the device
> needs to be optimized.
>
> Workaround this by setting the measure time to a value of 0xb. This
> value can be set regardless of the configuration.
>
> This issue is described in 'LAN8814 Silicon Errata and Data Sheet
> Clarification' and according to that, this will not be corrected in a
> future silicon revision.
>
> Reviewed-by: Wojciech Drewek <[email protected]>
> Signed-off-by: Horatiu Vultur <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2024-03-04 14:09:18

by Arun Ramadoss

[permalink] [raw]
Subject: Re: [PATCH net-next v3 2/2] net: phy: micrel: lan8814 cable improvement errata

On Mon, 2024-03-04 at 10:15 +0100, Horatiu Vultur wrote:
> When the length of the cable is more than 100m and the lan8814 is
> configured to run in 1000Base-T Slave then the register of the device
> needs to be optimized.
>
> Workaround this by setting the measure time to a value of 0xb. This
> value can be set regardless of the configuration.
>
> This issue is described in 'LAN8814 Silicon Errata and Data Sheet
> Clarification' and according to that, this will not be corrected in a
> future silicon revision.
>
> Reviewed-by: Wojciech Drewek <[email protected]>
> Signed-off-by: Horatiu Vultur <[email protected]>

Acked-by: Arun Ramadoss <[email protected]>

2024-03-05 19:20:44

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net-next v3 0/2] net: phy: micrel: lan8814 erratas

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <[email protected]>:

On Mon, 4 Mar 2024 10:15:46 +0100 you wrote:
> Add two erratas for lan8814. First one fix the led which might
> stay on even that there is no link. The second one improves increases
> length of the cable that can be used when used in 1000Base-T.
>
> v2->v3:
> - drop trailing underscore from register definitions
>
> [...]

Here is the summary with links:
- [net-next,v3,1/2] net: phy: micrel: lan8814 led errata
https://git.kernel.org/netdev/net-next/c/e9097f8e1e76
- [net-next,v3,2/2] net: phy: micrel: lan8814 cable improvement errata
https://git.kernel.org/netdev/net-next/c/ad080db4483b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html