Add hook for EmbeddedDevice XRT devices to allow moving the PSDDR memory region #1424
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By default the
EmbeddedDevice
seems to have a placeholder PSDDR region that gets added onto any other memory regions in the address map if no.xclbin
file is provided.zocl
of course doesn't find a reserved 256 Meg region at address 0 and falls back to the kernel CMA region which seems to be limited to 256M on most boards and is by default only 128M of which ~8M is already used by the kernel. This behavior is a tad confusing to the end user and means that only 120M of memory can by default be allocated using the default allocate region.In addition I'm not really sure what would happen if all or near all of the CMA region were allocated and the kernel needs some more (for e.g. a framebuffer on display hotplug), but I can't imagine it would be good things and this seems difficult to debug.
This patch allows one to point the default allocation region at any reserved region that XRT is willing to allocate from. On the RFSoC 4x2 I created such a region in the bottom half of the upper two gigs of PS DDR by adding:
To the device tree, on Alveo platforms this appears to be done by allocating hugepages on boot and using
xbutil
but this doesn't seem to be supported on Zynq platforms.To use it you call the
set_psddr_region(addr, size)
method on anEmbeddedDevice
to give it the address of a region you want to use before downloading an overlay. It does check that everything is page aligned but does not check that the region is actually in the PSDDR or that it is unused by other drivers however those checks seem like they would be better placed inzocl
if they aren't already there.It also does not check that the overlay hasn't been downloaded, is this a robust way to do that?