Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Mdio

Does Altera have an MDIO core in the SOPC builder , or mega functions?

I want to use the MDIO STA master to configure phy device on the board.

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Sure.

    MDIO core is one of the standard modules provided by SOPC builder.

    For instantiating the core refer to chapter 13 of Embedded IP User Guide document.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thankyou, so much.

    I have the SOPC builder running with Cyclone III, device and i have a few controllers in it. Its a tested project and runs....But I cant see the MDIO CORE on the Left to add to the project....please help where am i going wrong.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Has anybody got MDIO master core OR code that I can import in SOPC builder please? thanks.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Probably the availability of MDIO core in SOPC builder depends on the version and the licence. I don't know which one includes it and which not. I tried to browse Altera website by I could not find this information.

    Basically, MDIO is like I2C; then you can use one of the i2c cores available on opencores.org.

    If you choose one with wishbone interface, the connection to Avalon bus as a MM device is straightforward. You need a minimal experience with component definition in order to integrate it in sopc builder.

    Anyway, if you only need MDIO to configure a PHY and don't need great performance, the simplest solution is to implement it with two PIOs and bit bang the communication protocol.

    Cris
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Has anybody got MDIO master core OR code that I can import in SOPC builder please? thanks.

    --- Quote End ---

    Hi you can use Qsys and create a project with Nios II and Ethernet MDIO .and use this code for MDIO read and write.

    // writing

    IOWR_32DIRECT(ETH_MDIO_0_BASE,0x84,0x80000001);

    IOWR_32DIRECT(ETH_MDIO_0_BASE,0x80,0x0000b55d);

    //Reading

    IOWR_32DIRECT(ETH_MDIO_0_BASE,0x84,0x80000001);

    data32 = IORD_32DIRECT(ETH_MDIO_0_BASE, 0x80);