Catalin Marinas | 17f5721 | 2011-09-05 17:41:02 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/include/asm/pgtable-2level-hwdef.h |
| 3 | * |
| 4 | * Copyright (C) 1995-2002 Russell King |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | */ |
| 10 | #ifndef _ASM_PGTABLE_2LEVEL_HWDEF_H |
| 11 | #define _ASM_PGTABLE_2LEVEL_HWDEF_H |
| 12 | |
| 13 | /* |
| 14 | * Hardware page table definitions. |
| 15 | * |
| 16 | * + Level 1 descriptor (PMD) |
| 17 | * - common |
| 18 | */ |
Catalin Marinas | 442e70c | 2011-09-05 17:51:56 +0100 | [diff] [blame] | 19 | #define PMD_TYPE_MASK (_AT(pmdval_t, 3) << 0) |
| 20 | #define PMD_TYPE_FAULT (_AT(pmdval_t, 0) << 0) |
| 21 | #define PMD_TYPE_TABLE (_AT(pmdval_t, 1) << 0) |
| 22 | #define PMD_TYPE_SECT (_AT(pmdval_t, 2) << 0) |
Jungseung Lee | 1d4d371 | 2014-11-29 02:33:30 +0100 | [diff] [blame] | 23 | #define PMD_PXNTABLE (_AT(pmdval_t, 1) << 2) /* v7 */ |
Catalin Marinas | 442e70c | 2011-09-05 17:51:56 +0100 | [diff] [blame] | 24 | #define PMD_BIT4 (_AT(pmdval_t, 1) << 4) |
| 25 | #define PMD_DOMAIN(x) (_AT(pmdval_t, (x)) << 5) |
| 26 | #define PMD_PROTECTION (_AT(pmdval_t, 1) << 9) /* v5 */ |
Catalin Marinas | 17f5721 | 2011-09-05 17:41:02 +0100 | [diff] [blame] | 27 | /* |
| 28 | * - section |
| 29 | */ |
Jungseung Lee | 1d4d371 | 2014-11-29 02:33:30 +0100 | [diff] [blame] | 30 | #define PMD_SECT_PXN (_AT(pmdval_t, 1) << 0) /* v7 */ |
Catalin Marinas | 442e70c | 2011-09-05 17:51:56 +0100 | [diff] [blame] | 31 | #define PMD_SECT_BUFFERABLE (_AT(pmdval_t, 1) << 2) |
| 32 | #define PMD_SECT_CACHEABLE (_AT(pmdval_t, 1) << 3) |
| 33 | #define PMD_SECT_XN (_AT(pmdval_t, 1) << 4) /* v6 */ |
| 34 | #define PMD_SECT_AP_WRITE (_AT(pmdval_t, 1) << 10) |
| 35 | #define PMD_SECT_AP_READ (_AT(pmdval_t, 1) << 11) |
| 36 | #define PMD_SECT_TEX(x) (_AT(pmdval_t, (x)) << 12) /* v5 */ |
| 37 | #define PMD_SECT_APX (_AT(pmdval_t, 1) << 15) /* v6 */ |
| 38 | #define PMD_SECT_S (_AT(pmdval_t, 1) << 16) /* v6 */ |
| 39 | #define PMD_SECT_nG (_AT(pmdval_t, 1) << 17) /* v6 */ |
| 40 | #define PMD_SECT_SUPER (_AT(pmdval_t, 1) << 18) /* v6 */ |
| 41 | #define PMD_SECT_AF (_AT(pmdval_t, 0)) |
Catalin Marinas | 17f5721 | 2011-09-05 17:41:02 +0100 | [diff] [blame] | 42 | |
Catalin Marinas | 442e70c | 2011-09-05 17:51:56 +0100 | [diff] [blame] | 43 | #define PMD_SECT_UNCACHED (_AT(pmdval_t, 0)) |
Catalin Marinas | 17f5721 | 2011-09-05 17:41:02 +0100 | [diff] [blame] | 44 | #define PMD_SECT_BUFFERED (PMD_SECT_BUFFERABLE) |
| 45 | #define PMD_SECT_WT (PMD_SECT_CACHEABLE) |
| 46 | #define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) |
| 47 | #define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE) |
| 48 | #define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) |
| 49 | #define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2)) |
| 50 | |
| 51 | /* |
| 52 | * - coarse table (not used) |
| 53 | */ |
| 54 | |
| 55 | /* |
| 56 | * + Level 2 descriptor (PTE) |
| 57 | * - common |
| 58 | */ |
Catalin Marinas | 442e70c | 2011-09-05 17:51:56 +0100 | [diff] [blame] | 59 | #define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0) |
| 60 | #define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0) |
| 61 | #define PTE_TYPE_LARGE (_AT(pteval_t, 1) << 0) |
| 62 | #define PTE_TYPE_SMALL (_AT(pteval_t, 2) << 0) |
| 63 | #define PTE_TYPE_EXT (_AT(pteval_t, 3) << 0) /* v5 */ |
| 64 | #define PTE_BUFFERABLE (_AT(pteval_t, 1) << 2) |
| 65 | #define PTE_CACHEABLE (_AT(pteval_t, 1) << 3) |
Catalin Marinas | 17f5721 | 2011-09-05 17:41:02 +0100 | [diff] [blame] | 66 | |
| 67 | /* |
| 68 | * - extended small page/tiny page |
| 69 | */ |
Catalin Marinas | 442e70c | 2011-09-05 17:51:56 +0100 | [diff] [blame] | 70 | #define PTE_EXT_XN (_AT(pteval_t, 1) << 0) /* v6 */ |
| 71 | #define PTE_EXT_AP_MASK (_AT(pteval_t, 3) << 4) |
| 72 | #define PTE_EXT_AP0 (_AT(pteval_t, 1) << 4) |
| 73 | #define PTE_EXT_AP1 (_AT(pteval_t, 2) << 4) |
| 74 | #define PTE_EXT_AP_UNO_SRO (_AT(pteval_t, 0) << 4) |
Catalin Marinas | 17f5721 | 2011-09-05 17:41:02 +0100 | [diff] [blame] | 75 | #define PTE_EXT_AP_UNO_SRW (PTE_EXT_AP0) |
| 76 | #define PTE_EXT_AP_URO_SRW (PTE_EXT_AP1) |
| 77 | #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) |
Catalin Marinas | 442e70c | 2011-09-05 17:51:56 +0100 | [diff] [blame] | 78 | #define PTE_EXT_TEX(x) (_AT(pteval_t, (x)) << 6) /* v5 */ |
| 79 | #define PTE_EXT_APX (_AT(pteval_t, 1) << 9) /* v6 */ |
| 80 | #define PTE_EXT_COHERENT (_AT(pteval_t, 1) << 9) /* XScale3 */ |
| 81 | #define PTE_EXT_SHARED (_AT(pteval_t, 1) << 10) /* v6 */ |
| 82 | #define PTE_EXT_NG (_AT(pteval_t, 1) << 11) /* v6 */ |
Catalin Marinas | 17f5721 | 2011-09-05 17:41:02 +0100 | [diff] [blame] | 83 | |
| 84 | /* |
| 85 | * - small page |
| 86 | */ |
Catalin Marinas | 442e70c | 2011-09-05 17:51:56 +0100 | [diff] [blame] | 87 | #define PTE_SMALL_AP_MASK (_AT(pteval_t, 0xff) << 4) |
| 88 | #define PTE_SMALL_AP_UNO_SRO (_AT(pteval_t, 0x00) << 4) |
| 89 | #define PTE_SMALL_AP_UNO_SRW (_AT(pteval_t, 0x55) << 4) |
| 90 | #define PTE_SMALL_AP_URO_SRW (_AT(pteval_t, 0xaa) << 4) |
| 91 | #define PTE_SMALL_AP_URW_SRW (_AT(pteval_t, 0xff) << 4) |
Catalin Marinas | 17f5721 | 2011-09-05 17:41:02 +0100 | [diff] [blame] | 92 | |
Catalin Marinas | d7c5d0d | 2011-09-05 17:52:36 +0100 | [diff] [blame] | 93 | #define PHYS_MASK (~0UL) |
| 94 | |
Catalin Marinas | 17f5721 | 2011-09-05 17:41:02 +0100 | [diff] [blame] | 95 | #endif |