Commit 96da3bd1 authored by Konrad Dybcio's avatar Konrad Dybcio Committed by Yassine Oudjana
Browse files

iommu/arm-smmu: Implement qcom,skip-init



This adds the downstream property required to support
SMMUs on SDM630 and other platforms (the need for it
most likely depends on firmware configuration).
Signed-off-by: Konrad Dybcio's avatarKonrad Dybcio <konradybcio@gmail.com>
parent d3d753f2
......@@ -125,6 +125,16 @@ properties:
This is required for some SMMUs to function properly, mostly
concerning ones associated with the multimedia subsystem.
qcom,skip-init:
description: |
Disable resetting configuration for all context banks
during device reset. This is useful for targets where
some context banks are dedicated to other execution
environments outside of Linux and those other EEs are
programming their own stream match tables, SCTLR, etc.
Without setting this option we will trample on their
configuration.
stream-match-mask:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
......
......@@ -1660,13 +1660,16 @@ static void arm_smmu_device_reset(struct arm_smmu_device *smmu)
* Reset stream mapping groups: Initial values mark all SMRn as
* invalid and all S2CRn as bypass unless overridden.
*/
for (i = 0; i < smmu->num_mapping_groups; ++i)
arm_smmu_write_sme(smmu, i);
/* Make sure all context banks are disabled and clear CB_FSR */
for (i = 0; i < smmu->num_context_banks; ++i) {
arm_smmu_write_context_bank(smmu, i);
arm_smmu_cb_write(smmu, i, ARM_SMMU_CB_FSR, ARM_SMMU_FSR_FAULT);
if (!of_find_property(smmu->dev->of_node, "qcom,skip-init", NULL)) {
for (i = 0; i < smmu->num_mapping_groups; ++i)
arm_smmu_write_sme(smmu, i);
/* Make sure all context banks are disabled and clear CB_FSR */
for (i = 0; i < smmu->num_context_banks; ++i) {
arm_smmu_write_context_bank(smmu, i);
arm_smmu_cb_write(smmu, i, ARM_SMMU_CB_FSR, ARM_SMMU_FSR_FAULT);
}
}
/* Invalidate the TLB, just in case */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment