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++
12589 Discussions

Version 13.0 Triple Speed Ethernet on Cyclone III running uClinux

Altera_Forum
Honored Contributor II
1,345 Views

I am in the process of trying to get uClinux working on an ep3c120 system. Specifically, the "Altera Embedded Systems Development Kit, Cyclone III Edition". Following the tutorial posted in the thread "Running uClinux on the DE2-115", I managed to get uClinux running from a custom design detailed in that tutorial. My problem now is that I am trying to get ethernet working. I am using version 13.0 of Quartus, and this new version comes with a new Triple Speed Ethernet function. This new function has a significantly more complex interface both at the Qsys level and for the output conduits. All of the tutorials and example designs I have found online have used the older version of the TSE. Therefore, I am in need of some kind of documentation or tutorial of how I should integrate the TSE into my basic design. 

 

I did already attempt to integrate the TSE into my design by trying to adapt what I have seen in the afformentioned design examples, and when I boot uClinux I get the message 

 

libphy: altera_tse-mdio: probed eth0: Altera TSE MAC at 0xf0003400 irq 3/4 

during the boot sequence. Which I suppose means that not everything is wrong. :)  

 

However, when I try to set the ip of the eth0, terrible things happen. 

root:/> ifconfig eth0 192.168.1.1 kernel unaligned access at 0x80000014; BADADDR 0xffffb779; cause=6, isn=0xfdedde6d Oops: Exception in kernel mode, sig: 4 r1: 80000000 r2: 000000f7 r3: 00000008 r4: 00000000 r5: ffff9008 r6: 00000000 r7: 00000000 r8: 0009a064 r9: c8522124 r10: 00000001 r11: 00000000 r12: 00000005 r13: 2aab9ea0 r14: 2aac7180 r15: 000001e0 ra: 00000000 fp: 00000000 sp: cf0f9fa4 gp: 00066190 ea: 80000018 estatus: 00000001 kernel unaligned access at 0x80000014; BADADDR 0xffffb785; cause=6, isn=0xfdedde6d Oops: Exception in kernel mode, sig: 4 r1: 80000000 r2: 000000af r3: 7fe2dc74 r4: 00000000 r5: 7fe2dc74 r6: 00000000 r7: 00000008 r8: 00100374 r9: c8522124 r10: 00000001 r11: 00000000 r12: 5c5c5c5c r13: 2aab9ea0 r14: 2aac7180 r15: 2aaff380 ra: 0000000c fp: 2ac06460 sp: cf0e1fa4 gp: 00066190 ea: 80000018 estatus: 00000001 Oops: Exception in kernel mode, sig: 4 r1: cf116060 r2: 00000092 r3: 2abc12d0 r4: 00000001 r5: 7f9faca4 r6: 00000002 r7: 00000001 r8: 0006d424 r9: c8522124 r10: 00000001 r11: 00000000 r12: 0a0a0a0a r13: 2aab9ea0 r14: 2aac7180 r15: 0000006c ra: c8000948 fp: 00000000 sp: cfc1ffa4 gp: 0000ca80 ea: cf116060 estatus: 00000001 Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004 

 

So basically I would like some direction on what may be causing this. If one could at least isolate the problem to either a quartus design problem or a uClinux configuration problem, that would be very helpful. 

 

Thanks for any help you can give and please let me know if more information is needed. I'll gladly provide it. 

 

-Caleb
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
328 Views

What branch/version of Linux are you using? 

 

According to this, the driver should work for 13.0 without changes, but there has been some work to get it to recognize the new version in Device Tree. 

http://sopc.et.ntust.edu.tw/pipermail/nios2-dev/2013-may/006708.html
0 Kudos
Altera_Forum
Honored Contributor II
328 Views

Thanks for your response. 

 

I am using the nios2 branch of linux 2.6 from git://sopc.et.ntust.edu.tw/git/linux-2.6.git 

and the trunk branch of uClinux-dist from git://sopc.et.ntust.edu.tw/git/uClinux-dist.git

 

I am also using the toolchain from git://sopc.et.ntust.edu.tw/git/toolchain-mmu.git 

and the sopc2dts tool from git://sopc.et.ntust.edu.tw/git/tools.git

 

All of these are from the most recent commits. My build box is running Ubuntu 12.04 LTS. 

 

sopc2dts doesn't seem to be having any problems recognizing the new device for me. The output dts is: 

 

ethernet: ethernet0x10003c40 { compatible = "ALTR,tse-13.0", "ALTR,tse-1.0"; reg = < 0x10003400 0x00000400 0x10003C40 0x00000040 0x10003C00 0x00000040 0x10003800 0x00000400 >; reg-names = "control_port", "rx_csr", "tx_csr", "s1"; interrupt-parent = < &proc >; interrupts = < 3 4 >; ALTR,rx-fifo-depth = < 2048 >; /* embeddedsw.CMacro.RECEIVE_FIFO_DEPTH type NUMBER */ ALTR,tx-fifo-depth = < 2048 >; /* embeddedsw.CMacro.TRANSMIT_FIFO_DEPTH type NUMBER */ address-bits = < 48 >; max-frame-size = < 1518 >; local-mac-address = ; phy-mode = "rgmii"; ALTR,mii-id = < 0 >; }; //end ethernet0x10003c40 (ethernet) 

I also have what what I believe are the appropriate settings enabled in the uClinux menuconfig. 

 

Device Drivers -> Network device support -> Generic Media Independent Interface device support 

Device Drivers -> Network device support -> Ethernet driver support -> Altera Triple-Speed Ethernet MAC support
0 Kudos
Altera_Forum
Honored Contributor II
328 Views

Hi, 

 

Why did your CPU run there, "kernel unaligned access at 0x80000014". 

 

 

--- Quote Start ---  

 

root:/> ifconfig eth0 192.168.1.1 kernel unaligned access at 0x80000014; BADADDR 0xffffb779; cause=6, isn=0xfdedde6d Oops: Exception in kernel mode, sig: 4 r1: 80000000 r2: 000000f7 r3: 00000008 r4: 00000000 r5: ffff9008 r6: 00000000 r7: 00000000 r8: 0009a064 r9: c8522124 r10: 00000001 r11: 00000000 r12: 00000005 r13: 2aab9ea0 r14: 2aac7180 r15: 000001e0 ra: 00000000 fp: 00000000 sp: cf0f9fa4 gp: 00066190 ea: 80000018 estatus: 00000001 kernel unaligned access at 0x80000014; BADADDR 0xffffb785; cause=6, isn=0xfdedde6d Oops: Exception in kernel mode, sig: 4  

 

--- Quote End ---  

 

 

Kazu
0 Kudos
Reply