I'm using openil based on this PDF(OPEN-LINUX-IND-UM-1-10.pdf),In NXP official board (ls1028ardb), the driver can be loaded normally, but our own board can't load the driver with same image.In addition, we add a reset pin to the device tree of uboot.The modification code is as follows:
&enetc0 {
status = "okay";
phy-mode = "sgmii";
phy-handle = <&rdb_phy0>;
phy-reset-duration = <10>;
phy-reset-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
phy-reset-gpios1 = <&gpio0 27 GPIO_ACTIVE_HIGH>;
phy-reset-post-delay = <230>;
};
Then add my reset code in drivers/net/fsl_enetc.c :
debug("ecetc_gpio_reset: enetc_gpio_reset(dev)\n");
if (dm_gpio_is_valid(&priv->phy_reset_gpio1)) {
dm_gpio_set_value(&priv->phy_reset_gpio1, 0);
mdelay(priv->reset_post_delay);
printf("phy2 reset time=%d\n",priv->reset_post_delay);
dm_gpio_set_value(&priv->phy_reset_gpio1, 1);
}
if (dm_gpio_is_valid(&priv->phy_reset_gpio)) {
dm_gpio_set_value(&priv->phy_reset_gpio, 0);
mdelay(priv->reset_delay);
printf("reset time=%d\n",priv->reset_delay);
dm_gpio_set_value(&priv->phy_reset_gpio, 1);
// if (priv->reset_post_delay)
// mdelay(priv->reset_post_delay);
}