iommu: msm: allow CBs to report an error when faults

Some clients of IOMMU treats the CB fault as non-recoverable
and they may want to trap the fault for debug purpose. Provide
that provision via context bank DT property.

Change-Id: Icb9cb67ed3dac44e144fcd7bc85deca833bf941c
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
This commit is contained in:
Chintan Pandya 2015-05-08 19:21:23 +05:30
parent c3c1ff2a70
commit 9f4508f124
4 changed files with 14 additions and 0 deletions

View File

@ -75,6 +75,8 @@ Optional properties:
the same property except this is for IOMMU with LPAE support.
- qcom,iommu-sid-mask : List of mask values to map the unique stream ids to
the Stream Mapping Table entries.
- qcom,report-error-on-fault : boolean indicating that when any fault
occurs in this context bank, an error will be sent to respective master
Example:

View File

@ -672,6 +672,12 @@ static void __program_context(struct msm_iommu_drvdata *iommu_drvdata,
/* Enable context fault interrupt */
SET_CB_SCTLR_CFIE(cb_base, ctx, 1);
/* Enable context fault error report */
if (ctx_drvdata->report_error_on_fault) {
SET_CB_SCTLR_HUPCF(cb_base, ctx, 1);
SET_CB_SCTLR_CFRE(cb_base, ctx, 1);
}
if (iommu_drvdata->model != MMU_500) {
/* Redirect all cacheable requests to L2 slave port. */
SET_CB_ACTLR_BPRCISH(cb_base, ctx, 1);

View File

@ -591,6 +591,10 @@ static int msm_iommu_ctx_parse_dt(struct platform_device *pdev,
&ctx_drvdata->name))
ctx_drvdata->name = dev_name(&pdev->dev);
ctx_drvdata->report_error_on_fault =
of_property_read_bool(pdev->dev.of_node,
"qcom,report-error-on-fault");
if (!of_get_property(pdev->dev.of_node, "qcom,iommu-ctx-sids", &nsid)) {
ret = -EINVAL;
goto out;

View File

@ -181,6 +181,7 @@ void iommu_resume(const struct msm_iommu_drvdata *iommu_drvdata);
the secure environment, false otherwise
* @asid ASID used with this context.
* @attach_count Number of time this context has been attached.
* @report_error_on_fault - true if error is returned back to master
*
* A msm_iommu_ctx_drvdata holds the driver data for a single context bank
* within each IOMMU hardware instance
@ -198,6 +199,7 @@ struct msm_iommu_ctx_drvdata {
int attach_count;
u32 sid_mask[MAX_NUM_SMR];
unsigned int n_sid_mask;
bool report_error_on_fault;
};
enum dump_reg {