Skip to contentSkip to conversation

phy: ti: gmii-sel: add support for am654x/j721e soc

PATCH Applied Grygorii Strashko 4 participants 13 messages Mar 3, 2020 – Mar 20, 2020 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover phy: ti: gmii-sel: add support for am654x/j721e soc

Hi Kishon,

This series adds support for TI K3 AM654x/J721E SoCs in TI phy-gmii-sel PHY driver, which is required for future adding networking support.

depends on:
[PATCH 0/2] phy: ti: gmii-sel: two fixes
https://lkml.org/lkml/2020/2/14/2510

Changes in v2:
- fixed comments

v1: https://lkml.org/lkml/2020/2/22/100

Grygorii Strashko (5):
phy: ti: gmii-sel: simplify config dependencies between net drivers
and gmii phy
dt-bindings: phy: ti: gmii-sel: add support for am654x/j721e soc
phy: ti: gmii-sel: add support for am654x/j721e soc
arm64: dts: ti: k3-am65-mcu: add phy-gmii-sel node
arm64: dts: ti: k3-j721e-mcu: add scm node and phy-gmii-sel nodes

 .../bindings/phy/ti-phy-gmii-sel.txt          |  1 +
 arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi       |  6 ++++++
 .../boot/dts/ti/k3-j721e-mcu-wakeup.dtsi      | 14 ++++++++++++++
 drivers/net/ethernet/ti/Kconfig               |  1 +
 drivers/phy/ti/Kconfig                        |  3 ---
 drivers/phy/ti/phy-gmii-sel.c                 | 19 +++++++++++++++++++
 6 files changed, 41 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/5 phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy

The phy-gmii-sel can be only auto selected in Kconfig and now the pretty complex Kconfig dependencies are defined for phy-gmii-sel driver, which also need to be updated every time phy-gmii-sel is re-used for any new networking driver.

Simplify Kconfig definition for phy-gmii-sel PHY driver - drop all dependencies and from networking drivers and rely on using 'imply PHY_TI_GMII_SEL' in Kconfig definitions for networking drivers instead.

---
 drivers/net/ethernet/ti/Kconfig | 1 +
 drivers/phy/ti/Kconfig          | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/ti/Kconfig +1 -0
index bf98e0fa7d8b..8a6ca16eee3b 100644
@@ -53,6 +53,7 @@ config TI_CPSW
 	select MFD_SYSCON
 	select PAGE_POOL
 	select REGMAP
+	imply PHY_TI_GMII_SEL
 	---help---
 	  This driver supports TI's CPSW Ethernet Switch.
 
drivers/phy/ti/Kconfig +0 -3
index 6dbe9d0b9ff3..15a3bcf32308 100644
@@ -106,11 +106,8 @@ config TWL4030_USB
 
 config PHY_TI_GMII_SEL
 	tristate
-	default y if TI_CPSW=y || TI_CPSW_SWITCHDEV=y
-	depends on TI_CPSW || TI_CPSW_SWITCHDEV || COMPILE_TEST
 	select GENERIC_PHY
 	select REGMAP
-	default m
 	help
 	  This driver supports configuring of the TI CPSW Port mode depending on
 	  the Ethernet PHY connected to the CPSW Port.
Signature · 1 line
2.17.1
#2 lore raw

Re: [for-next PATCH v2 1/5] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy

Hi Dave,

Quoted 5 lines · Grygorii Strashko

The phy-gmii-sel can be only auto selected in Kconfig and now the pretty complex Kconfig dependencies are defined for phy-gmii-sel driver, which also need to be updated every time phy-gmii-sel is re-used for any new networking driver.

Quoted 7 lines

Simplify Kconfig definition for phy-gmii-sel PHY driver - drop all dependencies and from networking drivers and rely on using 'imply PHY_TI_GMII_SEL' in Kconfig definitions for networking drivers instead.

---
 drivers/net/ethernet/ti/Kconfig | 1 +

I can pick this in my tree. Can you give your Acked-by since there is a small change in drivers/net?

Thanks
Kishon

Quoted 32 lines
 drivers/phy/ti/Kconfig          | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/ti/Kconfig +1 -0
