diff options
author | Loic Pallardy <loic.pallardy@st.com> | 2018-07-27 09:14:41 -0400 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2018-10-10 01:39:08 -0400 |
commit | 15c0b0258e4f1c3c817f34d092d2cc6ff5178bdd (patch) | |
tree | 715961a179ffbe84926c1282e4289d38a9af382a | |
parent | 72029c901a0244ca2e1eb09e1c453413a17f5787 (diff) |
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>
-rw-r--r-- | drivers/remoteproc/remoteproc_core.c | 16 | ||||
-rw-r--r-- | include/linux/remoteproc.h | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 9decc598944d..db771e53f097 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c | |||
@@ -747,7 +747,7 @@ static int rproc_handle_carveout(struct rproc *rproc, | |||
747 | if (!carveout) | 747 | if (!carveout) |
748 | goto free_carv; | 748 | goto free_carv; |
749 | 749 | ||
750 | list_add_tail(&carveout->node, &rproc->carveouts); | 750 | rproc_add_carveout(rproc, carveout); |
751 | 751 | ||
752 | return 0; | 752 | return 0; |
753 | 753 | ||
@@ -761,6 +761,20 @@ dma_free: | |||
761 | } | 761 | } |
762 | 762 | ||
763 | /** | 763 | /** |
764 | * rproc_add_carveout() - register an allocated carveout region | ||
765 | * @rproc: rproc handle | ||
766 | * @mem: memory entry to register | ||
767 | * | ||
768 | * This function registers specified memory entry in @rproc carveouts list. | ||
769 | * Specified carveout should have been allocated before registering. | ||
770 | */ | ||
771 | void rproc_add_carveout(struct rproc *rproc, struct rproc_mem_entry *mem) | ||
772 | { | ||
773 | list_add_tail(&mem->node, &rproc->carveouts); | ||
774 | } | ||
775 | EXPORT_SYMBOL(rproc_add_carveout); | ||
776 | |||
777 | /** | ||
764 | * rproc_mem_entry_init() - allocate and initialize rproc_mem_entry struct | 778 | * rproc_mem_entry_init() - allocate and initialize rproc_mem_entry struct |
765 | * @dev: pointer on device struct | 779 | * @dev: pointer on device struct |
766 | * @va: virtual address | 780 | * @va: virtual address |
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 9e2b84fa2efa..8a350265d883 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h | |||
@@ -559,6 +559,8 @@ int rproc_add(struct rproc *rproc); | |||
559 | int rproc_del(struct rproc *rproc); | 559 | int rproc_del(struct rproc *rproc); |
560 | void rproc_free(struct rproc *rproc); | 560 | void rproc_free(struct rproc *rproc); |
561 | 561 | ||
562 | void rproc_add_carveout(struct rproc *rproc, struct rproc_mem_entry *mem); | ||
563 | |||
562 | struct rproc_mem_entry * | 564 | struct rproc_mem_entry * |
563 | rproc_mem_entry_init(struct device *dev, | 565 | rproc_mem_entry_init(struct device *dev, |
564 | void *va, dma_addr_t dma, int len, u32 da, | 566 | void *va, dma_addr_t dma, int len, u32 da, |