Skip to content

Commit 646da63

Browse files
committed
Merge tag 'remoteproc-4.1-next' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc
Pull remoteproc update from Ohad Ben-Cohen: "Suman Anna is adding remoteproc support for processors not behind IOMMUs" * tag 'remoteproc-4.1-next' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc: remoteproc: add IOMMU hardware capability flag
2 parents 8f49309 + 315491e commit 646da63

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed

drivers/remoteproc/da8xx_remoteproc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
224224

225225
drproc = rproc->priv;
226226
drproc->rproc = rproc;
227+
rproc->has_iommu = false;
227228

228229
platform_set_drvdata(pdev, rproc);
229230

drivers/remoteproc/omap_remoteproc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ static int omap_rproc_probe(struct platform_device *pdev)
202202

203203
oproc = rproc->priv;
204204
oproc->rproc = rproc;
205+
/* All existing OMAP IPU and DSP processors have an MMU */
206+
rproc->has_iommu = true;
205207

206208
platform_set_drvdata(pdev, rproc);
207209

drivers/remoteproc/remoteproc_core.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,8 @@ static int rproc_enable_iommu(struct rproc *rproc)
9494
struct device *dev = rproc->dev.parent;
9595
int ret;
9696

97-
/*
98-
* We currently use iommu_present() to decide if an IOMMU
99-
* setup is needed.
100-
*
101-
* This works for simple cases, but will easily fail with
102-
* platforms that do have an IOMMU, but not for this specific
103-
* rproc.
104-
*
105-
* This will be easily solved by introducing hw capabilities
106-
* that will be set by the remoteproc driver.
107-
*/
108-
if (!iommu_present(dev->bus)) {
109-
dev_dbg(dev, "iommu not found\n");
97+
if (!rproc->has_iommu) {
98+
dev_dbg(dev, "iommu not present\n");
11099
return 0;
111100
}
112101

drivers/remoteproc/ste_modem_rproc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ static int sproc_probe(struct platform_device *pdev)
289289
sproc = rproc->priv;
290290
sproc->mdev = mdev;
291291
sproc->rproc = rproc;
292+
rproc->has_iommu = false;
292293
mdev->drv_data = sproc;
293294

294295
/* Provide callback functions to modem device */

include/linux/remoteproc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ enum rproc_crash_type {
404404
* @table_ptr: pointer to the resource table in effect
405405
* @cached_table: copy of the resource table
406406
* @table_csum: checksum of the resource table
407+
* @has_iommu: flag to indicate if remote processor is behind an MMU
407408
*/
408409
struct rproc {
409410
struct klist_node node;
@@ -435,6 +436,7 @@ struct rproc {
435436
struct resource_table *table_ptr;
436437
struct resource_table *cached_table;
437438
u32 table_csum;
439+
bool has_iommu;
438440
};
439441

440442
/* we currently support only two vrings per rvdev */

0 commit comments

Comments
 (0)