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: 
Observer jamesba-bbc
Observer
11,112 Views
Registered: ‎07-27-2011

PL Device memory access fails on Linux Kernel 4.0.0.0

Jump to solution

I've recently upgraded my linux kernel from the 2015.2 release version to the 2015.4.01 release version. The new kernel is a v.4 kernel and is built using xilinx_zynq_defconfig. When I boot the new kernel I have no access to the memory regions of AXI devices on the Programmable logic: notably I get the following error in my dmesg log:

 

xilinx_axienet 43c10000.ethernet: can't request region for resource [mem 0x40400000-0x4040ffff]

 

when trying to load the axi_ethernet driver. Similarly if I use a userspace programme to mmap memory from /dev/mem the mmap command fails when trying to map any memory corresponding to the devices on the AXI bus. Does anyone know what the cause of this might be? Is there some setup of the AXI-GP port that is done by kernel v.3 but no longer done by default on kernel v.4? The PS system hard peripherals all seem to work, which suggests to me that the level shifters between the PS and PL system may not be being activated, but I thought that was done by the FSBL, which I have not changed.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer jamesba-bbc
Observer
20,502 Views
Registered: ‎07-27-2011

Re: PL Device memory access fails on Linux Kernel 4.0.0.0

Jump to solution

In fact after some more investigation the problem with the ethernet was actually that the DMA was being grabbed by the DMA driver not the ethernet driver. A manual edit to the devicetree has fixed this.

 

It's still not possible to map AXI memory in /dev/mem, though, but that's less of a problem.

0 Kudos
4 Replies
Adventurer
Adventurer
11,001 Views
Registered: ‎09-19-2014

Re: PL Device memory access fails on Linux Kernel 4.0.0.0

Jump to solution

Is it possible the kernel drivers (e.g. for ethernet) changed in this kernel upgrade, and expect the device tree to be different? I assume you haven't changed your device tree at all?

 

I have standard Zynq PS ethernet working (is that the same as your AXI one?) with 2015.4.01. But I upgraded from 2014.3-ish kernel to that, and upgraded the device tree and everything else at the same time (and a number of drivers were re-written).

Generate your device tree with these sources:

https://github.com/Xilinx/device-tree-xlnx/tree/xilinx-v2015.4

 

My bootup for ethernet looks like this:

[    1.784695] macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 147 (00:0a:35:00:01:22)
[    1.794582] macb e000b000.ethernet eth0: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)

Anyway, mine does access other peripherals in AXI, such as PCIe:

[    0.859630] xilinx-pcie 50000000.axi-pcie: PCIe Link is UP

Perhaps it's the AXI bus driver that has been updated, and expects some different information in the device tree.

0 Kudos
Highlighted
Observer jamesba-bbc
Observer
20,503 Views
Registered: ‎07-27-2011

Re: PL Device memory access fails on Linux Kernel 4.0.0.0

Jump to solution

In fact after some more investigation the problem with the ethernet was actually that the DMA was being grabbed by the DMA driver not the ethernet driver. A manual edit to the devicetree has fixed this.

 

It's still not possible to map AXI memory in /dev/mem, though, but that's less of a problem.

0 Kudos
Adventurer
Adventurer
10,012 Views
Registered: ‎09-19-2014

Re: PL Device memory access fails on Linux Kernel 4.0.0.0

Jump to solution

That's good then. :)

I've found that Xilinx 2015.4 requires far fewer manual edits to the generated device tree, so I'm almost suspicious when it doesn't get generated correctly straight away.

0 Kudos
Adventurer
Adventurer
9,922 Views
Registered: ‎06-08-2015

Re: PL Device memory access fails on Linux Kernel 4.0.0.0

Jump to solution
To access /dev/mem, in the "Kernel hacking" configuration options, you should have CONFIG_DEVMEM set to 'y' and CONFIG_STRICT_DEVMEM set to 'n'.
0 Kudos