[U-Boot] [PATCH v4] drivers/net/phy: add fixed-phy / fixed-link support
Christian Gmeiner
christian.gmeiner at gmail.com
Thu Mar 23 14:03:49 UTC 2017
Hi
> +int fixedphy_probe(struct phy_device *phydev)
> +{
> + struct fixed_link *priv;
> + int ofnode = phydev->addr;
> + u32 val;
> +
> + /* check for mandatory properties within fixed-link node */
> + val = fdt_getprop_u32_default_node(gd->fdt_blob,
> + ofnode, 0, "speed", 0);
> + if (val != SPEED_10 && val != SPEED_1000 && val != SPEED_1000) {
Still wrong - SPEED_100 is missing.
if (val != SPEED_10 && val != SPEED_100 && val != SPEED_1000) {
> + printf("ERROR: no/invalid speed given in fixed-link node!");
> + return -EINVAL;
> + }
> +
> + priv = malloc(sizeof(*priv));
> + if (!priv)
> + return -ENOMEM;
> + memset(priv, 0, sizeof(*priv));
> +
> + phydev->priv = priv;
> + phydev->addr = 0;
> +
> + priv->link_speed = val;
> + priv->duplex = fdtdec_get_bool(gd->fdt_blob, ofnode, "full-duplex");
> + priv->pause = fdtdec_get_bool(gd->fdt_blob, ofnode, "pause");
> + priv->asym_pause = fdtdec_get_bool(gd->fdt_blob, ofnode, "asym-pause");
> +
> + /* fixed-link phy must not be reset by core phy code */
> + phydev->flags |= PHY_FLAG_BROKEN_RESET;
> +
> + return 0;
> +}
> +
Greets
--
Christian Gmeiner, MSc
https://www.youtube.com/user/AloryOFFICIAL
https://soundcloud.com/christian-gmeiner
More information about the U-Boot
mailing list