UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
7,686 Views
Registered: ‎11-05-2014

Linux AMP - how to get Linux to release ethernet interface?

Jump to solution

In my AMP configuration, I want Linux on CPU0 to use eth0 and FreeRTOS on CPU1 to use eth1. I'm not sure what to do to get Linux to release access to eth1, but I tried the following changes to the device tree:

 

  • Disabled eth1 with this:
 ps7_ethernet_1: ps7-ethernet@e000c000 { compatible="invalid"; };
  • Forward eth1 interrupt 77 to CPU1 in remoteproc stanza

 

The FreeRTOS binary runs stand-alone fine, but when used in AMP config with Linux, the eth1 register space at 0xe000c000 contains all zeroes.

 

/proc/vmallocinfo shows that 0xe000c000 is still being mapped to virtual memory by Linux:

0x9e8fc000-0x9e8fe000    8192 devm_ioremap_nocache+0x3c/0x74 phys=e000b000 ioremap

 

Could this be the issue?  What more do I need to do to get Linux to release eth1?

 

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
14,825 Views
Registered: ‎03-13-2012

Re: Linux AMP - how to get Linux to release ethernet interface?

Jump to solution

Please, check the actual value of the corresponding clock control register. IIUC, the kernel parameter is only good to avoid the initial disablement of unused clocks after boot up (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/kernel-parameters.txt#n613). I could imagine that Linux controlling one Ethernet clock might affect the other one at some common level.

0 Kudos
7 Replies
Xilinx Employee
Xilinx Employee
7,682 Views
Registered: ‎01-21-2014

Re: Linux AMP - how to get Linux to release ethernet interface?

Jump to solution

When Linux isn't using a peripheral, it will disable the clock. 

 

Take a look at this thread, I have a feeling this is your problem:

 

https://forums.xilinx.com/t5/Embedded-Linux/XC7Z020-Suspect-Linux-on-core-0-interferring-with-SPI-controlled/m-p/569499/highlight/true#M12223

 

 

Regards, 

Terry

 

 

0 Kudos
Adventurer
Adventurer
7,673 Views
Registered: ‎11-05-2014

Re: Linux AMP - how to get Linux to release ethernet interface?

Jump to solution

I forgot to mention I am also passing the "clk_ignore_unused" kernel parameter already, so it is not working with that.

0 Kudos
Xilinx Employee
Xilinx Employee
7,668 Views
Registered: ‎09-10-2008

Re: Linux AMP - how to get Linux to release ethernet interface?

Jump to solution
That virtual memory you show is for eth0 (e000b000) rather than eth1 which makes more sense. Since the clocks are off for eth1 it seems the device tree change worked fine and the driver for eth1 is not running. I'm assuming you verified the kernel command line at runtime.

You don't mention what kernel version you are running. You can manually turn on the clock in the SLCR registers for the EMAC in the standalone application but it would nice not to need that.
0 Kudos
Xilinx Employee
Xilinx Employee
14,826 Views
Registered: ‎03-13-2012

Re: Linux AMP - how to get Linux to release ethernet interface?

Jump to solution

Please, check the actual value of the corresponding clock control register. IIUC, the kernel parameter is only good to avoid the initial disablement of unused clocks after boot up (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/kernel-parameters.txt#n613). I could imagine that Linux controlling one Ethernet clock might affect the other one at some common level.

0 Kudos
Adventurer
Adventurer
7,645 Views
Registered: ‎11-05-2014

Re: Linux AMP - how to get Linux to release ethernet interface?

Jump to solution

Thanks once again @sorenb.  The GEM1 clock was not enabled in APER_CLK_CTRL nor GEM1_CLK_CTRL.  The "clk_ignore_unused" kernel param didn't do anything then?  I did verify this parameter at runtime.

 

Anyway, adding this quick 'n dirty code to the CPU1 application did the job:

	// Enable eth1 clock - APER_CLK_CTRL 
	u32 reg = Xil_In32(0xF800012C);
	Xil_Out32(0xF800012C, reg | 0x80);

	// Enable eth1 clock - GEM1_CLK_CTRL
	reg = Xil_In32(0xF8000144);
	Xil_Out32(0xF8000144, reg | 0x01);

Is there a device tree way to have Linux do this while still disabling eth1 for Linux?

 

@linnj The virtual memory I showed starts at 0xe000b000, but the size of the allocation also covers eth1 at 0xe000c000.  It still does that now that things are working, but I guess that's OK? I am running kernel 4.0.0.

 

0 Kudos
Xilinx Employee
Xilinx Employee
7,638 Views
Registered: ‎09-10-2008

Re: Linux AMP - how to get Linux to release ethernet interface?

Jump to solution
Yep I missed the size of that region, that's strange since the driver should not be probed for the emac instance.

There is not a way that I know of in the device tree to make this happen as we've discussed the need for it (unless the newer kernel has a way).
0 Kudos
Xilinx Employee
Xilinx Employee
7,623 Views
Registered: ‎03-13-2012

Re: Linux AMP - how to get Linux to release ethernet interface?

Jump to solution

There have been some proposals to solve this in DT. But AFAIK, none is available (yet). I think the last proposal is this https://lkml.org/lkml/2015/7/22/311

0 Kudos