Hello,
The ethernet interface is working fine with U-boot-2019.04 without CONFIG_DM_ETH on IMX6S. Following APIs are already implemented in the board file: board_phy_config, setup_iomux_enet and board_eth_init.
Below are the mii info: (Micrel phy is used)
PHY 0x01: OUI = 0x0885, Model = 0x16, Rev = 0x00, 10baseT, HDX
But If I use the CONFIG_DM_ETH, I got the following error:
Could not get PHY for FEC0: addr 1
Below is the device tree:
&fec {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet>;
phy-mode = "mii";
phy-reset-gpios = <&gpio4 8 0>;
phy-handle = <ðphy1>;
phy-reset-duration = <10>;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy1: ethernet-phy@1 {
reg = <1>;
};
};
};
Is there any additional setup to add?
Thanks
In the defconfig file of i.mx6s board, the CONFIG_DM_ETH=y.
Which version of BSP are you using?
For your reference, below is the Linux BSP web page.
(If the BSP version support i.MX6DL, it also support i.MX6S.)
For howto build the BSP, please read the Yocto User's Guide in the corresponding BSP documentation.
For your reference: (source code location and how to rebuild the source code)
(reference for porting the PHY to Yocto BSP)
https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Porting-KSZ9031-to-i-MX-BSP/ta-p/1112601
The solution is to invert the gpio polarity in device tree
phy-reset-gpios = <&gpio4 8 1>; instead of phy-reset-gpios = <&gpio4 8 0>;
It seems that there is a gpio polarity inversion in NXP driver.