Commit 85e566f7 authored by Zhang Zekun's avatar Zhang Zekun
Browse files

iommu/arm-smmu-v3: Change the style to identify the the hisi_platform

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IACKUP



----------------------------------------------

The code is isolated by CONFIG_ARCH_HISI which could also be opened
in other platforms . Change the style to identify the hisi platform
to minimize the code influence scope.

Fixes: 0b84ef37 ("iommu/arm-smmu-v3: Enable iotlb_sync_map according to SMMU_IIDR")
Signed-off-by: default avatarZhang Zekun <zhangzekun11@huawei.com>
parent 46ad6f1c
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ struct arm_smmu_ctx_desc quiet_cd = { 0 };
static struct arm_smmu_option_prop arm_smmu_options[] = {
	{ ARM_SMMU_OPT_SKIP_PREFETCH, "hisilicon,broken-prefetch-cmd" },
	{ ARM_SMMU_OPT_PAGE0_REGS_ONLY, "cavium,cn9900-broken-page1-regspace"},
	{ ARM_SMMU_OPT_SYNC_MAP, "hisilicon,broken-prefetch-pgtbl"},
	{ 0, NULL},
};

@@ -4493,6 +4494,25 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
}

#ifdef CONFIG_ACPI
static struct acpi_platform_list arm_smmu_v3_plat_info[] __initdata = {
	/* HiSilicon Hip09 Platform */
	{"HISI  ", "HIP09   ", 0, ACPI_SIG_IORT, greater_than_or_equal,
	 "Erratum #162100602", 0},
	{"HISI  ", "HIP10   ", 0, ACPI_SIG_IORT, greater_than_or_equal,
	 "Erratum #162100602", 0},
	{"HISI  ", "HIP11   ", 0, ACPI_SIG_IORT, greater_than_or_equal,
	 "Erratum #162100602", 0},
	{ }
};

static void acpi_get_hisi_options(struct arm_smmu_device *smmu)
{
	if (acpi_match_platform_list(arm_smmu_v3_plat_info) < 0)
		return;

	smmu->options |= ARM_SMMU_OPT_SYNC_MAP;
}

static void acpi_smmu_get_options(u32 model, struct arm_smmu_device *smmu)
{
	switch (model) {
@@ -4504,6 +4524,8 @@ static void acpi_smmu_get_options(u32 model, struct arm_smmu_device *smmu)
		break;
	}

	acpi_get_hisi_options(smmu);

	dev_notice(smmu->dev, "option mask 0x%x\n", smmu->options);
}