linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [for-next PATCH 0/5] phy: ti: gmii-sel: add support for am654x/j721e soc
@ 2020-02-22 12:03 Grygorii Strashko
  2020-02-22 12:03 ` [for-next PATCH 1/5] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy Grygorii Strashko
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Grygorii Strashko @ 2020-02-22 12:03 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Tero Kristo, David S. Miller
  Cc: netdev, Sekhar Nori, linux-kernel, devicetree, Rob Herring,
	Grygorii Strashko

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.

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(-)

-- 
2.17.1


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

* [for-next PATCH 1/5] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy
  2020-02-22 12:03 [for-next PATCH 0/5] phy: ti: gmii-sel: add support for am654x/j721e soc Grygorii Strashko
@ 2020-02-22 12:03 ` Grygorii Strashko
  2020-02-25 18:04   ` Murali Karicheri
  2020-02-22 12:03 ` [for-next PATCH 2/5] dt-bindings: phy: ti: gmii-sel: add support for am654x/j721e soc Grygorii Strashko
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Grygorii Strashko @ 2020-02-22 12:03 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Tero Kristo, David S. Miller
  Cc: netdev, Sekhar Nori, linux-kernel, devicetree, Rob Herring,
	Grygorii Strashko

The phy-gmii-sel can be only autoselacted 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 definotion for phy-gmii-sel PHY driver - drop all
depndencies and from networking drivers and rely on using 'imply imply
PHY_TI_GMII_SEL' in Kconfig definotions for networking drivers instead.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/net/ethernet/ti/Kconfig | 1 +
 drivers/phy/ti/Kconfig          | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index bf98e0fa7d8b..8a6ca16eee3b 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -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.
 
diff --git a/drivers/phy/ti/Kconfig b/drivers/phy/ti/Kconfig
index 6dbe9d0b9ff3..15a3bcf32308 100644
--- a/drivers/phy/ti/Kconfig
+++ b/drivers/phy/ti/Kconfig
@@ -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.
-- 
2.17.1


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

* [for-next PATCH 2/5] dt-bindings: phy: ti: gmii-sel: add support for am654x/j721e soc
  2020-02-22 12:03 [for-next PATCH 0/5] phy: ti: gmii-sel: add support for am654x/j721e soc Grygorii Strashko
  2020-02-22 12:03 ` [for-next PATCH 1/5] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy Grygorii Strashko
@ 2020-02-22 12:03 ` Grygorii Strashko
  2020-02-26 22:19   ` Rob Herring
  2020-02-22 12:03 ` [for-next PATCH 3/5] " Grygorii Strashko
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Grygorii Strashko @ 2020-02-22 12:03 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Tero Kristo, David S. Miller
  Cc: netdev, Sekhar Nori, linux-kernel, devicetree, Rob Herring,
	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.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 Documentation/devicetree/bindings/phy/ti-phy-gmii-sel.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/phy/ti-phy-gmii-sel.txt b/Documentation/devicetree/bindings/phy/ti-phy-gmii-sel.txt
index 50ce9ae0f7a5..83b78c1c0644 100644
--- a/Documentation/devicetree/bindings/phy/ti-phy-gmii-sel.txt
+++ b/Documentation/devicetree/bindings/phy/ti-phy-gmii-sel.txt
@@ -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)
-- 
2.17.1


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

* [for-next PATCH 3/5] phy: ti: gmii-sel: add support for am654x/j721e soc
  2020-02-22 12:03 [for-next PATCH 0/5] phy: ti: gmii-sel: add support for am654x/j721e soc Grygorii Strashko
  2020-02-22 12:03 ` [for-next PATCH 1/5] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy Grygorii Strashko
  2020-02-22 12:03 ` [for-next PATCH 2/5] dt-bindings: phy: ti: gmii-sel: add support for am654x/j721e soc Grygorii Strashko
