net: phy: Add support for TI PHY init
authorDan Murphy <dmurphy@ti.com>
Mon, 4 May 2020 21:14:39 +0000 (16:14 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 12 Jun 2020 17:17:23 +0000 (13:17 -0400)
ti_phy_init function was allocated to the DP83867 PHY.  This function
name is to generic for a specific PHY.  The function can be moved to a
TI specific file that can register all TI PHYs that are defined in the
defconfig.  The ti_phy_init file will contain all TI PHYs initialization
so that only phy_ti_init can be called from the framework.

In addition to the above the config flag for the DP83867 needs to be changed
in the Kconfig and dependent defconfig files. The config flag that was
used for the DP83867 was also generic in nature so a more specific
config flag for the DP83867 was created.

Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
15 files changed:
configs/am65x_evm_a53_defconfig
configs/am65x_hs_evm_a53_defconfig
configs/dra7xx_evm_defconfig
configs/dra7xx_hs_evm_defconfig
configs/dra7xx_hs_evm_usb_defconfig
configs/j721e_evm_a72_defconfig
configs/j721e_hs_evm_a72_defconfig
configs/k2g_evm_defconfig
configs/xilinx_versal_virt_defconfig
configs/xilinx_zynqmp_virt_defconfig
drivers/net/phy/Kconfig
drivers/net/phy/Makefile
drivers/net/phy/dp83867.c
drivers/net/phy/ti_phy_init.c [new file with mode: 0644]
drivers/net/phy/ti_phy_init.h [new file with mode: 0644]

index d74a2d09309bf6c0cb8da4556d2b58ac592262f1..c5ca4da73a8c547799844a6e1c7bddbf2a5af1f6 100644 (file)
@@ -99,7 +99,7 @@ CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_SPI_FLASH_MTD=y
-CONFIG_PHY_TI=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_PHY_FIXED=y
 CONFIG_DM_ETH=y
 CONFIG_E1000=y
index 117953817d820e1fdc2dc1ff0fe2d6dd39973441..644873d67c74192c149b8590c7da6318454a7b38 100644 (file)
@@ -101,7 +101,7 @@ CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_SPI_FLASH_MTD=y
-CONFIG_PHY_TI=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_PHY_FIXED=y
 CONFIG_DM_ETH=y
 CONFIG_E1000=y
index e4547d9dcc8c3960ade7d5721f6a8d25ba331dda..73ac3b319b59ea5fa74ff383f8abf94bf43c4240 100644 (file)
@@ -86,7 +86,7 @@ CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_SPANSION=y
-CONFIG_PHY_TI=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_DM_ETH=y
 CONFIG_PHY_GIGE=y
 CONFIG_MII=y
index c08bcce903813e1e2faaaf6483b597c91359bae2..40dc554e8071dcb260b1387aef43c0bd57506206 100644 (file)
@@ -89,7 +89,7 @@ CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_SPANSION=y
-CONFIG_PHY_TI=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_DM_ETH=y
 CONFIG_PHY_GIGE=y
 CONFIG_MII=y
index 879c2b650be3da549a4011db0b1c9096580c5887..babd7029c0e2decb8419ec9c074b245ebc161d7a 100644 (file)
@@ -87,7 +87,7 @@ CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_SPANSION=y
-CONFIG_PHY_TI=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_DM_ETH=y
 CONFIG_PHY_GIGE=y
 CONFIG_MII=y
index 4deb4e219fe77bedf9e0ca6eaded74a0b4545980..91a05722870babb008860b73636210a39485ccfe 100644 (file)
@@ -123,7 +123,7 @@ CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_SPI_FLASH_MTD=y
-CONFIG_PHY_TI=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_PHY_FIXED=y
 CONFIG_DM_ETH=y
 CONFIG_TI_AM65_CPSW_NUSS=y
index ae540a26a4015758a7af50eff68f0035fe665d2b..9aa3113642c96d98470672266e37db24cbfd2553 100644 (file)
@@ -113,7 +113,7 @@ CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_SPI_FLASH_MTD=y
-CONFIG_PHY_TI=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_PHY_FIXED=y
 CONFIG_DM_ETH=y
 CONFIG_TI_AM65_CPSW_NUSS=y
index 5bc7f7f8656ebacac80b22f94063901a1bca9475..0379021c14cb93c45c6ab9bafefdb5acfa24d97c 100644 (file)
@@ -58,7 +58,7 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ8XXX=y
-CONFIG_PHY_TI=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_DM_ETH=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_KEYSTONE_NET=y
index 4ed14f7030cca33a9e18059b299555f0821a4257..b3e21ea90371f41cffea33b31de4532122d149ef 100644 (file)
@@ -63,7 +63,7 @@ CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_NATSEMI=y
 CONFIG_PHY_REALTEK=y
-CONFIG_PHY_TI=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_PHY_VITESSE=y
 CONFIG_PHY_FIXED=y
 CONFIG_PHY_GIGE=y
index 7886d5a38f29e0017e48cfc855ca43df735114eb..2b4a0244fa9858b597486e2b65dfe5fda47fc8c2 100644 (file)
@@ -108,7 +108,7 @@ CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ90X1=y
 CONFIG_PHY_NATSEMI=y
 CONFIG_PHY_REALTEK=y
-CONFIG_PHY_TI=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_PHY_VITESSE=y
 CONFIG_PHY_XILINX_GMII2RGMII=y
 CONFIG_PHY_FIXED=y
index d1f049e62ab7c702bddd02106abe197a448cb822..a5a1ff257f9fb58cd5ce0eed4bb63c973e997d5f 100644 (file)
@@ -243,6 +243,14 @@ config PHY_TERANETICS
 
 config PHY_TI
        bool "Texas Instruments Ethernet PHYs support"
+       ---help---
+         Adds PHY registration support for TI PHYs.
+
+config PHY_TI_DP83867
+       select PHY_TI
+       bool "Texas Instruments Ethernet DP83867 PHY support"
+       ---help---
+         Adds support for the TI DP83867 1Gbit PHY.
 
 config PHY_VITESSE
        bool "Vitesse Ethernet PHYs support"
index 1d81516ecd1d3221074bf678fe27daeace85801f..6e722331f1bf2029282534a6745ca2195ae66899 100644 (file)
@@ -25,7 +25,8 @@ obj-$(CONFIG_PHY_NATSEMI) += natsemi.o
 obj-$(CONFIG_PHY_REALTEK) += realtek.o
 obj-$(CONFIG_PHY_SMSC) += smsc.o
 obj-$(CONFIG_PHY_TERANETICS) += teranetics.o
-obj-$(CONFIG_PHY_TI) += dp83867.o
+obj-$(CONFIG_PHY_TI) += ti_phy_init.o
+obj-$(CONFIG_PHY_TI_DP83867) += dp83867.o
 obj-$(CONFIG_PHY_XILINX) += xilinx_phy.o
 obj-$(CONFIG_PHY_XILINX_GMII2RGMII) += xilinx_gmii2rgmii.o
 obj-$(CONFIG_PHY_VITESSE) += vitesse.o
index d435cc1e6c549d76502cb71abd9958bed6f4d386..eada4541c9c336c786ec2d0c7d5bfe5e77edaa23 100644 (file)
@@ -14,6 +14,7 @@
 #include <dm.h>
 #include <dt-bindings/net/ti-dp83867.h>
 
+#include "ti_phy_init.h"
 
 /* TI DP83867 */
 #define DP83867_DEVADDR                0x1f
@@ -430,7 +431,7 @@ static struct phy_driver DP83867_driver = {
        .shutdown = &genphy_shutdown,
 };
 
-int phy_ti_init(void)
+int phy_dp83867_init(void)
 {
        phy_register(&DP83867_driver);
        return 0;
diff --git a/drivers/net/phy/ti_phy_init.c b/drivers/net/phy/ti_phy_init.c
new file mode 100644 (file)
index 0000000..277b29a
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * TI Generic PHY Init to register any TI Ethernet PHYs
+ *
+ * Author: Dan Murphy <dmurphy@ti.com>
+ *
+ * Copyright (C) 2019-20 Texas Instruments Inc.
+ */
+
+#include "ti_phy_init.h"
+
+int phy_ti_init(void)
+{
+#ifdef CONFIG_PHY_TI_DP83867
+       phy_dp83867_init();
+#endif
+       return 0;
+}
diff --git a/drivers/net/phy/ti_phy_init.h b/drivers/net/phy/ti_phy_init.h
new file mode 100644 (file)
index 0000000..6c7f6c6
--- /dev/null
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * TI Generic Ethernet PHY
+ *
+ * Author: Dan Murphy <dmurphy@ti.com>
+ *
+ * Copyright (C) 2019-20 Texas Instruments Inc.
+ */
+
+#ifndef _TI_GEN_PHY_H
+#define _TI_GEN_PHY_H
+
+int phy_dp83867_init(void);
+
+#endif /* _TI_GEN_PHY_H */