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

Ethernet autodetect IRQ failure

Altera_Forum
Honored Contributor II
1,020 Views

Hi, all. 

 

I'm using Nios II on the Altera Stratix 1s10 eval board; I'm using std_1s10.ptf, and standard.sof. 

 

I successfully followed the instructions in  

http://forum.niosforum.com/forum/index.php?showtopic=3174 (http://forum.niosforum.com/forum/index.php?showtopic=3174) (thanks to hippo for all his help on this). 

 

...up to step 9, where it indicates what to do to get networking going. 

 

 

I get the following output from the board; note the IRQ errors relating to Ethernet: 

 

uClinux/Nios II Altera Nios II support (C) 2004 Microtronix Datacom Ltd. Built 1 zonelists Kernel command line: PID hash table entries: 128 (order: 7, 2048 bytes) Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory available: 14592k/16384k RAM, 0k/0k ROM (1144k kernel code, 454k data) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) NET: Registered protocol family 16 Serial: JTAG UART driver $Revision: 1.4 $ ttyJ0 at MMIO 0x80810820 (irq = 2) is a jtag_uart io scheduler noop registered io scheduler deadline registered smc_probe: 50000 Khz Nios SMSC LAN91C111 Driver (v2.1), (Linux Kernel 2.6) eth0: Couldn&#39;t autodetect your IRQ. Use irq=xx.                        <<----- error in initcall at 0x011356b0: returned with disabled interrupts     <<----- NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes 2006 nios2nommu unknown TCP established hash table entries: 1024 (order: 1, 8192 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes) TCP: Hash tables configured (established 1024 bind 1024) NET: Registered protocol family 1 NET: Registered protocol family 17 Freeing unused kernel memory: 348k freed (0x112c000 - 0x1182000) init started:  BusyBox v1.1.1-pre0 (2006.05.13-03:07+0000) multi-call binary BusyBox v1.1.1-pre0 (2006.05.13-03:07+0000) Built-in shell (msh) Enter &#39;help&#39; for a list of built-in commands. # #  

 

I&#39;ve searched through the postings; all references to IRQs and Ethernet seemed unrelated to this. 

 

I also looked through the Altera eval board information, and could find anything helpful there either. 

 

I&#39;d appreciate any help you can provide, so I can get past this hurdle. 

 

Thanks, 

-- therrien
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
285 Views

I didn&#39;t look into to drivers code. 

But I take a look at the irq number for lan91c111, it is "0" (zero) for standard ptf. 

It is not good for uClinux, irq 0 used to be auto-detect, and that is not supported. 

You will have to change the irq number in sopc builder. 

Then regenerate hardware, and kerenl from hwselect. 

Or you can use full_featured.
0 Kudos
Altera_Forum
Honored Contributor II
285 Views

Thanks, Hippo. 

 

I tried the full-featured CPU (including "make clean" in linux-2.6.x), but it doesn&#39;t boot. It gets as far as this: 

 

Uncompressing Linux... Ok, booting the kernel. Linux version 2.6.11-uc0 (digaetas@server) (gcc version 3.4.6)# 14 Sun May 14 22 :59:02 EDT 2006 uClinux/Nios II Altera Nios II support (C) 2004 Microtronix Datacom Ltd. Built 1 zonelists Kernel command line: PID hash table entries: 128 (order: 7, 2048 bytes) 

 

And that&#39;s it...oh well, perhaps I should restart the compile from scratch and try again. 

 

BTW...where did you look in the PTF file to find the IRQ number? There are many fields in that file which could represent IRQ number; I&#39;m not familiar with the file format. 

 

Thanks, 

-- therrien
0 Kudos
Altera_Forum
Honored Contributor II
285 Views

     SLAVE s1      {         SYSTEM_BUILDER_INFO         {            Instantiate_In_System_Module = "0";            Is_Enabled = "1";            Is_Bus_Master = "0";            Bus_Type = "avalon_tristate";            Uses_Tri_State_Data_Bus = "1";            Address_Alignment = "native";            Address_Width = "14";            Data_Width = "32";            Has_IRQ = "1";            Read_Wait_States = "175ns";            Write_Wait_States = "175ns";            Setup_Time = "10ns";            Hold_Time = "5ns";            Is_Memory_Device = "0";            Date_Modified = "2002.03.19.10:51:51";            Base_Address = "0x00800000";            Tri_State_Data_Bus = "--unknown--";            MASTERED_BY ext_ram_bus/tristate_master            {               priority = "1";            }            IRQ_MASTER cpu/data_master            {               IRQ_Number = "0";        <-------            }            Address_Group = "0";         } 

 

Or you can look at the kernel include/nios2_system.h . 

 

Actually, I shall update the buildroot guide to build kerenl outside the source tree. 

With O=<build dir> option. 

So that you can build kernels for different boards/sof/config .
0 Kudos
Altera_Forum
Honored Contributor II
285 Views

 

--- Quote Start ---  

originally posted by therrien@May 15 2006, 10:04 AM 

thanks, hippo. 

 

i tried the full-featured cpu (including "make clean" in linux-2.6.x), but it doesn&#39;t boot.  it gets as far as this: 

 

uncompressing linux... ok, booting the kernel. linux version 2.6.11-uc0 (digaetas@server) (gcc version 3.4.6)# 14 sun may 14 22 :59:02 edt 2006 uclinux/nios ii altera nios ii support (c) 2004 microtronix datacom ltd. built 1 zonelists kernel command line: pid hash table entries: 128 (order: 7, 2048 bytes) 

 

and that&#39;s it...oh well, perhaps i should restart the compile from scratch and try again. 

 

btw...where did you look in the ptf file to find the irq number?  there are many fields in that file which could represent irq number; i&#39;m not familiar with the file format. 

 

thanks, 

-- therrien 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15367)</div> 

--- Quote End ---  

 

The execption vector (irq service) must be in sdram.
0 Kudos
Altera_Forum
Honored Contributor II
285 Views

SUCCESS!!!! 

 

I tried something different. 

 

I went into linux-2.6.x/drivers/net/smc91111.c, and commented out the auto-detect code (i.e. I let it succeed irrespective of the IRQ number that enters the function. 

 

With that change, the Ethernet came up, and I&#39;ve been able to give it an IP address and ping Internet sites (with a suitable resolv.conf and default gateway, of course). 

 

Something I noticed in that file: 

 

There is a# define surrounding the function smc_findirq(), called NO_AUTOPROBE; presumably, it is not set correctly for Nios II if the function continues to be called (which I know it is, I had added some (temporary) debugs. 

 

Also, the corresponding code inside smc_probe() is inaccurate, since it blindly calls this function (and it is _not_ surrounded by the NO_AUTOPROBE define). 

 

So there might be a way to circumvent this by editing the smc91111.c file as well (not sure whether anyone else is running into this; frankly, I&#39;m surprised that something like this hasn&#39;t shown up yet, given that I&#39;ve seen many other folks using the 1s10 eval board on the forum). 

 

Anyways, I&#39;m glad things are working now; I can proceed to the next step in my development plans. 

 

Thanks again, 

-- therrien
0 Kudos
Reply