Forum Discussion

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

OpenCores MAC Controller Question

Hi all,

I was wondering if it is possible to use multiple (in my case 2) Avalon OpenCores Ethernet MAC controllers in uClinux? I currently have 1 configured and working, I'm just looking to add a second. If this is possible, how might I go about it?

Thanks,

Jason Duell

1 Reply

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

    Hi again everyone,

    I have found a solution to my problem. It was essentially a brute force approach.

    I'm going from memory, so I may accidentally leave out some details during my explanation...

    I added a second OpenCores MAC Controller to my SOPC project. I named it 'eth_web'. I auto-assigned base addresses and IRQs, then generated my SOPC system. I modified my top level VHDL to include the changes to my SOPC system. Then I compiled in Quartus II.

    I then copied my PTF to my uClinux development system. I first made a copy of open_eth.c and named the copy open_eth_2.c. In open_eth_2.c I renamed a few of the functions (the names escape me at the moment) from 'whatever()' to 'whatever_2()'. I also modified the MAC address assignments and the hard-coded 'na_igor_mac' values to 'na_eth_web'. Space.c will need to be modified to include the second OpenCores MAC instance as well as the new _2 function calls. I think for the _2 call in Space.c, I passed a parameter value of '1' instead of '0' like the rest of the calls did. I believe I also had to modify one of the Makefiles to include the open_eth_2.o file or something like that.

    I did a 'make clean', 'make vendor_hwselect...', 'make romfs', and finally 'make'.

    After copying my zImage file back to my Windows PC, I loaded my SOF and uploaded my zImage to my board.

    All said and done, I had two OpenCore MAC controllers available in uClinux. Eth0 and Eth1. I did a simple 'ifconfig eth1 192.168.0.1 netmask 255.255.255.0' to associate the MAC controller with an IP and away I go.

    This may not be the most efficient or best way to solve the problem, but it definitely worked and may be a starting point for further investigation in the future.

    Hope this helps anyone that may be interested!

    -Jason