diff mbox series

[1/3] net: phy: nxp-c45-tja11xx: add support for TJA1121

Message ID 20250227160057.2385803-2-andrei.botila@oss.nxp.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: phy: nxp-c45-tja11xx: add support for TJA1121 and errata | expand

Checks

Context Check Description
netdev/series_format warning Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 1 this patch: 1
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 40 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2025-02-28--00-00 (tests: 896)

Commit Message

Andrei Botila Feb. 27, 2025, 4 p.m. UTC
Add naming for TJA1121 since TJA1121 is based on TJA1120 but with
additional MACsec IP.
Same applies for TJA1103 which shares the same hardware as TJA1104 with
the latter having MACsec IP enabled.

Signed-off-by: Andrei Botila <andrei.botila@oss.nxp.com>
---
 drivers/net/phy/Kconfig           | 2 +-
 drivers/net/phy/nxp-c45-tja11xx.c | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

Comments

Andrew Lunn Feb. 27, 2025, 4:14 p.m. UTC | #1
On Thu, Feb 27, 2025 at 06:00:54PM +0200, Andrei Botila wrote:
> Add naming for TJA1121 since TJA1121 is based on TJA1120 but with
> additional MACsec IP.
> Same applies for TJA1103 which shares the same hardware as TJA1104 with
> the latter having MACsec IP enabled.
> 
> Signed-off-by: Andrei Botila <andrei.botila@oss.nxp.com>
> ---
>  drivers/net/phy/Kconfig           | 2 +-
>  drivers/net/phy/nxp-c45-tja11xx.c | 8 +++++---
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
> index 41c15a2c2037..d29f9f7fd2e1 100644
> --- a/drivers/net/phy/Kconfig
> +++ b/drivers/net/phy/Kconfig
> @@ -328,7 +328,7 @@ config NXP_C45_TJA11XX_PHY
>  	depends on MACSEC || !MACSEC
>  	help
>  	  Enable support for NXP C45 TJA11XX PHYs.
> -	  Currently supports the TJA1103, TJA1104 and TJA1120 PHYs.
> +	  Currently supports the TJA1103, TJA1104, TJA1120 and TJA1121 PHYs.
>  
>  config NXP_TJA11XX_PHY
>  	tristate "NXP TJA11xx PHYs support"
> diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c
> index 34231b5b9175..244b5889e805 100644
> --- a/drivers/net/phy/nxp-c45-tja11xx.c
> +++ b/drivers/net/phy/nxp-c45-tja11xx.c
> @@ -1,6 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0
>  /* NXP C45 PHY driver
> - * Copyright 2021-2023 NXP
> + * Copyright 2021-2025 NXP
>   * Author: Radu Pirea <radu-nicolae.pirea@oss.nxp.com>
>   */
>  
> @@ -19,7 +19,9 @@
>  
>  #include "nxp-c45-tja11xx.h"
>  
> +/* Same id: TJA1103, TJA1104 */
>  #define PHY_ID_TJA_1103			0x001BB010
> +/* Same id: TJA1120, TJA1121 */
>  #define PHY_ID_TJA_1120			0x001BB031

Is there a way to tell them apart? Another register somewhere?

	Andrew
Andrei Botila Feb. 27, 2025, 4:30 p.m. UTC | #2
On 2/27/2025 6:14 PM, Andrew Lunn wrote:
> On Thu, Feb 27, 2025 at 06:00:54PM +0200, Andrei Botila wrote:
>> Add naming for TJA1121 since TJA1121 is based on TJA1120 but with
>> additional MACsec IP.
>> Same applies for TJA1103 which shares the same hardware as TJA1104 with
>> the latter having MACsec IP enabled.
>>
>> Signed-off-by: Andrei Botila <andrei.botila@oss.nxp.com>
>> ---
>>   drivers/net/phy/Kconfig           | 2 +-
>>   drivers/net/phy/nxp-c45-tja11xx.c | 8 +++++---
>>   2 files changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
>> index 41c15a2c2037..d29f9f7fd2e1 100644
>> --- a/drivers/net/phy/Kconfig
>> +++ b/drivers/net/phy/Kconfig
>> @@ -328,7 +328,7 @@ config NXP_C45_TJA11XX_PHY
>>   	depends on MACSEC || !MACSEC
>>   	help
>>   	  Enable support for NXP C45 TJA11XX PHYs.
>> -	  Currently supports the TJA1103, TJA1104 and TJA1120 PHYs.
>> +	  Currently supports the TJA1103, TJA1104, TJA1120 and TJA1121 PHYs.
>>   
>>   config NXP_TJA11XX_PHY
>>   	tristate "NXP TJA11xx PHYs support"
>> diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c
>> index 34231b5b9175..244b5889e805 100644
>> --- a/drivers/net/phy/nxp-c45-tja11xx.c
>> +++ b/drivers/net/phy/nxp-c45-tja11xx.c
>> @@ -1,6 +1,6 @@
>>   // SPDX-License-Identifier: GPL-2.0
>>   /* NXP C45 PHY driver
>> - * Copyright 2021-2023 NXP
>> + * Copyright 2021-2025 NXP
>>    * Author: Radu Pirea <radu-nicolae.pirea@oss.nxp.com>
>>    */
>>   
>> @@ -19,7 +19,9 @@
>>   
>>   #include "nxp-c45-tja11xx.h"
>>   
>> +/* Same id: TJA1103, TJA1104 */
>>   #define PHY_ID_TJA_1103			0x001BB010
>> +/* Same id: TJA1120, TJA1121 */
>>   #define PHY_ID_TJA_1120			0x001BB031
> 
> Is there a way to tell them apart? Another register somewhere?

