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: 
Contributor
Contributor
2,430 Views
Registered: ‎12-30-2015

Re: Zynq + Petalinux reserve a DDR memory region

Jump to solution
Hi David,

I could be when you try to perform DMA to ddr at that moment Linux is using that part of memory.

What i had done i built the Linux kernel with my own hardware design and developed DMA driver. Then I performed whole DMA transactions in Linux.

I also tried to do like you are doing but I didn’t got any success. So I decide to use Linux and developed kernel drivers.

Another thing Linux reads and writes to virtual addresses while bearmetal with DMA uses actual address. That could be the cause of problem.

Make sure you are reading acutal address space in Linux. You can also see the memory registers after written through DMA there was a option in xsdk.

It will give you more clues.

Regards
Abbas
0 Kudos
2,423 Views
Registered: ‎05-16-2015

Re: Zynq + Petalinux reserve a DDR memory region

Jump to solution

The DMA is a shared resource.

If you don't have a clear hand shaking between to access it, you might run in to troubles?!.

Additionally, you might as well having caching issues.

 

I had caching issues while moving data between from one core to the other using the DDR (but no DMA transfer).

 

Hope this helps.

Regards 

0 Kudos
Observer davirol
Observer
2,399 Views
Registered: ‎08-16-2017

Re: Zynq + Petalinux reserve a DDR memory region

Jump to solution

Thanks @abbascit,giona.imperatori@phonak.com for the help. We'll try to figure out what can be happening.

 

Regards

 

 

0 Kudos
Highlighted
Explorer
Explorer
497 Views
Registered: ‎10-09-2017

Re: Zynq + Petalinux reserve a DDR memory region

Jump to solution

I'm trying the solution, but I wonder where  the dts file is. 

I add usb with changing ./project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

It is  petalinux 2018.2, 

how to do "altering the devicetree in the boot partition"?

0 Kudos
Explorer
Explorer
135 Views
Registered: ‎05-25-2016

Re: Zynq + Petalinux reserve a DDR memory region

Jump to solution

Has a working example of a device tree that reserves DDR memory space been posted?  This seems critically important and there is no clear detailed response from Xilinx.  This is a core pillar of the entire zynq platform.

Could someone from Xilinx please respond to the follow:

1. Example working device tree that reserves a DDR memory chunk

2. How did you select the memory region to ensure it doesn't interefere with other parts of linux?

3. What do the lines in the reserved-memory section of the device tree do/mean?

4. What else besides the device tree do we need to modify for the linux image build?

5. Are there any additional steps, flags etc.. involved in the petalinux build of this system?

6. Should we use UIO or mmap - there is a lot of confusion here.

This is too important to be this fragmented and confusing - someone from Xilinx needs to straighten out this approach with clear details!

I ran across this which may be helpful but still doesn't cover all the questions.

#1 may be covere by the below link - it looks like there is a write up on confluence that describes this process to some degree.

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841683/Linux+Reserved+Memory

0 Kudos
Participant r.sarwar87
Participant
125 Views
Registered: ‎09-17-2018

Re: Zynq + Petalinux reserve a DDR memory region

Jump to solution

The method of reserving memory from device tree is given in wiki:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841683/Linux+Reserved+Memory

 

reserved-memory {
   #address-cells = <2>;
   #size-cells = <2>;
   ranges;
 
   reserved: buffer@0 {
      no-map;
      reg = <0x0 0x70000000 0x0 0x10000000>;
   };
};
 
reserved-driver@0 {
   compatible = "xlnx,reserved-memory";
   memory-region = <&reserved>;
};

1. The above lines will reserve 256 MB bettween 3.5 and 4 GB.

2. you can select any region you feel like. Linux will bypass it. It is called "reserved memory" after all :)

3. they reserve memory in between address range bla bla bla, and assigns a driver, if you want to use cma, etc.

4. nothing

5. no

6. depends on your application

 

most of your questions are things you should be able to answer yourself -> just compile, boot, and find out. 

 

0 Kudos
Explorer
Explorer
122 Views
Registered: ‎05-25-2016

Re: Zynq + Petalinux reserve a DDR memory region

Jump to solution

Thanks for the direction

0 Kudos
Explorer
Explorer
81 Views
Registered: ‎05-25-2016

Re: Zynq + Petalinux reserve a DDR memory region

Jump to solution

for current version of petalinux - should this node be added to the "system-user.dtsi" instead of the "system-top.dts"?

 

When I do a petalinux-build -x mrproper I see that all my device trees get deleted except for the /project-spec/meta-user/recipes-bsp/device-tree/files/systemuser.dtsi

0 Kudos
Participant r.sarwar87
Participant
43 Views
Registered: ‎09-17-2018

Re: Zynq + Petalinux reserve a DDR memory region

Jump to solution

depends on your workflow, xilinx will have you added to  /project-spec/meta-user/recipes-bsp/device-tree/files/...

 

    0 /include/ "system-conf.dtsi"
    1 / {
    2   chosen {
    3   ┊ xlnx,eeprom = &eeprom;
    4   };
+   5   reserved-memory {
+   6   ┊ ┊#address-cells = <2>;
+   7   ┊ ┊#size-cells = <2>;
+   8   ┊ ┊ranges;
+   9   ┊
+  10   ┊ ┊reserved: buffer@0 {
+  11   ┊ ┊ ┊ no-map;
+  12   ┊ ┊ ┊ reg = <0x0 0x5ff00000 0x0 0x20000000>;
+  13   ┊ ┊};
+  14   };
+  15   ┊
+  16   reserved-driver@0 {
+  17   ┊ ┊compatible = "xlnx,reserved-memory";
+  18   ┊ ┊memory-region = <&reserved>;
+  19   };
   20 };
   21 
   22 /* notes:
   23 serdes: // PHY TYP see: dt-bindings/phy/phy.h
   24 */
   25 
   26 /* default */
   27 &amba {
   28   ┊ zyxclmm_drm {
   29   ┊ ┊ ┊ ┊ ┊ compatible = "xlnx,zocl";
   30   ┊ ┊ ┊ ┊ ┊ status = "okay";
   31   ┊ ┊ ┊ ┊ ┊ reg = <0x0 0xA0000000 0x0 0x10000>;
   32   ┊ ┊ ┊ };
   33 };
   34 /* SD */

 

0 Kudos
Explorer
Explorer
22 Views
Registered: ‎05-25-2016

Re: Zynq + Petalinux reserve a DDR memory region

Jump to solution

thansk @r.sarwar87 that is the correct place I think.  I now seem to have this up and running in 2019.1.  The wiki is outdated and the above mentioned device tree file should be used instead.

0 Kudos