Skip to content

Commit

Permalink
drm/etnaviv: mmuv2: support 40 bit phys address
Browse files Browse the repository at this point in the history
MMUv2 supports up to 40 bits of physical address by folding the upper
8 bits into bits [4:11] of the PTE.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
  • Loading branch information
Lucas Stach committed May 18, 2018
1 parent a1fb6f2 commit 931e97f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,14 @@ static int etnaviv_iommuv2_map(struct etnaviv_iommu_domain *domain,
struct etnaviv_iommuv2_domain *etnaviv_domain =
to_etnaviv_domain(domain);
int mtlb_entry, stlb_entry, ret;
u32 entry = (u32)paddr | MMUv2_PTE_PRESENT;
u32 entry = lower_32_bits(paddr) | MMUv2_PTE_PRESENT;

if (size != SZ_4K)
return -EINVAL;

if (IS_ENABLED(CONFIG_PHYS_ADDR_T_64BIT))
entry |= (upper_32_bits(paddr) & 0xff) << 4;

if (prot & ETNAVIV_PROT_WRITE)
entry |= MMUv2_PTE_WRITEABLE;

Expand Down

0 comments on commit 931e97f

Please sign in to comment.