apps: examples: load_fw: Use accessors for remoteproc_mem and rproc

The remoteproc_mem and rproc structs contents are internal to remoteproc.
These should be accessed using the provided accessors, not directly. This
is done in preparation of making these struct opaque to code outside of
the remoteproc drivers.

Signed-off-by: Andrew Davis <afd@ti.com>
This commit is contained in:
Andrew Davis
2024-04-05 19:08:42 +02:00
committed by Arnaud Pouliquen
parent 3758939d83
commit f757dad6f3
3 changed files with 6 additions and 12 deletions
@@ -81,7 +81,6 @@ static void *apu_rproc_mmap(struct remoteproc *rproc,
if (!mem)
return NULL;
mem->pa = lpa;
mem->da = lda;
*io = metal_allocate_memory(sizeof(struct metal_io_region));
if (!*io) {
@@ -95,11 +94,10 @@ static void *apu_rproc_mmap(struct remoteproc *rproc,
*/
metal_io_init(*io, (void *)mem->pa, &mem->pa, size,
sizeof(metal_phys_addr_t)<<3, attribute, NULL);
mem->io = *io;
metal_list_add_tail(&rproc->mems, &mem->node);
remoteproc_init_mem(mem, NULL, lpa, lda, size, *io);
remoteproc_add_mem(rproc, mem);
*pa = lpa;
*da = lda;
mem->size = size;
return metal_io_phys_to_virt(*io, mem->pa);
}
@@ -202,7 +202,6 @@ void *r5_rproc_mmap(struct remoteproc *rproc,
if (!mem)
return NULL;
mem->pa = lpa;
mem->da = lda;
*io = metal_allocate_memory(sizeof(struct metal_io_region));
if (!*io) {
@@ -211,11 +210,10 @@ void *r5_rproc_mmap(struct remoteproc *rproc,
}
metal_io_init(*io, (void *)mem->pa, &mem->pa, size,
sizeof(metal_phys_addr_t)<<3, attribute, NULL);
mem->io = *io;
metal_list_add_tail(&rproc->mems, &mem->node);
remoteproc_init_mem(mem, NULL, lpa, lda, size, *io);
remoteproc_add_mem(rproc, mem);
*pa = lpa;
*da = lda;
mem->size = size;
return metal_io_phys_to_virt(*io, mem->pa);
}
@@ -94,7 +94,6 @@ static void *rpu_rproc_mmap(struct remoteproc *rproc,
if (!mem)
return NULL;
mem->pa = lpa;
mem->da = lda;
*io = metal_allocate_memory(sizeof(struct metal_io_region));
if (!*io) {
@@ -108,11 +107,10 @@ static void *rpu_rproc_mmap(struct remoteproc *rproc,
*/
metal_io_init(*io, (void *)mem->pa, &mem->pa, size,
sizeof(metal_phys_addr_t)<<3, attribute, NULL);
mem->io = *io;
metal_list_add_tail(&rproc->mems, &mem->node);
remoteproc_init_mem(mem, NULL, lpa, lda, size, *io);
remoteproc_add_mem(rproc, mem);
*pa = lpa;
*da = lda;
mem->size = size;
return metal_io_phys_to_virt(*io, mem->pa);
}