index bf98e0fa7d8b..8a6ca16eee3b 100644
@@ -53,6 +53,7 @@ config TI_CPSW
 	select MFD_SYSCON
 	select PAGE_POOL
 	select REGMAP
+	imply PHY_TI_GMII_SEL
 	---help---
 	  This driver supports TI's CPSW Ethernet Switch.
 
drivers/phy/ti/Kconfig +0 -3
index 6dbe9d0b9ff3..15a3bcf32308 100644
@@ -106,11 +106,8 @@ config TWL4030_USB
 
 config PHY_TI_GMII_SEL
 	tristate
-	default y if TI_CPSW=y || TI_CPSW_SWITCHDEV=y
-	depends on TI_CPSW || TI_CPSW_SWITCHDEV || COMPILE_TEST
 	select GENERIC_PHY
 	select REGMAP
-	default m
 	help
 	  This driver supports configuring of the TI CPSW Port mode depending on
 	  the Ethernet PHY connected to the CPSW Port.
#3 lore raw

Re: [for-next PATCH v2 1/5] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy

Hi All,

Quoted 12 lines · Kishon Vijay Abraham I

Hi Dave,

Quoted 9 lines · Grygorii Strashko

The phy-gmii-sel can be only auto selected in Kconfig and now the pretty complex Kconfig dependencies are defined for phy-gmii-sel driver, which also need to be updated every time phy-gmii-sel is re-used for any new networking driver.

Simplify Kconfig definition for phy-gmii-sel PHY driver - drop all dependencies and from networking drivers and rely on using 'imply PHY_TI_GMII_SEL' in Kconfig definitions for networking drivers instead.

Quoted 6 lines
Quoted 3 lines
---
  drivers/net/ethernet/ti/Kconfig | 1 +

I can pick this in my tree. Can you give your Acked-by since there is a small change in drivers/net?

Sorry for disturbing you, but what's the final decision here?

Quoted 35 lines

Thanks
Kishon

Quoted 32 lines
  drivers/phy/ti/Kconfig          | 3 ---
  2 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/ti/Kconfig +1 -0
index bf98e0fa7d8b..8a6ca16eee3b 100644
@@ -53,6 +53,7 @@ config TI_CPSW
  	select MFD_SYSCON
  	select PAGE_POOL
  	select REGMAP
+	imply PHY_TI_GMII_SEL
  	---help---
  	  This driver supports TI's CPSW Ethernet Switch.
 
drivers/phy/ti/Kconfig +0 -3
index 6dbe9d0b9ff3..15a3bcf32308 100644
@@ -106,11 +106,8 @@ config TWL4030_USB
 
  config PHY_TI_GMII_SEL
  	tristate
-	default y if TI_CPSW=y || TI_CPSW_SWITCHDEV=y
-	depends on TI_CPSW || TI_CPSW_SWITCHDEV || COMPILE_TEST
  	select GENERIC_PHY
  	select REGMAP
-	default m
  	help
  	  This driver supports configuring of the TI CPSW Port mode depending on
  	  the Ethernet PHY connected to the CPSW Port.
Signature · 2 lines
Best regards,
grygorii

A message that is not in the archive (sent off-list or not yet received): 20200316140859.GA30922@a0393678ub

#5 lore raw

Re: [for-next PATCH v2 1/5] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy

Quoted 6 lines · Kishon Vijay Abraham I
Quoted 5 lines · Grygorii Strashko

The phy-gmii-sel can be only auto selected in Kconfig and now the pretty complex Kconfig dependencies are defined for phy-gmii-sel driver, which also need to be updated every time phy-gmii-sel is re-used for any new networking driver.

Quoted 7 lines
Quoted 5 lines

Simplify Kconfig definition for phy-gmii-sel PHY driver - drop all dependencies and from networking drivers and rely on using 'imply PHY_TI_GMII_SEL' in Kconfig definitions for networking drivers instead.

Thanks you, Kishon.

I'll include this patch in next version of my series to add networking support for k3 am65x/j721e soc.

Signature · 2 lines
Best regards,
grygorii
#6 lore raw

PATCH v2 2/5 dt-bindings: phy: ti: gmii-sel: add support for am654x/j721e soc

In reply to Grygorii Strashko

