Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bc8140b authored by Loic Pallardy's avatar Loic Pallardy Committed by Bjorn Andersson
Browse files

remoteproc: configure IOMMU only if device address requested



If there is no IOMMU associate to remote processor device,
remoteproc_core won't be able to satisfy device address requested
in firmware resource table.
Return an error as configuration won't be coherent.

Signed-off-by: default avatarLoic Pallardy <loic.pallardy@st.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent bbcda302
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -657,7 +657,15 @@ static int rproc_handle_carveout(struct rproc *rproc,
	 * to use the iommu-based DMA API: we expect 'dma' to contain the
	 * physical address in this case.
	 */
	if (rproc->domain) {

	if (rsc->da != FW_RSC_ADDR_ANY && !rproc->domain) {
		dev_err(dev->parent,
			"Bad carveout rsc configuration\n");
		ret = -ENOMEM;
		goto dma_free;
	}

	if (rsc->da != FW_RSC_ADDR_ANY && rproc->domain) {
		mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
		if (!mapping) {
			ret = -ENOMEM;