MPC8313 MII PHY Support research process

Source: Internet
Author: User

Now to use MPC8313 out of a product, MPC8313 Development Board with the PHY is a 1G PHY switch and a 1G PHY network card, natural system configuration is configured in this way, now needs only to support 100M on the line, so ready to use 175c this PHY , support a WAN port and 4 LAN, through two Mii port connection 8313, 1G PHY to 100M PHY, as long as it is modified in the initialization of Mii mouth, the Mii work mode from sgmii to Mii on the line.

Now the problem is to change to Mii after only one Mii port corresponding to the PHY can work, another one using ipconfig configure IP prompts:

Eth0:could not attach to PHY siocsifflags:device or resource busy

By tracking the kernel's PHY driver registration process, we found that the kernel's Mdio drive has identified two Mii ports and created
Eth0 and eth1, eth1 can be used, but when ETH0 is configured with Ifconfig, the trace appears without attach
Problem:
Ifconfig eth0--in Init_phy Name=eth0, irq=0, bassaddr=c9060000, gigabit=0 Get interface = 0 Ljx:phy_attach d->driver =c0304368 Attach eth0:e0024520:04 eth0:e0024520:04 already attached

Continue to trace Discovery Phy_attach () function to attach phy_id is eth1 phy_id.
It may be that the configuration in the device tree is not correct, because in the Mdiobus_register () function of Mdio_bus
To read the PHY information, only PHY address 4 reads to have an IRQ value. The configuration for modifying Mdio in Add DTS is as follows:

mdio@24520 {device_type = "mdio"; compatible = "Gianfar"; reg = <24520 20>; #address-cells = <1>; #size-cells = <0>; phy3:ethernet-phy@3 {interrupt-parent = < &ipic >; interrupts = <13 8>; reg = <3>; Device_type = " Ethernet-phy "; }; phy4:ethernet-phy@4 {interrupt-parent = < &ipic >; interrupts = <14 8>; reg = <4>; Device_type = " Ethernet-phy "; }; };

It is found that in the Mdio_bus Mdiobus_register () function to read the PHY information, the address 3,4 can
Read the information. Eth1 can work, eth0 or attach when the address is wrong.
Analysis found below DTS: ethernet@25000 's phy-handle=<&phy4> feel this configuration should be and
The configuration in the above Mdio should correspond to the above, hence to: phy-handle=<&phy3> that's the front in the Mdio section.
The new configuration. Recompile, start the board, wow Kaka, ifconfig eth0 success.


PS. device file tree configuration, has not found the completed configuration item description, more uncomfortable.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.