TI AM654x/J721E SoCs have the same PHY interface selection mechanism for CPSWx subsystem as TI SoCs (AM3/4/5/DRA7), but registers and bit-fields placement is different.

This patch adds corresponding compatible strings to enable support for TI AM654x/J721E SoCs.

---
 Documentation/devicetree/bindings/phy/ti-phy-gmii-sel.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/phy/ti-phy-gmii-sel.txt +1 -0
index 50ce9ae0f7a5..83b78c1c0644 100644
@@ -40,6 +40,7 @@ Required properties:
 			  "ti,dra7xx-phy-gmii-sel" for dra7xx/am57xx platform
 			  "ti,am43xx-phy-gmii-sel" for am43xx platform
 			  "ti,dm814-phy-gmii-sel" for dm814x platform
+			  "ti,am654-phy-gmii-sel" for AM654x/J721E platform
 - reg			: Address and length of the register set for the device
 - #phy-cells		: must be 2.
 			  cell 1 - CPSW port number (starting from 1)
Signature · 1 line
2.17.1
#7 lore raw

PATCH v2 3/5 phy: ti: gmii-sel: add support for am654x/j721e soc

In reply to Grygorii Strashko

TI AM654x/J721E SoCs have the same PHY interface selection mechanism for CPSWx subsystem as TI SoCs (AM3/4/5/DRA7), but registers and bit-fields placement is different.

This patch adds corresponding support for TI AM654x/J721E SoCs PHY interface selection.

---
 drivers/phy/ti/phy-gmii-sel.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/phy/ti/phy-gmii-sel.c +19 -0
index 1c536fc03c83..7edd5c3bc536 100644
@@ -170,6 +170,21 @@ struct phy_gmii_sel_soc_data phy_gmii_sel_soc_dm814 = {
 	.regfields = phy_gmii_sel_fields_am33xx,
 };
 
+static const
+struct reg_field phy_gmii_sel_fields_am654[][PHY_GMII_SEL_LAST] = {
+	{
+		[PHY_GMII_SEL_PORT_MODE] = REG_FIELD(0x4040, 0, 1),
+		[PHY_GMII_SEL_RGMII_ID_MODE] = REG_FIELD((~0), 0, 0),
+		[PHY_GMII_SEL_RMII_IO_CLK_EN] = REG_FIELD((~0), 0, 0),
+	},
+};
+
+static const
+struct phy_gmii_sel_soc_data phy_gmii_sel_soc_am654 = {
+	.num_ports = 1,
+	.regfields = phy_gmii_sel_fields_am654,
+};
+
 static const struct of_device_id phy_gmii_sel_id_table[] = {
 	{
 		.compatible	= "ti,am3352-phy-gmii-sel",
@@ -187,6 +202,10 @@ static const struct of_device_id phy_gmii_sel_id_table[] = {
 		.compatible	= "ti,dm814-phy-gmii-sel",
 		.data		= &phy_gmii_sel_soc_dm814,
 	},
+	{
+		.compatible	= "ti,am654-phy-gmii-sel",
+		.data		= &phy_gmii_sel_soc_am654,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, phy_gmii_sel_id_table);
Signature · 1 line
2.17.1
#8 lore raw

PATCH v2 4/5 arm64: dts: ti: k3-am65-mcu: add phy-gmii-sel node

In reply to Grygorii Strashko

Add DT node for the TI AM65x SoC phy-gmii-sel PHY required for Ethernet ports mode selection.

---
 arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi +6 -0
index 92629cbdc184..ad89f93f30e5 100644
@@ -12,6 +12,12 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x40f00000 0x20000>;
+
+		phy_gmii_sel: phy@4040 {
+			compatible = "ti,am654-phy-gmii-sel";
+			reg = <0x4040 0x4>;
+			#phy-cells = <1>;
+		};
 	};
 
 	mcu_uart0: serial@40a00000 {
Signature · 1 line
2.17.1
#9 lore raw

PATCH v2 5/5 arm64: dts: ti: k3-j721e-mcu: add scm node and phy-gmii-sel nodes

In reply to Grygorii Strashko

Add DT node for MCU System Control module DT node and DT node for the TI J721E SoC phy-gmii-sel PHY required for Ethernet ports mode selection.

---
 arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi +14 -0
index 16c874bfd49a..6f961d5f077a 100644
@@ -34,6 +34,20 @@
 		};
 	};
 
