Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

request_mem_region() error in uClinux

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

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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 ?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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?