iommu/io-pgtable: Add fast page table mapper for ARMv8L

Certain use cases require performance that can't be achieved with the
general-purpose SMMU page table code.  By limiting ourselves to 4K page
mappings (no block mappings) and pre-populating the first and second
levels of the page tables up front, we can eliminate a lot of the work
needed for page table mapping and unmapping.

Add a performance-tuned io-pgtable implementation for ARMv8L page tables
that only supports 4K page mappings.  Any size can be mapped, but only
4K page mappings will be installed in the page tables.

CRs-Fixed: 997751
Change-Id: I5861270709675016988052360d196e0a16a0d103
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
diff --git a/include/linux/io-pgtable-fast.h b/include/linux/io-pgtable-fast.h
new file mode 100644
index 0000000..b482ffe
--- /dev/null
+++ b/include/linux/io-pgtable-fast.h
@@ -0,0 +1,24 @@
+/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __LINUX_IO_PGTABLE_FAST_H
+#define __LINUX_IO_PGTABLE_FAST_H
+
+typedef u64 av8l_fast_iopte;
+
+#define iopte_pmd_offset(pmds, iova) (pmds + (iova >> 12))
+
+int av8l_fast_map_public(av8l_fast_iopte *ptep, phys_addr_t paddr, size_t size,
+			 int prot);
+void av8l_fast_unmap_public(av8l_fast_iopte *ptep, size_t size);
+
+#endif /* __LINUX_IO_PGTABLE_FAST_H */