Useful on scripts which control the retry operation
themselves.
+phy_aneg_timeout
+ If set, the specified value will override CONFIG_PHY_ANEG_TIMEOUT.
+ This variable has the same base and unit as CONFIG_PHY_ANEG_TIMEOUT
+ which is "decimal" and "millisecond" respectively. The default value
+ of CONFIG_PHY_ANEG_TIMEOUT may be sufficient for most use-cases, but
+ certain link-partners may require a larger timeout due to the Ethernet
+ PHY they use. Alternatively, the timeout can be reduced as well if the
+ use-case demands it.
+
rng_seed_size
Size of random value added to device-tree node /chosen/rng-seed.
This variable is given as a decimal number.
int "PHY auto-negotiation timeout"
default 4000
help
- Default PHY auto-negotiation timeout.
+ Value of PHY auto-negotiation timeout with the base being
+ "decimal" and the unit being "millisecond". This can be
+ overridden by the "phy_aneg_timeout" environment variable
+ that has the same base (decimal) and unit (millisecond).
if PHY_ADDR_ENABLE
config PHY_ADDR
*/
#include <config.h>
#include <dm.h>
+#include <env.h>
#include <log.h>
#include <net.h>
#include <phy.h>
int aquantia_startup(struct phy_device *phydev)
{
- u32 speed;
- int i = 0;
+ u32 speed, i = 0;
int reg;
phydev->duplex = DUPLEX_FULL;
/* if the AN is still in progress, wait till timeout. */
if (!aquantia_link_is_up(phydev)) {
+ u32 aneg_timeout = env_get_ulong("phy_aneg_timeout", 10,
+ CONFIG_PHY_ANEG_TIMEOUT);
printf("%s Waiting for PHY auto negotiation to complete",
phydev->dev->name);
do {
if ((i++ % 500) == 0)
printf(".");
} while (!aquantia_link_is_up(phydev) &&
- i < (4 * CONFIG_PHY_ANEG_TIMEOUT));
+ i < (4 * aneg_timeout));
- if (i > CONFIG_PHY_ANEG_TIMEOUT)
+ if (i > aneg_timeout)
printf(" TIMEOUT !\n");
}
*/
#include <console.h>
#include <dm.h>
+#include <env.h>
#include <log.h>
#include <malloc.h>
#include <net.h>
if ((phydev->autoneg == AUTONEG_ENABLE) &&
!(mii_reg & BMSR_ANEGCOMPLETE)) {
- int i = 0;
+ u32 i = 0;
+ u32 aneg_timeout = env_get_ulong("phy_aneg_timeout", 10,
+ CONFIG_PHY_ANEG_TIMEOUT);
printf("%s Waiting for PHY auto negotiation to complete",
phydev->dev->name);
/*
* Timeout reached ?
*/
- if (i > (CONFIG_PHY_ANEG_TIMEOUT / 50)) {
+ if (i > (aneg_timeout / 50)) {
printf(" TIMEOUT !\n");
phydev->link = 0;
return -ETIMEDOUT;
#include <display_options.h>
#include <dm.h>
#include <dm/device_compat.h>
+#include <env.h>
#include <log.h>
#include <net.h>
#include <malloc.h>
static int pcs_pma_startup(struct axidma_priv *priv)
{
+ u32 aneg_timeout = env_get_ulong("phy_aneg_timeout", 10,
+ CONFIG_PHY_ANEG_TIMEOUT);
u32 rc, retry_cnt = 0;
u16 mii_reg;
* and the external PHY is not obtained.
*/
debug("axiemac: waiting for link status of the PCS/PMA PHY");
- while (retry_cnt * 10 < CONFIG_PHY_ANEG_TIMEOUT) {
+ while (retry_cnt * 10 < aneg_timeout) {
rc = phyread(priv, priv->pcsaddr, MII_BMSR, &mii_reg);
if ((mii_reg & BMSR_LSTATUS) && mii_reg != 0xffff && !rc) {
debug(".Done\n");