mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] net: phy: tja11xx: add support for TJA1102S
@ 2025-03-04 18:37 Dimitri Fedrau via B4 Relay
  2025-03-04 18:37 ` [PATCH net-next v2 1/2] " Dimitri Fedrau via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dimitri Fedrau via B4 Relay @ 2025-03-04 18:37 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, Dimitri Fedrau, Dimitri Fedrau,
	Marek Vasut, Oleksij Rempel

- add support for TJA1102S
- enable PHY in sleep mode for TJA1102S

Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
---
Changes in v2:
- Drop fallthrough tja11xx_config_init
- Address net-next
- Link to v1: https://lore.kernel.org/r/20250303-tja1102s-support-v1-0-180e945396e0@liebherr.com

---
Dimitri Fedrau (2):
      net: phy: tja11xx: add support for TJA1102S
      net: phy: tja11xx: enable PHY in sleep mode for TJA1102S

 drivers/net/phy/nxp-tja11xx.c | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
---
base-commit: f77f12010f67259bd0e1ad18877ed27c721b627a
change-id: 20250303-tja1102s-support-53267c1e9dc4

Best regards,
-- 
Dimitri Fedrau <dimitri.fedrau@liebherr.com>



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

* [PATCH net-next v2 1/2] net: phy: tja11xx: add support for TJA1102S
  2025-03-04 18:37 [PATCH net-next v2 0/2] net: phy: tja11xx: add support for TJA1102S Dimitri Fedrau via B4 Relay
@ 2025-03-04 18:37 ` Dimitri Fedrau via B4 Relay
  2025-03-04 20:30   ` Andrew Lunn
  2025-03-04 18:37 ` [PATCH net-next v2 2/2] net: phy: tja11xx: enable PHY in sleep mode " Dimitri Fedrau via B4 Relay
  2025-03-08  4:00 ` [PATCH net-next v2 0/2] net: phy: tja11xx: add support " patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Dimitri Fedrau via B4 Relay @ 2025-03-04 18:37 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, Dimitri Fedrau, Dimitri Fedrau,
	Marek Vasut, Oleksij Rempel

From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>

NXPs TJA1102S is a single PHY version of the TJA1102 in which one of the
PHYs is disabled.

Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
---
 drivers/net/phy/nxp-tja11xx.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/net/phy/nxp-tja11xx.c b/drivers/net/phy/nxp-tja11xx.c
index ed7fa26bac8e83f43d6d656e2e2812e501111eb0..9cf5e6d32fab88cae5cd556623a9ffa285227ab6 100644
--- a/drivers/net/phy/nxp-tja11xx.c
+++ b/drivers/net/phy/nxp-tja11xx.c
@@ -21,6 +21,7 @@
 #define PHY_ID_TJA1100			0x0180dc40
 #define PHY_ID_TJA1101			0x0180dd00
 #define PHY_ID_TJA1102			0x0180dc80
+#define PHY_ID_TJA1102S			0x0180dc90
 
 #define MII_ECTRL			17
 #define MII_ECTRL_LINK_CONTROL		BIT(15)
@@ -316,6 +317,7 @@ static int tja11xx_config_init(struct phy_device *phydev)
 		if (ret)
 			return ret;
 		break;
+	case PHY_ID_TJA1102S:
 	case PHY_ID_TJA1101:
 		reg_mask = MII_CFG1_INTERFACE_MODE_MASK;
 		ret = tja11xx_get_interface_mode(phydev);
@@ -883,6 +885,29 @@ static struct phy_driver tja11xx_driver[] = {
 		.handle_interrupt = tja11xx_handle_interrupt,
 		.cable_test_start = tja11xx_cable_test_start,
 		.cable_test_get_status = tja11xx_cable_test_get_status,
+	}, {
+		PHY_ID_MATCH_MODEL(PHY_ID_TJA1102S),
+		.name		= "NXP TJA1102S",
+		.features       = PHY_BASIC_T1_FEATURES,
+		.flags          = PHY_POLL_CABLE_TEST,
+		.probe		= tja11xx_probe,
+		.soft_reset	= tja11xx_soft_reset,
+		.config_aneg	= tja11xx_config_aneg,
+		.config_init	= tja11xx_config_init,
+		.read_status	= tja11xx_read_status,
+		.get_sqi	= tja11xx_get_sqi,
+		.get_sqi_max	= tja11xx_get_sqi_max,
+		.suspend	= genphy_suspend,
+		.resume		= genphy_resume,
+		.set_loopback   = genphy_loopback,
+		/* Statistics */
+		.get_sset_count = tja11xx_get_sset_count,
+		.get_strings	= tja11xx_get_strings,
+		.get_stats	= tja11xx_get_stats,
+		.config_intr	= tja11xx_config_intr,
+		.handle_interrupt = tja11xx_handle_interrupt,
+		.cable_test_start = tja11xx_cable_test_start,
+		.cable_test_get_status = tja11xx_cable_test_get_status,
 	}
 };
 
@@ -892,6 +917,7 @@ static const struct mdio_device_id __maybe_unused tja11xx_tbl[] = {
 	{ PHY_ID_MATCH_MODEL(PHY_ID_TJA1100) },
 	{ PHY_ID_MATCH_MODEL(PHY_ID_TJA1101) },
 	{ PHY_ID_MATCH_MODEL(PHY_ID_TJA1102) },
+	{ PHY_ID_MATCH_MODEL(PHY_ID_TJA1102S) },
 	{ }
 };
 

-- 
2.39.5



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

* [PATCH net-next v2 2/2] net: phy: tja11xx: enable PHY in sleep mode for TJA1102S
  2025-03-04 18:37 [PATCH net-next v2 0/2] net: phy: tja11xx: add support for TJA1102S Dimitri Fedrau via B4 Relay
  2025-03-04 18:37 ` [PATCH net-next v2 1/2] " Dimitri Fedrau via B4 Relay
