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:
parent
c3c1ff2a70
commit
9f4508f124
|
@ -75,6 +75,8 @@ Optional properties:
|
||||||
the same property except this is for IOMMU with LPAE support.
|
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
|
- qcom,iommu-sid-mask : List of mask values to map the unique stream ids to
|
||||||
the Stream Mapping Table entries.
|
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:
|
Example:
|
||||||
|
|
||||||
|
|
|
@ -672,6 +672,12 @@ static void __program_context(struct msm_iommu_drvdata *iommu_drvdata,
|
||||||
/* Enable context fault interrupt */
|
/* Enable context fault interrupt */
|
||||||
SET_CB_SCTLR_CFIE(cb_base, ctx, 1);
|
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) {
|
if (iommu_drvdata->model != MMU_500) {
|
||||||
/* Redirect all cacheable requests to L2 slave port. */
|
/* Redirect all cacheable requests to L2 slave port. */
|
||||||
SET_CB_ACTLR_BPRCISH(cb_base, ctx, 1);
|
SET_CB_ACTLR_BPRCISH(cb_base, ctx, 1);
|
||||||
|
|
|
@ -591,6 +591,10 @@ static int msm_iommu_ctx_parse_dt(struct platform_device *pdev,
|
||||||
&ctx_drvdata->name))
|
&ctx_drvdata->name))
|
||||||
ctx_drvdata->name = dev_name(&pdev->dev);
|
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)) {
|
if (!of_get_property(pdev->dev.of_node, "qcom,iommu-ctx-sids", &nsid)) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -181,6 +181,7 @@ void iommu_resume(const struct msm_iommu_drvdata *iommu_drvdata);
|
||||||
the secure environment, false otherwise
|
the secure environment, false otherwise
|
||||||
* @asid ASID used with this context.
|
* @asid ASID used with this context.
|
||||||
* @attach_count Number of time this context has been attached.
|
* @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
|
* A msm_iommu_ctx_drvdata holds the driver data for a single context bank
|
||||||
* within each IOMMU hardware instance
|
* within each IOMMU hardware instance
|
||||||
|
@ -198,6 +199,7 @@ struct msm_iommu_ctx_drvdata {
|
||||||
int attach_count;
|
int attach_count;
|
||||||
u32 sid_mask[MAX_NUM_SMR];
|
u32 sid_mask[MAX_NUM_SMR];
|
||||||
unsigned int n_sid_mask;
|
unsigned int n_sid_mask;
|
||||||
|
bool report_error_on_fault;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum dump_reg {
|
enum dump_reg {
|
||||||
|
|
Loading…
Reference in New Issue