提交 8356023a 编写于 作者: J Jean-Philippe Brucker 提交者: Xie XiuQi

iommu/of: Add stall and pasid properties to iommu_fwspec

hulk inclusion
category: feature
bugzilla: 14369
CVE: NA
-------------------

Add stall and pasid properties to iommu_fwspec, and fill them when
dma-can-stall and pasid-bits properties are present in the device tree.
Signed-off-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: NFang Lijun <fanglijun3@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Reviewed-by: NZhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 0bef59dc
......@@ -187,6 +187,19 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
if (err)
break;
}
fwspec = dev->iommu_fwspec;
if (!err && fwspec) {
const __be32 *prop;
if (of_get_property(master_np, "dma-can-stall", NULL))
fwspec->can_stall = true;
prop = of_get_property(master_np,
"pasid-num-bits", NULL);
if (prop)
fwspec->num_pasid_bits = be32_to_cpu(*prop);
}
}
/*
......
......@@ -650,6 +650,8 @@ struct iommu_fwspec {
struct fwnode_handle *iommu_fwnode;
void *iommu_priv;
unsigned int num_ids;
unsigned int num_pasid_bits;
bool can_stall;
u32 ids[1];
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册