@ 2025-03-04 18:37 ` Dimitri Fedrau via B4 Relay
  2025-03-08  4:00 ` [PATCH net-next v2 0/2] net: phy: tja11xx: add support " patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Dimitri Fedrau via B4 Relay @ 2025-03-04 18:37 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, Dimitri Fedrau, Dimitri Fedrau,
	Marek Vasut, Oleksij Rempel

From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>

Due to pin strapping the PHY maybe disabled per default. TJA1102 devices
can be enabled by setting the PHY_EN bit. Support is provided for TJA1102S
devices but can be easily added for TJA1102 too.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
---
 drivers/net/phy/nxp-tja11xx.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/phy/nxp-tja11xx.c b/drivers/net/phy/nxp-tja11xx.c
index 9cf5e6d32fab88cae5cd556623a9ffa285227ab6..601094fe24ca8273a845512b111ccdd9d2785758 100644
--- a/drivers/net/phy/nxp-tja11xx.c
+++ b/drivers/net/phy/nxp-tja11xx.c
@@ -28,6 +28,7 @@
 #define MII_ECTRL_POWER_MODE_MASK	GENMASK(14, 11)
 #define MII_ECTRL_POWER_MODE_NO_CHANGE	(0x0 << 11)
 #define MII_ECTRL_POWER_MODE_NORMAL	(0x3 << 11)
+#define MII_ECTRL_POWER_MODE_SLEEP	(0xa << 11)
 #define MII_ECTRL_POWER_MODE_STANDBY	(0xc << 11)
 #define MII_ECTRL_CABLE_TEST		BIT(5)
 #define MII_ECTRL_CONFIG_EN		BIT(2)
@@ -79,6 +80,9 @@
 #define MII_COMMCFG			27
 #define MII_COMMCFG_AUTO_OP		BIT(15)
 
