Device driver for Managed Ethernet Switch IC connected w/ Avalon Bus
Hello everyone!
I am working on writing a network device driver for an Ethernet switch IC, for uClinux (2.6 kernel), running on a Nios2 processor on a Cyclone2 FPGA, connected via an Avalon Bus. Currently, my module compiles and loads fine and I can successfully read and write from the indirectly addressed registers (accessing directly addressed registers 0 and 2, which are address and data respectively). It is registered as a platform device. The device is registered as eth0, and displays the correct information (such as the MAC address I have specified) when I run the ifconfig command. When I attempt to ping anything, it calls my transmit function. The problem I am having at the moment is I have been unable to send/receive any packets, or receive any interrupts. I see no activity on the Ethernet ports when monitoring them under Wireshark. I think that this may be related to how we are accessing the directly addressed registers and/or the setup of the Avalon bus. The first point that I would like any comments on is the method I am using to access the directly addressed registers. I have a structure named "procif" which contains an entry for each directly addressed register: Code:
struct st_procif { Code:
db->procif = (struct st_procif *) ioremap_nocache(BASE, SIZE); Code:
#define BASE 0x01002050 To read/write to the registers I call a function like ioread8 with the argument being the address of the structure entry. For example, the following code is used in the CPU check, which reads from indirectly addressed register 0xfff, which should always contain the value of 0xDA. This process is successful. Code:
uint16_t indir_addr = 0xfff; Any help or ideas will be greatly appreciated. :) Thanks, Austin. |
All times are GMT -5. The time now is 10:07 PM. |