iommu: io-pgtable: Add ARM Mali midgard MMU page table format
authorRob Herring <robh@kernel.org>
Thu, 21 Feb 2019 20:23:25 +0000 (14:23 -0600)
committerRob Herring <robh@kernel.org>
Fri, 12 Apr 2019 17:52:38 +0000 (12:52 -0500)
commitd08d42de6432d5064045159aed060e3db9fa7807
tree2019c00522f05dfd8df93440401a2042cd085da0
parent0eb2766dd6f366d42448121c383420bb0307bcc7
iommu: io-pgtable: Add ARM Mali midgard MMU page table format

ARM Mali midgard GPU is similar to standard 64-bit stage 1 page tables, but
have a few differences. Add a new format type to represent the format. The
input address size is 48-bits and the output address size is 40-bits (and
possibly less?). Note that the later bifrost GPUs follow the standard
64-bit stage 1 format.

The differences in the format compared to 64-bit stage 1 format are:

The 3rd level page entry bits are 0x1 instead of 0x3 for page entries.

The access flags are not read-only and unprivileged, but read and write.
This is similar to stage 2 entries, but the memory attributes field matches
stage 1 being an index.

The nG bit is not set by the vendor driver. This one didn't seem to matter,
but we'll keep it aligned to the vendor driver.

Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: iommu@lists.linux-foundation.org
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190409205427.6943-2-robh@kernel.org
drivers/iommu/io-pgtable-arm.c
drivers/iommu/io-pgtable.c
include/linux/io-pgtable.h