@ 2020-02-22 12:03 ` Grygorii Strashko
  2020-02-22 12:03 ` [for-next PATCH 4/5] arm64: dts: ti: k3-am65-mcu: add phy-gmii-sel node Grygorii Strashko
  2020-02-22 12:03 ` [for-next PATCH 5/5] arm64: dts: ti: k3-j721e-mcu: add scm node and phy-gmii-sel nodes Grygorii Strashko
  4 siblings, 0 replies; 9+ messages in thread
From: Grygorii Strashko @ 2020-02-22 12:03 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Tero Kristo, David S. Miller
  Cc: netdev, Sekhar Nori, linux-kernel, devicetree, Rob Herring,
	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.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/phy/ti/phy-gmii-sel.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c
index 1c536fc03c83..7edd5c3bc536 100644
--- a/drivers/phy/ti/phy-gmii-sel.c
+++ b/drivers/phy/ti/phy-gmii-sel.c
@@ -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);
-- 
2.17.1


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

* [for-next PATCH 4/5] arm64: dts: ti: k3-am65-mcu: add phy-gmii-sel node
  2020-02-22 12:03 [for-next PATCH 0/5] phy: ti: gmii-sel: add support for am654x/j721e soc Grygorii Strashko
                   ` (2 preceding siblings ...)
  2020-02-22 12:03 ` [for-next PATCH 3/5] " Grygorii Strashko
@ 2020-02-22 12:03 ` Grygorii Strashko
  2020-02-22 12:03 ` [for-next PATCH 5/5] arm64: dts: ti: k3-j721e-mcu: add scm node and phy-gmii-sel nodes Grygorii Strashko
  4 siblings, 0 replies; 9+ messages in thread
From: Grygorii Strashko @ 2020-02-22 12:03 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Tero Kristo, David S. Miller
  Cc: netdev, Sekhar Nori, linux-kernel, devicetree, Rob Herring,
	Grygorii Strashko

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

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi
index 92629cbdc184..8309f49713b4 100644
--- a/arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am65-mcu.dtsi
@@ -12,6 +12,12 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x40f00000 0x20000>;
+
+		phy_gmii_sel: phy-gmii-sel {
+			compatible = "ti,am654-phy-gmii-sel";
+			reg = <0x4040 0x4>;
+			#phy-cells = <1>;
+		};
 	};
 
 	mcu_uart0: serial@40a00000 {
-- 
2.17.1


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

* [for-next PATCH 5/5] arm64: dts: ti: k3-j721e-mcu: add scm node and phy-gmii-sel nodes
  2020-02-22 12:03 [for-next PATCH 0/5] phy: ti: gmii-sel: add support for am654x/j721e soc Grygorii Strashko
                   ` (3 preceding siblings ...)
  2020-02-22 12:03 ` [for-next PATCH 4/5] arm64: dts: ti: k3-am65-mcu: add phy-gmii-sel node Grygorii Strashko
@ 2020-02-22 12:03 ` Grygorii Strashko
  2020-02-22 18:06   ` Sergei Shtylyov
  4 siblings, 1 reply; 9+ messages in thread
From: Grygorii Strashko @ 2020-02-22 12:03 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Tero Kristo, David S. Miller
  Cc: netdev, Sekhar Nori, linux-kernel, devicetree, Rob Herring,
	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.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi
index 16c874bfd49a..9b3d10241a2e 100644
--- a/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi
@@ -34,6 +34,20 @@
 		};
 	};
 
+	mcu_conf: scm_conf@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-gmii-sel {
+			compatible = "ti,am654-phy-gmii-sel";
+			reg = <0x4040 0x4>;
+			#phy-cells = <1>;
+		};
+	};
+
 	wkup_pmx0: pinmux@4301c000 {
 		compatible = "pinctrl-single";
 		/* Proxy 0 addressing */
-- 
2.17.1


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

* Re: [for-next PATCH 5/5] arm64: dts: ti: k3-j721e-mcu: add scm node and phy-gmii-sel nodes
  2020-02-22 12:03 ` [for-next PATCH 5/5] arm64: dts: ti: k3-j721e-mcu: add scm node and phy-gmii-sel nodes Grygorii Strashko
