Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iommu/io-pgtable-arm: Move some definitions to a header

Extract some of the most generic TCR defines, so they can be reused by
the page table sharing code.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20200918101852.582559-6-jean-philippe@linaro.org
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Jean-Philippe Brucker and committed by
Will Deacon
7cef39dd 8122dec0

+33 -27
+1 -2
MAINTAINERS
··· 1506 1506 S: Maintained 1507 1507 F: Documentation/devicetree/bindings/iommu/arm,smmu* 1508 1508 F: drivers/iommu/arm/ 1509 - F: drivers/iommu/io-pgtable-arm-v7s.c 1510 - F: drivers/iommu/io-pgtable-arm.c 1509 + F: drivers/iommu/io-pgtable-arm* 1511 1510 1512 1511 ARM SUB-ARCHITECTURES 1513 1512 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+2 -25
drivers/iommu/io-pgtable-arm.c
··· 20 20 21 21 #include <asm/barrier.h> 22 22 23 + #include "io-pgtable-arm.h" 24 + 23 25 #define ARM_LPAE_MAX_ADDR_BITS 52 24 26 #define ARM_LPAE_S2_MAX_CONCAT_PAGES 16 25 27 #define ARM_LPAE_MAX_LEVELS 4 ··· 102 100 #define ARM_LPAE_PTE_MEMATTR_DEV (((arm_lpae_iopte)0x1) << 2) 103 101 104 102 /* Register bits */ 105 - #define ARM_LPAE_TCR_TG0_4K 0 106 - #define ARM_LPAE_TCR_TG0_64K 1 107 - #define ARM_LPAE_TCR_TG0_16K 2 108 - 109 - #define ARM_LPAE_TCR_TG1_16K 1 110 - #define ARM_LPAE_TCR_TG1_4K 2 111 - #define ARM_LPAE_TCR_TG1_64K 3 112 - 113 - #define ARM_LPAE_TCR_SH_NS 0 114 - #define ARM_LPAE_TCR_SH_OS 2 115 - #define ARM_LPAE_TCR_SH_IS 3 116 - 117 - #define ARM_LPAE_TCR_RGN_NC 0 118 - #define ARM_LPAE_TCR_RGN_WBWA 1 119 - #define ARM_LPAE_TCR_RGN_WT 2 120 - #define ARM_LPAE_TCR_RGN_WB 3 121 - 122 103 #define ARM_LPAE_VTCR_SL0_MASK 0x3 123 104 124 105 #define ARM_LPAE_TCR_T0SZ_SHIFT 0 125 106 126 107 #define ARM_LPAE_VTCR_PS_SHIFT 16 127 108 #define ARM_LPAE_VTCR_PS_MASK 0x7 128 - 129 - #define ARM_LPAE_TCR_PS_32_BIT 0x0ULL 130 - #define ARM_LPAE_TCR_PS_36_BIT 0x1ULL 131 - #define ARM_LPAE_TCR_PS_40_BIT 0x2ULL 132 - #define ARM_LPAE_TCR_PS_42_BIT 0x3ULL 133 - #define ARM_LPAE_TCR_PS_44_BIT 0x4ULL 134 - #define ARM_LPAE_TCR_PS_48_BIT 0x5ULL 135 - #define ARM_LPAE_TCR_PS_52_BIT 0x6ULL 136 109 137 110 #define ARM_LPAE_MAIR_ATTR_SHIFT(n) ((n) << 3) 138 111 #define ARM_LPAE_MAIR_ATTR_MASK 0xff
+30
drivers/iommu/io-pgtable-arm.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #ifndef IO_PGTABLE_ARM_H_ 3 + #define IO_PGTABLE_ARM_H_ 4 + 5 + #define ARM_LPAE_TCR_TG0_4K 0 6 + #define ARM_LPAE_TCR_TG0_64K 1 7 + #define ARM_LPAE_TCR_TG0_16K 2 8 + 9 + #define ARM_LPAE_TCR_TG1_16K 1 10 + #define ARM_LPAE_TCR_TG1_4K 2 11 + #define ARM_LPAE_TCR_TG1_64K 3 12 + 13 + #define ARM_LPAE_TCR_SH_NS 0 14 + #define ARM_LPAE_TCR_SH_OS 2 15 + #define ARM_LPAE_TCR_SH_IS 3 16 + 17 + #define ARM_LPAE_TCR_RGN_NC 0 18 + #define ARM_LPAE_TCR_RGN_WBWA 1 19 + #define ARM_LPAE_TCR_RGN_WT 2 20 + #define ARM_LPAE_TCR_RGN_WB 3 21 + 22 + #define ARM_LPAE_TCR_PS_32_BIT 0x0ULL 23 + #define ARM_LPAE_TCR_PS_36_BIT 0x1ULL 24 + #define ARM_LPAE_TCR_PS_40_BIT 0x2ULL 25 + #define ARM_LPAE_TCR_PS_42_BIT 0x3ULL 26 + #define ARM_LPAE_TCR_PS_44_BIT 0x4ULL 27 + #define ARM_LPAE_TCR_PS_48_BIT 0x5ULL 28 + #define ARM_LPAE_TCR_PS_52_BIT 0x6ULL 29 + 30 + #endif /* IO_PGTABLE_ARM_H_ */