+#define MII_CFG3			28
+#define MII_CFG3_PHY_EN			BIT(0)
+
 /* Configure REF_CLK as input in RMII mode */
 #define TJA110X_RMII_MODE_REFCLK_IN       BIT(0)
 
@@ -180,6 +184,14 @@ static int tja11xx_wakeup(struct phy_device *phydev)
 			return ret;
 
 		return tja11xx_enable_link_control(phydev);
+	case MII_ECTRL_POWER_MODE_SLEEP:
+		switch (phydev->phy_id & PHY_ID_MASK) {
+		case PHY_ID_TJA1102S:
+			/* Enable PHY, maybe it is disabled due to pin strapping */
+			return phy_set_bits(phydev, MII_CFG3, MII_CFG3_PHY_EN);
+		default:
+			return 0;
+		}
 	default:
 		break;
 	}

-- 
2.39.5



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

* Re: [PATCH net-next v2 1/2] net: phy: tja11xx: add support for TJA1102S
  2025-03-04 18:37 ` [PATCH net-next v2 1/2] " Dimitri Fedrau via B4 Relay
@ 2025-03-04 20:30   ` Andrew Lunn
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2025-03-04 20:30 UTC (permalink / raw)
  To: dimitri.fedrau
  Cc: Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel,
	Dimitri Fedrau, Marek Vasut, Oleksij Rempel

On Tue, Mar 04, 2025 at 07:37:26PM +0100, Dimitri Fedrau via B4 Relay wrote:
> From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> 
> NXPs TJA1102S is a single PHY version of the TJA1102 in which one of the
> PHYs is disabled.
> 
> Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>

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

    Andrew

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

* Re: [PATCH net-next v2 0/2] net: phy: tja11xx: add support for TJA1102S
  2025-03-04 18:37 [PATCH net-next v2 0/2] net: phy: tja11xx: add support for TJA1102S Dimitri Fedrau via B4 Relay
  2025-03-04 18:37 ` [PATCH net-next v2 1/2] " Dimitri Fedrau via B4 Relay
  2025-03-04 18:37 ` [PATCH net-next v2 2/2] net: phy: tja11xx: enable PHY in sleep mode " Dimitri Fedrau via B4 Relay
@ 2025-03-08  4:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-03-08  4:00 UTC (permalink / raw)
  To: Dimitri Fedrau via B4 Relay
  Cc: andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, dimitri.fedrau, dima.fedrau, marex, o.rempel

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 04 Mar 2025 19:37:25 +0100 you wrote:
> - add support for TJA1102S
> - enable PHY in sleep mode for TJA1102S
> 
> Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> ---
> Changes in v2:
> - Drop fallthrough tja11xx_config_init
> - Address net-next
> - Link to v1: https://lore.kernel.org/r/20250303-tja1102s-support-v1-0-180e945396e0@liebherr.com
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/2] net: phy: tja11xx: add support for TJA1102S
    https://git.kernel.org/netdev/net-next/c/5d7610577fd9
  - [net-next,v2,2/2] net: phy: tja11xx: enable PHY in sleep mode for TJA1102S
    https://git.kernel.org/netdev/net-next/c/5b3178c452c3

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



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

end of thread, other threads:[~2025-03-08  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-04 18:37 [PATCH net-next v2 0/2] net: phy: tja11xx: add support for TJA1102S Dimitri Fedrau via B4 Relay
2025-03-04 18:37 ` [PATCH net-next v2 1/2] " Dimitri Fedrau via B4 Relay
2025-03-04 20:30   ` Andrew Lunn
2025-03-04 18:37 ` [PATCH net-next v2 2/2] net: phy: tja11xx: enable PHY in sleep mode " Dimitri Fedrau via B4 Relay
2025-03-08  4:00 ` [PATCH net-next v2 0/2] net: phy: tja11xx: add support " patchwork-bot+netdevbpf

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

all inboxes | Powered by JetHome®