[PATCH] RFC: net: fec: get rid of CONFIG_FEC_MXC_MDIO_BASE
Ramon Fried
rfried.dev at gmail.com
Mon May 16 02:28:51 CEST 2022
On Fri, May 6, 2022 at 1:12 AM Tim Harvey <tharvey at gateworks.com> wrote:
>
> A number of IMX8Q boards using FEC configure the address of the ethernet
> controller via defconfig as there are two FEC controllers in the SoC.
>
> Now that the FEC driver uses DM the register address should be coming from
> device-tree.
>
> Remove the hard coded config and while at it remove the unused
> CONFIG_FEC_MXC_SHARE_MDIO.
>
> This is an RFC as I do not have the affected boards to test with and
> would want to see a Tested-By from someone with each board. I am attempting
> to clean up some ugliness in the FEC driver. There appears to be
> multiple constructs to deal with shared MDIO busses when DM_MDIO should
> be the right solution for that.
>
> Signed-off-by: Tim Harvey <tharvey at gateworks.com>
> Cc: Marcel Ziswiler <marcel.ziswiler at toradex.com> (maintainer:Apalis iMX8)
> Cc: Oliver Graute <oliver.graute at kococonnector.com> (maintainer:i.MX8QM CGTQMX8 BOARD)
> Cc: Anatolij Gustschin <agust at denx.de> (maintainer:CAPRICORN BOARD)
> Cc: Peng Fan <peng.fan at nxp.com> (maintainer:i.MX8QM MEK BOARD)
> Cc: Fabio Estevam <festevam at gmail.com> (maintainer:i.MX8QXP MEK BOARD)
> Cc: Oleh Kravchenko <oleg at kaa.org.ua> (maintainer:OUT4-IMX6ULL-NANO BOARD)
> Cc: Joe Hershberger <joe.hershberger at ni.com> (maintainer:NETWORK)
> Cc: Ramon Fried <rfried.dev at gmail.com> (maintainer:NETWORK)
> ---
> configs/apalis-imx8_defconfig | 2 --
> configs/cgtqmx8_defconfig | 2 --
> configs/colibri-imx8x_defconfig | 2 --
> configs/deneb_defconfig | 2 --
> configs/giedi_defconfig | 2 --
> configs/imx8qm_mek_defconfig | 2 --
> configs/imx8qm_rom7720_a1_4G_defconfig | 2 --
> configs/imx8qxp_mek_defconfig | 2 --
> configs/o4-imx6ull-nano_defconfig | 2 --
> drivers/net/Kconfig | 11 -----------
> drivers/net/fec_mxc.c | 5 -----
> 11 files changed, 34 deletions(-)
>
> diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig
> index beb20f6e1c01..bd8e7f01e493 100644
> --- a/configs/apalis-imx8_defconfig
> +++ b/configs/apalis-imx8_defconfig
> @@ -56,8 +56,6 @@ CONFIG_PHY_ADDR_ENABLE=y
> CONFIG_PHY_MICREL=y
> CONFIG_PHY_MICREL_KSZ90X1=y
> CONFIG_DM_ETH=y
> -CONFIG_FEC_MXC_SHARE_MDIO=y
> -CONFIG_FEC_MXC_MDIO_BASE=0x5B040000
> CONFIG_FEC_MXC=y
> CONFIG_MII=y
> CONFIG_PINCTRL=y
> diff --git a/configs/cgtqmx8_defconfig b/configs/cgtqmx8_defconfig
> index 2cf882f826ab..fe62b639bd88 100644
> --- a/configs/cgtqmx8_defconfig
> +++ b/configs/cgtqmx8_defconfig
> @@ -72,8 +72,6 @@ CONFIG_PHY_ADDR_ENABLE=y
> CONFIG_PHY_ATHEROS=y
> CONFIG_DM_ETH=y
> CONFIG_PHY_GIGE=y
> -CONFIG_FEC_MXC_SHARE_MDIO=y
> -CONFIG_FEC_MXC_MDIO_BASE=0x5B040000
> CONFIG_FEC_MXC=y
> CONFIG_MII=y
> CONFIG_PINCTRL=y
> diff --git a/configs/colibri-imx8x_defconfig b/configs/colibri-imx8x_defconfig
> index 0c9d6b64c1b6..03e899f51fed 100644
> --- a/configs/colibri-imx8x_defconfig
> +++ b/configs/colibri-imx8x_defconfig
> @@ -54,8 +54,6 @@ CONFIG_PHYLIB=y
> CONFIG_PHY_ADDR_ENABLE=y
> CONFIG_PHY_MICREL=y
> CONFIG_DM_ETH=y
> -CONFIG_FEC_MXC_SHARE_MDIO=y
> -CONFIG_FEC_MXC_MDIO_BASE=0x5B040000
> CONFIG_FEC_MXC=y
> CONFIG_MII=y
> CONFIG_PINCTRL=y
> diff --git a/configs/deneb_defconfig b/configs/deneb_defconfig
> index 425fff6c70a6..d0fc11a774f8 100644
> --- a/configs/deneb_defconfig
> +++ b/configs/deneb_defconfig
> @@ -94,8 +94,6 @@ CONFIG_MV88E61XX_CPU_PORT=5
> CONFIG_MV88E61XX_PHY_PORTS=0x7
> CONFIG_MV88E61XX_FIXED_PORTS=0x0
> CONFIG_DM_ETH=y
> -CONFIG_FEC_MXC_SHARE_MDIO=y
> -CONFIG_FEC_MXC_MDIO_BASE=0x5B050000
> CONFIG_FEC_MXC=y
> CONFIG_MII=y
> CONFIG_PINCTRL=y
> diff --git a/configs/giedi_defconfig b/configs/giedi_defconfig
> index 4fbf7ebdcd95..24bc621cf184 100644
> --- a/configs/giedi_defconfig
> +++ b/configs/giedi_defconfig
> @@ -94,8 +94,6 @@ CONFIG_MV88E61XX_CPU_PORT=5
> CONFIG_MV88E61XX_PHY_PORTS=0x7
> CONFIG_MV88E61XX_FIXED_PORTS=0x0
> CONFIG_DM_ETH=y
> -CONFIG_FEC_MXC_SHARE_MDIO=y
> -CONFIG_FEC_MXC_MDIO_BASE=0x5B050000
> CONFIG_FEC_MXC=y
> CONFIG_MII=y
> CONFIG_PINCTRL=y
> diff --git a/configs/imx8qm_mek_defconfig b/configs/imx8qm_mek_defconfig
> index 2e42872f843d..448a20c7afd1 100644
> --- a/configs/imx8qm_mek_defconfig
> +++ b/configs/imx8qm_mek_defconfig
> @@ -73,8 +73,6 @@ CONFIG_PHY_ADDR_ENABLE=y
> CONFIG_PHY_ATHEROS=y
> CONFIG_DM_ETH=y
> CONFIG_PHY_GIGE=y
> -CONFIG_FEC_MXC_SHARE_MDIO=y
> -CONFIG_FEC_MXC_MDIO_BASE=0x5B040000
> CONFIG_FEC_MXC=y
> CONFIG_MII=y
> CONFIG_PINCTRL=y
> diff --git a/configs/imx8qm_rom7720_a1_4G_defconfig b/configs/imx8qm_rom7720_a1_4G_defconfig
> index d9997cfa8280..0a8de612ea32 100644
> --- a/configs/imx8qm_rom7720_a1_4G_defconfig
> +++ b/configs/imx8qm_rom7720_a1_4G_defconfig
> @@ -68,8 +68,6 @@ CONFIG_PHY_ADDR_ENABLE=y
> CONFIG_PHY_ATHEROS=y
> CONFIG_DM_ETH=y
> CONFIG_PHY_GIGE=y
> -CONFIG_FEC_MXC_SHARE_MDIO=y
> -CONFIG_FEC_MXC_MDIO_BASE=0x5B040000
> CONFIG_FEC_MXC=y
> CONFIG_MII=y
> CONFIG_PINCTRL=y
> diff --git a/configs/imx8qxp_mek_defconfig b/configs/imx8qxp_mek_defconfig
> index 43f42f7a58af..e4a3c4b103e6 100644
> --- a/configs/imx8qxp_mek_defconfig
> +++ b/configs/imx8qxp_mek_defconfig
> @@ -74,8 +74,6 @@ CONFIG_PHY_ADDR_ENABLE=y
> CONFIG_PHY_ATHEROS=y
> CONFIG_DM_ETH=y
> CONFIG_PHY_GIGE=y
> -CONFIG_FEC_MXC_SHARE_MDIO=y
> -CONFIG_FEC_MXC_MDIO_BASE=0x5B040000
> CONFIG_FEC_MXC=y
> CONFIG_MII=y
> CONFIG_PINCTRL=y
> diff --git a/configs/o4-imx6ull-nano_defconfig b/configs/o4-imx6ull-nano_defconfig
> index 27a82b116304..216b4ef8a261 100644
> --- a/configs/o4-imx6ull-nano_defconfig
> +++ b/configs/o4-imx6ull-nano_defconfig
> @@ -45,8 +45,6 @@ CONFIG_PHYLIB=y
> CONFIG_PHY_SMSC=y
> CONFIG_DM_ETH=y
> CONFIG_DM_ETH_PHY=y
> -CONFIG_FEC_MXC_SHARE_MDIO=y
> -CONFIG_FEC_MXC_MDIO_BASE=0x020b4000
> CONFIG_FEC_MXC=y
> CONFIG_MII=y
> CONFIG_PINCTRL=y
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 347fe8aa425f..82e51b098ae0 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -326,17 +326,6 @@ config ETHOC
> help
> This MAC is present in OpenRISC and Xtensa XTFPGA boards.
>
> -config FEC_MXC_SHARE_MDIO
> - bool "Share the MDIO bus for FEC controller"
> - depends on FEC_MXC
> -
> -config FEC_MXC_MDIO_BASE
> - hex "MDIO base address for the FEC controller"
> - depends on FEC_MXC_SHARE_MDIO
> - help
> - This specifies the MDIO registers base address. It is used when
> - two FEC controllers share MDIO bus.
> -
> config FEC_MXC
> bool "FEC Ethernet controller"
> depends on MX28 || MX5 || MX6 || MX7 || IMX8 || IMX8M || IMX8ULP || VF610
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index a623a5c45e4d..1add6fb91f53 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -1233,12 +1233,7 @@ static int fecmxc_probe(struct udevice *dev)
>
> if (!bus) {
> dm_mii_bus = false;
> -#ifdef CONFIG_FEC_MXC_MDIO_BASE
> - bus = fec_get_miibus((ulong)CONFIG_FEC_MXC_MDIO_BASE,
> - dev_seq(dev));
> -#else
> bus = fec_get_miibus((ulong)priv->eth, dev_seq(dev));
> -#endif
> }
> if (!bus) {
> ret = -ENOMEM;
> --
> 2.17.1
>
Reviewed-by: Ramon Fried <rfried.dev at gmail.com>
More information about the U-Boot
mailing list