diff options
Diffstat (limited to 'include/lib/xlat_tables/xlat_tables_defs.h')
-rw-r--r-- | include/lib/xlat_tables/xlat_tables_defs.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/include/lib/xlat_tables/xlat_tables_defs.h b/include/lib/xlat_tables/xlat_tables_defs.h index 8a5ce535d..ba0559c63 100644 --- a/include/lib/xlat_tables/xlat_tables_defs.h +++ b/include/lib/xlat_tables/xlat_tables_defs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -62,6 +62,11 @@ #define OSH (U(0x2) << 6) #define ISH (U(0x3) << 6) +#ifdef __aarch64__ +/* Guarded Page bit */ +#define GP (ULL(1) << 50) +#endif + #define TABLE_ADDR_MASK ULL(0x0000FFFFFFFFF000) /* @@ -174,4 +179,24 @@ #define XN_SHIFT 54 #define UXN_SHIFT XN_SHIFT +/* + * Stage 2 translation Lower attributes + */ +#define S2TTE_AP_SHIFT 6 +#define S2TTE_AP_RW (3UL << S2TTE_AP_SHIFT) + +#define S2TTE_SH_SHIFT 8 +#define S2TTE_SH_MASK (3UL << S2TTE_SH_SHIFT) +#define S2TTE_SH_NS (0UL << S2TTE_SH_SHIFT) +#define S2TTE_SH_OS (2UL << S2TTE_SH_SHIFT) +#define S2TTE_SH_IS (3UL << S2TTE_SH_SHIFT) + +/* + * Attributes when FEAT_S2FWB is enabled at EL2 (HCR_EL2.FWB == 1). + * For Normal WB cacheability attribute, set bit[4] to 1 and bits[3:2] to 0b10. + */ +#define S2TTE_MEMATTR_FWB_NORMAL_WB ((1UL << 4) | (2UL << 2)) +#define S2TTE_ATTR_FWB_WB_RW (S2TTE_MEMATTR_FWB_NORMAL_WB | S2TTE_AP_RW | \ + S2TTE_SH_IS) + #endif /* XLAT_TABLES_DEFS_H */ |