mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-12-24 04:23:04 +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
b74218f2ae
commit
c735b0ebca
1 changed files with 4 additions and 2 deletions
|
@ -42,7 +42,7 @@ static void *alloc_mapped_data(size_t size, u64 *iova)
|
||||||
else
|
else
|
||||||
mapping->iova = *iova = ALIGN_UP((mapping - 1)->iova + (mapping - 1)->size, SZ_16K);
|
mapping->iova = *iova = ALIGN_UP((mapping - 1)->iova + (mapping - 1)->size, SZ_16K);
|
||||||
mapping->size = ALIGN_UP(size, SZ_4K);
|
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));
|
memset64((void *)mapping->phys, 0, ALIGN_UP(mapping->size, SZ_16K));
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
@ -211,7 +211,9 @@ err:
|
||||||
for (int i = 0; i < MAX_FWDATA; i++) {
|
for (int i = 0; i < MAX_FWDATA; i++) {
|
||||||
if (!sio_fwdata[i].size)
|
if (!sio_fwdata[i].size)
|
||||||
break;
|
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_fwdata);
|
||||||
free(sio_fwparams);
|
free(sio_fwparams);
|
||||||
|
|
Loading…
Reference in a new issue