Unfortunately no, TJA1120 and TJA1121 share the same hardware the only 
difference being that TJA1121 has MACsec support while TJA1120 does not.
It is the same for TJA1103 and TJA1104.

Best regards,
Andrei

> 
> 	Andrew
Andrew Lunn Feb. 27, 2025, 4:56 p.m. UTC | #3
> > Is there a way to tell them apart? Another register somewhere?
> 
> Unfortunately no, TJA1120 and TJA1121 share the same hardware the only
> difference being that TJA1121 has MACsec support while TJA1120 does not.
> It is the same for TJA1103 and TJA1104.

So the hardware can do MACsec, but it is disabled in firmware? Golden
screw driver could be used?

So you can tell them apart, otherwise you would offer MACsec on both.
It might be worth adding a .match_phy_device to the driver, so you can
have an entry per device. Just watch out for the semantics of
.match_phy_device, it gets called before the IDs are looked at.

	Andrew
diff mbox series

Patch

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 41c15a2c2037..d29f9f7fd2e1 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -328,7 +328,7 @@  config NXP_C45_TJA11XX_PHY
 	depends on MACSEC || !MACSEC
 	help
 	  Enable support for NXP C45 TJA11XX PHYs.
-	  Currently supports the TJA1103, TJA1104 and TJA1120 PHYs.
+	  Currently supports the TJA1103, TJA1104, TJA1120 and TJA1121 PHYs.
 
 config NXP_TJA11XX_PHY
 	tristate "NXP TJA11xx PHYs support"
diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c
index 34231b5b9175..244b5889e805 100644
--- a/drivers/net/phy/nxp-c45-tja11xx.c
+++ b/drivers/net/phy/nxp-c45-tja11xx.c
@@ -1,6 +1,6 @@ 
 // SPDX-License-Identifier: GPL-2.0
 /* NXP C45 PHY driver
- * Copyright 2021-2023 NXP
+ * Copyright 2021-2025 NXP
  * Author: Radu Pirea <radu-nicolae.pirea@oss.nxp.com>
  */
 
@@ -19,7 +19,9 @@ 
 
 #include "nxp-c45-tja11xx.h"
 
+/* Same id: TJA1103, TJA1104 */
 #define PHY_ID_TJA_1103			0x001BB010
+/* Same id: TJA1120, TJA1121 */
 #define PHY_ID_TJA_1120			0x001BB031
 
 #define VEND1_DEVICE_CONTROL		0x0040
@@ -1959,7 +1961,7 @@  static const struct nxp_c45_phy_data tja1120_phy_data = {
 static struct phy_driver nxp_c45_driver[] = {
 	{
 		PHY_ID_MATCH_MODEL(PHY_ID_TJA_1103),
-		.name			= "NXP C45 TJA1103",
+		.name			= "NXP C45 TJA1103 or TJA1104",
 		.get_features		= nxp_c45_get_features,
 		.driver_data		= &tja1103_phy_data,
 		.probe			= nxp_c45_probe,
@@ -1983,7 +1985,7 @@  static struct phy_driver nxp_c45_driver[] = {
 	},
 	{
 		PHY_ID_MATCH_MODEL(PHY_ID_TJA_1120),
-		.name			= "NXP C45 TJA1120",
+		.name			= "NXP C45 TJA1120 or TJA1121",
 		.get_features		= nxp_c45_get_features,
 		.driver_data		= &tja1120_phy_data,
 		.probe			= nxp_c45_probe,