]> git.baikalelectronics.ru Git - uboot.git/commitdiff
net: mvneta: Use DM MDIO API for connecting PHY
authorMarek Behún <marek.behun@nic.cz>
Wed, 27 Apr 2022 10:41:46 +0000 (12:41 +0200)
committerStefan Roese <sr@denx.de>
Wed, 4 May 2022 05:05:51 +0000 (07:05 +0200)
Use the modern DM MDIO API for connecting PHY in the mvneta driver.

This requires enabling MVMDIO driver in several config files.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
15 files changed:
configs/clearfog_defconfig
configs/controlcenterdc_defconfig
configs/db-88f6820-amc_defconfig
configs/db-88f6820-gp_defconfig
configs/db-mv784mp-gp_defconfig
configs/ds414_defconfig
configs/helios4_defconfig
configs/maxbcm_defconfig
configs/mvebu_espressobin-88f3720_defconfig
configs/theadorable_debug_defconfig
configs/turris_mox_defconfig
configs/turris_omnia_defconfig
configs/uDPU_defconfig
drivers/net/Kconfig
drivers/net/mvneta.c

index 1e9c389deb7dc714e6c6b6dab78c7fd23f750925..a7b6508a5c6d3524a9a067b366f11d8f0540cd4a 100644 (file)
@@ -62,6 +62,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
+CONFIG_MVMDIO=y
 CONFIG_PCI=y
 CONFIG_PCI_MVEBU=y
 CONFIG_SCSI=y
index d4b966b93f548585c6b11e62bdb8b9b0a7b1220d..df38b2c54f083c9129650eb796f2c78667529cbf 100644 (file)
@@ -77,6 +77,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
+CONFIG_MVMDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCI_MVEBU=y
index 46c822fccd578c9366199ddcf6eb6b91e01a24f6..9b77b4a5f0574266b457a3ed6de8beadfb37e2ab 100644 (file)
@@ -67,6 +67,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
+CONFIG_MVMDIO=y
 CONFIG_PCI=y
 CONFIG_PCI_MVEBU=y
 CONFIG_DEBUG_UART_SHIFT=2
index 2dcbc2f29a8a9f544178c0b61aa1f5e3fe40e182..f56d1fbf2530ab877a38528817600672eacf407d 100644 (file)
@@ -62,6 +62,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
+CONFIG_MVMDIO=y
 CONFIG_PCI=y
 CONFIG_PCI_MVEBU=y
 CONFIG_SCSI=y
index f19cc54975267124c4fb28af5a05c13d7da32a56..5683f118365f52dff394e0dabd77b2c793b53ab3 100644 (file)
@@ -65,6 +65,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
+CONFIG_MVMDIO=y
 CONFIG_PCI=y
 CONFIG_PCI_MVEBU=y
 CONFIG_DEBUG_UART_SHIFT=2
index a3279c15c5cdf22d6dc29f8fd2dd264a8afd863c..a83fe079b3a1fced28756e805af910c66a2d2837 100644 (file)
@@ -65,6 +65,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
+CONFIG_MVMDIO=y
 CONFIG_PCI=y
 CONFIG_PCI_MVEBU=y
 CONFIG_DEBUG_UART_SHIFT=2
index 7d812e8fab212450cfefbae82d639cba8deb1053..c2130bacb4b4b4d3ede2bfb2f3b3383df5f27341 100644 (file)
@@ -63,6 +63,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
+CONFIG_MVMDIO=y
 CONFIG_PCI=y
 CONFIG_PCI_MVEBU=y
 CONFIG_SCSI=y
index 8dd6adf247b0d51a60dc52b54467a707d142785f..40f79d47ea98a11700ba21792c714ab7e2013cdc 100644 (file)
@@ -47,6 +47,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
+CONFIG_MVMDIO=y
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550=y
 CONFIG_KIRKWOOD_SPI=y
index ff05630d202e34f878f537760923907a366e5183..af30f1b3636746eee49fa56310bd60b99a507944 100644 (file)
@@ -76,6 +76,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MVNETA=y
+CONFIG_MVMDIO=y
 CONFIG_NVME_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_AARDVARK=y
index 86129e7d2d7755b98ea8ba06a1d705301272b262..9a03a0a7a3041ed0d8223bd6c629ffc25b913c13 100644 (file)
@@ -70,6 +70,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
+CONFIG_MVMDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCI_MVEBU=y
index 9a76a118c2f7d06946e88363e7576c84b1360f6c..bcd3699a4fab47f9a9ca853d7516836155766d5c 100644 (file)
@@ -82,6 +82,7 @@ CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
+CONFIG_MVMDIO=y
 CONFIG_NVME_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_AARDVARK=y
index 5591c9716b26673e6e3406fa443e0295750c5bcc..5e4f094506c7396296d7d0c84030af8d3df4d1fc 100644 (file)
@@ -85,6 +85,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
+CONFIG_MVMDIO=y
 CONFIG_NVME_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_MVEBU=y
index c07bad5076e785e347fca1352f332274ff1f0614..f2852ad29bc0507c4cbb1ff87a1b64f7322ff859 100644 (file)
@@ -73,6 +73,7 @@ CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MVNETA=y
+CONFIG_MVMDIO=y
 CONFIG_PCI=y
 CONFIG_PCI_AARDVARK=y
 CONFIG_PHY=y
index da56326ad32eac52b829a56d50428d757e899172..7fe0e00649cf0b3ccaa3921550ebc54c6b329d8e 100644 (file)
@@ -445,6 +445,7 @@ config MVNETA
        bool "Marvell Armada XP/385/3700 network interface support"
        depends on ARMADA_XP || ARMADA_38X || ARMADA_3700
        select PHYLIB
+       select DM_MDIO
        help
          This driver supports the network interface units in the
          Marvell ARMADA XP, ARMADA 38X and ARMADA 3700 SoCs
index 79cdb93341c1d519055739789ee9ed5583a1d121..24a491dcde67a726413d69a16c1685b224dab540 100644 (file)
@@ -1571,16 +1571,15 @@ static int mvneta_start(struct udevice *dev)
 
                        mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
                } else {
-                       /* Set phy address of the port */
-                       mvreg_write(pp, MVNETA_PHY_ADDR, pp->phyaddr);
-
-                       phydev = phy_connect(pp->bus, pp->phyaddr, dev,
-                                            pp->phy_interface);
+                       phydev = dm_eth_phy_connect(dev);
                        if (!phydev) {
-                               printf("phy_connect failed\n");
+                               printf("dm_eth_phy_connect failed\n");
                                return -ENODEV;
                        }
 
+                       /* Set PHY address in case we will enable HW polling */
+                       mvreg_write(pp, MVNETA_PHY_ADDR, phydev->addr);
+
                        pp->phydev = phydev;
                        phy_config(phydev);
                        phy_startup(phydev);