Forum Discussion
Altera_Forum
Honored Contributor
21 years agoOpencores MAC 10/100 Driver
Hi Everyone
Please feel free to use these files and/or comment on them. I've written them as a driver for the opencores mac solution. I have been using them with the lwip web server example that comes with the nios II installation and they seems to work. I've attached a zip file with three files in it: OpenCores_Ethernet_MAC_regs.h - contains the definitions of the registers inside the opencores MAC component. OpenCores_Ethernet_MAC.c and the matching h file is the actual driver. I've used these files in conjuction with files that come with the Nios installation, which I can't post here for obvious reasons. What I did was to make a copy of the altera_avalon_lan91c111 directory, name it accordingly and replace the file in the HAL\inc and HAL\src as well as the regs file in the inc directory with the file I've attached. I hope this helps someone. Nir24 Replies
- Altera_Forum
Honored Contributor
Thanks.
- Altera_Forum
Honored Contributor
analysis of the freeze problem
I have tested the driver with both a DP83847 PHY and DP83848 PHY and I have found a bug causing the program to freeze. I have tested it with the lwip web server demo, using lwip-0.7.1. The way to make the program freeze is to ping it while repeatedly requesting a web page from it (e.g. using a while loop with curl in cygwin). In less than a minute, the program will stop responding to ping. I have done some analysis and come to the conclusion that it has something to do with interrupts. alt_avalon_opencores_mac_irq() handles interrupts of source RXE and BUSY, but ignores TXE interrupts. When the program is stressed, it receives a TXE interrupt, which is not cleared. Since it is not cleared, the MAC component seems to issue another interrupt and we have starvation. I tried to disable TXE interrupts in g_int_mask_contents, which improved the situation. The program no longer freezes, but after a while (sometimes almost 30 minutes), the program stops responding to pings and http requests. It still enters the opencores_ethernet_mac_output() function (which I am able to see in printf's I have inserted), but no response is sent to the pinging host. Restarting the program does not help, I must reset the FPGA. My guess is that the MAC component gets incapable of transmitting since its transmit buffers are filled with erroneous TX data. Does anybody have any pointers to how to properly handle the TXE interrupts, equivalent of how the RXE interrutps are handled. - Altera_Forum
Honored Contributor
I am using the MaCo Wishbone to Avalon interface for Opencores MAC. I see that it does not connect thru a Avalon Tristate Slave, but connects directly to the NIOS core. Can i still use this driver?
thanks in advance, Raghu - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by nir@May 17 2005, 02:38 AM sorry for that.here it is
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=6961)
--- quote end ---
--- Quote End --- Hi Nir, I cant download the file, can you please upload it again... Ragrmn
- Altera_Forum
Honored Contributor
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif Hello all & Nir
Please take in mind that the S/W Auto negotiation process with the STE100 assumes that the STE100 device is Hardware configured (resistors pull-up & down). to enable auto negotiation at 100/10 Mbit full duplex (without H/W configuration) ANA and 100CTR registers should be modified before Autonegotiation restart. Thanks for everything We this work fine for us Avi - Altera_Forum
Honored Contributor
Hi everyone,
where can I download the ip core? Is it www.opencores.org? Thanks! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/laugh.gif - Altera_Forum
Honored Contributor
Nir,
Do you know if this driver works with uCLinux or does it already have a driver? Thanks, Wade --- Quote Start --- originally posted by nir@Jan 4 2005, 04:49 PM hi everyoneplease feel free to use these files and/or comment on them. i've written them as a driver for the opencores mac solution. i have been using them with the lwip web server example that comes with the nios ii installation and they seems to work.
i've attached a zip file with three files in it:
opencores_ethernet_mac_regs.h - contains the definitions of the registers inside the opencores mac component.
opencores_ethernet_mac.c and the matching h file is the actual driver.
i've used these files in conjuction with files that come with the nios installation, which i can't post here for obvious reasons. what i did was to make a copy of the altera_avalon_lan91c111 directory, name it accordingly and replace the file in the hal\inc and hal\src as well as the regs file in the inc directory with the file i've attached. i hope this helps someone.
nir
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=3675)
--- quote end ---
--- Quote End ---
- Altera_Forum
Honored Contributor
you can get the alt_ethernet_dev.h from the lwIP.zip file available in the ip download section.
@Nir: Thank you very much... i get an error because my bus width is 16, how do i get it to 32? - Altera_Forum
Honored Contributor
Hello all
Unfortunately I didn't find "alt_ethernet_dev.h" file and couldn't download it. I'll appreciate somebody's help. Thanks, Ilya - Altera_Forum
Honored Contributor
Hello Jon
I have to work with TDK PHY. Can you send me TDK files? Thanks, Ilya