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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

request_mem_region() error in uClinux

Altera_Forum
Honored Contributor II
1,716 Views

Hi All, 

I am new to uClinux and NiOS II. I have been trying to make the ethernet work under uClinux with no success. 

I followed the ethernet link in nioswiki but keep getting the errors: 

*****ATSE:../../../nios2-linux/linux-2.6/drivers/net/altera_tse.c:1671:request_mem_region() failed 

atse: probe of atse.0 failed with error -16 

0: New Bus ID 

Altera TSE MII Bus: probed 

Found phy with ID=0x20005c90 at address =0x01 

Altera TSE MII Bus: MDIO bus registered 

ERROR: ../../../nios2-linux/linux-2.6/drivers/net/atera_tse.c:1652: request_mem_region() failed 

altera_tse: probe of altera_tse.0 failed with error -16 

 

Note: uclinux is starting and I can use the bash. 

ifconfig shows only lo: local loopback 

 

Any pointers on how to solve it ? 

 

Thanks in advance
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
888 Views
0 Kudos
Altera_Forum
Honored Contributor II
888 Views

Thank you for your reply. 

I have already checked this thread but could not much understand what should be done. Additionally I am using a MMUless system, and the thread targets NiOS with MMU, can the information posted on that thread still be used in my system ? 

Regards
0 Kudos
Altera_Forum
Honored Contributor II
888 Views

Ok got it, I had to modify atse.c and altera_tse.c 

thanks to the following thread 

 

alteraforum.com/forum/showthread.php?t=18802 

 

here are the modifications: 

* in atse.c, replace 

---------- 

if (!request_mem_region(res_sgdma_rx_mem->start, res_sgdma_rx_mem->end - res_sgdma_rx_mem->start + 1, ATSE_CARDNAME)) { printk("******ATSE:%s:%d:request_mem_region() failed\n", __FILE__, __LINE__); ret = -EBUSY; goto out; } 

by: 

if (!request_mem_region(res_sgdma_rx_mem->start, res_sgdma_rx_mem->end - res_sgdma_rx_mem->start + 1, ATSE_CARDNAME)) { reg_resource = __request_region(&iomem_resource, res_sgdma_rx_mem->start, res_sgdma_rx_mem->end - res_sgdma_rx_mem->start + 1, ATSE_CARDNAME,0); if(reg_resource != NULL && reg_resource->flags & IORESOURCE_BUSY) { printk("******ATSE:%s:%d:request_mem_region() failed\n", __FILE__, __LINE__); ret = -EBUSY; goto out; } } 

 

and  

if (!request_mem_region(res_sgdma_tx_mem->start, res_sgdma_tx_mem->end - res_sgdma_tx_mem->start + 1, ATSE_CARDNAME)) { printk("******ATSE:%s:%d:request_mem_region() failed\n", __FILE__, __LINE__); ret = -EBUSY; goto out; } 

by: 

if (!request_mem_region(res_sgdma_tx_mem->start, res_sgdma_tx_mem->end - res_sgdma_tx_mem->start + 1, ATSE_CARDNAME)) { reg_resource = __request_region(&iomem_resource, res_sgdma_tx_mem->start, res_sgdma_tx_mem->end - res_sgdma_tx_mem->start + 1, ATSE_CARDNAME,0); if(reg_resource != NULL && reg_resource->flags & IORESOURCE_BUSY) { printk("******ATSE:%s:%d:request_mem_region() failed\n", __FILE__, __LINE__); ret = -EBUSY; goto out; } } 

 

* in altera_tse.c, replace 

--------------- 

if (!request_mem_region(sgdma_rx_base, sgdma_rx_size, "altera_tse")) { printk(KERN_ERR "ERROR: %s:%d: request_mem_region() failed\n", __FILE__, __LINE__); ret = -EBUSY; goto out_sgdma_rx; } 

by 

if (!request_mem_region(sgdma_rx_base, sgdma_rx_size, "altera_tse")) { reg_resource = __request_region(&iomem_resource, sgdma_rx_base, sgdma_rx_size, " altera_tse" ,0); if(reg_resource != NULL && reg_resource->flags & IORESOURCE_BUSY) { printk(KERN_ERR "ERROR: %s:%d: request_mem_region() failed\n", __FILE__, __LINE__); ret = -EBUSY; goto out_sgdma_rx; } } 

 

and  

if (!request_mem_region(sgdma_tx_base, sgdma_tx_size, "altera_tse")) { printk(KERN_ERR "ERROR: %s:%d: request_mem_region() failed\n", __FILE__, __LINE__); ret = -EBUSY; goto out_sgdma_tx; } 

by 

if (!request_mem_region(sgdma_tx_base, sgdma_tx_size, "altera_tse")) { reg_resource = __request_region(&iomem_resource, sgdma_tx_base, sgdma_tx_size, " altera_tse" ,0); if(reg_resource != NULL && reg_resource->flags & IORESOURCE_BUSY) { printk(KERN_ERR "ERROR: %s:%d: request_mem_region() failed\n", __FILE__, __LINE__); ret = -EBUSY; goto out_sgdma_tx; } } 

* in both files, and at the beginning of the functions where we made the modifications declare reg_resource by adding the following line  

struct resource *reg_resource; 

 

after compiling and downloading the image 

I was able to start eth0 by typing : 

# ifconfig eth0 up
0 Kudos
Altera_Forum
Honored Contributor II
888 Views

 

--- Quote Start ---  

Ok got it, I had to modify atse.c and altera_tse.c 

thanks to the following thread 

--- Quote End ---  

 

These are two separate drivers. In menuconfig, they are the experimental and SLS driver, respectively. You shouldn't be using both at the same time.
0 Kudos
Altera_Forum
Honored Contributor II
888 Views

OK, that explains why I have the errors I describe in my following thread (I think)! 

Can you please take a look at it and give me your feedback ?
0 Kudos
Altera_Forum
Honored Contributor II
888 Views

hi, i had the same problem 

after the modifications works my ethernet korrekt, but I become the following errors: 

physmap-flash physmap-flash.0: Could not reserve memory region  

physmap-flash: probe of physmap-flash.0 failed with error -12  

can anybody help me?
0 Kudos
Reply