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
Observer iakovosmavro
Observer
5,871 Views
Registered: ‎10-03-2013

linux and sparse memory issue on Zedboard

Jump to solution

 

Dear all,

 

We are using a ZedBoard connected to an external memory device. The Zedboard has 512MB of DRAM, and an ARM A9 processor. The two boards are connected via a custom transport link. The A9 processor on the Zedboard can access the external memory device through the GP0 port of the Processing System (0x40000000 base address).

We are trying to boot the Zedboard with Linux and give it transparent access to the memory device, thus having a total of 768MB (512MB local with base addess 0x00000000, 256MB remote with base addresss 0x40000000). We have created a "device tree" that describes two memory regions (local memory: 512MB, remote memory: 256MB). So far, when we boot Zedboard with Linux we have been only able to use the local memory region in a transparent manner.

 

The remote memory is characterized by the Linux kernel at boot time as "highmem". We have only been able to use the remote memory region from applications via use of the mmap() system call. We have the CONFIG_ARCH_SPARSEMEM_ENABLE, CONFIG_ARCH_SPARSEMEM_DEFAULT and CONFIG_SPARSEMEM_MANUAL options enabled.

Question #1:
We have not been able to map the remote memory region adjacently to the local memory region. There is a 512MB-wide "gap" from the end of the local memory region to the beginning of the remote memory region. If this "gap" could be avoided, then we would have one contiguous memory region, and we would expect the Linux kernel to be able to use all of it in a transparent manner. Would this be feasible ?

Question #2:
We have tried to experiment with the Linux kernel's support for "sparse memory" (i.e. discontiguous memory regions), so that each of the boards is given access to a region of memory exported by the other board. Is this feature supported by the Linux kernel distribution provided by Xilinx (v.3.10.0) ?

 

Thanks in advance,

Iakovos

 

0 Kudos
1 Solution

Accepted Solutions
Newbie jveleg
Newbie
7,597 Views
Registered: ‎02-12-2014

Re: linux and sparse memory issue on Zedboard

Jump to solution

Greetings,

 

Thank you all for your responses.We had a bug in our hardware design, that

was the main cause of fault. We fixed it and managed to run the kernel in sparse memory configuration.

 

Although the new design is stable enough, the default xilinx linux kernel does not run with sparse memory.

We changed kernel to that used by xillinux and all things are all right now.

 

Thanks again

 

 

0 Kudos
7 Replies
Scholar milosoftware
Scholar
5,849 Views
Registered: ‎10-26-2012

Re: linux and sparse memory issue on Zedboard

Jump to solution

Please post your DT changes.

 

Linux can handle memory with "gaps" just fine, I've worked with several boards that had such a gap. (Actually, the PC on your desk also has a memory gap!)

 

If you provide multiple RAM ranges, Linux will just join them together, and user-space applications won't notice the gap is there.

 

You can experiment with that using the internal RAM, e.g. set it up as 256MB + 128 "gap" + 128MB, and you should get 384 MB of memory with a gap in between (which you can still map though, for example as a linear buffer).

 

The memory must be accesible through the MMU though - without MMU, the kernel cannot map the memory to user-defined ranges.

 

0 Kudos
Observer iakovosmavro
Observer
5,838 Views
Registered: ‎10-03-2013

Re: linux and sparse memory issue on Zedboard

Jump to solution

 

Thanks a lot for your reply!

 

The only change that we made was to declare one more memory region in the device tree graph of linux. We thought that linux would automatically join the two memory regions (local memory: 512MB, remote memory: 256MB) together as you also mention.

 

Notice that the remote memory region is not part of the main memory space of the A9 processor but it is part of its external memory space (0x40000000 is the base address in Zynq FPGAs) which is used for accessing external devices.

 

Iakovos

 

0 Kudos
Observer iakovosmavro
Observer
5,781 Views
Registered: ‎10-03-2013

Re: linux and sparse memory issue on Zedboard

Jump to solution

 

We are still facing the problem of the sparse memory model on the Zedboard. Below is a description of the problem from the person who is working on this issue. Please let me know if you have any advice.

 

Thanks,

Iakovos

 

-- Description of the problem --

We tried to run Xilinx Linux, with a sparse memory model
on the Zedboard. The RAM of the board is 512MB:
<0x0 0x20000000>. We defined two sections of RAM in the
device tree, thus creating a gap of 128MB in the board's RAM.
The device tree entry in the memory section is:
reg = <0x0 0x0FFFFFFF 0x1800000 0x20000000>.
(RAM sections 0-256MB and 384-512MB)

The kernel crashes while booting.
All other files, u-boot, uImage, ramdisk are the default ones.
Does the Xilinx Linux support sparse memory models?
In the menuconfig procedure at compile time, there is not
any option about sparse memory.

 

0 Kudos
Scholar milosoftware
Scholar
5,769 Views
Registered: ‎10-26-2012

Re: linux and sparse memory issue on Zedboard

Jump to solution

Just looking at:

 

reg = <0x0 0x0FFFFFFF 0x1800000 0x20000000>

 

That should be:

 

reg = <0x0 0x0FFFFFFF 0x1800000 0x1FFFFFFF>.

 

But since the "classic" way of specifying multiple memory regions is to use multiple "RAM=..." on the kernel command line, I would expect the device tree to need multiple RAM entries instead of a single entry with multiple parameters.

0 Kudos
Scholar milosoftware
Scholar
5,766 Views
Registered: ‎10-26-2012

Re: linux and sparse memory issue on Zedboard

Jump to solution

Try this in the devicetree:

 

        memory@0000 {
                device_type = "memory";
                reg = <0x000000000 0x10000000>;
        };
        memory@1800 {
                device_type = "memory";
                reg = <0x18000000 0x08000000>;
        };

 

 

root@zedboard:~# cat /proc/iomem                                                
00000000-0fffffff : System RAM                                                  
  00008000-0050335f : Kernel code                                               
  0052c000-005758a7 : Kernel data                                               
18000000-1fffffff : System RAM                                                  
...

root@zedboard:~# free                                                          
             total         used         free       shared      buffers         
Mem:        384084        66532       317552            0          792         
-/+ buffers:              65740       318344                                   
Swap:            0            0            0                                   

 

0 Kudos
Newbie jveleg
Newbie
7,598 Views
Registered: ‎02-12-2014

Re: linux and sparse memory issue on Zedboard

Jump to solution

Greetings,

 

Thank you all for your responses.We had a bug in our hardware design, that

was the main cause of fault. We fixed it and managed to run the kernel in sparse memory configuration.

 

Although the new design is stable enough, the default xilinx linux kernel does not run with sparse memory.

We changed kernel to that used by xillinux and all things are all right now.

 

Thanks again

 

 

0 Kudos
Newbie alverti
Newbie
2,614 Views
Registered: ‎09-07-2015

Re: linux and sparse memory issue on Zedboard

Jump to solution

Hello,

 

I am aslo trying to compile the digilent kernel for zedboard with the sparse memory model. However, I also cannot find SPARSEMEM as a kernel configuration option...Can you please give a brief explanation of how you solved this issue?

 

Thank you very much in advance,

Chloe Alverti

0 Kudos