mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 09:44:13 +00:00
sio: Allocate from top of memory
Place the firmware data we are preparing at the top of memory. Signed-off-by: Martin Povišer <povik@cutebit.org>
This commit is contained in:
parent
fa820a7164
commit
8824bd2dbf
1 changed files with 4 additions and 2 deletions
|
@ -42,7 +42,7 @@ static void *alloc_mapped_data(size_t size, u64 *iova)
|
|||
else
|
||||
mapping->iova = *iova = ALIGN_UP((mapping - 1)->iova + (mapping - 1)->size, SZ_16K);
|
||||
mapping->size = ALIGN_UP(size, SZ_4K);
|
||||
mapping->phys = (u64)memalign(SZ_16K, ALIGN_UP(size, SZ_16K));
|
||||
mapping->phys = top_of_memory_alloc(size);
|
||||
memset64((void *)mapping->phys, 0, ALIGN_UP(mapping->size, SZ_16K));
|
||||
|
||||
done:
|
||||
|
@ -211,7 +211,9 @@ err:
|
|||
for (int i = 0; i < MAX_FWDATA; i++) {
|
||||
if (!sio_fwdata[i].size)
|
||||
break;
|
||||
free((void *)sio_fwdata[i].phys);
|
||||
// No way to give back memory with the top of memory
|
||||
// allocator.
|
||||
// free((void *)sio_fwdata[i].phys);
|
||||
}
|
||||
free(sio_fwdata);
|
||||
free(sio_fwparams);
|
||||
|
|
Loading…
Reference in a new issue