Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 403e8c7c authored by Linu Cherian's avatar Linu Cherian Committed by Will Deacon
Browse files

ACPI/IORT: Fixup SMMUv3 resource size for Cavium ThunderX2 SMMUv3 model



Cavium ThunderX2 implementation doesn't support second page in SMMU
register space. Hence, resource size is set as 64k for this model.

Signed-off-by: default avatarLinu Cherian <linu.cherian@cavium.com>
Signed-off-by: default avatarGeetha Sowjanya <geethasowjanya.akula@cavium.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 12275bf0
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -833,6 +833,18 @@ static int __init arm_smmu_v3_count_resources(struct acpi_iort_node *node)
	return num_res;
}

static unsigned long arm_smmu_v3_resource_size(struct acpi_iort_smmu_v3 *smmu)
{
	/*
	 * Override the size, for Cavium ThunderX2 implementation
	 * which doesn't support the page 1 SMMU register space.
	 */
	if (smmu->model == ACPI_IORT_SMMU_V3_CAVIUM_CN99XX)
		return SZ_64K;

	return SZ_128K;
}

static void __init arm_smmu_v3_init_resources(struct resource *res,
					      struct acpi_iort_node *node)
{
@@ -843,7 +855,8 @@ static void __init arm_smmu_v3_init_resources(struct resource *res,
	smmu = (struct acpi_iort_smmu_v3 *)node->node_data;

	res[num_res].start = smmu->base_address;
	res[num_res].end = smmu->base_address + SZ_128K - 1;
	res[num_res].end = smmu->base_address +
				arm_smmu_v3_resource_size(smmu) - 1;
	res[num_res].flags = IORESOURCE_MEM;

	num_res++;