Issue with LAN8720A with IMX8MN

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Issue with LAN8720A with IMX8MN

1,881件の閲覧回数
sunil_embex
Contributor I

Dear All, 

I am facing issue in "interfacing the LAN8720A with IMX8MN with Android 10 build". Below are the descriptions:

dtsi changes:

&fec1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec1>;
phy-mode = "rmii";
phy-handle = <&ethphy0>;
fsl,magic-packet;
phy-reset-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
phy-reset-duration = <25>;
phy-reset-active-high;
//phy-supply = <&reg_3v3_p>;
status = "okay";

mdio {
#address-cells = <1>;
#size-cells = <0>;

ethphy0: ethernet-phy@0{
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
//smsc,disable-energy-detect;
//reset-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
//reset-assert-us = <12000>;
//reset-deassert-us = <13000>;
max-speed = <100>;
};
};
};

 

Pin MUX:

pinctrl_fec1: fec1grp {
fsl,pins = <
MX8MN_IOMUXC_ENET_MDC_ENET1_MDC 0x3 /* ENET_MDC */
MX8MN_IOMUXC_ENET_MDIO_ENET1_MDIO 0x23 /* ENET_MDIO */
MX8MN_IOMUXC_ENET_TD2_ENET1_TX_CLK 0x4000001f /* ENET_TX_CLK */
MX8MN_IOMUXC_ENET_TD1_ENET1_RGMII_TD1 0x56 /* ENET_TXD1 */
MX8MN_IOMUXC_ENET_TD0_ENET1_RGMII_TD0 0x56 /* ENET_TXD0 */
MX8MN_IOMUXC_ENET_RD1_ENET1_RGMII_RD1 0x56 /* ENET_RXD1 */
MX8MN_IOMUXC_ENET_RD0_ENET1_RGMII_RD0 0x56 /* ENET_RXD0 */
MX8MN_IOMUXC_ENET_RXC_ENET1_RX_ER 0x56 /* ENET_RXERR */
MX8MN_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL 0x56 /* ENET_CRS_DV */
MX8MN_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL 0x56 /* ENET_TX_EN */
MX8MN_IOMUXC_SPDIF_RX_GPIO5_IO4 0x41 /* ENET1_nRST */
>;
};

I have attached the screenshot of the schematic.

Below is the error log:

8.196838] ##################### msec = 25 #######################
[ 8.237584] pps pps0: new PPS source ptp0
[ 8.248334] fec 30be0000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[ 8.255199] fec 30be0000.ethernet: Using random MAC address: 66:3d:6c:a1:91:cd
[ 8.263446] libphy: fec_enet_mii_bus: probed
[ 8.267737] Child is a phy ########################
[ 8.272624] ############### In else ####################
[ 8.278150] failed in IS_ERR ##########################
[ 8.283508] mdio_bus 30be0000.ethernet-1: MDIO device at address 0 is missing.
[ 8.291473] fec 30be0000.ethernet eth0: registered PHC device 0
[ 8.299761] imx-spdif sound-spdif: ASoC: failed to init link S/PDIF PCM: -517
[ 8.307720] sdhci-esdhc-imx 30b40000.mmc: allocated mmc-pwrseq
[ 8.347031] mmc0: SDHCI controller on 30b40000.mmc [30b40000.mmc] using ADMA

Let me know if you need more information and your early help shall be greatly appreciated.

Regards,

Sunil

 

ラベル(1)
0 件の賞賛
5 返答(返信)

1,794件の閲覧回数
sunil_embex
Contributor I

Hi Jummychan,

Still Phy is not working. I have attached the waveform screenshot of MDIO,MDC.. pins.

Can you please also check whether the settings are ok or not  which I have used in dts.

Regards,

Sunil 

0 件の賞賛

1,830件の閲覧回数
sunil_embex
Contributor I

I am able to assign but seems link is not working because my laptop is not detecting this static connection.

Can you please help me to confirm the following dtsi changes whether its ok or not:

&fec1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec1>;
phy-mode = "rmii";
phy-handle = <&ethphy0>;
fsl,magic-packet;
phy-reset-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
phy-reset-duration = <25>;
phy-reset-active-high;
//phy-supply = <&reg_3v3_p>;
status = "okay";

mdio {
#address-cells = <1>;
#size-cells = <0>;

ethphy0: ethernet-phy@0{
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
//smsc,disable-energy-detect;
//reset-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
//reset-assert-us = <12000>;
//reset-deassert-us = <13000>;
max-speed = <100>;
};
};
};

 

Pin MUX:

pinctrl_fec1: fec1grp {
fsl,pins = <
MX8MN_IOMUXC_ENET_MDC_ENET1_MDC 0x3 /* ENET_MDC */
MX8MN_IOMUXC_ENET_MDIO_ENET1_MDIO 0x23 /* ENET_MDIO */
MX8MN_IOMUXC_ENET_TD2_ENET1_TX_CLK 0x4000001f /* ENET_TX_CLK */
MX8MN_IOMUXC_ENET_TD1_ENET1_RGMII_TD1 0x56 /* ENET_TXD1 */
MX8MN_IOMUXC_ENET_TD0_ENET1_RGMII_TD0 0x56 /* ENET_TXD0 */
MX8MN_IOMUXC_ENET_RD1_ENET1_RGMII_RD1 0x56 /* ENET_RXD1 */
MX8MN_IOMUXC_ENET_RD0_ENET1_RGMII_RD0 0x56 /* ENET_RXD0 */
MX8MN_IOMUXC_ENET_RXC_ENET1_RX_ER 0x56 /* ENET_RXERR */
MX8MN_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL 0x56 /* ENET_CRS_DV */
MX8MN_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL 0x56 /* ENET_TX_EN */
MX8MN_IOMUXC_SPDIF_RX_GPIO5_IO4 0x41 /* ENET1_nRST */
>;
};

 

Added Support of 50Mhz which was missing before in imx8mn.dtsi

<&clk IMX8MN_SYS_PLL2_125M>,
+ <&clk IMX8MN_SYS_PLL2_50M>;
+ assigned-clock-rates = <0>, <50000000>,<100000000> <0>;

Please confirm the dtsi changes and I have also attached the schematic.

Your early help will be greatly appriciated.

Regards,

Sunil

 

0 件の賞賛

1,817件の閲覧回数
jimmychan
NXP TechSupport
NXP TechSupport

Please check the signals on the PHY are proper or not. e.g. the reset_n, the clock signal.

Please refer to the i.MX8MNRM Table 11-78. ENET External Signals.

0 件の賞賛

1,860件の閲覧回数
sunil_embex
Contributor I

I got the etho but not getting the ip address:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope: Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0

dummy0 Link encap:Ethernet HWaddr 7e:d0:da:e4:05:3f
inet6 addr: fe80::7cd0:daff:fee4:53f/64 Scope: Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:560

eth0 Link encap:Ethernet HWaddr 12:0b:86:4c:4d:b3 Driver fec
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0

Seems there is no dhcp so can you please help what is the issue.

Regards,

Sunil

0 件の賞賛

1,842件の閲覧回数
jimmychan
NXP TechSupport
NXP TechSupport

So, the PHY is working now? Did you try using ifconfig to setup an ip address?

0 件の賞賛