Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Mdio

Altera_Forum
Honored Contributor II
1,987 Views

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.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
767 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
767 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
767 Views

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

0 Kudos
Altera_Forum
Honored Contributor II
767 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
767 Views

 

--- 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);
0 Kudos
Reply