From: Hannes Schmelzer Date: Wed, 22 Jun 2016 10:07:14 +0000 (+0200) Subject: driver/net/fec: support fixed speed connection X-Git-Tag: v2016.09-rc2~174^2~66 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0750701a3f74e831b6cb0ecc69be2f7eff94e819;p=oweals%2Fu-boot.git driver/net/fec: support fixed speed connection If MAC is directly connected to another MAC (like a switch for example) we don't need to probe for a phy, autoneogation and so on. We simply have to setup speed. Signed-off-by: Hannes Schmelzer Acked-by: Joe Hershberger --- diff --git a/doc/README.fec_mxc b/doc/README.fec_mxc index ed7e47d728..9ca6ac2fb5 100644 --- a/doc/README.fec_mxc +++ b/doc/README.fec_mxc @@ -27,6 +27,11 @@ CONFIG_FEC_MXC_PHYADDR Optional, selects the exact phy address that should be connected and function fecmxc_initialize will try to initialize it. +CONFIG_FEC_FIXED_SPEED + Optional, selects a fixed speed on the MAC interface without asking some + phy. This is usefull if there is a direct MAC <-> MAC connection, for + example if the CPU is connected directly via the RGMII interface to a + ethernet-switch. Reading the ethaddr from the SoC eFuses: if CONFIG_FEC_MXC is defined and the U-Boot environment does not contain the diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 360f8e44d1..e871b3e81b 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -233,6 +233,7 @@ static int miiphy_restart_aneg(struct eth_device *dev) return ret; } +#ifndef CONFIG_FEC_FIXED_SPEED static int miiphy_wait_aneg(struct eth_device *dev) { uint32_t start; @@ -260,6 +261,7 @@ static int miiphy_wait_aneg(struct eth_device *dev) return 0; } +#endif /* CONFIG_FEC_FIXED_SPEED */ #endif static int fec_rx_task_enable(struct fec_priv *fec) @@ -502,6 +504,8 @@ static int fec_open(struct eth_device *edev) } speed = fec->phydev->speed; } +#elif CONFIG_FEC_FIXED_SPEED + speed = CONFIG_FEC_FIXED_SPEED; #else miiphy_wait_aneg(edev); speed = miiphy_speed(edev->name, fec->phy_id);