+	mcu_conf: syscon@40f00000 {
+		compatible = "syscon", "simple-mfd";
+		reg = <0x0 0x40f00000 0x0 0x20000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x0 0x0 0x40f00000 0x20000>;
+
+		phy_gmii_sel: phy@4040 {
+			compatible = "ti,am654-phy-gmii-sel";
+			reg = <0x4040 0x4>;
+			#phy-cells = <1>;
+		};
+	};
+
 	wkup_pmx0: pinmux@4301c000 {
 		compatible = "pinctrl-single";
 		/* Proxy 0 addressing */
Signature · 1 line
2.17.1
maintainer
#10 lore raw
In reply to Grygorii Strashko

From: Grygorii Strashko <[email protected]>
Date: Tue, 3 Mar 2020 18:00:24 +0200

Quoted 5 lines

Hi Kishon,

This series adds support for TI K3 AM654x/J721E SoCs in TI phy-gmii-sel PHY driver, which is required for future adding networking support.

Quoted 8 lines

depends on:
[PATCH 0/2] phy: ti: gmii-sel: two fixes
https://lkml.org/lkml/2020/2/14/2510

Changes in v2:
- fixed comments

v1: https://lkml.org/lkml/2020/2/22/100

This is mostly DT updates and not much networking code changes, will some other tree take this?

#11 lore raw

Hi,

Quoted 12 lines · David Miller

From: Grygorii Strashko <[email protected]>
Date: Tue, 3 Mar 2020 18:00:24 +0200

Quoted 9 lines

Hi Kishon,

This series adds support for TI K3 AM654x/J721E SoCs in TI phy-gmii-sel PHY driver, which is required for future adding networking support.

depends on:
[PATCH 0/2] phy: ti: gmii-sel: two fixes
https://lkml.org/lkml/2020/2/14/2510

Quoted 7 lines
Quoted 4 lines

Changes in v2:
- fixed comments

v1: https://lkml.org/lkml/2020/2/22/100

This is mostly DT updates and not much networking code changes, will some other tree take this?

I can take the phy related changes. Grygorii, can you split the dt patches into a separate series?

Thanks
Kishon

#12 lore raw
Quoted 18 lines · Kishon Vijay Abraham I

Hi,

Quoted 15 lines · David Miller

From: Grygorii Strashko <[email protected]>
Date: Tue, 3 Mar 2020 18:00:24 +0200

Quoted 12 lines

Hi Kishon,

This series adds support for TI K3 AM654x/J721E SoCs in TI phy-gmii-sel PHY driver, which is required for future adding networking support.

depends on:
[PATCH 0/2] phy: ti: gmii-sel: two fixes
https://lkml.org/lkml/2020/2/14/2510

Changes in v2:
- fixed comments

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

v1: https://lkml.org/lkml/2020/2/22/100

This is mostly DT updates and not much networking code changes, will some other tree take this?

I can take the phy related changes. Grygorii, can you split the dt patches into a separate series?

sure. Could pls, pick up 1-3 and I'll resend 4-5.
Or you want me re-send once again?

Signature · 2 lines
Best regards,
grygorii
Applied
#13 lore raw
Quoted 23 lines · Grygorii Strashko
Quoted 20 lines · Kishon Vijay Abraham I

Hi,

Quoted 17 lines · David Miller

From: Grygorii Strashko <[email protected]>
Date: Tue, 3 Mar 2020 18:00:24 +0200

Quoted 13 lines

Hi Kishon,

This series adds support for TI K3 AM654x/J721E SoCs in TI phy-gmii-sel PHY driver, which is required for future adding networking support.

depends on:
  [PATCH 0/2] phy: ti: gmii-sel: two fixes
  https://lkml.org/lkml/2020/2/14/2510

Changes in v2:
  - fixed comments

v1: https://lkml.org/lkml/2020/2/22/100

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

This is mostly DT updates and not much networking code changes, will some other tree take this?

I can take the phy related changes. Grygorii, can you split the dt patches into a separate series?

sure. Could pls, pick up 1-3 and I'll resend 4-5.
Or you want me re-send once again?

Queued up patches #4 and #5 towards 5.7, thanks.

-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki