[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1487189929-24196-3-git-send-email-loic.pallardy@st.com>
Date: Wed, 15 Feb 2017 21:18:49 +0100
From: Loic Pallardy <loic.pallardy@...com>
To: <bjorn.andersson@...aro.org>, <ohad@...ery.com>,
<lee.jones@...aro.org>
CC: <loic.pallardy@...com>, <linux-remoteproc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <kernel@...inux.com>,
<patrice.chotard@...com>, <hugues.fruchet@...com>,
<peter.griffin@...aro.org>
Subject: [PATCH v4 2/2] remoteproc: core: don't allocate carveout if pa is defined
Remoteproc doesn't check if firmware requests fixed
addresses for carveout regions.
Current assumption is that platform specific driver is in
charge of coprocessor specific memory region allocation and
remoteproc core doesn't have to handle them.
If a pa is specified in firmware resource table, remoteproc
core doesn't have to perform any allocation.
Access to carveout will be done thanks to rproc_da_to_pa function,
which will provide virtual address on carveout region allocated
by platform specific driver.
Signed-off-by: Loic Pallardy <loic.pallardy@...com>
Acked-by: Hugues Fruchet <hugues.fruchet@...com>
Tested-by: Hugues Fruchet <hugues.fruchet@...com>
---
Changes from V3:
- Fix Bjorn's remark: Don't check if da is already specified in resource table.
Because this doesn't mean buffer has been allocated, but that a specific da
is requested for IOMMU configuration.
- Rebase on rproc-next branch
---
drivers/remoteproc/remoteproc_core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 3dabb20..74ad2d0 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -622,6 +622,11 @@ static int rproc_handle_carveout(struct rproc *rproc,
dev_dbg(dev, "carveout rsc: name: %s, da 0x%x, pa 0x%x, len 0x%x, flags 0x%x\n",
rsc->name, rsc->da, rsc->pa, rsc->len, rsc->flags);
+ if (rsc->pa != FW_RSC_ADDR_ANY) {
+ dev_dbg(dev, "carveout already allocated by low level driver\n");
+ return 0;
+ }
+
carveout = kzalloc(sizeof(*carveout), GFP_KERNEL);
if (!carveout)
return -ENOMEM;
--
1.9.1
Powered by blists - more mailing lists