cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Ryose93
Visitor
Visitor
272 Views
Registered: ‎03-16-2021

Error Reserving fdt Memory failed

I'm working on a petalinux (2020.1) based project on a zcu111 and I want to reserve some memory to perform DMA operations. Basically, I followed this tutorial https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841683/Linux+Reserved+Memory#LinuxReservedMemory-Reservedmemory and have managed to build the project after modifying system-user.dtsi starting from the xilinx bsp.

Unfortunately, at boot time the system shows this log:

Ryose93_0-1617185828820.png

In the end the kernel fails to load with a kernel panic, what am i doing wrong?

 

0 Kudos
5 Replies
Ryose93
Visitor
Visitor
200 Views
Registered: ‎03-16-2021

I'm adding some informations since I'm still trying to solve the issue:

I have tried to reduce memory size of the system to 0x7_00000000 by maintaining the same device-tree entry, but with no improvements:

Ryose93_0-1617357823427.png

I also tried to add a custom kernel module to the build, which completes withut error, but the boot does not go that far, i suppose something is wrong with my device-tree file? Here i copied the system-user.dtsi :

/include/ "system-conf.dtsi"
/{
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>;
};
};

0 Kudos
jrhtech
Voyager
Voyager
160 Views
Registered: ‎10-04-2017

We create a region like this with no problems:

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
mojo_dispcal_reserved: mdcal@40000000 {
no-map;
reg = <0x0 0x40000000 0x0 0x1000000>;
};
};

 

And there is also a reserved region for RPU memory.  I've also done what you tried, reducing the size and then reserving at the end, in 2018.3 and that worked. 

I see that you do this:

reserved-driver@0

where I put the starting address of my reserved area after the @.   I would just get the reserved working before adding anything for a driver that tries to use it.

 

jeff

 

Ryose93
Visitor
Visitor
109 Views
Registered: ‎03-16-2021

I tried following your suggestion, so i modified my device-tree this way:

/include/ "system-conf.dtsi"
/{
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

reserved: buffer@70000000{
no-map;
reg = <0x0 0x70000000 0x0 0x10000000>;
};
};
reserved-driver@70000000 {
compatible = "xlnx,reserved-memory";
memory-region = <&reserved>;
};
};

but it won't work. Maybe there is a way in which I can modify the offset of RamDisk? (since the RamDisk is booted at 78735000, although i don't know if this hex or decimal coded nor virtual or phisical address)

0 Kudos
jrhtech
Voyager
Voyager
86 Views
Registered: ‎10-04-2017

I can’t say the best way to determine the address to reserve but it does look like you are overlapping.   My example is from my setup with a ramdisk and there was no problems.  Those are the hex physical addresses.  I would just change the reserve address instead of messing with ramdisk

 

jeff

jeff

Ryose93
Visitor
Visitor
57 Views
Registered: ‎03-16-2021

I find it really strange that is not behaving like the tutorial, either the tutorial is buggy or the BSP is, since I haven't done anything more than creating the project from the bsp and modifying the device-tree. Also by reducing the memory size from petalinux-config it is really odd that the ramdisk is loaded at that particular address. I will try to investigate the problem better, but thanks for you help @jrhtech!

0 Kudos