@ 2020-02-22 18:06   ` Sergei Shtylyov
  0 siblings, 0 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2020-02-22 18:06 UTC (permalink / raw)
  To: Grygorii Strashko, Kishon Vijay Abraham I, Tero Kristo, David S. Miller
  Cc: netdev, Sekhar Nori, linux-kernel, devicetree, Rob Herring

Hello!

On 02/22/2020 03:03 PM, Grygorii Strashko wrote:

> 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.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
>  arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi
> index 16c874bfd49a..9b3d10241a2e 100644
> --- a/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi
> @@ -34,6 +34,20 @@
>  		};
>  	};
>  
> +	mcu_conf: scm_conf@40f00000 {

   The devce names should be generic and it appears that DT spec even has has
a device name "syscon".

[...]

MBR, Sergei

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

* Re: [for-next PATCH 1/5] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy
  2020-02-22 12:03 ` [for-next PATCH 1/5] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy Grygorii Strashko
@ 2020-02-25 18:04   ` Murali Karicheri
  0 siblings, 0 replies; 9+ messages in thread
From: Murali Karicheri @ 2020-02-25 18:04 UTC (permalink / raw)
  To: Grygorii Strashko, Kishon Vijay Abraham I, Tero Kristo, David S. Miller
  Cc: netdev, Sekhar Nori, linux-kernel, devicetree, Rob Herring

Hi Grygorii,

On 02/22/2020 07:03 AM, Grygorii Strashko wrote:
> The phy-gmii-sel can be only autoselacted in Kconfig and now the pretty
s/autoselacted/auto selected
> 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 definotion for phy-gmii-sel PHY driver - drop all

s/definotion/definition

> depndencies and from networking drivers and rely on using 'imply imply

s/depndencies/dependencies

> PHY_TI_GMII_SEL' in Kconfig definotions for networking drivers instead.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
>   drivers/net/ethernet/ti/Kconfig | 1 +
>   drivers/phy/ti/Kconfig          | 3 ---
>   2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
> index bf98e0fa7d8b..8a6ca16eee3b 100644
> --- a/drivers/net/ethernet/ti/Kconfig
> +++ b/drivers/net/ethernet/ti/Kconfig
> @@ -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.
>   
> diff --git a/drivers/phy/ti/Kconfig b/drivers/phy/ti/Kconfig
> index 6dbe9d0b9ff3..15a3bcf32308 100644
> --- a/drivers/phy/ti/Kconfig
> +++ b/drivers/phy/ti/Kconfig
> @@ -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.
> 

-- 
Murali Karicheri
Texas Instruments

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

* Re: [for-next PATCH 2/5] dt-bindings: phy: ti: gmii-sel: add support for am654x/j721e soc
  2020-02-22 12:03 ` [for-next PATCH 2/5] dt-bindings: phy: ti: gmii-sel: add support for am654x/j721e soc Grygorii Strashko
@ 2020-02-26 22:19   ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2020-02-26 22:19 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Kishon Vijay Abraham I, Tero Kristo, David S. Miller, netdev,
	Sekhar Nori, linux-kernel, devicetree, Rob Herring,
	Grygorii Strashko

On Sat, 22 Feb 2020 14:03:55 +0200, Grygorii Strashko wrote:
> 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.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
>  Documentation/devicetree/bindings/phy/ti-phy-gmii-sel.txt | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2020-02-26 22:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-22 12:03 [for-next PATCH 0/5] phy: ti: gmii-sel: add support for am654x/j721e soc Grygorii Strashko
2020-02-22 12:03 ` [for-next PATCH 1/5] phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy Grygorii Strashko
2020-02-25 18:04   ` Murali Karicheri
2020-02-22 12:03 ` [for-next PATCH 2/5] dt-bindings: phy: ti: gmii-sel: add support for am654x/j721e soc Grygorii Strashko
2020-02-26 22:19   ` Rob Herring
2020-02-22 12:03 ` [for-next PATCH 3/5] " Grygorii Strashko
2020-02-22 12:03 ` [for-next PATCH 4/5] arm64: dts: ti: k3-am65-mcu: add phy-gmii-sel node Grygorii Strashko
2020-02-22 12:03 ` [for-next PATCH 5/5] arm64: dts: ti: k3-j721e-mcu: add scm node and phy-gmii-sel nodes Grygorii Strashko
2020-02-22 18:06   ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).