Commit 20dc3750 authored by Simon Que's avatar Simon Que Committed by Hari Kanigeri

SYSLINK: proc4430 - Reserve memory alignment

The memory alignment was not done properly in proc4430_map.  It was not
being aligned to the size of all pages needed to cover the reserved
area.  As a result, not all of it was reserved.  This has been fixed and
tested.
Signed-off-by: default avatarSimon Que <sque@ti.com>
parent 7954c88a
...@@ -850,12 +850,12 @@ int proc4430_map(void *handle, u32 proc_addr, ...@@ -850,12 +850,12 @@ int proc4430_map(void *handle, u32 proc_addr,
return 0; return 0;
} }
dmm_reserve_memory(size, &da);
/* Calculate the page-aligned PA, VA and size */ /* Calculate the page-aligned PA, VA and size */
da_align = PG_ALIGN_LOW((u32)da, PAGE_SIZE);
va_align = PG_ALIGN_LOW(proc_addr, PAGE_SIZE); va_align = PG_ALIGN_LOW(proc_addr, PAGE_SIZE);
size_align = PG_ALIGN_HIGH(size + (u32)proc_addr - va_align, PAGE_SIZE); size_align = PG_ALIGN_HIGH(size + (u32)proc_addr - va_align, PAGE_SIZE);
dmm_reserve_memory(size_align, &da);
da_align = PG_ALIGN_LOW((u32)da, PAGE_SIZE);
retval = ducati_mem_map(va_align, da_align, size_align, map_attribs); retval = ducati_mem_map(va_align, da_align, size_align, map_attribs);
/* Mapped address = MSB of DA | LSB of VA */ /* Mapped address = MSB of DA | LSB of VA */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment