remoteproc: introduce rproc_add_carveout function

This patch introduces a new API to allow platform driver to register
platform specific carveout regions.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Loic Pallardy 2018-07-27 15:14:41 +02:00 committed by Bjorn Andersson
parent 72029c901a
commit 15c0b0258e
2 changed files with 17 additions and 1 deletions

View File

@ -747,7 +747,7 @@ static int rproc_handle_carveout(struct rproc *rproc,
if (!carveout) if (!carveout)
goto free_carv; goto free_carv;
list_add_tail(&carveout->node, &rproc->carveouts); rproc_add_carveout(rproc, carveout);
return 0; return 0;
@ -760,6 +760,20 @@ dma_free:
return ret; return ret;
} }
/**
* rproc_add_carveout() - register an allocated carveout region
* @rproc: rproc handle
* @mem: memory entry to register
*
* This function registers specified memory entry in @rproc carveouts list.
* Specified carveout should have been allocated before registering.
*/
void rproc_add_carveout(struct rproc *rproc, struct rproc_mem_entry *mem)
{
list_add_tail(&mem->node, &rproc->carveouts);
}
EXPORT_SYMBOL(rproc_add_carveout);
/** /**
* rproc_mem_entry_init() - allocate and initialize rproc_mem_entry struct * rproc_mem_entry_init() - allocate and initialize rproc_mem_entry struct
* @dev: pointer on device struct * @dev: pointer on device struct

View File

@ -559,6 +559,8 @@ int rproc_add(struct rproc *rproc);
int rproc_del(struct rproc *rproc); int rproc_del(struct rproc *rproc);
void rproc_free(struct rproc *rproc); void rproc_free(struct rproc *rproc);
void rproc_add_carveout(struct rproc *rproc, struct rproc_mem_entry *mem);
struct rproc_mem_entry * struct rproc_mem_entry *
rproc_mem_entry_init(struct device *dev, rproc_mem_entry_init(struct device *dev,
void *va, dma_addr_t dma, int len, u32 da, void *va, dma_addr_t dma, int len, u32 da,